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