SP-1594-device-location-api-integration.

This commit is contained in:
Faris Armoush
2025-06-04 13:06:27 +03:00
parent 79b974ee6c
commit 24a7f3ac2a
7 changed files with 65 additions and 51 deletions

View File

@ -8,6 +8,8 @@ class AnalyticsDevice {
this.isActive,
this.productDevice,
this.spaceUuid,
this.latitude,
this.longitude,
});
final String uuid;
@ -18,6 +20,8 @@ class AnalyticsDevice {
final bool? isActive;
final ProductDevice? productDevice;
final String? spaceUuid;
final double? latitude;
final double? longitude;
factory AnalyticsDevice.fromJson(Map<String, dynamic> json) {
return AnalyticsDevice(
@ -35,6 +39,8 @@ class AnalyticsDevice {
? ProductDevice.fromJson(json['productDevice'] as Map<String, dynamic>)
: null,
spaceUuid: json['spaceUuid'] as String?,
latitude: json['lat'] != null ? double.parse(json['lat'] as String) : null,
longitude: json['lon'] != null ? double.parse(json['lon'] as String) : null,
);
}
}