Fixing formatting

This commit is contained in:
naeem 2025-09-28 20:56:37 +01:00
parent 7a903d39c0
commit 9731a1a60f
6 changed files with 18 additions and 41 deletions

View file

@ -2,14 +2,7 @@ import 'dart:convert';
const _defaultRotationMinutes = 30; const _defaultRotationMinutes = 30;
enum RotationMode { enum RotationMode { lockUnlock, minutes, hours, daily }
lockUnlock,
minutes,
hours,
daily,
}
extension RotationModeExtension on RotationMode { extension RotationModeExtension on RotationMode {
String get label { String get label {
@ -39,8 +32,6 @@ extension RotationModeExtension on RotationMode {
} }
} }
class LiveWallpaperPreferences { class LiveWallpaperPreferences {
const LiveWallpaperPreferences({ const LiveWallpaperPreferences({
required this.enabled, required this.enabled,
@ -148,6 +139,4 @@ class LiveWallpaperPreferences {
return RotationMode.minutes; return RotationMode.minutes;
} }
} }
} }

View file

@ -86,8 +86,6 @@ class LiveWallpaperSetupPage extends HookConsumerWidget {
} }
} }
return Scaffold( return Scaffold(
appBar: AppBar(title: Text('live_wallpaper_setup_title'.tr())), appBar: AppBar(title: Text('live_wallpaper_setup_title'.tr())),
body: Padding( body: Padding(
@ -132,7 +130,6 @@ class LiveWallpaperSetupPage extends HookConsumerWidget {
onPressed: onSetWallpaper, onPressed: onSetWallpaper,
), ),
), ),
], ],
), ),
), ),
@ -250,5 +247,3 @@ class _RotationControl extends StatelessWidget {
); );
} }
} }

View file

@ -15,15 +15,14 @@ final liveWallpaperAssetServiceProvider = Provider<LiveWallpaperAssetService>((r
return LiveWallpaperAssetService(ref.watch(assetApiRepositoryProvider)); return LiveWallpaperAssetService(ref.watch(assetApiRepositoryProvider));
}); });
final liveWallpaperPreferencesProvider = StateNotifierProvider<LiveWallpaperPreferencesNotifier, LiveWallpaperPreferences> final liveWallpaperPreferencesProvider =
((ref) { StateNotifierProvider<LiveWallpaperPreferencesNotifier, LiveWallpaperPreferences>((ref) {
final service = ref.watch(liveWallpaperPreferencesServiceProvider); final service = ref.watch(liveWallpaperPreferencesServiceProvider);
return LiveWallpaperPreferencesNotifier(service); return LiveWallpaperPreferencesNotifier(service);
}); });
class LiveWallpaperPreferencesNotifier extends StateNotifier<LiveWallpaperPreferences> { class LiveWallpaperPreferencesNotifier extends StateNotifier<LiveWallpaperPreferences> {
LiveWallpaperPreferencesNotifier(this._service) LiveWallpaperPreferencesNotifier(this._service) : super(_service.load()) {
: super(_service.load()) {
_subscription = _service.watch().listen((event) { _subscription = _service.watch().listen((event) {
if (mounted) { if (mounted) {
state = event; state = event;

View file

@ -42,9 +42,7 @@ class LiveWallpaperSetting extends HookConsumerWidget {
margin: const EdgeInsets.symmetric(horizontal: 12, vertical: 4), margin: const EdgeInsets.symmetric(horizontal: 12, vertical: 4),
child: ListTile( child: ListTile(
title: Text('live_wallpaper_setting_manage'.tr()), title: Text('live_wallpaper_setting_manage'.tr()),
subtitle: statusText == null subtitle: statusText == null ? null : Text(statusText, style: Theme.of(context).textTheme.bodySmall),
? null
: Text(statusText, style: Theme.of(context).textTheme.bodySmall),
trailing: const Icon(Icons.chevron_right), trailing: const Icon(Icons.chevron_right),
onTap: () => context.pushRoute(const LiveWallpaperSetupRoute()), onTap: () => context.pushRoute(const LiveWallpaperSetupRoute()),
), ),

View file

@ -30,11 +30,7 @@ class WallpaperStatusMessage {
final bool isActive; final bool isActive;
final String? lastError; final String? lastError;
const WallpaperStatusMessage({ const WallpaperStatusMessage({this.isSupported = true, this.isActive = false, this.lastError});
this.isSupported = true,
this.isActive = false,
this.lastError,
});
} }
@HostApi() @HostApi()