mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
Fixing formatting
This commit is contained in:
parent
7a903d39c0
commit
9731a1a60f
6 changed files with 18 additions and 41 deletions
|
|
@ -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<String> personIds;
|
||||
|
|
@ -148,6 +139,4 @@ class LiveWallpaperPreferences {
|
|||
return RotationMode.minutes;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -15,15 +15,14 @@ final liveWallpaperAssetServiceProvider = Provider<LiveWallpaperAssetService>((r
|
|||
return LiveWallpaperAssetService(ref.watch(assetApiRepositoryProvider));
|
||||
});
|
||||
|
||||
final liveWallpaperPreferencesProvider = StateNotifierProvider<LiveWallpaperPreferencesNotifier, LiveWallpaperPreferences>
|
||||
((ref) {
|
||||
final service = ref.watch(liveWallpaperPreferencesServiceProvider);
|
||||
return LiveWallpaperPreferencesNotifier(service);
|
||||
});
|
||||
final liveWallpaperPreferencesProvider =
|
||||
StateNotifierProvider<LiveWallpaperPreferencesNotifier, LiveWallpaperPreferences>((ref) {
|
||||
final service = ref.watch(liveWallpaperPreferencesServiceProvider);
|
||||
return LiveWallpaperPreferencesNotifier(service);
|
||||
});
|
||||
|
||||
class LiveWallpaperPreferencesNotifier extends StateNotifier<LiveWallpaperPreferences> {
|
||||
LiveWallpaperPreferencesNotifier(this._service)
|
||||
: super(_service.load()) {
|
||||
LiveWallpaperPreferencesNotifier(this._service) : super(_service.load()) {
|
||||
_subscription = _service.watch().listen((event) {
|
||||
if (mounted) {
|
||||
state = event;
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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()),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue