mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2024-11-17 22:29:15 +00:00
19 lines
495 B
Dart
19 lines
495 B
Dart
import 'package:equatable/equatable.dart';
|
|
import 'package:timezone/timezone.dart';
|
|
|
|
class ServerTimezone extends Equatable {
|
|
final Location timezone;
|
|
|
|
const ServerTimezone({required this.timezone});
|
|
|
|
factory ServerTimezone.fromJson(Map<String, dynamic> json) {
|
|
var timezone = getLocation(json['timezone']);
|
|
return ServerTimezone(timezone: timezone);
|
|
}
|
|
|
|
Map<String, dynamic> toJson() => {'timezone': timezone.name};
|
|
|
|
@override
|
|
List<Object?> get props => [timezone.name];
|
|
}
|