part of '../pref_controller.dart'; extension on Pref { int? getHomeAlbumsSort() => provider.getInt(PrefKey.homeAlbumsSort); int getHomeAlbumsSortOr(int def) => getHomeAlbumsSort() ?? def; Future setHomeAlbumsSort(int value) => provider.setInt(PrefKey.homeAlbumsSort, value); bool? isDarkTheme() => provider.getBool(PrefKey.darkTheme); bool isDarkThemeOr(bool def) => isDarkTheme() ?? def; Future setDarkTheme(bool value) => provider.setBool(PrefKey.darkTheme, value); bool? isFollowSystemTheme() => provider.getBool(PrefKey.followSystemTheme); bool isFollowSystemThemeOr(bool def) => isFollowSystemTheme() ?? def; Future setFollowSystemTheme(bool value) => provider.setBool(PrefKey.followSystemTheme, value); bool? isUseBlackInDarkTheme() => provider.getBool(PrefKey.useBlackInDarkTheme); bool isUseBlackInDarkThemeOr(bool def) => isUseBlackInDarkTheme() ?? def; Future setUseBlackInDarkTheme(bool value) => provider.setBool(PrefKey.useBlackInDarkTheme, value); int? getGpsMapProvider() => provider.getInt(PrefKey.gpsMapProvider); int getGpsMapProviderOr(int def) => getGpsMapProvider() ?? def; Future setGpsMapProvider(int value) => provider.setInt(PrefKey.gpsMapProvider, value); int? getSeedColor() => provider.getInt(PrefKey.seedColor); // int getSeedColorOr(int def) => getSeedColor() ?? def; Future setSeedColor(int? value) { if (value == null) { return provider.remove(PrefKey.seedColor); } else { return provider.setInt(PrefKey.seedColor, value); } } int? getSecondarySeedColor() => provider.getInt(PrefKey.secondarySeedColor); // int getSecondarySeedColorOr(int def) => getSecondarySeedColor() ?? def; Future setSecondarySeedColor(int? value) { if (value == null) { return provider.remove(PrefKey.secondarySeedColor); } else { return provider.setInt(PrefKey.secondarySeedColor, value); } } int? getProtectedPageAuthType() => provider.getInt(PrefKey.protectedPageAuthType); // int getProtectedPageAuthTypeOr(int def) => getProtectedPageAuthType() ?? def; Future setProtectedPageAuthType(int? value) { if (value == null) { return provider.remove(PrefKey.protectedPageAuthType); } else { return provider.setInt(PrefKey.protectedPageAuthType, value); } } String? getProtectedPageAuthPin() => provider.getString(PrefKey.protectedPageAuthPin); // String getProtectedPageAuthPinOr(String def) => // getProtectedPageAuthPin() ?? def; Future setProtectedPageAuthPin(String? value) { if (value == null) { return provider.remove(PrefKey.protectedPageAuthPin); } else { return provider.setString(PrefKey.protectedPageAuthPin, value); } } String? getProtectedPageAuthPassword() => provider.getString(PrefKey.protectedPageAuthPassword); // String getProtectedPageAuthPasswordOr(String def) => // getProtectedPageAuthPassword() ?? def; Future setProtectedPageAuthPassword(String? value) { if (value == null) { return provider.remove(PrefKey.protectedPageAuthPassword); } else { return provider.setString(PrefKey.protectedPageAuthPassword, value); } } }