mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
24 lines
422 B
Dart
24 lines
422 B
Dart
class RegionModel {
|
|
final String name;
|
|
final String id;
|
|
|
|
RegionModel({
|
|
required this.name,
|
|
required this.id,
|
|
});
|
|
|
|
factory RegionModel.fromJson(Map<String, dynamic> json) {
|
|
return RegionModel(
|
|
name: json['regionName'],
|
|
id: json['uuid'].toString(), // Ensure id is a String
|
|
);
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
return {
|
|
'regionName': name,
|
|
'uuid': id,
|
|
};
|
|
}
|
|
}
|