selfprivacy.org.app/lib/logic/models/timezone_settings.dart
NaiJi 2ac8e4366b Linting!
Co-authored-by: Inex Code <inex.code@selfprivacy.org>
2022-06-06 01:40:34 +03:00

16 lines
385 B
Dart

import 'package:timezone/timezone.dart';
class TimeZoneSettings {
factory TimeZoneSettings.fromString(final String string) {
final Location location = timeZoneDatabase.locations[string]!;
return TimeZoneSettings(location);
}
TimeZoneSettings(this.timezone);
final Location timezone;
Map<String, dynamic> toJson() => {
'timezone': timezone.name,
};
}