48 lines
1.5 KiB
Dart
48 lines
1.5 KiB
Dart
import 'package:manager_api_new/api.dart';
|
|
|
|
class BeaconSection {
|
|
int? minorBeaconId;
|
|
int? orderInConfig;
|
|
String? configurationId;
|
|
String? sectionId;
|
|
SectionType? sectionType;
|
|
/*int? rssi;
|
|
int? accuracy;
|
|
String? proximityUUID;*/
|
|
bool? found = false;
|
|
|
|
BeaconSection({this.minorBeaconId, this.orderInConfig, this.configurationId, this.sectionId, this.sectionType, this.found});
|
|
|
|
Map<String, dynamic> toMap() {
|
|
return {
|
|
'minorBeaconId': minorBeaconId,
|
|
'orderInConfig': orderInConfig,
|
|
'configurationId': configurationId,
|
|
'sectionId': sectionId,
|
|
'sectionType': sectionType,
|
|
/*'rssi': rssi,
|
|
'accuracy': accuracy,
|
|
'proximityUUID': proximityUUID,*/
|
|
//'found': found
|
|
};
|
|
}
|
|
|
|
factory BeaconSection.fromJson(Map<String, dynamic> json) {
|
|
return BeaconSection(
|
|
minorBeaconId: json['minorBeaconId'] as int,
|
|
orderInConfig: json['orderInConfig'] as int,
|
|
configurationId: json['configurationId'] as String,
|
|
sectionId: json['sectionId'] as String,
|
|
sectionType: SectionType.fromJson(json[r'sectionType']),
|
|
/*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{minorBeaconId: $minorBeaconId, orderInConfig: $orderInConfig, sectionId: $sectionId, sectionType: $sectionType, configurationId: $configurationId, found: $found}';
|
|
}
|
|
} |