selfprivacy.org.app/lib/logic/models/server_timezone.dart
2022-01-25 18:02:32 +01:00

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];
}