mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
refactor(mobile): server info to use data classes instead of dtos (#4591)
* refactor: server info model to use data classes instead of dtos * mobile: add return types and refactor private variables in map / stack --------- Co-authored-by: shalong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
@@ -4,26 +4,24 @@ import 'package:immich_mobile/modules/settings/providers/app_settings.provider.d
|
||||
import 'package:immich_mobile/modules/settings/services/app_settings.service.dart';
|
||||
|
||||
class MapStateNotifier extends StateNotifier<MapState> {
|
||||
MapStateNotifier(this.appSettingsProvider)
|
||||
MapStateNotifier(this._appSettingsProvider)
|
||||
: super(
|
||||
MapState(
|
||||
isDarkTheme: appSettingsProvider
|
||||
isDarkTheme: _appSettingsProvider
|
||||
.getSetting<bool>(AppSettingsEnum.mapThemeMode),
|
||||
showFavoriteOnly: appSettingsProvider
|
||||
showFavoriteOnly: _appSettingsProvider
|
||||
.getSetting<bool>(AppSettingsEnum.mapShowFavoriteOnly),
|
||||
includeArchived: appSettingsProvider
|
||||
includeArchived: _appSettingsProvider
|
||||
.getSetting<bool>(AppSettingsEnum.mapIncludeArchived),
|
||||
relativeTime: appSettingsProvider
|
||||
relativeTime: _appSettingsProvider
|
||||
.getSetting<int>(AppSettingsEnum.mapRelativeDate),
|
||||
),
|
||||
);
|
||||
|
||||
final AppSettingsService appSettingsProvider;
|
||||
|
||||
bool get isDarkTheme => state.isDarkTheme;
|
||||
final AppSettingsService _appSettingsProvider;
|
||||
|
||||
void switchTheme(bool isDarkTheme) {
|
||||
appSettingsProvider.setSetting(
|
||||
_appSettingsProvider.setSetting(
|
||||
AppSettingsEnum.mapThemeMode,
|
||||
isDarkTheme,
|
||||
);
|
||||
@@ -31,7 +29,7 @@ class MapStateNotifier extends StateNotifier<MapState> {
|
||||
}
|
||||
|
||||
void switchFavoriteOnly(bool isFavoriteOnly) {
|
||||
appSettingsProvider.setSetting(
|
||||
_appSettingsProvider.setSetting(
|
||||
AppSettingsEnum.mapShowFavoriteOnly,
|
||||
isFavoriteOnly,
|
||||
);
|
||||
@@ -39,7 +37,7 @@ class MapStateNotifier extends StateNotifier<MapState> {
|
||||
}
|
||||
|
||||
void switchIncludeArchived(bool isIncludeArchived) {
|
||||
appSettingsProvider.setSetting(
|
||||
_appSettingsProvider.setSetting(
|
||||
AppSettingsEnum.mapIncludeArchived,
|
||||
isIncludeArchived,
|
||||
);
|
||||
@@ -47,7 +45,7 @@ class MapStateNotifier extends StateNotifier<MapState> {
|
||||
}
|
||||
|
||||
void setRelativeTime(int relativeTime) {
|
||||
appSettingsProvider.setSetting(
|
||||
_appSettingsProvider.setSetting(
|
||||
AppSettingsEnum.mapRelativeDate,
|
||||
relativeTime,
|
||||
);
|
||||
|
||||
@@ -17,7 +17,7 @@ final mapServiceProvider = Provider(
|
||||
class MapSerivce {
|
||||
final ApiService _apiService;
|
||||
final Isar _db;
|
||||
final log = Logger("MapService");
|
||||
final _log = Logger("MapService");
|
||||
|
||||
MapSerivce(this._apiService, this._db);
|
||||
|
||||
@@ -37,7 +37,7 @@ class MapSerivce {
|
||||
|
||||
return markers ?? [];
|
||||
} catch (error, stack) {
|
||||
log.severe("Cannot get map markers ${error.toString()}", error, stack);
|
||||
_log.severe("Cannot get map markers ${error.toString()}", error, stack);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -53,7 +53,7 @@ class MapSerivce {
|
||||
}
|
||||
return Asset.remote(dto);
|
||||
} catch (error, stack) {
|
||||
log.severe(
|
||||
_log.severe(
|
||||
"Cannot get asset for marker ${error.toString()}",
|
||||
error,
|
||||
stack,
|
||||
|
||||
Reference in New Issue
Block a user