mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2026-02-16 14:29:35 +00:00
格式化代码
This commit is contained in:
parent
a28547685b
commit
b3a9d76c78
24 changed files with 611 additions and 451 deletions
|
|
@ -18,11 +18,13 @@ class AppSettings with _$AppSettings {
|
|||
@Default(SleepTimerSettings()) SleepTimerSettings sleepTimerSettings,
|
||||
@Default(DownloadSettings()) DownloadSettings downloadSettings,
|
||||
@Default(NotificationSettings()) NotificationSettings notificationSettings,
|
||||
@Default(ShakeDetectionSettings()) ShakeDetectionSettings shakeDetectionSettings,
|
||||
@Default(ShakeDetectionSettings())
|
||||
ShakeDetectionSettings shakeDetectionSettings,
|
||||
@Default(HomePageSettings()) HomePageSettings homePageSettings,
|
||||
}) = _AppSettings;
|
||||
|
||||
factory AppSettings.fromJson(Map<String, dynamic> json) => _$AppSettingsFromJson(json);
|
||||
factory AppSettings.fromJson(Map<String, dynamic> json) =>
|
||||
_$AppSettingsFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
|
|
@ -36,14 +38,17 @@ class ThemeSettings with _$ThemeSettings {
|
|||
@Default(true) bool useCurrentPlayerThemeThroughoutApp,
|
||||
}) = _ThemeSettings;
|
||||
|
||||
factory ThemeSettings.fromJson(Map<String, dynamic> json) => _$ThemeSettingsFromJson(json);
|
||||
factory ThemeSettings.fromJson(Map<String, dynamic> json) =>
|
||||
_$ThemeSettingsFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
class PlayerSettings with _$PlayerSettings {
|
||||
const factory PlayerSettings({
|
||||
@Default(MinimizedPlayerSettings()) MinimizedPlayerSettings miniPlayerSettings,
|
||||
@Default(ExpandedPlayerSettings()) ExpandedPlayerSettings expandedPlayerSettings,
|
||||
@Default(MinimizedPlayerSettings())
|
||||
MinimizedPlayerSettings miniPlayerSettings,
|
||||
@Default(ExpandedPlayerSettings())
|
||||
ExpandedPlayerSettings expandedPlayerSettings,
|
||||
@Default(1) double preferredDefaultVolume,
|
||||
@Default(1) double preferredDefaultSpeed,
|
||||
@Default([1, 1.25, 1.5, 1.75, 2]) List<double> speedOptions,
|
||||
|
|
@ -56,7 +61,8 @@ class PlayerSettings with _$PlayerSettings {
|
|||
@Default(true) bool configurePlayerForEveryBook,
|
||||
}) = _PlayerSettings;
|
||||
|
||||
factory PlayerSettings.fromJson(Map<String, dynamic> json) => _$PlayerSettingsFromJson(json);
|
||||
factory PlayerSettings.fromJson(Map<String, dynamic> json) =>
|
||||
_$PlayerSettingsFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
|
|
@ -139,7 +145,8 @@ class DownloadSettings with _$DownloadSettings {
|
|||
@Default(3) int maxConcurrentByGroup,
|
||||
}) = _DownloadSettings;
|
||||
|
||||
factory DownloadSettings.fromJson(Map<String, dynamic> json) => _$DownloadSettingsFromJson(json);
|
||||
factory DownloadSettings.fromJson(Map<String, dynamic> json) =>
|
||||
_$DownloadSettingsFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
|
|
@ -196,7 +203,8 @@ class ShakeDetectionSettings with _$ShakeDetectionSettings {
|
|||
@Default(ShakeDirection.horizontal) ShakeDirection direction,
|
||||
@Default(5) double threshold,
|
||||
@Default(ShakeAction.resetSleepTimer) ShakeAction shakeAction,
|
||||
@Default({ShakeDetectedFeedback.vibrate}) Set<ShakeDetectedFeedback> feedback,
|
||||
@Default({ShakeDetectedFeedback.vibrate})
|
||||
Set<ShakeDetectedFeedback> feedback,
|
||||
@Default(0.5) double beepVolume,
|
||||
|
||||
/// the duration to wait before the shake detection is enabled again
|
||||
|
|
@ -234,5 +242,6 @@ class HomePageSettings with _$HomePageSettings {
|
|||
@Default(false) bool showPlayButtonOnListenAgainShelf,
|
||||
}) = _HomePageSettings;
|
||||
|
||||
factory HomePageSettings.fromJson(Map<String, dynamic> json) => _$HomePageSettingsFromJson(json);
|
||||
factory HomePageSettings.fromJson(Map<String, dynamic> json) =>
|
||||
_$HomePageSettingsFromJson(json);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue