migration done

This commit is contained in:
Fabian Freund
2025-09-19 11:50:34 +02:00
parent b01012c76c
commit 79da47d11b
198 changed files with 17341 additions and 15711 deletions
@@ -19,12 +19,12 @@
*/
import 'package:drift/drift.dart';
import 'package:weblibre/data/database/extensions/database_table_size.dart';
import 'package:weblibre/features/user/data/database/daos/cache.drift.dart';
import 'package:weblibre/features/user/data/database/database.dart';
part 'cache.g.dart';
import 'package:weblibre/features/user/data/database/definitions.drift.dart';
@DriftAccessor()
class CacheDao extends DatabaseAccessor<UserDatabase> with _$CacheDaoMixin {
class CacheDao extends DatabaseAccessor<UserDatabase> with $CacheDaoMixin {
CacheDao(super.attachedDatabase);
SingleSelectable<double> getIconCacheSize() {
@@ -0,0 +1,6 @@
// dart format width=80
// ignore_for_file: type=lint
import 'package:drift/drift.dart' as i0;
import 'package:weblibre/features/user/data/database/database.dart' as i1;
mixin $CacheDaoMixin on i0.DatabaseAccessor<i1.UserDatabase> {}
@@ -1,6 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'cache.dart';
// ignore_for_file: type=lint
mixin _$CacheDaoMixin on DatabaseAccessor<UserDatabase> {}
@@ -19,12 +19,10 @@
*/
import 'package:drift/drift.dart';
import 'package:weblibre/features/user/data/database/database.dart';
part 'onboarding.g.dart';
import 'package:weblibre/features/user/data/database/definitions.drift.dart';
@DriftAccessor()
class OnboardingDao extends DatabaseAccessor<UserDatabase>
with _$OnboardingDaoMixin {
class OnboardingDao extends DatabaseAccessor<UserDatabase> {
OnboardingDao(super.attachedDatabase);
SingleOrNullSelectable<int?> getLastRevision() {
@@ -0,0 +1,6 @@
// dart format width=80
// ignore_for_file: type=lint
import 'package:drift/drift.dart' as i0;
import 'package:weblibre/features/user/data/database/database.dart' as i1;
mixin $OnboardingDaoMixin on i0.DatabaseAccessor<i1.UserDatabase> {}
@@ -1,6 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'onboarding.dart';
// ignore_for_file: type=lint
mixin _$OnboardingDaoMixin on DatabaseAccessor<UserDatabase> {}
@@ -21,12 +21,12 @@ import 'dart:convert';
import 'package:drift/drift.dart';
import 'package:nullability/nullability.dart';
import 'package:weblibre/features/user/data/database/daos/setting.drift.dart';
import 'package:weblibre/features/user/data/database/database.dart';
part 'setting.g.dart';
import 'package:weblibre/features/user/data/database/definitions.drift.dart';
@DriftAccessor()
class SettingDao extends DatabaseAccessor<UserDatabase> with _$SettingDaoMixin {
class SettingDao extends DatabaseAccessor<UserDatabase> with $SettingDaoMixin {
SettingDao(super.attachedDatabase);
Future<int> updateSetting(String key, String? partitionKey, Object? value) {
@@ -0,0 +1,6 @@
// dart format width=80
// ignore_for_file: type=lint
import 'package:drift/drift.dart' as i0;
import 'package:weblibre/features/user/data/database/database.dart' as i1;
mixin $SettingDaoMixin on i0.DatabaseAccessor<i1.UserDatabase> {}
@@ -1,6 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'setting.dart';
// ignore_for_file: type=lint
mixin _$SettingDaoMixin on DatabaseAccessor<UserDatabase> {}
@@ -21,14 +21,13 @@ import 'package:drift/drift.dart';
import 'package:weblibre/features/user/data/database/daos/cache.dart';
import 'package:weblibre/features/user/data/database/daos/onboarding.dart';
import 'package:weblibre/features/user/data/database/daos/setting.dart';
part 'database.g.dart';
import 'package:weblibre/features/user/data/database/database.drift.dart';
@DriftDatabase(
include: {'database.drift'},
include: {'definitions.drift'},
daos: [SettingDao, CacheDao, OnboardingDao],
)
class UserDatabase extends _$UserDatabase {
class UserDatabase extends $UserDatabase {
@override
final int schemaVersion = 1;
@@ -0,0 +1,94 @@
// dart format width=80
// ignore_for_file: type=lint
import 'package:drift/drift.dart' as i0;
import 'package:weblibre/features/user/data/database/definitions.drift.dart'
as i1;
import 'package:weblibre/features/user/data/database/daos/setting.dart' as i2;
import 'package:weblibre/features/user/data/database/database.dart' as i3;
import 'package:weblibre/features/user/data/database/daos/cache.dart' as i4;
import 'package:weblibre/features/user/data/database/daos/onboarding.dart'
as i5;
import 'package:drift/internal/modular.dart' as i6;
import 'package:sqlite3/common.dart' as i7;
abstract class $UserDatabase extends i0.GeneratedDatabase {
$UserDatabase(i0.QueryExecutor e) : super(e);
$UserDatabaseManager get managers => $UserDatabaseManager(this);
late final i1.Setting setting = i1.Setting(this);
late final i1.IconCache iconCache = i1.IconCache(this);
late final i1.Onboarding onboarding = i1.Onboarding(this);
late final i2.SettingDao settingDao = i2.SettingDao(this as i3.UserDatabase);
late final i4.CacheDao cacheDao = i4.CacheDao(this as i3.UserDatabase);
late final i5.OnboardingDao onboardingDao = i5.OnboardingDao(
this as i3.UserDatabase,
);
i1.DefinitionsDrift get definitionsDrift => i6.ReadDatabaseContainer(
this,
).accessor<i1.DefinitionsDrift>(i1.DefinitionsDrift.new);
@override
Iterable<i0.TableInfo<i0.Table, Object?>> get allTables =>
allSchemaEntities.whereType<i0.TableInfo<i0.Table, Object?>>();
@override
List<i0.DatabaseSchemaEntity> get allSchemaEntities => [
setting,
iconCache,
onboarding,
];
}
class $UserDatabaseManager {
final $UserDatabase _db;
$UserDatabaseManager(this._db);
i1.$SettingTableManager get setting =>
i1.$SettingTableManager(_db, _db.setting);
i1.$IconCacheTableManager get iconCache =>
i1.$IconCacheTableManager(_db, _db.iconCache);
i1.$OnboardingTableManager get onboarding =>
i1.$OnboardingTableManager(_db, _db.onboarding);
}
extension DefineFunctions on i7.CommonDatabase {
void defineFunctions({
required String Function(int, String?) lexoRankNext,
required String Function(int, String?) lexoRankPrevious,
required String Function(String?, String?) lexoRankReorderAfter,
required String Function(String?, String?) lexoRankReorderBefore,
}) {
createFunction(
functionName: 'lexo_rank_next',
argumentCount: const i7.AllowedArgumentCount(2),
function: (args) {
final arg0 = args[0] as int;
final arg1 = args[1] as String?;
return lexoRankNext(arg0, arg1);
},
);
createFunction(
functionName: 'lexo_rank_previous',
argumentCount: const i7.AllowedArgumentCount(2),
function: (args) {
final arg0 = args[0] as int;
final arg1 = args[1] as String?;
return lexoRankPrevious(arg0, arg1);
},
);
createFunction(
functionName: 'lexo_rank_reorder_after',
argumentCount: const i7.AllowedArgumentCount(2),
function: (args) {
final arg0 = args[0] as String?;
final arg1 = args[1] as String?;
return lexoRankReorderAfter(arg0, arg1);
},
);
createFunction(
functionName: 'lexo_rank_reorder_before',
argumentCount: const i7.AllowedArgumentCount(2),
function: (args) {
final arg0 = args[0] as String?;
final arg1 = args[1] as String?;
return lexoRankReorderBefore(arg0, arg1);
},
);
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -51,12 +51,13 @@ abstract class _$EngineSettingsCWProxy {
BounceTrackingProtectionMode bounceTrackingProtectionMode,
);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `EngineSettings(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
/// Creates a new instance with the provided field values.
/// Passing `null` to a nullable field nullifies it, while `null` for a non-nullable field is ignored. To update a single field use `EngineSettings(...).copyWith.fieldName(value)`.
///
/// Usage
/// Example:
/// ```dart
/// EngineSettings(...).copyWith(id: 12, name: "My name")
/// ````
/// ```
EngineSettings call({
bool? javascriptEnabled,
TrackingProtectionPolicy? trackingProtectionPolicy,
@@ -75,7 +76,8 @@ abstract class _$EngineSettingsCWProxy {
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfEngineSettings.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfEngineSettings.copyWith.fieldName(...)`
/// Callable proxy for `copyWith` functionality.
/// Use as `instanceOfEngineSettings.copyWith(...)` or call `instanceOfEngineSettings.copyWith.fieldName(value)` for a single field.
class _$EngineSettingsCWProxyImpl implements _$EngineSettingsCWProxy {
const _$EngineSettingsCWProxyImpl(this._value);
@@ -83,35 +85,35 @@ class _$EngineSettingsCWProxyImpl implements _$EngineSettingsCWProxy {
@override
EngineSettings javascriptEnabled(bool? javascriptEnabled) =>
this(javascriptEnabled: javascriptEnabled);
call(javascriptEnabled: javascriptEnabled);
@override
EngineSettings trackingProtectionPolicy(
TrackingProtectionPolicy? trackingProtectionPolicy,
) => this(trackingProtectionPolicy: trackingProtectionPolicy);
) => call(trackingProtectionPolicy: trackingProtectionPolicy);
@override
EngineSettings httpsOnlyMode(HttpsOnlyMode? httpsOnlyMode) =>
this(httpsOnlyMode: httpsOnlyMode);
call(httpsOnlyMode: httpsOnlyMode);
@override
EngineSettings globalPrivacyControlEnabled(
bool? globalPrivacyControlEnabled,
) => this(globalPrivacyControlEnabled: globalPrivacyControlEnabled);
) => call(globalPrivacyControlEnabled: globalPrivacyControlEnabled);
@override
EngineSettings preferredColorScheme(ColorScheme? preferredColorScheme) =>
this(preferredColorScheme: preferredColorScheme);
call(preferredColorScheme: preferredColorScheme);
@override
EngineSettings cookieBannerHandlingMode(
CookieBannerHandlingMode? cookieBannerHandlingMode,
) => this(cookieBannerHandlingMode: cookieBannerHandlingMode);
) => call(cookieBannerHandlingMode: cookieBannerHandlingMode);
@override
EngineSettings cookieBannerHandlingModePrivateBrowsing(
CookieBannerHandlingMode? cookieBannerHandlingModePrivateBrowsing,
) => this(
) => call(
cookieBannerHandlingModePrivateBrowsing:
cookieBannerHandlingModePrivateBrowsing,
);
@@ -119,12 +121,12 @@ class _$EngineSettingsCWProxyImpl implements _$EngineSettingsCWProxy {
@override
EngineSettings cookieBannerHandlingGlobalRules(
bool? cookieBannerHandlingGlobalRules,
) => this(cookieBannerHandlingGlobalRules: cookieBannerHandlingGlobalRules);
) => call(cookieBannerHandlingGlobalRules: cookieBannerHandlingGlobalRules);
@override
EngineSettings cookieBannerHandlingGlobalRulesSubFrames(
bool? cookieBannerHandlingGlobalRulesSubFrames,
) => this(
) => call(
cookieBannerHandlingGlobalRulesSubFrames:
cookieBannerHandlingGlobalRulesSubFrames,
);
@@ -132,32 +134,33 @@ class _$EngineSettingsCWProxyImpl implements _$EngineSettingsCWProxy {
@override
EngineSettings webContentIsolationStrategy(
WebContentIsolationStrategy? webContentIsolationStrategy,
) => this(webContentIsolationStrategy: webContentIsolationStrategy);
) => call(webContentIsolationStrategy: webContentIsolationStrategy);
@override
EngineSettings userAgent(String? userAgent) => this(userAgent: userAgent);
EngineSettings userAgent(String? userAgent) => call(userAgent: userAgent);
@override
EngineSettings enterpriseRootsEnabled(bool? enterpriseRootsEnabled) =>
this(enterpriseRootsEnabled: enterpriseRootsEnabled);
call(enterpriseRootsEnabled: enterpriseRootsEnabled);
@override
EngineSettings queryParameterStripping(
QueryParameterStripping queryParameterStripping,
) => this(queryParameterStripping: queryParameterStripping);
) => call(queryParameterStripping: queryParameterStripping);
@override
EngineSettings bounceTrackingProtectionMode(
BounceTrackingProtectionMode bounceTrackingProtectionMode,
) => this(bounceTrackingProtectionMode: bounceTrackingProtectionMode);
) => call(bounceTrackingProtectionMode: bounceTrackingProtectionMode);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `EngineSettings(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
/// Creates a new instance with the provided field values.
/// Passing `null` to a nullable field nullifies it, while `null` for a non-nullable field is ignored. To update a single field use `EngineSettings(...).copyWith.fieldName(value)`.
///
/// Usage
/// Example:
/// ```dart
/// EngineSettings(...).copyWith(id: 12, name: "My name")
/// ````
/// ```
EngineSettings call({
Object? javascriptEnabled = const $CopyWithPlaceholder(),
Object? trackingProtectionPolicy = const $CopyWithPlaceholder(),
@@ -237,12 +240,14 @@ class _$EngineSettingsCWProxyImpl implements _$EngineSettingsCWProxy {
// ignore: cast_nullable_to_non_nullable
: enterpriseRootsEnabled as bool?,
queryParameterStripping:
queryParameterStripping == const $CopyWithPlaceholder()
queryParameterStripping == const $CopyWithPlaceholder() ||
queryParameterStripping == null
? _value.queryParameterStripping
// ignore: cast_nullable_to_non_nullable
: queryParameterStripping as QueryParameterStripping,
bounceTrackingProtectionMode:
bounceTrackingProtectionMode == const $CopyWithPlaceholder()
bounceTrackingProtectionMode == const $CopyWithPlaceholder() ||
bounceTrackingProtectionMode == null
? _value.bounceTrackingProtectionMode
// ignore: cast_nullable_to_non_nullable
: bounceTrackingProtectionMode as BounceTrackingProtectionMode,
@@ -251,7 +256,8 @@ class _$EngineSettingsCWProxyImpl implements _$EngineSettingsCWProxy {
}
extension $EngineSettingsCopyWith on EngineSettings {
/// Returns a callable class that can be used as follows: `instanceOfEngineSettings.copyWith(...)` or like so:`instanceOfEngineSettings.copyWith.fieldName(...)`.
/// Returns a callable class used to build a new instance with modified fields.
/// Example: `instanceOfEngineSettings.copyWith(...)` or `instanceOfEngineSettings.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$EngineSettingsCWProxy get copyWith => _$EngineSettingsCWProxyImpl(this);
}
@@ -41,12 +41,13 @@ abstract class _$GeneralSettingsCWProxy {
GeneralSettings historyAutoCleanInterval(Duration historyAutoCleanInterval);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GeneralSettings(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
/// Creates a new instance with the provided field values.
/// Passing `null` to a nullable field nullifies it, while `null` for a non-nullable field is ignored. To update a single field use `GeneralSettings(...).copyWith.fieldName(value)`.
///
/// Usage
/// Example:
/// ```dart
/// GeneralSettings(...).copyWith(id: 12, name: "My name")
/// ````
/// ```
GeneralSettings call({
ThemeMode themeMode,
bool enableReadability,
@@ -65,77 +66,79 @@ abstract class _$GeneralSettingsCWProxy {
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfGeneralSettings.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfGeneralSettings.copyWith.fieldName(...)`
/// Callable proxy for `copyWith` functionality.
/// Use as `instanceOfGeneralSettings.copyWith(...)` or call `instanceOfGeneralSettings.copyWith.fieldName(value)` for a single field.
class _$GeneralSettingsCWProxyImpl implements _$GeneralSettingsCWProxy {
const _$GeneralSettingsCWProxyImpl(this._value);
final GeneralSettings _value;
@override
GeneralSettings themeMode(ThemeMode themeMode) => this(themeMode: themeMode);
GeneralSettings themeMode(ThemeMode themeMode) => call(themeMode: themeMode);
@override
GeneralSettings enableReadability(bool enableReadability) =>
this(enableReadability: enableReadability);
call(enableReadability: enableReadability);
@override
GeneralSettings enforceReadability(bool enforceReadability) =>
this(enforceReadability: enforceReadability);
call(enforceReadability: enforceReadability);
@override
GeneralSettings deleteBrowsingDataOnQuit(
Set<DeleteBrowsingDataType>? deleteBrowsingDataOnQuit,
) => this(deleteBrowsingDataOnQuit: deleteBrowsingDataOnQuit);
) => call(deleteBrowsingDataOnQuit: deleteBrowsingDataOnQuit);
@override
GeneralSettings defaultSearchProvider(String defaultSearchProvider) =>
this(defaultSearchProvider: defaultSearchProvider);
call(defaultSearchProvider: defaultSearchProvider);
@override
GeneralSettings defaultSearchSuggestionsProvider(
SearchSuggestionProviders defaultSearchSuggestionsProvider,
) => this(defaultSearchSuggestionsProvider: defaultSearchSuggestionsProvider);
) => call(defaultSearchSuggestionsProvider: defaultSearchSuggestionsProvider);
@override
GeneralSettings createChildTabsOption(bool createChildTabsOption) =>
this(createChildTabsOption: createChildTabsOption);
call(createChildTabsOption: createChildTabsOption);
@override
GeneralSettings showExtensionShortcut(bool showExtensionShortcut) =>
this(showExtensionShortcut: showExtensionShortcut);
call(showExtensionShortcut: showExtensionShortcut);
@override
GeneralSettings enableLocalAiFeatures(bool enableLocalAiFeatures) =>
this(enableLocalAiFeatures: enableLocalAiFeatures);
call(enableLocalAiFeatures: enableLocalAiFeatures);
@override
GeneralSettings defaultCreateTabType(TabType defaultCreateTabType) =>
this(defaultCreateTabType: defaultCreateTabType);
call(defaultCreateTabType: defaultCreateTabType);
@override
GeneralSettings tabIntentOpenSetting(
TabIntentOpenSetting tabIntentOpenSetting,
) => this(tabIntentOpenSetting: tabIntentOpenSetting);
) => call(tabIntentOpenSetting: tabIntentOpenSetting);
@override
GeneralSettings autoHideTabBar(bool autoHideTabBar) =>
this(autoHideTabBar: autoHideTabBar);
call(autoHideTabBar: autoHideTabBar);
@override
GeneralSettings tabBarSwipeAction(TabBarSwipeAction tabBarSwipeAction) =>
this(tabBarSwipeAction: tabBarSwipeAction);
call(tabBarSwipeAction: tabBarSwipeAction);
@override
GeneralSettings historyAutoCleanInterval(Duration historyAutoCleanInterval) =>
this(historyAutoCleanInterval: historyAutoCleanInterval);
call(historyAutoCleanInterval: historyAutoCleanInterval);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GeneralSettings(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
/// Creates a new instance with the provided field values.
/// Passing `null` to a nullable field nullifies it, while `null` for a non-nullable field is ignored. To update a single field use `GeneralSettings(...).copyWith.fieldName(value)`.
///
/// Usage
/// Example:
/// ```dart
/// GeneralSettings(...).copyWith(id: 12, name: "My name")
/// ````
/// ```
GeneralSettings call({
Object? themeMode = const $CopyWithPlaceholder(),
Object? enableReadability = const $CopyWithPlaceholder(),
@@ -153,15 +156,19 @@ class _$GeneralSettingsCWProxyImpl implements _$GeneralSettingsCWProxy {
Object? historyAutoCleanInterval = const $CopyWithPlaceholder(),
}) {
return GeneralSettings(
themeMode: themeMode == const $CopyWithPlaceholder()
themeMode: themeMode == const $CopyWithPlaceholder() || themeMode == null
? _value.themeMode
// ignore: cast_nullable_to_non_nullable
: themeMode as ThemeMode,
enableReadability: enableReadability == const $CopyWithPlaceholder()
enableReadability:
enableReadability == const $CopyWithPlaceholder() ||
enableReadability == null
? _value.enableReadability
// ignore: cast_nullable_to_non_nullable
: enableReadability as bool,
enforceReadability: enforceReadability == const $CopyWithPlaceholder()
enforceReadability:
enforceReadability == const $CopyWithPlaceholder() ||
enforceReadability == null
? _value.enforceReadability
// ignore: cast_nullable_to_non_nullable
: enforceReadability as bool,
@@ -171,48 +178,62 @@ class _$GeneralSettingsCWProxyImpl implements _$GeneralSettingsCWProxy {
// ignore: cast_nullable_to_non_nullable
: deleteBrowsingDataOnQuit as Set<DeleteBrowsingDataType>?,
defaultSearchProvider:
defaultSearchProvider == const $CopyWithPlaceholder()
defaultSearchProvider == const $CopyWithPlaceholder() ||
defaultSearchProvider == null
? _value.defaultSearchProvider
// ignore: cast_nullable_to_non_nullable
: defaultSearchProvider as String,
defaultSearchSuggestionsProvider:
defaultSearchSuggestionsProvider == const $CopyWithPlaceholder()
defaultSearchSuggestionsProvider == const $CopyWithPlaceholder() ||
defaultSearchSuggestionsProvider == null
? _value.defaultSearchSuggestionsProvider
// ignore: cast_nullable_to_non_nullable
: defaultSearchSuggestionsProvider as SearchSuggestionProviders,
createChildTabsOption:
createChildTabsOption == const $CopyWithPlaceholder()
createChildTabsOption == const $CopyWithPlaceholder() ||
createChildTabsOption == null
? _value.createChildTabsOption
// ignore: cast_nullable_to_non_nullable
: createChildTabsOption as bool,
showExtensionShortcut:
showExtensionShortcut == const $CopyWithPlaceholder()
showExtensionShortcut == const $CopyWithPlaceholder() ||
showExtensionShortcut == null
? _value.showExtensionShortcut
// ignore: cast_nullable_to_non_nullable
: showExtensionShortcut as bool,
enableLocalAiFeatures:
enableLocalAiFeatures == const $CopyWithPlaceholder()
enableLocalAiFeatures == const $CopyWithPlaceholder() ||
enableLocalAiFeatures == null
? _value.enableLocalAiFeatures
// ignore: cast_nullable_to_non_nullable
: enableLocalAiFeatures as bool,
defaultCreateTabType: defaultCreateTabType == const $CopyWithPlaceholder()
defaultCreateTabType:
defaultCreateTabType == const $CopyWithPlaceholder() ||
defaultCreateTabType == null
? _value.defaultCreateTabType
// ignore: cast_nullable_to_non_nullable
: defaultCreateTabType as TabType,
tabIntentOpenSetting: tabIntentOpenSetting == const $CopyWithPlaceholder()
tabIntentOpenSetting:
tabIntentOpenSetting == const $CopyWithPlaceholder() ||
tabIntentOpenSetting == null
? _value.tabIntentOpenSetting
// ignore: cast_nullable_to_non_nullable
: tabIntentOpenSetting as TabIntentOpenSetting,
autoHideTabBar: autoHideTabBar == const $CopyWithPlaceholder()
autoHideTabBar:
autoHideTabBar == const $CopyWithPlaceholder() ||
autoHideTabBar == null
? _value.autoHideTabBar
// ignore: cast_nullable_to_non_nullable
: autoHideTabBar as bool,
tabBarSwipeAction: tabBarSwipeAction == const $CopyWithPlaceholder()
tabBarSwipeAction:
tabBarSwipeAction == const $CopyWithPlaceholder() ||
tabBarSwipeAction == null
? _value.tabBarSwipeAction
// ignore: cast_nullable_to_non_nullable
: tabBarSwipeAction as TabBarSwipeAction,
historyAutoCleanInterval:
historyAutoCleanInterval == const $CopyWithPlaceholder()
historyAutoCleanInterval == const $CopyWithPlaceholder() ||
historyAutoCleanInterval == null
? _value.historyAutoCleanInterval
// ignore: cast_nullable_to_non_nullable
: historyAutoCleanInterval as Duration,
@@ -221,7 +242,8 @@ class _$GeneralSettingsCWProxyImpl implements _$GeneralSettingsCWProxy {
}
extension $GeneralSettingsCopyWith on GeneralSettings {
/// Returns a callable class that can be used as follows: `instanceOfGeneralSettings.copyWith(...)` or like so:`instanceOfGeneralSettings.copyWith.fieldName(...)`.
/// Returns a callable class used to build a new instance with modified fields.
/// Example: `instanceOfGeneralSettings.copyWith(...)` or `instanceOfGeneralSettings.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$GeneralSettingsCWProxy get copyWith => _$GeneralSettingsCWProxyImpl(this);
}
@@ -15,12 +15,13 @@ abstract class _$TorSettingsCWProxy {
TorSettings fetchRemoteBridges(bool fetchRemoteBridges);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TorSettings(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
/// Creates a new instance with the provided field values.
/// Passing `null` to a nullable field nullifies it, while `null` for a non-nullable field is ignored. To update a single field use `TorSettings(...).copyWith.fieldName(value)`.
///
/// Usage
/// Example:
/// ```dart
/// TorSettings(...).copyWith(id: 12, name: "My name")
/// ````
/// ```
TorSettings call({
bool proxyPrivateTabsTor,
TorConnectionConfig config,
@@ -29,7 +30,8 @@ abstract class _$TorSettingsCWProxy {
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfTorSettings.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfTorSettings.copyWith.fieldName(...)`
/// Callable proxy for `copyWith` functionality.
/// Use as `instanceOfTorSettings.copyWith(...)` or call `instanceOfTorSettings.copyWith.fieldName(value)` for a single field.
class _$TorSettingsCWProxyImpl implements _$TorSettingsCWProxy {
const _$TorSettingsCWProxyImpl(this._value);
@@ -37,26 +39,27 @@ class _$TorSettingsCWProxyImpl implements _$TorSettingsCWProxy {
@override
TorSettings proxyPrivateTabsTor(bool proxyPrivateTabsTor) =>
this(proxyPrivateTabsTor: proxyPrivateTabsTor);
call(proxyPrivateTabsTor: proxyPrivateTabsTor);
@override
TorSettings config(TorConnectionConfig config) => this(config: config);
TorSettings config(TorConnectionConfig config) => call(config: config);
@override
TorSettings requireBridge(bool requireBridge) =>
this(requireBridge: requireBridge);
call(requireBridge: requireBridge);
@override
TorSettings fetchRemoteBridges(bool fetchRemoteBridges) =>
this(fetchRemoteBridges: fetchRemoteBridges);
call(fetchRemoteBridges: fetchRemoteBridges);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TorSettings(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
/// Creates a new instance with the provided field values.
/// Passing `null` to a nullable field nullifies it, while `null` for a non-nullable field is ignored. To update a single field use `TorSettings(...).copyWith.fieldName(value)`.
///
/// Usage
/// Example:
/// ```dart
/// TorSettings(...).copyWith(id: 12, name: "My name")
/// ````
/// ```
TorSettings call({
Object? proxyPrivateTabsTor = const $CopyWithPlaceholder(),
Object? config = const $CopyWithPlaceholder(),
@@ -64,19 +67,24 @@ class _$TorSettingsCWProxyImpl implements _$TorSettingsCWProxy {
Object? fetchRemoteBridges = const $CopyWithPlaceholder(),
}) {
return TorSettings(
proxyPrivateTabsTor: proxyPrivateTabsTor == const $CopyWithPlaceholder()
proxyPrivateTabsTor:
proxyPrivateTabsTor == const $CopyWithPlaceholder() ||
proxyPrivateTabsTor == null
? _value.proxyPrivateTabsTor
// ignore: cast_nullable_to_non_nullable
: proxyPrivateTabsTor as bool,
config: config == const $CopyWithPlaceholder()
config: config == const $CopyWithPlaceholder() || config == null
? _value.config
// ignore: cast_nullable_to_non_nullable
: config as TorConnectionConfig,
requireBridge: requireBridge == const $CopyWithPlaceholder()
requireBridge:
requireBridge == const $CopyWithPlaceholder() || requireBridge == null
? _value.requireBridge
// ignore: cast_nullable_to_non_nullable
: requireBridge as bool,
fetchRemoteBridges: fetchRemoteBridges == const $CopyWithPlaceholder()
fetchRemoteBridges:
fetchRemoteBridges == const $CopyWithPlaceholder() ||
fetchRemoteBridges == null
? _value.fetchRemoteBridges
// ignore: cast_nullable_to_non_nullable
: fetchRemoteBridges as bool,
@@ -85,7 +93,8 @@ class _$TorSettingsCWProxyImpl implements _$TorSettingsCWProxy {
}
extension $TorSettingsCopyWith on TorSettings {
/// Returns a callable class that can be used as follows: `instanceOfTorSettings.copyWith(...)` or like so:`instanceOfTorSettings.copyWith.fieldName(...)`.
/// Returns a callable class used to build a new instance with modified fields.
/// Example: `instanceOfTorSettings.copyWith(...)` or `instanceOfTorSettings.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$TorSettingsCWProxy get copyWith => _$TorSettingsCWProxyImpl(this);
}
+40 -16
View File
@@ -6,22 +6,46 @@ part of 'providers.dart';
// RiverpodGenerator
// **************************************************************************
String _$userDatabaseHash() => r'b925780435806f0241d7ddb635e301e9fc8baf6e';
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
/// See also [userDatabase].
@ProviderFor(userDatabase)
final userDatabaseProvider = Provider<UserDatabase>.internal(
userDatabase,
name: r'userDatabaseProvider',
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
? null
: _$userDatabaseHash,
dependencies: null,
allTransitiveDependencies: null,
);
const userDatabaseProvider = UserDatabaseProvider._();
@Deprecated('Will be removed in 3.0. Use Ref instead')
// ignore: unused_element
typedef UserDatabaseRef = ProviderRef<UserDatabase>;
// ignore_for_file: type=lint
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
final class UserDatabaseProvider
extends $FunctionalProvider<UserDatabase, UserDatabase, UserDatabase>
with $Provider<UserDatabase> {
const UserDatabaseProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'userDatabaseProvider',
isAutoDispose: false,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$userDatabaseHash();
@$internal
@override
$ProviderElement<UserDatabase> $createElement($ProviderPointer pointer) =>
$ProviderElement(pointer);
@override
UserDatabase create(Ref ref) {
return userDatabase(ref);
}
/// {@macro riverpod.override_with_value}
Override overrideWithValue(UserDatabase value) {
return $ProviderOverride(
origin: this,
providerOverride: $SyncValueProvider<UserDatabase>(value),
);
}
}
String _$userDatabaseHash() => r'b925780435806f0241d7ddb635e301e9fc8baf6e';