fromJson method
Responsible for converting the Map<String, dynamic> representation
of the bloc state into a concrete instance of the bloc state.
Implementation
@override
ThemeMode? fromJson(Map<String, dynamic> json) {
try {
return ThemeMode.values.firstWhere((e) => e.toString() == json['value']);
} catch (_) {
return ThemeMode.system;
}
}