dart format
This commit is contained in:
@@ -14,10 +14,7 @@ part 'settings.g.dart';
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class Settings {
|
||||
@JsonKey(
|
||||
toJson: _themeToJson,
|
||||
fromJson: _themeFromJson,
|
||||
)
|
||||
@JsonKey(toJson: _themeToJson, fromJson: _themeFromJson)
|
||||
ThemeMode appTheme;
|
||||
bool devToolsEnabled;
|
||||
|
||||
@@ -44,8 +41,10 @@ class Settings {
|
||||
});
|
||||
|
||||
static String _themeToJson(ThemeMode m) => m.name;
|
||||
static ThemeMode _themeFromJson(String m) => ThemeMode.values.firstWhere((element) => element.name == m);
|
||||
static ThemeMode _themeFromJson(String m) =>
|
||||
ThemeMode.values.firstWhere((element) => element.name == m);
|
||||
|
||||
factory Settings.fromJson(Map<String, dynamic> json) => _$SettingsFromJson(json);
|
||||
factory Settings.fromJson(Map<String, dynamic> json) =>
|
||||
_$SettingsFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$SettingsToJson(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user