more refactors

This commit is contained in:
shenlong-tanwen
2024-10-19 14:34:42 +05:30
parent e8bb9a3934
commit 3b8951fde6
46 changed files with 598 additions and 435 deletions
@@ -0,0 +1,25 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:immich_mobile/domain/models/app_setting.model.dart';
import 'package:immich_mobile/domain/services/app_setting.service.dart';
import 'package:immich_mobile/presentation/theme/app_theme.dart';
class AppThemeProvider extends ValueNotifier<AppTheme> {
final AppSettingService _appSettings;
late final StreamSubscription _appSettingSubscription;
AppThemeProvider({required AppSettingService settingsService})
: _appSettings = settingsService,
super(AppTheme.blue) {
_appSettingSubscription = _appSettings
.watch(AppSetting.appTheme)
.listen((theme) => value = theme);
}
@override
void dispose() {
_appSettingSubscription.cancel();
super.dispose();
}
}