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() => {
|
2022-06-05 22:40:34 +00:00
|
|
|
'timezone': timezone.name,
|
|
|
|
};
|
2022-02-07 07:53:13 +00:00
|
|
|
}
|