Initial commit

This commit is contained in:
2026-01-19 10:20:45 +01:00
commit dd6d0b6e7b
144 changed files with 7016 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
import 'static_talkgroup.dart';
import 'cluster.dart';
class DeviceProfile {
final List<StaticTalkgroup> blockedGroups;
final List<StaticTalkgroup> staticSubscriptions;
final List<StaticTalkgroup> dynamicSubscriptions;
final List<StaticTalkgroup> timedSubscriptions;
final List<Cluster> clusters;
DeviceProfile({
this.blockedGroups = const [],
this.staticSubscriptions = const [],
this.dynamicSubscriptions = const [],
this.timedSubscriptions = const [],
this.clusters = const [],
});
factory DeviceProfile.fromJson(Map<String, dynamic> json) {
return DeviceProfile(
blockedGroups: (json['blockedGroups'] as List<dynamic>?)
?.map((e) => StaticTalkgroup.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
staticSubscriptions: (json['staticSubscriptions'] as List<dynamic>?)
?.map((e) => StaticTalkgroup.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
dynamicSubscriptions: (json['dynamicSubscriptions'] as List<dynamic>?)
?.map((e) => StaticTalkgroup.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
timedSubscriptions: (json['timedSubscriptions'] as List<dynamic>?)
?.map((e) => StaticTalkgroup.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
clusters: (json['clusters'] as List<dynamic>?)
?.map((e) => Cluster.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
);
}
Map<String, dynamic> toJson() {
return {
'blockedGroups': blockedGroups.map((e) => e.toJson()).toList(),
'staticSubscriptions': staticSubscriptions.map((e) => e.toJson()).toList(),
'dynamicSubscriptions':
dynamicSubscriptions.map((e) => e.toJson()).toList(),
'timedSubscriptions': timedSubscriptions.map((e) => e.toJson()).toList(),
'clusters': clusters.map((e) => e.toJson()).toList(),
};
}
}