42 lines
1.2 KiB
Dart
42 lines
1.2 KiB
Dart
import 'package:manager_api/api.dart';
|
|
|
|
class BeaconSection {
|
|
String? macAddress;
|
|
String? configurationId;
|
|
String? sectionId;
|
|
int? rssi;
|
|
int? accuracy;
|
|
String? proximityUUID;
|
|
bool? found = false;
|
|
|
|
BeaconSection({this.macAddress, this.configurationId, this.sectionId, this.rssi, this.accuracy, this.proximityUUID, this.found});
|
|
|
|
Map<String, dynamic> toMap() {
|
|
return {
|
|
'macAddress': macAddress,
|
|
'configurationId': configurationId,
|
|
'sectionId': sectionId,
|
|
'rssi': rssi,
|
|
'accuracy': accuracy,
|
|
'proximityUUID': proximityUUID,
|
|
'found': found
|
|
};
|
|
}
|
|
|
|
factory BeaconSection.fromJson(Map<String, dynamic> json) {
|
|
return BeaconSection(
|
|
macAddress: json['macAddress'] as String,
|
|
configurationId: json['configurationId'] as String,
|
|
sectionId: json['sectionId'] as String,
|
|
rssi: json['rssi'] as int,
|
|
accuracy: json['accuracy'] as int,
|
|
proximityUUID: json['proximityUUID'] as String,
|
|
found: json['found'] as bool
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return 'BeaconSection{macAddress: $macAddress, sectionId: $sectionId, configurationId: $configurationId, rssi: $rssi, accuracy: $accuracy, proximityUUID: $proximityUUID, found: $found}';
|
|
}
|
|
} |