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
+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() {