Add rawName property

Co-authored-by: Rohit Sangwan <rohitsangwan647@gmail.com>
This commit is contained in:
Foti Dim
2024-10-08 17:58:29 +02:00
parent e4b6bd74ba
commit 4e225b756c
4 changed files with 12 additions and 4 deletions
+4
View File
@@ -1,3 +1,7 @@
## 0.14.0
* BREAKING CHANGE: `bleDevice.name` now filters out non-printable characters
* Add `bleDevice.rawName`
## 0.13.0
* BREAKING CHANGE: `scanFilter` filters are now in OR relation
* BREAKING CHANGE: `manufacturerDataHead` is removed from `BleDevice`
@@ -14,7 +14,7 @@ class ScannedItemWidget extends StatelessWidget {
if (rawManufacturerData.isNotEmpty) {
manufacturerData = rawManufacturerData.first;
}
if (name == null || name.isEmpty) name = 'NA';
if (name == null || name.isEmpty) name = 'N/A';
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0),
child: Card(
+6 -2
View File
@@ -5,6 +5,7 @@ import 'package:universal_ble/universal_ble.dart';
class BleDevice {
String deviceId;
String? name;
String? rawName;
int? rssi;
bool? isPaired;
List<String> services;
@@ -29,13 +30,16 @@ class BleDevice {
BleDevice({
required this.deviceId,
required this.name,
required String? name,
this.rssi,
this.isPaired,
this.services = const [],
this.isSystemDevice,
this.manufacturerDataList = const [],
});
}) {
rawName = name;
this.name = name?.replaceAll(RegExp(r'[^ -~]'), '').trim();
}
@override
String toString() {
+1 -1
View File
@@ -1,6 +1,6 @@
name: universal_ble
description: A cross-platform (Android/iOS/macOS/Windows/Linux/Web) Bluetooth Low Energy (BLE) plugin for Flutter
version: 0.13.0
version: 0.14.0
homepage: https://navideck.com
repository: https://github.com/Navideck/universal_ble
issue_tracker: https://github.com/Navideck/universal_ble/issues