increase min sdk and apply new formatter
This commit is contained in:
@@ -25,8 +25,9 @@ Future<String?> _storedAuthData(Ref ref) {
|
||||
AsyncAuthStore authStore(Ref ref) {
|
||||
const secureStorage = FlutterSecureStorage();
|
||||
|
||||
final intial =
|
||||
ref.watch(_storedAuthDataProvider.select((value) => value.valueOrNull));
|
||||
final intial = ref.watch(
|
||||
_storedAuthDataProvider.select((value) => value.valueOrNull),
|
||||
);
|
||||
|
||||
return AsyncAuthStore(
|
||||
initial: intial,
|
||||
@@ -52,7 +53,8 @@ PocketBase pocketBase(Ref ref) {
|
||||
@Riverpod()
|
||||
bool incognitoModeEnabled(Ref ref) {
|
||||
return ref.watch(
|
||||
generalSettingsRepositoryProvider
|
||||
.select((value) => value.deleteBrowsingDataOnQuit != null),
|
||||
generalSettingsRepositoryProvider.select(
|
||||
(value) => value.deleteBrowsingDataOnQuit != null,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -13,14 +13,15 @@ String _$iconCacheSizeMegabytesHash() =>
|
||||
@ProviderFor(iconCacheSizeMegabytes)
|
||||
final iconCacheSizeMegabytesProvider =
|
||||
AutoDisposeStreamProvider<double>.internal(
|
||||
iconCacheSizeMegabytes,
|
||||
name: r'iconCacheSizeMegabytesProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$iconCacheSizeMegabytesHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
iconCacheSizeMegabytes,
|
||||
name: r'iconCacheSizeMegabytesProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$iconCacheSizeMegabytesHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
@@ -32,9 +33,10 @@ String _$storedAuthDataHash() => r'5f7e3ef6233a2036f7ce3728131901a46b1e548e';
|
||||
final _storedAuthDataProvider = AutoDisposeFutureProvider<String?>.internal(
|
||||
_storedAuthData,
|
||||
name: r'_storedAuthDataProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$storedAuthDataHash,
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$storedAuthDataHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
@@ -98,9 +100,10 @@ String _$incognitoModeEnabledHash() =>
|
||||
final incognitoModeEnabledProvider = AutoDisposeProvider<bool>.internal(
|
||||
incognitoModeEnabled,
|
||||
name: r'incognitoModeEnabledProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$incognitoModeEnabledHash,
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$incognitoModeEnabledHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@@ -33,13 +33,15 @@ class AuthRepository extends _$AuthRepository {
|
||||
String password,
|
||||
) async {
|
||||
try {
|
||||
return await _pb.collection('users').create(
|
||||
body: {
|
||||
"email": email,
|
||||
"password": password,
|
||||
"passwordConfirm": password,
|
||||
},
|
||||
);
|
||||
return await _pb
|
||||
.collection('users')
|
||||
.create(
|
||||
body: {
|
||||
"email": email,
|
||||
"password": password,
|
||||
"passwordConfirm": password,
|
||||
},
|
||||
);
|
||||
} on ClientException catch (e) {
|
||||
throw AuthException(e.errorMessage);
|
||||
}
|
||||
|
||||
@@ -12,14 +12,15 @@ String _$authRepositoryHash() => r'90ea6f082ef968831763c7f7ee31863f1fe329fe';
|
||||
@ProviderFor(AuthRepository)
|
||||
final authRepositoryProvider =
|
||||
AutoDisposeNotifierProvider<AuthRepository, void>.internal(
|
||||
AuthRepository.new,
|
||||
name: r'authRepositoryProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$authRepositoryHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
AuthRepository.new,
|
||||
name: r'authRepositoryProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$authRepositoryHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$AuthRepository = AutoDisposeNotifier<void>;
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
@@ -12,14 +12,15 @@ String _$cacheRepositoryHash() => r'548b7cba9a23c21bba39f0918d7d90acaaf8d8e9';
|
||||
@ProviderFor(CacheRepository)
|
||||
final cacheRepositoryProvider =
|
||||
NotifierProvider<CacheRepository, void>.internal(
|
||||
CacheRepository.new,
|
||||
name: r'cacheRepositoryProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$cacheRepositoryHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
CacheRepository.new,
|
||||
name: r'cacheRepositoryProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$cacheRepositoryHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$CacheRepository = Notifier<void>;
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
@@ -7,9 +7,8 @@ import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
|
||||
part 'engine_settings.g.dart';
|
||||
|
||||
typedef UpdateEngineSettingsFunc = EngineSettings Function(
|
||||
EngineSettings currentSettings,
|
||||
);
|
||||
typedef UpdateEngineSettingsFunc =
|
||||
EngineSettings Function(EngineSettings currentSettings);
|
||||
|
||||
@Riverpod(keepAlive: true)
|
||||
class EngineSettingsRepository extends _$EngineSettingsRepository {
|
||||
@@ -39,34 +38,52 @@ class EngineSettingsRepository extends _$EngineSettingsRepository {
|
||||
.allSettingsOfPartitionKey(_partitionKey)
|
||||
.watch()
|
||||
.listen((entries) {
|
||||
final settings = Map.fromEntries(entries);
|
||||
final settings = Map.fromEntries(entries);
|
||||
|
||||
state = EngineSettings.fromJson({
|
||||
'incognitoMode': settings['incognitoMode']
|
||||
?.readAs(DriftSqlType.bool, db.typeMapping),
|
||||
'javascriptEnabled': settings['javascriptEnabled']
|
||||
?.readAs(DriftSqlType.bool, db.typeMapping),
|
||||
'trackingProtectionPolicy': settings['trackingProtectionPolicy']
|
||||
?.readAs(DriftSqlType.string, db.typeMapping),
|
||||
'httpsOnlyMode': settings['httpsOnlyMode']
|
||||
?.readAs(DriftSqlType.string, db.typeMapping),
|
||||
'globalPrivacyControlEnabled': settings['globalPrivacyControlEnabled']
|
||||
?.readAs(DriftSqlType.bool, db.typeMapping),
|
||||
'cookieBannerHandlingMode': settings['cookieBannerHandlingMode']
|
||||
?.readAs(DriftSqlType.string, db.typeMapping),
|
||||
'cookieBannerHandlingModePrivateBrowsing':
|
||||
settings['cookieBannerHandlingModePrivateBrowsing']
|
||||
state = EngineSettings.fromJson({
|
||||
'incognitoMode': settings['incognitoMode']?.readAs(
|
||||
DriftSqlType.bool,
|
||||
db.typeMapping,
|
||||
),
|
||||
'javascriptEnabled': settings['javascriptEnabled']?.readAs(
|
||||
DriftSqlType.bool,
|
||||
db.typeMapping,
|
||||
),
|
||||
'trackingProtectionPolicy': settings['trackingProtectionPolicy']
|
||||
?.readAs(DriftSqlType.string, db.typeMapping),
|
||||
'cookieBannerHandlingGlobalRules':
|
||||
settings['cookieBannerHandlingGlobalRules']
|
||||
?.readAs(DriftSqlType.bool, db.typeMapping),
|
||||
'cookieBannerHandlingGlobalRulesSubFrames':
|
||||
settings['cookieBannerHandlingGlobalRulesSubFrames']
|
||||
?.readAs(DriftSqlType.bool, db.typeMapping),
|
||||
'webContentIsolationStrategy': settings['webContentIsolationStrategy']
|
||||
?.readAs(DriftSqlType.string, db.typeMapping),
|
||||
});
|
||||
});
|
||||
'httpsOnlyMode': settings['httpsOnlyMode']?.readAs(
|
||||
DriftSqlType.string,
|
||||
db.typeMapping,
|
||||
),
|
||||
'globalPrivacyControlEnabled':
|
||||
settings['globalPrivacyControlEnabled']?.readAs(
|
||||
DriftSqlType.bool,
|
||||
db.typeMapping,
|
||||
),
|
||||
'cookieBannerHandlingMode': settings['cookieBannerHandlingMode']
|
||||
?.readAs(DriftSqlType.string, db.typeMapping),
|
||||
'cookieBannerHandlingModePrivateBrowsing':
|
||||
settings['cookieBannerHandlingModePrivateBrowsing']?.readAs(
|
||||
DriftSqlType.string,
|
||||
db.typeMapping,
|
||||
),
|
||||
'cookieBannerHandlingGlobalRules':
|
||||
settings['cookieBannerHandlingGlobalRules']?.readAs(
|
||||
DriftSqlType.bool,
|
||||
db.typeMapping,
|
||||
),
|
||||
'cookieBannerHandlingGlobalRulesSubFrames':
|
||||
settings['cookieBannerHandlingGlobalRulesSubFrames']?.readAs(
|
||||
DriftSqlType.bool,
|
||||
db.typeMapping,
|
||||
),
|
||||
'webContentIsolationStrategy':
|
||||
settings['webContentIsolationStrategy']?.readAs(
|
||||
DriftSqlType.string,
|
||||
db.typeMapping,
|
||||
),
|
||||
});
|
||||
});
|
||||
|
||||
ref.onDispose(() {
|
||||
unawaited(watchSub.cancel());
|
||||
|
||||
@@ -13,14 +13,15 @@ String _$engineSettingsRepositoryHash() =>
|
||||
@ProviderFor(EngineSettingsRepository)
|
||||
final engineSettingsRepositoryProvider =
|
||||
NotifierProvider<EngineSettingsRepository, EngineSettings>.internal(
|
||||
EngineSettingsRepository.new,
|
||||
name: r'engineSettingsRepositoryProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$engineSettingsRepositoryHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
EngineSettingsRepository.new,
|
||||
name: r'engineSettingsRepositoryProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$engineSettingsRepositoryHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$EngineSettingsRepository = Notifier<EngineSettings>;
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
@@ -9,9 +9,8 @@ import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
|
||||
part 'general_settings.g.dart';
|
||||
|
||||
typedef UpdateGeneralSettingsFunc = GeneralSettings Function(
|
||||
GeneralSettings currentSettings,
|
||||
);
|
||||
typedef UpdateGeneralSettingsFunc =
|
||||
GeneralSettings Function(GeneralSettings currentSettings);
|
||||
|
||||
@Riverpod(keepAlive: true)
|
||||
class GeneralSettingsRepository extends _$GeneralSettingsRepository {
|
||||
@@ -25,10 +24,14 @@ class GeneralSettingsRepository extends _$GeneralSettingsRepository {
|
||||
final db = ref.read(userDatabaseProvider);
|
||||
|
||||
return GeneralSettings.fromJson({
|
||||
'themeMode':
|
||||
settings['themeMode']?.readAs(DriftSqlType.string, db.typeMapping),
|
||||
'enableReadability': settings['enableReadability']
|
||||
?.readAs(DriftSqlType.bool, db.typeMapping),
|
||||
'themeMode': settings['themeMode']?.readAs(
|
||||
DriftSqlType.string,
|
||||
db.typeMapping,
|
||||
),
|
||||
'enableReadability': settings['enableReadability']?.readAs(
|
||||
DriftSqlType.bool,
|
||||
db.typeMapping,
|
||||
),
|
||||
'deleteBrowsingDataOnQuit': settings['deleteBrowsingDataOnQuit']
|
||||
?.readAs(DriftSqlType.string, db.typeMapping)
|
||||
.mapNotNull(jsonDecode),
|
||||
@@ -64,12 +67,12 @@ class GeneralSettingsRepository extends _$GeneralSettingsRepository {
|
||||
GeneralSettings build() {
|
||||
final db = ref.watch(userDatabaseProvider);
|
||||
|
||||
final watchSub =
|
||||
db.settingDao.allSettingsOfPartitionKey(_partitionKey).watch().listen(
|
||||
(event) {
|
||||
state = _deserializeSettings(event);
|
||||
},
|
||||
);
|
||||
final watchSub = db.settingDao
|
||||
.allSettingsOfPartitionKey(_partitionKey)
|
||||
.watch()
|
||||
.listen((event) {
|
||||
state = _deserializeSettings(event);
|
||||
});
|
||||
|
||||
ref.onDispose(() {
|
||||
unawaited(watchSub.cancel());
|
||||
|
||||
@@ -13,14 +13,15 @@ String _$generalSettingsRepositoryHash() =>
|
||||
@ProviderFor(GeneralSettingsRepository)
|
||||
final generalSettingsRepositoryProvider =
|
||||
NotifierProvider<GeneralSettingsRepository, GeneralSettings>.internal(
|
||||
GeneralSettingsRepository.new,
|
||||
name: r'generalSettingsRepositoryProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$generalSettingsRepositoryHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
GeneralSettingsRepository.new,
|
||||
name: r'generalSettingsRepositoryProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$generalSettingsRepositoryHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$GeneralSettingsRepository = Notifier<GeneralSettings>;
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
@@ -23,9 +23,7 @@ class LocalAuthenticationService extends _$LocalAuthenticationService {
|
||||
}
|
||||
|
||||
void evictCacheOnBackground() {
|
||||
_cache.removeWhere(
|
||||
(key, value) => value.$2.lockOnAppBackground,
|
||||
);
|
||||
_cache.removeWhere((key, value) => value.$2.lockOnAppBackground);
|
||||
}
|
||||
|
||||
Future<bool> authenticate({
|
||||
@@ -38,9 +36,7 @@ class LocalAuthenticationService extends _$LocalAuthenticationService {
|
||||
var result = useAuthCache && _cacheAuth(authKey);
|
||||
|
||||
if (!result) {
|
||||
result = await _auth.authenticate(
|
||||
localizedReason: localizedReason,
|
||||
);
|
||||
result = await _auth.authenticate(localizedReason: localizedReason);
|
||||
}
|
||||
|
||||
if (result && settings != null) {
|
||||
|
||||
@@ -13,14 +13,15 @@ String _$localAuthenticationServiceHash() =>
|
||||
@ProviderFor(LocalAuthenticationService)
|
||||
final localAuthenticationServiceProvider =
|
||||
AsyncNotifierProvider<LocalAuthenticationService, bool>.internal(
|
||||
LocalAuthenticationService.new,
|
||||
name: r'localAuthenticationServiceProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$localAuthenticationServiceHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
LocalAuthenticationService.new,
|
||||
name: r'localAuthenticationServiceProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$localAuthenticationServiceHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$LocalAuthenticationService = AsyncNotifier<bool>;
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
Reference in New Issue
Block a user