mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-15 01:35:23 +00:00
28 lines
511 B
Dart
28 lines
511 B
Dart
class TimeZone {
|
|
final String name;
|
|
final String offset;
|
|
final String id;
|
|
|
|
TimeZone({
|
|
required this.name,
|
|
required this.offset,
|
|
required this.id,
|
|
});
|
|
|
|
factory TimeZone.fromJson(Map<String, dynamic> json) {
|
|
return TimeZone(
|
|
name: json['cityName'],
|
|
offset: json['timeZoneOffset'],
|
|
id: json['uuid'].toString(), // Ensure id is a String
|
|
);
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
return {
|
|
'name': name,
|
|
'offset': offset,
|
|
'id': id,
|
|
};
|
|
}
|
|
}
|