selfprivacy.org.app/lib/logic/models/timezone_settings.dart

16 lines
385 B
Dart
Raw Normal View History

2022-02-07 07:53:13 +00:00
import 'package:timezone/timezone.dart';
class TimeZoneSettings {
2022-06-05 19:36:32 +00:00
factory TimeZoneSettings.fromString(final String string) {
final Location location = timeZoneDatabase.locations[string]!;
return TimeZoneSettings(location);
}
2022-02-07 07:53:13 +00:00
TimeZoneSettings(this.timezone);
2022-06-05 19:36:32 +00:00
final Location timezone;
2022-02-07 07:53:13 +00:00
2022-06-05 19:36:32 +00:00
Map<String, dynamic> toJson() => {
'timezone': timezone.name,
};
2022-02-07 07:53:13 +00:00
}