mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2024-11-06 00:43:13 +00:00
19 lines
477 B
Dart
19 lines
477 B
Dart
import 'package:timezone/timezone.dart';
|
|
|
|
class TimeZoneSettings {
|
|
factory TimeZoneSettings.fromString(final String string) {
|
|
final Location location = timeZoneDatabase.locations[string]!;
|
|
return TimeZoneSettings(timezone: location);
|
|
}
|
|
|
|
TimeZoneSettings({this.timezone});
|
|
final Location? timezone;
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
'timezone': timezone?.name ?? 'Unknown',
|
|
};
|
|
|
|
@override
|
|
String toString() => timezone?.name ?? 'Unknown';
|
|
}
|