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

19 lines
379 B
Dart
Raw Normal View History

2022-02-07 07:53:13 +00:00
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);
}
}