feat: implement watchPositions() tag position stream
This commit is contained in:
@@ -8,11 +8,13 @@ class Tag {
|
||||
this.currentRoomId,
|
||||
this.lastPosition,
|
||||
this.lastSeen,
|
||||
this.color,
|
||||
});
|
||||
|
||||
final int id;
|
||||
final String tagId; // BLE beacon advertised identifier
|
||||
final String name;
|
||||
final String? color;
|
||||
final String? currentRoomId;
|
||||
final Position? lastPosition;
|
||||
final DateTime? lastSeen;
|
||||
@@ -34,6 +36,7 @@ class Tag {
|
||||
'current_room_id': currentRoomId,
|
||||
'last_position': lastPosition?.toJson(),
|
||||
'last_seen': lastSeen?.toIso8601String(),
|
||||
'color': color,
|
||||
};
|
||||
|
||||
factory Tag.fromJson(Map<String, dynamic> json) => Tag(
|
||||
@@ -41,6 +44,7 @@ class Tag {
|
||||
tagId: json['tag_id'] as String,
|
||||
name: json['name'] as String,
|
||||
currentRoomId: json['current_room_id'] as String?,
|
||||
color: json['color'] as String?,
|
||||
lastPosition: json['last_position'] == null
|
||||
? null
|
||||
: Position.fromJson(json['last_position'] as Map<String, dynamic>),
|
||||
|
||||
Reference in New Issue
Block a user