mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2024-11-08 09:53:12 +00:00
19 lines
379 B
Dart
19 lines
379 B
Dart
|
import 'package:timezone/timezone.dart';
|
||
|
|
||
|
class TimeZoneSettings {
|
||
|
final Location timezone;
|
||
|
|
||
|
TimeZoneSettings(this.timezone);
|
||
|
|
||
|
Map<String, dynamic> toJson() {
|
||
|
return {
|
||
|
'timezone': timezone.name,
|
||
|
};
|
||
|
}
|
||
|
|
||
|
factory TimeZoneSettings.fromString(String string) {
|
||
|
var location = timeZoneDatabase.locations[string]!;
|
||
|
return TimeZoneSettings(location);
|
||
|
}
|
||
|
}
|