dart format
This commit is contained in:
@@ -8,8 +8,13 @@ class DevToolsSettings {
|
||||
bool checkerboardOffscreenLayers;
|
||||
bool checkerboardRasterCacheImages;
|
||||
|
||||
DevToolsSettings({required this.showPerformanceOverlay, required this.checkerboardOffscreenLayers, required this.checkerboardRasterCacheImages});
|
||||
DevToolsSettings({
|
||||
required this.showPerformanceOverlay,
|
||||
required this.checkerboardOffscreenLayers,
|
||||
required this.checkerboardRasterCacheImages,
|
||||
});
|
||||
|
||||
factory DevToolsSettings.fromJson(Map<String, dynamic> json) => _$DevToolsSettingsFromJson(json);
|
||||
factory DevToolsSettings.fromJson(Map<String, dynamic> json) =>
|
||||
_$DevToolsSettingsFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$DevToolsSettingsToJson(this);
|
||||
}
|
||||
|
||||
@@ -11,8 +11,13 @@ class FileSettings {
|
||||
bool ascending;
|
||||
SortOption sortBy;
|
||||
|
||||
FileSettings({required this.sortFoldersToTop, required this.ascending, required this.sortBy});
|
||||
FileSettings({
|
||||
required this.sortFoldersToTop,
|
||||
required this.ascending,
|
||||
required this.sortBy,
|
||||
});
|
||||
|
||||
factory FileSettings.fromJson(Map<String, dynamic> json) => _$FileSettingsFromJson(json);
|
||||
factory FileSettings.fromJson(Map<String, dynamic> json) =>
|
||||
_$FileSettingsFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$FileSettingsToJson(this);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ class FileViewSettings {
|
||||
|
||||
FileViewSettings({required this.alwaysOpenExternally});
|
||||
|
||||
factory FileViewSettings.fromJson(Map<String, dynamic> json) => _$FileViewSettingsFromJson(json);
|
||||
factory FileViewSettings.fromJson(Map<String, dynamic> json) =>
|
||||
_$FileViewSettingsFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$FileViewSettingsToJson(this);
|
||||
}
|
||||
|
||||
@@ -7,8 +7,12 @@ class HolidaysSettings {
|
||||
bool dismissedDisclaimer;
|
||||
bool showPastEvents;
|
||||
|
||||
HolidaysSettings({required this.dismissedDisclaimer, required this.showPastEvents});
|
||||
HolidaysSettings({
|
||||
required this.dismissedDisclaimer,
|
||||
required this.showPastEvents,
|
||||
});
|
||||
|
||||
factory HolidaysSettings.fromJson(Map<String, dynamic> json) => _$HolidaysSettingsFromJson(json);
|
||||
factory HolidaysSettings.fromJson(Map<String, dynamic> json) =>
|
||||
_$HolidaysSettingsFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$HolidaysSettingsToJson(this);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ class ModulesSettings {
|
||||
this.fixedBottomBarSlots = 3,
|
||||
});
|
||||
|
||||
factory ModulesSettings.fromJson(Map<String, dynamic> json) => _$ModulesSettingsFromJson(json);
|
||||
factory ModulesSettings.fromJson(Map<String, dynamic> json) =>
|
||||
_$ModulesSettingsFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$ModulesSettingsToJson(this);
|
||||
}
|
||||
|
||||
@@ -7,8 +7,12 @@ class NotificationSettings {
|
||||
bool askUsageDismissed;
|
||||
bool enabled;
|
||||
|
||||
NotificationSettings({required this.askUsageDismissed, required this.enabled});
|
||||
NotificationSettings({
|
||||
required this.askUsageDismissed,
|
||||
required this.enabled,
|
||||
});
|
||||
|
||||
factory NotificationSettings.fromJson(Map<String, dynamic> json) => _$NotificationSettingsFromJson(json);
|
||||
factory NotificationSettings.fromJson(Map<String, dynamic> json) =>
|
||||
_$NotificationSettingsFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$NotificationSettingsToJson(this);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -9,8 +9,14 @@ class TalkSettings {
|
||||
Map<String, String> drafts;
|
||||
Map<String, int> draftReplies;
|
||||
|
||||
TalkSettings({required this.sortFavoritesToTop, required this.sortUnreadToTop, required this.drafts, required this.draftReplies});
|
||||
TalkSettings({
|
||||
required this.sortFavoritesToTop,
|
||||
required this.sortUnreadToTop,
|
||||
required this.drafts,
|
||||
required this.draftReplies,
|
||||
});
|
||||
|
||||
factory TalkSettings.fromJson(Map<String, dynamic> json) => _$TalkSettingsFromJson(json);
|
||||
factory TalkSettings.fromJson(Map<String, dynamic> json) =>
|
||||
_$TalkSettingsFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$TalkSettingsToJson(this);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ class TimetableSettings {
|
||||
required this.timetableNameMode,
|
||||
});
|
||||
|
||||
factory TimetableSettings.fromJson(Map<String, dynamic> json) => _$TimetableSettingsFromJson(json);
|
||||
factory TimetableSettings.fromJson(Map<String, dynamic> json) =>
|
||||
_$TimetableSettingsFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$TimetableSettingsToJson(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user