From 9731a1a60fb3453bd2f92f94ac6987314ccb53e0 Mon Sep 17 00:00:00 2001 From: naeem Date: Sun, 28 Sep 2025 20:56:37 +0100 Subject: [PATCH] Fixing formatting --- .../live_wallpaper_preferences.model.dart | 29 ++++++------------- .../common/live_wallpaper_setup.page.dart | 5 ---- .../live_wallpaper_preferences.provider.dart | 13 ++++----- mobile/lib/routing/router.dart | 2 +- .../live_wallpaper_setting.dart | 4 +-- mobile/pigeon/wallpaper_api.dart | 6 +--- 6 files changed, 18 insertions(+), 41 deletions(-) diff --git a/mobile/lib/domain/models/live_wallpaper_preferences.model.dart b/mobile/lib/domain/models/live_wallpaper_preferences.model.dart index cd5a0c8c65..b07b45cda7 100644 --- a/mobile/lib/domain/models/live_wallpaper_preferences.model.dart +++ b/mobile/lib/domain/models/live_wallpaper_preferences.model.dart @@ -2,14 +2,7 @@ import 'dart:convert'; const _defaultRotationMinutes = 30; -enum RotationMode { - lockUnlock, - minutes, - hours, - daily, -} - - +enum RotationMode { lockUnlock, minutes, hours, daily } extension RotationModeExtension on RotationMode { String get label { @@ -24,7 +17,7 @@ extension RotationModeExtension on RotationMode { return 'Daily'; } } - + Duration get duration { switch (this) { case RotationMode.lockUnlock: @@ -39,8 +32,6 @@ extension RotationModeExtension on RotationMode { } } - - class LiveWallpaperPreferences { const LiveWallpaperPreferences({ required this.enabled, @@ -53,13 +44,13 @@ class LiveWallpaperPreferences { }); const LiveWallpaperPreferences.defaults() - : enabled = false, - personIds = const [], - rotationInterval = const Duration(minutes: _defaultRotationMinutes), - rotationMode = RotationMode.minutes, - allowCellularData = false, - lastAssetId = null, - lastUpdated = null; + : enabled = false, + personIds = const [], + rotationInterval = const Duration(minutes: _defaultRotationMinutes), + rotationMode = RotationMode.minutes, + allowCellularData = false, + lastAssetId = null, + lastUpdated = null; final bool enabled; final List personIds; @@ -148,6 +139,4 @@ class LiveWallpaperPreferences { return RotationMode.minutes; } } - - } diff --git a/mobile/lib/pages/common/live_wallpaper_setup.page.dart b/mobile/lib/pages/common/live_wallpaper_setup.page.dart index 1003eece0a..1d28ea0f0d 100644 --- a/mobile/lib/pages/common/live_wallpaper_setup.page.dart +++ b/mobile/lib/pages/common/live_wallpaper_setup.page.dart @@ -86,8 +86,6 @@ class LiveWallpaperSetupPage extends HookConsumerWidget { } } - - return Scaffold( appBar: AppBar(title: Text('live_wallpaper_setup_title'.tr())), body: Padding( @@ -132,7 +130,6 @@ class LiveWallpaperSetupPage extends HookConsumerWidget { onPressed: onSetWallpaper, ), ), - ], ), ), @@ -250,5 +247,3 @@ class _RotationControl extends StatelessWidget { ); } } - - diff --git a/mobile/lib/providers/live_wallpaper_preferences.provider.dart b/mobile/lib/providers/live_wallpaper_preferences.provider.dart index 50528a15e4..ee9813b065 100644 --- a/mobile/lib/providers/live_wallpaper_preferences.provider.dart +++ b/mobile/lib/providers/live_wallpaper_preferences.provider.dart @@ -15,15 +15,14 @@ final liveWallpaperAssetServiceProvider = Provider((r return LiveWallpaperAssetService(ref.watch(assetApiRepositoryProvider)); }); -final liveWallpaperPreferencesProvider = StateNotifierProvider - ((ref) { - final service = ref.watch(liveWallpaperPreferencesServiceProvider); - return LiveWallpaperPreferencesNotifier(service); -}); +final liveWallpaperPreferencesProvider = + StateNotifierProvider((ref) { + final service = ref.watch(liveWallpaperPreferencesServiceProvider); + return LiveWallpaperPreferencesNotifier(service); + }); class LiveWallpaperPreferencesNotifier extends StateNotifier { - LiveWallpaperPreferencesNotifier(this._service) - : super(_service.load()) { + LiveWallpaperPreferencesNotifier(this._service) : super(_service.load()) { _subscription = _service.watch().listen((event) { if (mounted) { state = event; diff --git a/mobile/lib/routing/router.dart b/mobile/lib/routing/router.dart index ab5537d371..b90e081d34 100644 --- a/mobile/lib/routing/router.dart +++ b/mobile/lib/routing/router.dart @@ -234,7 +234,7 @@ class AppRouter extends RootStackRouter { ), AutoRoute(page: SettingsRoute.page, guards: [_duplicateGuard]), AutoRoute(page: SettingsSubRoute.page, guards: [_duplicateGuard]), - AutoRoute(page: LiveWallpaperSetupRoute.page, guards: [_duplicateGuard]), + AutoRoute(page: LiveWallpaperSetupRoute.page, guards: [_duplicateGuard]), AutoRoute(page: AppLogRoute.page, guards: [_duplicateGuard]), AutoRoute(page: AppLogDetailRoute.page, guards: [_duplicateGuard]), CustomRoute( diff --git a/mobile/lib/widgets/settings/preference_settings/live_wallpaper_setting.dart b/mobile/lib/widgets/settings/preference_settings/live_wallpaper_setting.dart index c86e4021f1..8aa8d6f818 100644 --- a/mobile/lib/widgets/settings/preference_settings/live_wallpaper_setting.dart +++ b/mobile/lib/widgets/settings/preference_settings/live_wallpaper_setting.dart @@ -42,9 +42,7 @@ class LiveWallpaperSetting extends HookConsumerWidget { margin: const EdgeInsets.symmetric(horizontal: 12, vertical: 4), child: ListTile( title: Text('live_wallpaper_setting_manage'.tr()), - subtitle: statusText == null - ? null - : Text(statusText, style: Theme.of(context).textTheme.bodySmall), + subtitle: statusText == null ? null : Text(statusText, style: Theme.of(context).textTheme.bodySmall), trailing: const Icon(Icons.chevron_right), onTap: () => context.pushRoute(const LiveWallpaperSetupRoute()), ), diff --git a/mobile/pigeon/wallpaper_api.dart b/mobile/pigeon/wallpaper_api.dart index 3e90fa1555..9d257c225a 100644 --- a/mobile/pigeon/wallpaper_api.dart +++ b/mobile/pigeon/wallpaper_api.dart @@ -30,11 +30,7 @@ class WallpaperStatusMessage { final bool isActive; final String? lastError; - const WallpaperStatusMessage({ - this.isSupported = true, - this.isActive = false, - this.lastError, - }); + const WallpaperStatusMessage({this.isSupported = true, this.isActive = false, this.lastError}); } @HostApi()