Initial commit
This commit is contained in:
35
lib/models/static_talkgroup.dart
Normal file
35
lib/models/static_talkgroup.dart
Normal file
@@ -0,0 +1,35 @@
|
||||
class StaticTalkgroup {
|
||||
final String? talkgroup;
|
||||
final String? repeaterId;
|
||||
final String? slot;
|
||||
|
||||
StaticTalkgroup({
|
||||
this.talkgroup,
|
||||
this.repeaterId,
|
||||
this.slot,
|
||||
});
|
||||
|
||||
factory StaticTalkgroup.fromJson(Map<String, dynamic> json) {
|
||||
return StaticTalkgroup(
|
||||
talkgroup: json['talkgroup']?.toString(),
|
||||
repeaterId: json['repeaterId']?.toString(),
|
||||
slot: json['slot']?.toString(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'talkgroup': talkgroup,
|
||||
'repeaterId': repeaterId,
|
||||
'slot': slot,
|
||||
};
|
||||
}
|
||||
|
||||
String get displaySlot {
|
||||
return slot != null ? 'TS$slot' : 'TS?';
|
||||
}
|
||||
|
||||
String get displayId {
|
||||
return talkgroup ?? 'Unknown';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user