diff --git a/app/build.yaml b/app/build.yaml index 50a3e5b4..0f3118d3 100644 --- a/app/build.yaml +++ b/app/build.yaml @@ -2,8 +2,14 @@ targets: $default: builders: drift_dev: - # These options change how drift generates code - options: + # disable drift's default builder, we're using the modular setup + # instead. + enabled: false + + # Instead, enable drift_dev:analyzer and drift_dev:modular manually: + drift_dev:analyzer: + enabled: true + options: &options skip_verification_code: true data_class_to_companions: false named_parameters: true @@ -19,6 +25,16 @@ targets: modules: - json1 - fts5 + drift_dev:modular: + enabled: true + # We use yaml anchors to give the two builders the same options + options: *options json_serializable: options: - explicit_to_json: true \ No newline at end of file + explicit_to_json: true + +global_options: + drift_dev:modular: + runs_before: + - riverpod_generator + \ No newline at end of file diff --git a/app/lib/core/error_observer.dart b/app/lib/core/error_observer.dart index bf423411..99094ff0 100644 --- a/app/lib/core/error_observer.dart +++ b/app/lib/core/error_observer.dart @@ -20,16 +20,15 @@ import 'package:riverpod/riverpod.dart'; import 'package:weblibre/core/logger.dart'; -class ErrorObserver extends ProviderObserver { +final class ErrorObserver extends ProviderObserver { const ErrorObserver(); @override void providerDidFail( - ProviderBase provider, + ProviderObserverContext context, Object error, StackTrace stackTrace, - ProviderContainer container, ) { - logger.e('Provider $provider threw $error at $stackTrace'); + logger.e('Provider ${context.provider} threw $error at $stackTrace'); } } diff --git a/app/lib/core/providers/defaults.g.dart b/app/lib/core/providers/defaults.g.dart index b640b896..649e76d2 100644 --- a/app/lib/core/providers/defaults.g.dart +++ b/app/lib/core/providers/defaults.g.dart @@ -6,58 +6,129 @@ part of 'defaults.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(lightSeedColorFallback) +const lightSeedColorFallbackProvider = LightSeedColorFallbackProvider._(); + +final class LightSeedColorFallbackProvider + extends $FunctionalProvider + with $Provider { + const LightSeedColorFallbackProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'lightSeedColorFallbackProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$lightSeedColorFallbackHash(); + + @$internal + @override + $ProviderElement $createElement($ProviderPointer pointer) => + $ProviderElement(pointer); + + @override + Color create(Ref ref) { + return lightSeedColorFallback(ref); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(Color value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + String _$lightSeedColorFallbackHash() => r'af151d3293d372f5df451aa8c3a75136377b6ce1'; -/// See also [lightSeedColorFallback]. -@ProviderFor(lightSeedColorFallback) -final lightSeedColorFallbackProvider = Provider.internal( - lightSeedColorFallback, - name: r'lightSeedColorFallbackProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$lightSeedColorFallbackHash, - dependencies: null, - allTransitiveDependencies: null, -); +@ProviderFor(darkSeedColorFallback) +const darkSeedColorFallbackProvider = DarkSeedColorFallbackProvider._(); + +final class DarkSeedColorFallbackProvider + extends $FunctionalProvider + with $Provider { + const DarkSeedColorFallbackProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'darkSeedColorFallbackProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$darkSeedColorFallbackHash(); + + @$internal + @override + $ProviderElement $createElement($ProviderPointer pointer) => + $ProviderElement(pointer); + + @override + Color create(Ref ref) { + return darkSeedColorFallback(ref); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(Color value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef LightSeedColorFallbackRef = ProviderRef; String _$darkSeedColorFallbackHash() => r'9418cf71e3d80c8a2142e0d3a8820989b29bff86'; -/// See also [darkSeedColorFallback]. -@ProviderFor(darkSeedColorFallback) -final darkSeedColorFallbackProvider = Provider.internal( - darkSeedColorFallback, - name: r'darkSeedColorFallbackProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$darkSeedColorFallbackHash, - dependencies: null, - allTransitiveDependencies: null, -); - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef DarkSeedColorFallbackRef = ProviderRef; -String _$docsUriHash() => r'6456efcf97ddc7ee87a67e2d3380f7241e3d76ea'; - -/// See also [docsUri]. @ProviderFor(docsUri) -final docsUriProvider = Provider.internal( - docsUri, - name: r'docsUriProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$docsUriHash, - dependencies: null, - allTransitiveDependencies: null, -); +const docsUriProvider = DocsUriProvider._(); -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef DocsUriRef = ProviderRef; -// 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 DocsUriProvider extends $FunctionalProvider + with $Provider { + const DocsUriProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'docsUriProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$docsUriHash(); + + @$internal + @override + $ProviderElement $createElement($ProviderPointer pointer) => + $ProviderElement(pointer); + + @override + Uri create(Ref ref) { + return docsUri(ref); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(Uri value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + +String _$docsUriHash() => r'6456efcf97ddc7ee87a67e2d3380f7241e3d76ea'; diff --git a/app/lib/core/providers/format.g.dart b/app/lib/core/providers/format.g.dart index a2fcf636..7a5e647a 100644 --- a/app/lib/core/providers/format.g.dart +++ b/app/lib/core/providers/format.g.dart @@ -6,20 +6,49 @@ part of 'format.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(Format) +const formatProvider = FormatProvider._(); + +final class FormatProvider extends $AsyncNotifierProvider { + const FormatProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'formatProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$formatHash(); + + @$internal + @override + Format create() => Format(); +} + String _$formatHash() => r'fe7fcdd19b512784a36f3838c57701030475e429'; -/// See also [Format]. -@ProviderFor(Format) -final formatProvider = AsyncNotifierProvider.internal( - Format.new, - name: r'formatProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$formatHash, - dependencies: null, - allTransitiveDependencies: null, -); - -typedef _$Format = AsyncNotifier; -// 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 +abstract class _$Format extends $AsyncNotifier { + FutureOr build(); + @$mustCallSuper + @override + void runBuild() { + build(); + final ref = this.ref as $Ref, void>; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, void>, + AsyncValue, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} diff --git a/app/lib/core/providers/global_drop.g.dart b/app/lib/core/providers/global_drop.g.dart index 5bb3e188..e51d5b10 100644 --- a/app/lib/core/providers/global_drop.g.dart +++ b/app/lib/core/providers/global_drop.g.dart @@ -6,21 +6,58 @@ part of 'global_drop.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(WillAcceptDrop) +const willAcceptDropProvider = WillAcceptDropProvider._(); + +final class WillAcceptDropProvider + extends $NotifierProvider { + const WillAcceptDropProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'willAcceptDropProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$willAcceptDropHash(); + + @$internal + @override + WillAcceptDrop create() => WillAcceptDrop(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(DropTargetData? value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + String _$willAcceptDropHash() => r'97b47784ef9101757602b4408d1f545ef2308830'; -/// See also [WillAcceptDrop]. -@ProviderFor(WillAcceptDrop) -final willAcceptDropProvider = - AutoDisposeNotifierProvider.internal( - WillAcceptDrop.new, - name: r'willAcceptDropProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$willAcceptDropHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$WillAcceptDrop = AutoDisposeNotifier; -// 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 +abstract class _$WillAcceptDrop extends $Notifier { + DropTargetData? build(); + @$mustCallSuper + @override + void runBuild() { + final created = build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + DropTargetData?, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} diff --git a/app/lib/core/providers/router.g.dart b/app/lib/core/providers/router.g.dart index fdd8fdc9..3bd6fdf3 100644 --- a/app/lib/core/providers/router.g.dart +++ b/app/lib/core/providers/router.g.dart @@ -6,22 +6,39 @@ part of 'router.dart'; // RiverpodGenerator // ************************************************************************** -String _$routerHash() => r'ce7cc5b5f236781a06867a852a08ed03d3582022'; +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning -/// See also [router]. @ProviderFor(router) -final routerProvider = FutureProvider.internal( - router, - name: r'routerProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$routerHash, - dependencies: null, - allTransitiveDependencies: null, -); +const routerProvider = RouterProvider._(); -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef RouterRef = FutureProviderRef; -// 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 RouterProvider + extends + $FunctionalProvider, GoRouter, FutureOr> + with $FutureModifier, $FutureProvider { + const RouterProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'routerProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$routerHash(); + + @$internal + @override + $FutureProviderElement $createElement($ProviderPointer pointer) => + $FutureProviderElement(pointer); + + @override + FutureOr create(Ref ref) { + return router(ref); + } +} + +String _$routerHash() => r'ce7cc5b5f236781a06867a852a08ed03d3582022'; diff --git a/app/lib/core/routing/routes.bangs.dart b/app/lib/core/routing/routes.bangs.dart index 355f4ab1..97cc4e57 100644 --- a/app/lib/core/routing/routes.bangs.dart +++ b/app/lib/core/routing/routes.bangs.dart @@ -39,14 +39,14 @@ part of 'routes.dart'; ), ], ) -class BangCategoriesRoute extends GoRouteData with _$BangCategoriesRoute { +class BangCategoriesRoute extends GoRouteData with $BangCategoriesRoute { @override Widget build(BuildContext context, GoRouterState state) { return const BangCategoriesScreen(); } } -class BangCategoryRoute extends GoRouteData with _$BangCategoryRoute { +class BangCategoryRoute extends GoRouteData with $BangCategoryRoute { final String category; const BangCategoryRoute({required this.category}); @@ -57,7 +57,7 @@ class BangCategoryRoute extends GoRouteData with _$BangCategoryRoute { } } -class BangSubCategoryRoute extends GoRouteData with _$BangSubCategoryRoute { +class BangSubCategoryRoute extends GoRouteData with $BangSubCategoryRoute { final String category; final String subCategory; @@ -72,7 +72,7 @@ class BangSubCategoryRoute extends GoRouteData with _$BangSubCategoryRoute { } } -class BangSearchRoute extends GoRouteData with _$BangSearchRoute { +class BangSearchRoute extends GoRouteData with $BangSearchRoute { static const String emptySearchText = ' '; //This should be nullable but isnt allowed by go_router diff --git a/app/lib/core/routing/routes.browser.dart b/app/lib/core/routing/routes.browser.dart index c0fab4d9..81175f0e 100644 --- a/app/lib/core/routing/routes.browser.dart +++ b/app/lib/core/routing/routes.browser.dart @@ -61,7 +61,7 @@ part of 'routes.dart'; ), ], ) -class BrowserRoute extends GoRouteData with _$BrowserRoute { +class BrowserRoute extends GoRouteData with $BrowserRoute { static const name = 'BrowserRoute'; @override @@ -72,7 +72,7 @@ class BrowserRoute extends GoRouteData with _$BrowserRoute { enum TabType { regular, private, child } -class SearchRoute extends GoRouteData with _$SearchRoute { +class SearchRoute extends GoRouteData with $SearchRoute { static const String emptySearchText = ' '; final TabType tabType; @@ -100,14 +100,14 @@ class SearchRoute extends GoRouteData with _$SearchRoute { } } -class TorProxyRoute extends GoRouteData with _$TorProxyRoute { +class TorProxyRoute extends GoRouteData with $TorProxyRoute { @override Widget build(BuildContext context, GoRouterState state) { return const TorProxyScreen(); } } -class ContainerListRoute extends GoRouteData with _$ContainerListRoute { +class ContainerListRoute extends GoRouteData with $ContainerListRoute { @override Widget build(BuildContext context, GoRouterState state) { return const ContainerListScreen(); @@ -115,14 +115,14 @@ class ContainerListRoute extends GoRouteData with _$ContainerListRoute { } class ContainerSelectionRoute extends GoRouteData - with _$ContainerSelectionRoute { + with $ContainerSelectionRoute { @override Widget build(BuildContext context, GoRouterState state) { return const ContainerSelectionScreen(); } } -class ContainerEditRoute extends GoRouteData with _$ContainerEditRoute { +class ContainerEditRoute extends GoRouteData with $ContainerEditRoute { final ContainerDataWithCount $extra; ContainerEditRoute(this.$extra); @@ -133,7 +133,7 @@ class ContainerEditRoute extends GoRouteData with _$ContainerEditRoute { } } -class ContainerCreateRoute extends GoRouteData with _$ContainerCreateRoute { +class ContainerCreateRoute extends GoRouteData with $ContainerCreateRoute { final ContainerData $extra; ContainerCreateRoute(this.$extra); @@ -144,7 +144,7 @@ class ContainerCreateRoute extends GoRouteData with _$ContainerCreateRoute { } } -class ContextMenuRoute extends GoRouteData with _$ContextMenuRoute { +class ContextMenuRoute extends GoRouteData with $ContextMenuRoute { final String $extra; const ContextMenuRoute(this.$extra); @@ -158,7 +158,7 @@ class ContextMenuRoute extends GoRouteData with _$ContextMenuRoute { } } -class TabTreeRoute extends GoRouteData with _$TabTreeRoute { +class TabTreeRoute extends GoRouteData with $TabTreeRoute { final String rootTabId; const TabTreeRoute(this.rootTabId); @@ -169,7 +169,7 @@ class TabTreeRoute extends GoRouteData with _$TabTreeRoute { } } -class OpenSharedContentRoute extends GoRouteData with _$OpenSharedContentRoute { +class OpenSharedContentRoute extends GoRouteData with $OpenSharedContentRoute { final Uri $extra; const OpenSharedContentRoute(this.$extra); @@ -180,7 +180,7 @@ class OpenSharedContentRoute extends GoRouteData with _$OpenSharedContentRoute { } } -class HistoryRoute extends GoRouteData with _$HistoryRoute { +class HistoryRoute extends GoRouteData with $HistoryRoute { @override Widget build(BuildContext context, GoRouterState state) { return const HistoryScreen(); diff --git a/app/lib/core/routing/routes.dart b/app/lib/core/routing/routes.dart index 35faad96..ebcee5d0 100644 --- a/app/lib/core/routing/routes.dart +++ b/app/lib/core/routing/routes.dart @@ -60,7 +60,7 @@ part 'routes.bangs.dart'; part 'routes.feeds.dart'; @TypedGoRoute(name: 'AboutRoute', path: '/about') -class AboutRoute extends GoRouteData with _$AboutRoute { +class AboutRoute extends GoRouteData with $AboutRoute { @override Page buildPage(BuildContext context, GoRouterState state) { return DialogPage(builder: (_) => const AboutDialogScreen()); @@ -71,7 +71,7 @@ class AboutRoute extends GoRouteData with _$AboutRoute { name: 'OnboardingRoute', path: '/onboarding/:currentRevision/:targetRevision', ) -class OnboardingRoute extends GoRouteData with _$OnboardingRoute { +class OnboardingRoute extends GoRouteData with $OnboardingRoute { final int currentRevision; final int targetRevision; diff --git a/app/lib/core/routing/routes.feeds.dart b/app/lib/core/routing/routes.feeds.dart index 8dc3eb0d..cf4b4285 100644 --- a/app/lib/core/routing/routes.feeds.dart +++ b/app/lib/core/routing/routes.feeds.dart @@ -43,14 +43,14 @@ part of 'routes.dart'; TypedGoRoute(name: 'FeedEditRoute', path: 'edit/:feedId'), ], ) -class FeedListRoute extends GoRouteData with _$FeedListRoute { +class FeedListRoute extends GoRouteData with $FeedListRoute { @override Widget build(BuildContext context, GoRouterState state) { return const FeedListScreen(); } } -class FeedCreateRoute extends GoRouteData with _$FeedCreateRoute { +class FeedCreateRoute extends GoRouteData with $FeedCreateRoute { final Uri feedId; FeedCreateRoute({required this.feedId}); @@ -61,7 +61,7 @@ class FeedCreateRoute extends GoRouteData with _$FeedCreateRoute { } } -class SelectFeedDialogRoute extends GoRouteData with _$SelectFeedDialogRoute { +class SelectFeedDialogRoute extends GoRouteData with $SelectFeedDialogRoute { final String feedsJson; const SelectFeedDialogRoute({required this.feedsJson}); @@ -78,7 +78,7 @@ class SelectFeedDialogRoute extends GoRouteData with _$SelectFeedDialogRoute { } } -class FeedEditRoute extends GoRouteData with _$FeedEditRoute { +class FeedEditRoute extends GoRouteData with $FeedEditRoute { final Uri feedId; const FeedEditRoute({required this.feedId}); @@ -89,7 +89,7 @@ class FeedEditRoute extends GoRouteData with _$FeedEditRoute { } } -class FeedAddRoute extends GoRouteData with _$FeedAddRoute { +class FeedAddRoute extends GoRouteData with $FeedAddRoute { final Uri? $extra; static const name = 'FeedAddRoute'; @@ -102,7 +102,7 @@ class FeedAddRoute extends GoRouteData with _$FeedAddRoute { } } -class FeedArticleListRoute extends GoRouteData with _$FeedArticleListRoute { +class FeedArticleListRoute extends GoRouteData with $FeedArticleListRoute { final Uri feedId; FeedArticleListRoute({required this.feedId}); @@ -113,7 +113,7 @@ class FeedArticleListRoute extends GoRouteData with _$FeedArticleListRoute { } } -class FeedArticleRoute extends GoRouteData with _$FeedArticleRoute { +class FeedArticleRoute extends GoRouteData with $FeedArticleRoute { final String articleId; FeedArticleRoute({required this.articleId}); diff --git a/app/lib/core/routing/routes.g.dart b/app/lib/core/routing/routes.g.dart index b1bd1e3e..ddb896dc 100644 --- a/app/lib/core/routing/routes.g.dart +++ b/app/lib/core/routing/routes.g.dart @@ -18,11 +18,10 @@ List get $appRoutes => [ RouteBase get $aboutRoute => GoRouteData.$route( path: '/about', name: 'AboutRoute', - - factory: _$AboutRoute._fromState, + factory: $AboutRoute._fromState, ); -mixin _$AboutRoute on GoRouteData { +mixin $AboutRoute on GoRouteData { static AboutRoute _fromState(GoRouterState state) => AboutRoute(); @override @@ -45,14 +44,13 @@ mixin _$AboutRoute on GoRouteData { RouteBase get $onboardingRoute => GoRouteData.$route( path: '/onboarding/:currentRevision/:targetRevision', name: 'OnboardingRoute', - - factory: _$OnboardingRoute._fromState, + factory: $OnboardingRoute._fromState, ); -mixin _$OnboardingRoute on GoRouteData { +mixin $OnboardingRoute on GoRouteData { static OnboardingRoute _fromState(GoRouterState state) => OnboardingRoute( - currentRevision: int.parse(state.pathParameters['currentRevision']!)!, - targetRevision: int.parse(state.pathParameters['targetRevision']!)!, + currentRevision: int.parse(state.pathParameters['currentRevision']!), + targetRevision: int.parse(state.pathParameters['targetRevision']!), ); OnboardingRoute get _self => this as OnboardingRoute; @@ -79,38 +77,32 @@ mixin _$OnboardingRoute on GoRouteData { RouteBase get $settingsRoute => GoRouteData.$route( path: '/settings', name: 'SettingsRoute', - - factory: _$SettingsRoute._fromState, + factory: $SettingsRoute._fromState, routes: [ GoRouteData.$route( path: 'general', name: 'GeneralSettingsRoute', - - factory: _$GeneralSettingsRoute._fromState, + factory: $GeneralSettingsRoute._fromState, ), GoRouteData.$route( path: 'bang', name: 'BangSettingsRoute', - - factory: _$BangSettingsRoute._fromState, + factory: $BangSettingsRoute._fromState, ), GoRouteData.$route( path: 'web_engine', name: 'WebEngineSettingsRoute', - - factory: _$WebEngineSettingsRoute._fromState, + factory: $WebEngineSettingsRoute._fromState, routes: [ GoRouteData.$route( path: 'hardening', name: 'WebEngineHardeningRoute', - - factory: _$WebEngineHardeningRoute._fromState, + factory: $WebEngineHardeningRoute._fromState, routes: [ GoRouteData.$route( path: 'group/:group', name: 'WebEngineHardeningGroupRoute', - - factory: _$WebEngineHardeningGroupRoute._fromState, + factory: $WebEngineHardeningGroupRoute._fromState, ), ], ), @@ -119,13 +111,12 @@ RouteBase get $settingsRoute => GoRouteData.$route( GoRouteData.$route( path: 'developer', name: 'DeveloperSettingsRoute', - - factory: _$DeveloperSettingsRoute._fromState, + factory: $DeveloperSettingsRoute._fromState, ), ], ); -mixin _$SettingsRoute on GoRouteData { +mixin $SettingsRoute on GoRouteData { static SettingsRoute _fromState(GoRouterState state) => SettingsRoute(); @override @@ -145,7 +136,7 @@ mixin _$SettingsRoute on GoRouteData { void replace(BuildContext context) => context.replace(location); } -mixin _$GeneralSettingsRoute on GoRouteData { +mixin $GeneralSettingsRoute on GoRouteData { static GeneralSettingsRoute _fromState(GoRouterState state) => GeneralSettingsRoute(); @@ -166,7 +157,7 @@ mixin _$GeneralSettingsRoute on GoRouteData { void replace(BuildContext context) => context.replace(location); } -mixin _$BangSettingsRoute on GoRouteData { +mixin $BangSettingsRoute on GoRouteData { static BangSettingsRoute _fromState(GoRouterState state) => BangSettingsRoute(); @@ -187,7 +178,7 @@ mixin _$BangSettingsRoute on GoRouteData { void replace(BuildContext context) => context.replace(location); } -mixin _$WebEngineSettingsRoute on GoRouteData { +mixin $WebEngineSettingsRoute on GoRouteData { static WebEngineSettingsRoute _fromState(GoRouterState state) => WebEngineSettingsRoute(); @@ -208,7 +199,7 @@ mixin _$WebEngineSettingsRoute on GoRouteData { void replace(BuildContext context) => context.replace(location); } -mixin _$WebEngineHardeningRoute on GoRouteData { +mixin $WebEngineHardeningRoute on GoRouteData { static WebEngineHardeningRoute _fromState(GoRouterState state) => WebEngineHardeningRoute(); @@ -230,7 +221,7 @@ mixin _$WebEngineHardeningRoute on GoRouteData { void replace(BuildContext context) => context.replace(location); } -mixin _$WebEngineHardeningGroupRoute on GoRouteData { +mixin $WebEngineHardeningGroupRoute on GoRouteData { static WebEngineHardeningGroupRoute _fromState(GoRouterState state) => WebEngineHardeningGroupRoute(group: state.pathParameters['group']!); @@ -256,7 +247,7 @@ mixin _$WebEngineHardeningGroupRoute on GoRouteData { void replace(BuildContext context) => context.replace(location); } -mixin _$DeveloperSettingsRoute on GoRouteData { +mixin $DeveloperSettingsRoute on GoRouteData { static DeveloperSettingsRoute _fromState(GoRouterState state) => DeveloperSettingsRoute(); @@ -280,75 +271,64 @@ mixin _$DeveloperSettingsRoute on GoRouteData { RouteBase get $browserRoute => GoRouteData.$route( path: '/', name: 'BrowserRoute', - - factory: _$BrowserRoute._fromState, + factory: $BrowserRoute._fromState, routes: [ GoRouteData.$route( path: 'search/:tabType/:searchText', name: 'SearchRoute', - - factory: _$SearchRoute._fromState, + factory: $SearchRoute._fromState, ), GoRouteData.$route( path: 'tor_proxy', name: 'TorProxyRoute', - - factory: _$TorProxyRoute._fromState, + factory: $TorProxyRoute._fromState, ), GoRouteData.$route( path: 'history', name: 'HistoryRoute', - - factory: _$HistoryRoute._fromState, + factory: $HistoryRoute._fromState, ), GoRouteData.$route( path: 'context_menu', name: 'ContextMenuRoute', - - factory: _$ContextMenuRoute._fromState, + factory: $ContextMenuRoute._fromState, ), GoRouteData.$route( path: 'containers', name: 'ContainerListRoute', - - factory: _$ContainerListRoute._fromState, + factory: $ContainerListRoute._fromState, routes: [ GoRouteData.$route( path: 'create', name: 'ContainerCreateRoute', - - factory: _$ContainerCreateRoute._fromState, + factory: $ContainerCreateRoute._fromState, ), GoRouteData.$route( path: 'edit', name: 'ContainerEditRoute', - - factory: _$ContainerEditRoute._fromState, + factory: $ContainerEditRoute._fromState, ), ], ), GoRouteData.$route( path: 'select_container', name: 'ContainerSelectionRoute', - - factory: _$ContainerSelectionRoute._fromState, + factory: $ContainerSelectionRoute._fromState, ), GoRouteData.$route( path: 'tab_tree/:rootTabId', name: 'TabTreeRoute', - - factory: _$TabTreeRoute._fromState, + factory: $TabTreeRoute._fromState, ), GoRouteData.$route( path: 'open_content', name: 'OpenSharedContentRoute', - - factory: _$OpenSharedContentRoute._fromState, + factory: $OpenSharedContentRoute._fromState, ), ], ); -mixin _$BrowserRoute on GoRouteData { +mixin $BrowserRoute on GoRouteData { static BrowserRoute _fromState(GoRouterState state) => BrowserRoute(); @override @@ -368,7 +348,7 @@ mixin _$BrowserRoute on GoRouteData { void replace(BuildContext context) => context.replace(location); } -mixin _$SearchRoute on GoRouteData { +mixin $SearchRoute on GoRouteData { static SearchRoute _fromState(GoRouterState state) => SearchRoute( tabType: _$TabTypeEnumMap._$fromName(state.pathParameters['tabType']!)!, searchText: @@ -405,7 +385,7 @@ const _$TabTypeEnumMap = { TabType.child: 'child', }; -mixin _$TorProxyRoute on GoRouteData { +mixin $TorProxyRoute on GoRouteData { static TorProxyRoute _fromState(GoRouterState state) => TorProxyRoute(); @override @@ -425,7 +405,7 @@ mixin _$TorProxyRoute on GoRouteData { void replace(BuildContext context) => context.replace(location); } -mixin _$HistoryRoute on GoRouteData { +mixin $HistoryRoute on GoRouteData { static HistoryRoute _fromState(GoRouterState state) => HistoryRoute(); @override @@ -445,7 +425,7 @@ mixin _$HistoryRoute on GoRouteData { void replace(BuildContext context) => context.replace(location); } -mixin _$ContextMenuRoute on GoRouteData { +mixin $ContextMenuRoute on GoRouteData { static ContextMenuRoute _fromState(GoRouterState state) => ContextMenuRoute(state.extra as String); @@ -470,7 +450,7 @@ mixin _$ContextMenuRoute on GoRouteData { context.replace(location, extra: _self.$extra); } -mixin _$ContainerListRoute on GoRouteData { +mixin $ContainerListRoute on GoRouteData { static ContainerListRoute _fromState(GoRouterState state) => ContainerListRoute(); @@ -491,7 +471,7 @@ mixin _$ContainerListRoute on GoRouteData { void replace(BuildContext context) => context.replace(location); } -mixin _$ContainerCreateRoute on GoRouteData { +mixin $ContainerCreateRoute on GoRouteData { static ContainerCreateRoute _fromState(GoRouterState state) => ContainerCreateRoute(state.extra as ContainerData); @@ -516,7 +496,7 @@ mixin _$ContainerCreateRoute on GoRouteData { context.replace(location, extra: _self.$extra); } -mixin _$ContainerEditRoute on GoRouteData { +mixin $ContainerEditRoute on GoRouteData { static ContainerEditRoute _fromState(GoRouterState state) => ContainerEditRoute(state.extra as ContainerDataWithCount); @@ -541,7 +521,7 @@ mixin _$ContainerEditRoute on GoRouteData { context.replace(location, extra: _self.$extra); } -mixin _$ContainerSelectionRoute on GoRouteData { +mixin $ContainerSelectionRoute on GoRouteData { static ContainerSelectionRoute _fromState(GoRouterState state) => ContainerSelectionRoute(); @@ -562,7 +542,7 @@ mixin _$ContainerSelectionRoute on GoRouteData { void replace(BuildContext context) => context.replace(location); } -mixin _$TabTreeRoute on GoRouteData { +mixin $TabTreeRoute on GoRouteData { static TabTreeRoute _fromState(GoRouterState state) => TabTreeRoute(state.pathParameters['rootTabId']!); @@ -587,7 +567,7 @@ mixin _$TabTreeRoute on GoRouteData { void replace(BuildContext context) => context.replace(location); } -mixin _$OpenSharedContentRoute on GoRouteData { +mixin $OpenSharedContentRoute on GoRouteData { static OpenSharedContentRoute _fromState(GoRouterState state) => OpenSharedContentRoute(state.extra as Uri); @@ -620,33 +600,29 @@ extension on Map { RouteBase get $bangCategoriesRoute => GoRouteData.$route( path: '/bangs', name: 'BangRoute', - - factory: _$BangCategoriesRoute._fromState, + factory: $BangCategoriesRoute._fromState, routes: [ GoRouteData.$route( path: 'search/:searchText', name: 'BangSearchRoute', - - factory: _$BangSearchRoute._fromState, + factory: $BangSearchRoute._fromState, ), GoRouteData.$route( path: 'category/:category', name: 'BangCategoryRoute', - - factory: _$BangCategoryRoute._fromState, + factory: $BangCategoryRoute._fromState, routes: [ GoRouteData.$route( path: ':subCategory', name: 'BangSubCategoryRoute', - - factory: _$BangSubCategoryRoute._fromState, + factory: $BangSubCategoryRoute._fromState, ), ], ), ], ); -mixin _$BangCategoriesRoute on GoRouteData { +mixin $BangCategoriesRoute on GoRouteData { static BangCategoriesRoute _fromState(GoRouterState state) => BangCategoriesRoute(); @@ -667,7 +643,7 @@ mixin _$BangCategoriesRoute on GoRouteData { void replace(BuildContext context) => context.replace(location); } -mixin _$BangSearchRoute on GoRouteData { +mixin $BangSearchRoute on GoRouteData { static BangSearchRoute _fromState(GoRouterState state) => BangSearchRoute( searchText: state.pathParameters['searchText'] ?? BangSearchRoute.emptySearchText, @@ -694,7 +670,7 @@ mixin _$BangSearchRoute on GoRouteData { void replace(BuildContext context) => context.replace(location); } -mixin _$BangCategoryRoute on GoRouteData { +mixin $BangCategoryRoute on GoRouteData { static BangCategoryRoute _fromState(GoRouterState state) => BangCategoryRoute(category: state.pathParameters['category']!); @@ -719,7 +695,7 @@ mixin _$BangCategoryRoute on GoRouteData { void replace(BuildContext context) => context.replace(location); } -mixin _$BangSubCategoryRoute on GoRouteData { +mixin $BangSubCategoryRoute on GoRouteData { static BangSubCategoryRoute _fromState(GoRouterState state) => BangSubCategoryRoute( category: state.pathParameters['category']!, @@ -750,49 +726,42 @@ mixin _$BangSubCategoryRoute on GoRouteData { RouteBase get $feedListRoute => GoRouteData.$route( path: '/feeds', name: 'FeedListRoute', - - factory: _$FeedListRoute._fromState, + factory: $FeedListRoute._fromState, routes: [ GoRouteData.$route( path: 'add', name: 'FeedAddRoute', - - factory: _$FeedAddRoute._fromState, + factory: $FeedAddRoute._fromState, ), GoRouteData.$route( path: 'articles/:feedId', name: 'FeedArticleListRoute', - - factory: _$FeedArticleListRoute._fromState, + factory: $FeedArticleListRoute._fromState, ), GoRouteData.$route( path: 'article/:articleId', name: 'FeedArticleRoute', - - factory: _$FeedArticleRoute._fromState, + factory: $FeedArticleRoute._fromState, ), GoRouteData.$route( path: 'create/:feedId', name: 'FeedCreateRoute', - - factory: _$FeedCreateRoute._fromState, + factory: $FeedCreateRoute._fromState, ), GoRouteData.$route( path: 'available/:feedsJson', name: 'SelectFeedDialogRoute', - - factory: _$SelectFeedDialogRoute._fromState, + factory: $SelectFeedDialogRoute._fromState, ), GoRouteData.$route( path: 'edit/:feedId', name: 'FeedEditRoute', - - factory: _$FeedEditRoute._fromState, + factory: $FeedEditRoute._fromState, ), ], ); -mixin _$FeedListRoute on GoRouteData { +mixin $FeedListRoute on GoRouteData { static FeedListRoute _fromState(GoRouterState state) => FeedListRoute(); @override @@ -812,7 +781,7 @@ mixin _$FeedListRoute on GoRouteData { void replace(BuildContext context) => context.replace(location); } -mixin _$FeedAddRoute on GoRouteData { +mixin $FeedAddRoute on GoRouteData { static FeedAddRoute _fromState(GoRouterState state) => FeedAddRoute($extra: state.extra as Uri?); @@ -837,9 +806,9 @@ mixin _$FeedAddRoute on GoRouteData { context.replace(location, extra: _self.$extra); } -mixin _$FeedArticleListRoute on GoRouteData { +mixin $FeedArticleListRoute on GoRouteData { static FeedArticleListRoute _fromState(GoRouterState state) => - FeedArticleListRoute(feedId: Uri.parse(state.pathParameters['feedId']!)!); + FeedArticleListRoute(feedId: Uri.parse(state.pathParameters['feedId']!)); FeedArticleListRoute get _self => this as FeedArticleListRoute; @@ -862,7 +831,7 @@ mixin _$FeedArticleListRoute on GoRouteData { void replace(BuildContext context) => context.replace(location); } -mixin _$FeedArticleRoute on GoRouteData { +mixin $FeedArticleRoute on GoRouteData { static FeedArticleRoute _fromState(GoRouterState state) => FeedArticleRoute(articleId: state.pathParameters['articleId']!); @@ -887,9 +856,9 @@ mixin _$FeedArticleRoute on GoRouteData { void replace(BuildContext context) => context.replace(location); } -mixin _$FeedCreateRoute on GoRouteData { +mixin $FeedCreateRoute on GoRouteData { static FeedCreateRoute _fromState(GoRouterState state) => - FeedCreateRoute(feedId: Uri.parse(state.pathParameters['feedId']!)!); + FeedCreateRoute(feedId: Uri.parse(state.pathParameters['feedId']!)); FeedCreateRoute get _self => this as FeedCreateRoute; @@ -912,7 +881,7 @@ mixin _$FeedCreateRoute on GoRouteData { void replace(BuildContext context) => context.replace(location); } -mixin _$SelectFeedDialogRoute on GoRouteData { +mixin $SelectFeedDialogRoute on GoRouteData { static SelectFeedDialogRoute _fromState(GoRouterState state) => SelectFeedDialogRoute(feedsJson: state.pathParameters['feedsJson']!); @@ -937,9 +906,9 @@ mixin _$SelectFeedDialogRoute on GoRouteData { void replace(BuildContext context) => context.replace(location); } -mixin _$FeedEditRoute on GoRouteData { +mixin $FeedEditRoute on GoRouteData { static FeedEditRoute _fromState(GoRouterState state) => - FeedEditRoute(feedId: Uri.parse(state.pathParameters['feedId']!)!); + FeedEditRoute(feedId: Uri.parse(state.pathParameters['feedId']!)); FeedEditRoute get _self => this as FeedEditRoute; diff --git a/app/lib/core/routing/routes.settings.dart b/app/lib/core/routing/routes.settings.dart index e770c84f..d6b2ee7f 100644 --- a/app/lib/core/routing/routes.settings.dart +++ b/app/lib/core/routing/routes.settings.dart @@ -50,35 +50,35 @@ part of 'routes.dart'; ), ], ) -class SettingsRoute extends GoRouteData with _$SettingsRoute { +class SettingsRoute extends GoRouteData with $SettingsRoute { @override Widget build(BuildContext context, GoRouterState state) { return const SettingsScreen(); } } -class GeneralSettingsRoute extends GoRouteData with _$GeneralSettingsRoute { +class GeneralSettingsRoute extends GoRouteData with $GeneralSettingsRoute { @override Widget build(BuildContext context, GoRouterState state) { return const GeneralSettingsScreen(); } } -class BangSettingsRoute extends GoRouteData with _$BangSettingsRoute { +class BangSettingsRoute extends GoRouteData with $BangSettingsRoute { @override Widget build(BuildContext context, GoRouterState state) { return const BangSettingsScreen(); } } -class WebEngineSettingsRoute extends GoRouteData with _$WebEngineSettingsRoute { +class WebEngineSettingsRoute extends GoRouteData with $WebEngineSettingsRoute { @override Widget build(BuildContext context, GoRouterState state) { return const WebEngineSettingsScreen(); } } -class DeveloperSettingsRoute extends GoRouteData with _$DeveloperSettingsRoute { +class DeveloperSettingsRoute extends GoRouteData with $DeveloperSettingsRoute { @override Widget build(BuildContext context, GoRouterState state) { return const DeveloperSettingsScreen(); @@ -86,7 +86,7 @@ class DeveloperSettingsRoute extends GoRouteData with _$DeveloperSettingsRoute { } class WebEngineHardeningRoute extends GoRouteData - with _$WebEngineHardeningRoute { + with $WebEngineHardeningRoute { @override Widget build(BuildContext context, GoRouterState state) { return const WebEngineHardeningScreen(); @@ -94,7 +94,7 @@ class WebEngineHardeningRoute extends GoRouteData } class WebEngineHardeningGroupRoute extends GoRouteData - with _$WebEngineHardeningGroupRoute { + with $WebEngineHardeningGroupRoute { final String group; const WebEngineHardeningGroupRoute({required this.group}); diff --git a/app/lib/data/models/web_page_info.g.dart b/app/lib/data/models/web_page_info.g.dart index 296ae1fd..016d6c69 100644 --- a/app/lib/data/models/web_page_info.g.dart +++ b/app/lib/data/models/web_page_info.g.dart @@ -15,12 +15,13 @@ abstract class _$WebPageInfoCWProxy { WebPageInfo feeds(Set? feeds); - /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `WebPageInfo(...).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 `WebPageInfo(...).copyWith.fieldName(value)`. /// - /// Usage + /// Example: /// ```dart /// WebPageInfo(...).copyWith(id: 12, name: "My name") - /// ```` + /// ``` WebPageInfo call({ Uri url, String? title, @@ -29,31 +30,33 @@ abstract class _$WebPageInfoCWProxy { }); } -/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfWebPageInfo.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfWebPageInfo.copyWith.fieldName(...)` +/// Callable proxy for `copyWith` functionality. +/// Use as `instanceOfWebPageInfo.copyWith(...)` or call `instanceOfWebPageInfo.copyWith.fieldName(value)` for a single field. class _$WebPageInfoCWProxyImpl implements _$WebPageInfoCWProxy { const _$WebPageInfoCWProxyImpl(this._value); final WebPageInfo _value; @override - WebPageInfo url(Uri url) => this(url: url); + WebPageInfo url(Uri url) => call(url: url); @override - WebPageInfo title(String? title) => this(title: title); + WebPageInfo title(String? title) => call(title: title); @override - WebPageInfo favicon(BrowserIcon? favicon) => this(favicon: favicon); + WebPageInfo favicon(BrowserIcon? favicon) => call(favicon: favicon); @override - WebPageInfo feeds(Set? feeds) => this(feeds: feeds); + WebPageInfo feeds(Set? feeds) => call(feeds: feeds); @override - /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `WebPageInfo(...).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 `WebPageInfo(...).copyWith.fieldName(value)`. /// - /// Usage + /// Example: /// ```dart /// WebPageInfo(...).copyWith(id: 12, name: "My name") - /// ```` + /// ``` WebPageInfo call({ Object? url = const $CopyWithPlaceholder(), Object? title = const $CopyWithPlaceholder(), @@ -61,7 +64,7 @@ class _$WebPageInfoCWProxyImpl implements _$WebPageInfoCWProxy { Object? feeds = const $CopyWithPlaceholder(), }) { return WebPageInfo( - url: url == const $CopyWithPlaceholder() + url: url == const $CopyWithPlaceholder() || url == null ? _value.url // ignore: cast_nullable_to_non_nullable : url as Uri, @@ -82,7 +85,8 @@ class _$WebPageInfoCWProxyImpl implements _$WebPageInfoCWProxy { } extension $WebPageInfoCopyWith on WebPageInfo { - /// Returns a callable class that can be used as follows: `instanceOfWebPageInfo.copyWith(...)` or like so:`instanceOfWebPageInfo.copyWith.fieldName(...)`. + /// Returns a callable class used to build a new instance with modified fields. + /// Example: `instanceOfWebPageInfo.copyWith(...)` or `instanceOfWebPageInfo.copyWith.fieldName(...)`. // ignore: library_private_types_in_public_api _$WebPageInfoCWProxy get copyWith => _$WebPageInfoCWProxyImpl(this); } diff --git a/app/lib/domain/services/app_initialization.g.dart b/app/lib/domain/services/app_initialization.g.dart index b89694af..1997c51a 100644 --- a/app/lib/domain/services/app_initialization.g.dart +++ b/app/lib/domain/services/app_initialization.g.dart @@ -6,28 +6,94 @@ part of 'app_initialization.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(AppInitializationService) +const appInitializationServiceProvider = AppInitializationServiceProvider._(); + +final class AppInitializationServiceProvider + extends + $NotifierProvider< + AppInitializationService, + Result<({List errors, bool initialized, String? stage})> + > { + const AppInitializationServiceProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'appInitializationServiceProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$appInitializationServiceHash(); + + @$internal + @override + AppInitializationService create() => AppInitializationService(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue( + Result<({List errors, bool initialized, String? stage})> + value, + ) { + return $ProviderOverride( + origin: this, + providerOverride: + $SyncValueProvider< + Result< + ({List errors, bool initialized, String? stage}) + > + >(value), + ); + } +} + String _$appInitializationServiceHash() => r'9966be978ea4990c56a3aba347e7979921bf6b2b'; -/// See also [AppInitializationService]. -@ProviderFor(AppInitializationService) -final appInitializationServiceProvider = - NotifierProvider< - AppInitializationService, - Result<({bool initialized, String? stage, List errors})> - >.internal( - AppInitializationService.new, - name: r'appInitializationServiceProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$appInitializationServiceHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$AppInitializationService = - Notifier< - Result<({bool initialized, String? stage, List errors})> - >; -// 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 +abstract class _$AppInitializationService + extends + $Notifier< + Result<({List errors, bool initialized, String? stage})> + > { + Result<({List errors, bool initialized, String? stage})> + build(); + @$mustCallSuper + @override + void runBuild() { + final created = build(); + final ref = + this.ref + as $Ref< + Result< + ({List errors, bool initialized, String? stage}) + >, + Result< + ({List errors, bool initialized, String? stage}) + > + >; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier< + Result< + ({List errors, bool initialized, String? stage}) + >, + Result< + ({List errors, bool initialized, String? stage}) + > + >, + Result< + ({List errors, bool initialized, String? stage}) + >, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} diff --git a/app/lib/domain/services/generic_website.g.dart b/app/lib/domain/services/generic_website.g.dart index e581cc5f..7807b5b6 100644 --- a/app/lib/domain/services/generic_website.g.dart +++ b/app/lib/domain/services/generic_website.g.dart @@ -6,22 +6,59 @@ part of 'generic_website.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(GenericWebsiteService) +const genericWebsiteServiceProvider = GenericWebsiteServiceProvider._(); + +final class GenericWebsiteServiceProvider + extends $NotifierProvider { + const GenericWebsiteServiceProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'genericWebsiteServiceProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$genericWebsiteServiceHash(); + + @$internal + @override + GenericWebsiteService create() => GenericWebsiteService(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(void value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + String _$genericWebsiteServiceHash() => r'c20897405a4d31983a22d61e955ffb7430d06a54'; -/// See also [GenericWebsiteService]. -@ProviderFor(GenericWebsiteService) -final genericWebsiteServiceProvider = - NotifierProvider.internal( - GenericWebsiteService.new, - name: r'genericWebsiteServiceProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$genericWebsiteServiceHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$GenericWebsiteService = Notifier; -// 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 +abstract class _$GenericWebsiteService extends $Notifier { + void build(); + @$mustCallSuper + @override + void runBuild() { + build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + void, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} diff --git a/app/lib/extensions/ref_cache.dart b/app/lib/extensions/ref_cache.dart index 484d804a..90599a34 100644 --- a/app/lib/extensions/ref_cache.dart +++ b/app/lib/extensions/ref_cache.dart @@ -19,6 +19,7 @@ */ import 'dart:async'; +import 'package:hooks_riverpod/misc.dart'; import 'package:riverpod/riverpod.dart'; extension CacheForExtension on Ref { diff --git a/app/lib/features/about/data/repositories/package_info_repository.g.dart b/app/lib/features/about/data/repositories/package_info_repository.g.dart index 37c37ee0..b1654369 100644 --- a/app/lib/features/about/data/repositories/package_info_repository.g.dart +++ b/app/lib/features/about/data/repositories/package_info_repository.g.dart @@ -6,22 +6,44 @@ part of 'package_info_repository.dart'; // RiverpodGenerator // ************************************************************************** -String _$packageInfoHash() => r'cc57db7b4684ab0d5df0f050b8ea045a3658e89a'; +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning -/// See also [packageInfo]. @ProviderFor(packageInfo) -final packageInfoProvider = FutureProvider.internal( - packageInfo, - name: r'packageInfoProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$packageInfoHash, - dependencies: null, - allTransitiveDependencies: null, -); +const packageInfoProvider = PackageInfoProvider._(); -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef PackageInfoRef = FutureProviderRef; -// 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 PackageInfoProvider + extends + $FunctionalProvider< + AsyncValue, + PackageInfo, + FutureOr + > + with $FutureModifier, $FutureProvider { + const PackageInfoProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'packageInfoProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$packageInfoHash(); + + @$internal + @override + $FutureProviderElement $createElement( + $ProviderPointer pointer, + ) => $FutureProviderElement(pointer); + + @override + FutureOr create(Ref ref) { + return packageInfo(ref); + } +} + +String _$packageInfoHash() => r'cc57db7b4684ab0d5df0f050b8ea045a3658e89a'; diff --git a/app/lib/features/app_widget/domain/services/home_widget.g.dart b/app/lib/features/app_widget/domain/services/home_widget.g.dart index 04e124e3..c9afef1d 100644 --- a/app/lib/features/app_widget/domain/services/home_widget.g.dart +++ b/app/lib/features/app_widget/domain/services/home_widget.g.dart @@ -6,42 +6,87 @@ part of 'home_widget.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(widgetPinnable) +const widgetPinnableProvider = WidgetPinnableProvider._(); + +final class WidgetPinnableProvider + extends $FunctionalProvider, bool, FutureOr> + with $FutureModifier, $FutureProvider { + const WidgetPinnableProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'widgetPinnableProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$widgetPinnableHash(); + + @$internal + @override + $FutureProviderElement $createElement($ProviderPointer pointer) => + $FutureProviderElement(pointer); + + @override + FutureOr create(Ref ref) { + return widgetPinnable(ref); + } +} + String _$widgetPinnableHash() => r'f91041f0f051ad0f00dd765cafea5571ca8c8088'; -/// See also [widgetPinnable]. -@ProviderFor(widgetPinnable) -final widgetPinnableProvider = FutureProvider.internal( - widgetPinnable, - name: r'widgetPinnableProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$widgetPinnableHash, - dependencies: null, - allTransitiveDependencies: null, -); +@ProviderFor(appWidgetLaunchStream) +const appWidgetLaunchStreamProvider = AppWidgetLaunchStreamProvider._(); + +final class AppWidgetLaunchStreamProvider + extends + $FunctionalProvider< + Raw>, + Raw>, + Raw> + > + with $Provider>> { + const AppWidgetLaunchStreamProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'appWidgetLaunchStreamProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$appWidgetLaunchStreamHash(); + + @$internal + @override + $ProviderElement>> $createElement( + $ProviderPointer pointer, + ) => $ProviderElement(pointer); + + @override + Raw> create(Ref ref) { + return appWidgetLaunchStream(ref); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(Raw> value) { + return $ProviderOverride( + origin: this, + providerOverride: + $SyncValueProvider>>(value), + ); + } +} -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef WidgetPinnableRef = FutureProviderRef; String _$appWidgetLaunchStreamHash() => r'ed042d1391ae3dbc26f806d6fa2e9a4a2464ae44'; - -/// See also [appWidgetLaunchStream]. -@ProviderFor(appWidgetLaunchStream) -final appWidgetLaunchStreamProvider = - AutoDisposeProvider>>.internal( - appWidgetLaunchStream, - name: r'appWidgetLaunchStreamProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$appWidgetLaunchStreamHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef AppWidgetLaunchStreamRef = - AutoDisposeProviderRef>>; -// 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 diff --git a/app/lib/features/bangs/data/database/daos/bang.dart b/app/lib/features/bangs/data/database/daos/bang.dart index a79ef47b..b6c94eb7 100644 --- a/app/lib/features/bangs/data/database/daos/bang.dart +++ b/app/lib/features/bangs/data/database/daos/bang.dart @@ -19,15 +19,15 @@ */ import 'package:drift/drift.dart'; import 'package:nullability/nullability.dart'; +import 'package:weblibre/features/bangs/data/database/daos/bang.drift.dart'; import 'package:weblibre/features/bangs/data/database/database.dart'; +import 'package:weblibre/features/bangs/data/database/definitions.drift.dart'; import 'package:weblibre/features/bangs/data/models/bang.dart'; import 'package:weblibre/features/bangs/data/models/bang_data.dart'; import 'package:weblibre/features/bangs/data/models/bang_group.dart'; -part 'bang.g.dart'; - @DriftAccessor() -class BangDao extends DatabaseAccessor with _$BangDaoMixin { +class BangDao extends DatabaseAccessor with $BangDaoMixin { BangDao(super.db); Selectable getBangList({Iterable? groups}) { @@ -122,9 +122,11 @@ class BangDao extends DatabaseAccessor with _$BangDaoMixin { final ftsQuery = db.buildFtsQuery(searchString); if (ftsQuery.isNotEmpty) { - return db.queryBangs(query: ftsQuery); + return db.definitionsDrift.queryBangs(query: ftsQuery); } else { - return db.queryBangsBasic(query: db.buildLikeQuery(searchString)); + return db.definitionsDrift.queryBangsBasic( + query: db.buildLikeQuery(searchString), + ); } } diff --git a/app/lib/features/bangs/data/database/daos/bang.drift.dart b/app/lib/features/bangs/data/database/daos/bang.drift.dart new file mode 100644 index 00000000..06bab42b --- /dev/null +++ b/app/lib/features/bangs/data/database/daos/bang.drift.dart @@ -0,0 +1,6 @@ +// dart format width=80 +// ignore_for_file: type=lint +import 'package:drift/drift.dart' as i0; +import 'package:weblibre/features/bangs/data/database/database.dart' as i1; + +mixin $BangDaoMixin on i0.DatabaseAccessor {} diff --git a/app/lib/features/bangs/data/database/daos/bang.g.dart b/app/lib/features/bangs/data/database/daos/bang.g.dart deleted file mode 100644 index b0d853c0..00000000 --- a/app/lib/features/bangs/data/database/daos/bang.g.dart +++ /dev/null @@ -1,6 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'bang.dart'; - -// ignore_for_file: type=lint -mixin _$BangDaoMixin on DatabaseAccessor {} diff --git a/app/lib/features/bangs/data/database/daos/sync.dart b/app/lib/features/bangs/data/database/daos/sync.dart index ab870ad2..82d67c07 100644 --- a/app/lib/features/bangs/data/database/daos/sync.dart +++ b/app/lib/features/bangs/data/database/daos/sync.dart @@ -18,14 +18,14 @@ * along with this program. If not, see . */ import 'package:drift/drift.dart'; +import 'package:weblibre/features/bangs/data/database/daos/sync.drift.dart'; import 'package:weblibre/features/bangs/data/database/database.dart'; +import 'package:weblibre/features/bangs/data/database/definitions.drift.dart'; import 'package:weblibre/features/bangs/data/models/bang.dart'; import 'package:weblibre/features/bangs/data/models/bang_group.dart'; -part 'sync.g.dart'; - @DriftAccessor() -class SyncDao extends DatabaseAccessor with _$SyncDaoMixin { +class SyncDao extends DatabaseAccessor with $SyncDaoMixin { SyncDao(super.db); SingleOrNullSelectable getLastSyncOfGroup(BangGroup group) { diff --git a/app/lib/features/bangs/data/database/daos/sync.drift.dart b/app/lib/features/bangs/data/database/daos/sync.drift.dart new file mode 100644 index 00000000..b98c5654 --- /dev/null +++ b/app/lib/features/bangs/data/database/daos/sync.drift.dart @@ -0,0 +1,6 @@ +// dart format width=80 +// ignore_for_file: type=lint +import 'package:drift/drift.dart' as i0; +import 'package:weblibre/features/bangs/data/database/database.dart' as i1; + +mixin $SyncDaoMixin on i0.DatabaseAccessor {} diff --git a/app/lib/features/bangs/data/database/daos/sync.g.dart b/app/lib/features/bangs/data/database/daos/sync.g.dart deleted file mode 100644 index 6ba5a943..00000000 --- a/app/lib/features/bangs/data/database/daos/sync.g.dart +++ /dev/null @@ -1,6 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'sync.dart'; - -// ignore_for_file: type=lint -mixin _$SyncDaoMixin on DatabaseAccessor {} diff --git a/app/lib/features/bangs/data/database/database.dart b/app/lib/features/bangs/data/database/database.dart index a325a376..3f0b1dbb 100644 --- a/app/lib/features/bangs/data/database/database.dart +++ b/app/lib/features/bangs/data/database/database.dart @@ -20,17 +20,11 @@ import 'package:drift/drift.dart'; import 'package:weblibre/features/bangs/data/database/daos/bang.dart'; import 'package:weblibre/features/bangs/data/database/daos/sync.dart'; -import 'package:weblibre/features/bangs/data/database/drift/converters/bang_format.dart'; -import 'package:weblibre/features/bangs/data/models/bang.dart'; -import 'package:weblibre/features/bangs/data/models/bang_data.dart'; -import 'package:weblibre/features/bangs/data/models/bang_group.dart'; -import 'package:weblibre/features/bangs/data/models/search_history_entry.dart'; +import 'package:weblibre/features/bangs/data/database/database.drift.dart'; import 'package:weblibre/features/search/domain/fts_tokenizer.dart'; -part 'database.g.dart'; - -@DriftDatabase(include: {'database.drift'}, daos: [BangDao, SyncDao]) -class BangDatabase extends _$BangDatabase with PrefixQueryBuilderMixin { +@DriftDatabase(include: {'definitions.drift'}, daos: [BangDao, SyncDao]) +class BangDatabase extends $BangDatabase with PrefixQueryBuilderMixin { @override final int schemaVersion = 1; diff --git a/app/lib/features/bangs/data/database/database.drift.dart b/app/lib/features/bangs/data/database/database.drift.dart new file mode 100644 index 00000000..edf8d938 --- /dev/null +++ b/app/lib/features/bangs/data/database/database.drift.dart @@ -0,0 +1,136 @@ +// dart format width=80 +// ignore_for_file: type=lint +import 'package:drift/drift.dart' as i0; +import 'package:weblibre/features/bangs/data/database/definitions.drift.dart' + as i1; +import 'package:weblibre/features/bangs/data/database/daos/bang.dart' as i2; +import 'package:weblibre/features/bangs/data/database/database.dart' as i3; +import 'package:weblibre/features/bangs/data/database/daos/sync.dart' as i4; +import 'package:drift/internal/modular.dart' as i5; +import 'package:sqlite3/common.dart' as i6; + +abstract class $BangDatabase extends i0.GeneratedDatabase { + $BangDatabase(i0.QueryExecutor e) : super(e); + $BangDatabaseManager get managers => $BangDatabaseManager(this); + late final i1.BangTable bang = i1.BangTable(this); + late final i1.BangSync bangSync = i1.BangSync(this); + late final i1.BangFrequency bangFrequency = i1.BangFrequency(this); + late final i1.BangHistory bangHistory = i1.BangHistory(this); + late final i1.BangFts bangFts = i1.BangFts(this); + late final i1.BangDataView bangDataView = i1.BangDataView(this); + late final i2.BangDao bangDao = i2.BangDao(this as i3.BangDatabase); + late final i4.SyncDao syncDao = i4.SyncDao(this as i3.BangDatabase); + i1.DefinitionsDrift get definitionsDrift => i5.ReadDatabaseContainer( + this, + ).accessor(i1.DefinitionsDrift.new); + @override + Iterable> get allTables => + allSchemaEntities.whereType>(); + @override + List get allSchemaEntities => [ + bang, + bangSync, + bangFrequency, + bangHistory, + bangFts, + bangDataView, + i1.bangAfterInsert, + i1.bangAfterDelete, + i1.bangAfterUpdate, + ]; + @override + i0.StreamQueryUpdateRules get streamUpdateRules => + const i0.StreamQueryUpdateRules([ + i0.WritePropagation( + on: i0.TableUpdateQuery.onTableName( + 'bang', + limitUpdateKind: i0.UpdateKind.delete, + ), + result: [ + i0.TableUpdate('bang_frequency', kind: i0.UpdateKind.delete), + ], + ), + i0.WritePropagation( + on: i0.TableUpdateQuery.onTableName( + 'bang', + limitUpdateKind: i0.UpdateKind.insert, + ), + result: [i0.TableUpdate('bang_fts', kind: i0.UpdateKind.insert)], + ), + i0.WritePropagation( + on: i0.TableUpdateQuery.onTableName( + 'bang', + limitUpdateKind: i0.UpdateKind.delete, + ), + result: [i0.TableUpdate('bang_fts', kind: i0.UpdateKind.insert)], + ), + i0.WritePropagation( + on: i0.TableUpdateQuery.onTableName( + 'bang', + limitUpdateKind: i0.UpdateKind.update, + ), + result: [i0.TableUpdate('bang_fts', kind: i0.UpdateKind.insert)], + ), + ]); +} + +class $BangDatabaseManager { + final $BangDatabase _db; + $BangDatabaseManager(this._db); + i1.$BangTableTableManager get bang => + i1.$BangTableTableManager(_db, _db.bang); + i1.$BangSyncTableManager get bangSync => + i1.$BangSyncTableManager(_db, _db.bangSync); + i1.$BangFrequencyTableManager get bangFrequency => + i1.$BangFrequencyTableManager(_db, _db.bangFrequency); + i1.$BangHistoryTableManager get bangHistory => + i1.$BangHistoryTableManager(_db, _db.bangHistory); + i1.$BangFtsTableManager get bangFts => + i1.$BangFtsTableManager(_db, _db.bangFts); +} + +extension DefineFunctions on i6.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 i6.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 i6.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 i6.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 i6.AllowedArgumentCount(2), + function: (args) { + final arg0 = args[0] as String?; + final arg1 = args[1] as String?; + return lexoRankReorderBefore(arg0, arg1); + }, + ); + } +} diff --git a/app/lib/features/bangs/data/database/database.g.dart b/app/lib/features/bangs/data/database/database.g.dart deleted file mode 100644 index a07460ec..00000000 --- a/app/lib/features/bangs/data/database/database.g.dart +++ /dev/null @@ -1,2687 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'database.dart'; - -// ignore_for_file: type=lint -class BangTable extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - BangTable(this.attachedDatabase, [this._alias]); - late final GeneratedColumn trigger = GeneratedColumn( - 'trigger', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'PRIMARY KEY NOT NULL', - ); - late final GeneratedColumnWithTypeConverter group = - GeneratedColumn( - 'group', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ).withConverter(BangTable.$convertergroup); - late final GeneratedColumn websiteName = GeneratedColumn( - 'website_name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn domain = GeneratedColumn( - 'domain', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn urlTemplate = GeneratedColumn( - 'url_template', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn category = GeneratedColumn( - 'category', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: '', - ); - late final GeneratedColumn subCategory = GeneratedColumn( - 'sub_category', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: '', - ); - late final GeneratedColumnWithTypeConverter?, String> format = - GeneratedColumn( - 'format', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: '', - ).withConverter?>(BangTable.$converterformat); - @override - List get $columns => [ - trigger, - group, - websiteName, - domain, - urlTemplate, - category, - subCategory, - format, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'bang'; - @override - Set get $primaryKey => {trigger}; - @override - Bang map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return Bang( - websiteName: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}website_name'], - )!, - domain: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}domain'], - )!, - trigger: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}trigger'], - )!, - urlTemplate: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}url_template'], - )!, - group: BangTable.$convertergroup.fromSql( - attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}group'], - )!, - ), - category: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}category'], - ), - subCategory: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}sub_category'], - ), - format: BangTable.$converterformat.fromSql( - attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}format'], - ), - ), - ); - } - - @override - BangTable createAlias(String alias) { - return BangTable(attachedDatabase, alias); - } - - static JsonTypeConverter2 $convertergroup = - const EnumIndexConverter(BangGroup.values); - static TypeConverter?, String?> $converterformat = - const BangFormatConverter(); - @override - bool get dontWriteConstraints => true; -} - -class BangCompanion extends UpdateCompanion { - final Value trigger; - final Value group; - final Value websiteName; - final Value domain; - final Value urlTemplate; - final Value category; - final Value subCategory; - final Value?> format; - final Value rowid; - const BangCompanion({ - this.trigger = const Value.absent(), - this.group = const Value.absent(), - this.websiteName = const Value.absent(), - this.domain = const Value.absent(), - this.urlTemplate = const Value.absent(), - this.category = const Value.absent(), - this.subCategory = const Value.absent(), - this.format = const Value.absent(), - this.rowid = const Value.absent(), - }); - BangCompanion.insert({ - required String trigger, - required BangGroup group, - required String websiteName, - required String domain, - required String urlTemplate, - this.category = const Value.absent(), - this.subCategory = const Value.absent(), - this.format = const Value.absent(), - this.rowid = const Value.absent(), - }) : trigger = Value(trigger), - group = Value(group), - websiteName = Value(websiteName), - domain = Value(domain), - urlTemplate = Value(urlTemplate); - static Insertable custom({ - Expression? trigger, - Expression? group, - Expression? websiteName, - Expression? domain, - Expression? urlTemplate, - Expression? category, - Expression? subCategory, - Expression? format, - Expression? rowid, - }) { - return RawValuesInsertable({ - if (trigger != null) 'trigger': trigger, - if (group != null) 'group': group, - if (websiteName != null) 'website_name': websiteName, - if (domain != null) 'domain': domain, - if (urlTemplate != null) 'url_template': urlTemplate, - if (category != null) 'category': category, - if (subCategory != null) 'sub_category': subCategory, - if (format != null) 'format': format, - if (rowid != null) 'rowid': rowid, - }); - } - - BangCompanion copyWith({ - Value? trigger, - Value? group, - Value? websiteName, - Value? domain, - Value? urlTemplate, - Value? category, - Value? subCategory, - Value?>? format, - Value? rowid, - }) { - return BangCompanion( - trigger: trigger ?? this.trigger, - group: group ?? this.group, - websiteName: websiteName ?? this.websiteName, - domain: domain ?? this.domain, - urlTemplate: urlTemplate ?? this.urlTemplate, - category: category ?? this.category, - subCategory: subCategory ?? this.subCategory, - format: format ?? this.format, - rowid: rowid ?? this.rowid, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (trigger.present) { - map['trigger'] = Variable(trigger.value); - } - if (group.present) { - map['group'] = Variable( - BangTable.$convertergroup.toSql(group.value), - ); - } - if (websiteName.present) { - map['website_name'] = Variable(websiteName.value); - } - if (domain.present) { - map['domain'] = Variable(domain.value); - } - if (urlTemplate.present) { - map['url_template'] = Variable(urlTemplate.value); - } - if (category.present) { - map['category'] = Variable(category.value); - } - if (subCategory.present) { - map['sub_category'] = Variable(subCategory.value); - } - if (format.present) { - map['format'] = Variable( - BangTable.$converterformat.toSql(format.value), - ); - } - if (rowid.present) { - map['rowid'] = Variable(rowid.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('BangCompanion(') - ..write('trigger: $trigger, ') - ..write('group: $group, ') - ..write('websiteName: $websiteName, ') - ..write('domain: $domain, ') - ..write('urlTemplate: $urlTemplate, ') - ..write('category: $category, ') - ..write('subCategory: $subCategory, ') - ..write('format: $format, ') - ..write('rowid: $rowid') - ..write(')')) - .toString(); - } -} - -class BangSync extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - BangSync(this.attachedDatabase, [this._alias]); - late final GeneratedColumnWithTypeConverter group = - GeneratedColumn( - 'group', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: false, - $customConstraints: 'PRIMARY KEY NOT NULL', - ).withConverter(BangSync.$convertergroup); - late final GeneratedColumn lastSync = GeneratedColumn( - 'last_sync', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [group, lastSync]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'bang_sync'; - @override - Set get $primaryKey => {group}; - @override - BangSyncData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return BangSyncData( - group: BangSync.$convertergroup.fromSql( - attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}group'], - )!, - ), - lastSync: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}last_sync'], - )!, - ); - } - - @override - BangSync createAlias(String alias) { - return BangSync(attachedDatabase, alias); - } - - static JsonTypeConverter2 $convertergroup = - const EnumIndexConverter(BangGroup.values); - @override - bool get dontWriteConstraints => true; -} - -class BangSyncData extends DataClass implements Insertable { - final BangGroup group; - final DateTime lastSync; - const BangSyncData({required this.group, required this.lastSync}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - { - map['group'] = Variable(BangSync.$convertergroup.toSql(group)); - } - map['last_sync'] = Variable(lastSync); - return map; - } - - factory BangSyncData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return BangSyncData( - group: BangSync.$convertergroup.fromJson( - serializer.fromJson(json['group']), - ), - lastSync: serializer.fromJson(json['last_sync']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'group': serializer.toJson(BangSync.$convertergroup.toJson(group)), - 'last_sync': serializer.toJson(lastSync), - }; - } - - BangSyncData copyWith({BangGroup? group, DateTime? lastSync}) => BangSyncData( - group: group ?? this.group, - lastSync: lastSync ?? this.lastSync, - ); - BangSyncData copyWithCompanion(BangSyncCompanion data) { - return BangSyncData( - group: data.group.present ? data.group.value : this.group, - lastSync: data.lastSync.present ? data.lastSync.value : this.lastSync, - ); - } - - @override - String toString() { - return (StringBuffer('BangSyncData(') - ..write('group: $group, ') - ..write('lastSync: $lastSync') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(group, lastSync); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is BangSyncData && - other.group == this.group && - other.lastSync == this.lastSync); -} - -class BangSyncCompanion extends UpdateCompanion { - final Value group; - final Value lastSync; - const BangSyncCompanion({ - this.group = const Value.absent(), - this.lastSync = const Value.absent(), - }); - BangSyncCompanion.insert({ - this.group = const Value.absent(), - required DateTime lastSync, - }) : lastSync = Value(lastSync); - static Insertable custom({ - Expression? group, - Expression? lastSync, - }) { - return RawValuesInsertable({ - if (group != null) 'group': group, - if (lastSync != null) 'last_sync': lastSync, - }); - } - - BangSyncCompanion copyWith({ - Value? group, - Value? lastSync, - }) { - return BangSyncCompanion( - group: group ?? this.group, - lastSync: lastSync ?? this.lastSync, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (group.present) { - map['group'] = Variable(BangSync.$convertergroup.toSql(group.value)); - } - if (lastSync.present) { - map['last_sync'] = Variable(lastSync.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('BangSyncCompanion(') - ..write('group: $group, ') - ..write('lastSync: $lastSync') - ..write(')')) - .toString(); - } -} - -class BangFrequency extends Table - with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - BangFrequency(this.attachedDatabase, [this._alias]); - late final GeneratedColumn trigger = GeneratedColumn( - 'trigger', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: - 'PRIMARY KEY NOT NULL REFERENCES bang("trigger")ON DELETE CASCADE', - ); - late final GeneratedColumn frequency = GeneratedColumn( - 'frequency', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn lastUsed = GeneratedColumn( - 'last_used', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [trigger, frequency, lastUsed]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'bang_frequency'; - @override - Set get $primaryKey => {trigger}; - @override - BangFrequencyData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return BangFrequencyData( - trigger: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}trigger'], - )!, - frequency: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}frequency'], - )!, - lastUsed: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}last_used'], - )!, - ); - } - - @override - BangFrequency createAlias(String alias) { - return BangFrequency(attachedDatabase, alias); - } - - @override - bool get dontWriteConstraints => true; -} - -class BangFrequencyData extends DataClass - implements Insertable { - final String trigger; - final int frequency; - final DateTime lastUsed; - const BangFrequencyData({ - required this.trigger, - required this.frequency, - required this.lastUsed, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['trigger'] = Variable(trigger); - map['frequency'] = Variable(frequency); - map['last_used'] = Variable(lastUsed); - return map; - } - - factory BangFrequencyData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return BangFrequencyData( - trigger: serializer.fromJson(json['trigger']), - frequency: serializer.fromJson(json['frequency']), - lastUsed: serializer.fromJson(json['last_used']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'trigger': serializer.toJson(trigger), - 'frequency': serializer.toJson(frequency), - 'last_used': serializer.toJson(lastUsed), - }; - } - - BangFrequencyData copyWith({ - String? trigger, - int? frequency, - DateTime? lastUsed, - }) => BangFrequencyData( - trigger: trigger ?? this.trigger, - frequency: frequency ?? this.frequency, - lastUsed: lastUsed ?? this.lastUsed, - ); - BangFrequencyData copyWithCompanion(BangFrequencyCompanion data) { - return BangFrequencyData( - trigger: data.trigger.present ? data.trigger.value : this.trigger, - frequency: data.frequency.present ? data.frequency.value : this.frequency, - lastUsed: data.lastUsed.present ? data.lastUsed.value : this.lastUsed, - ); - } - - @override - String toString() { - return (StringBuffer('BangFrequencyData(') - ..write('trigger: $trigger, ') - ..write('frequency: $frequency, ') - ..write('lastUsed: $lastUsed') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(trigger, frequency, lastUsed); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is BangFrequencyData && - other.trigger == this.trigger && - other.frequency == this.frequency && - other.lastUsed == this.lastUsed); -} - -class BangFrequencyCompanion extends UpdateCompanion { - final Value trigger; - final Value frequency; - final Value lastUsed; - final Value rowid; - const BangFrequencyCompanion({ - this.trigger = const Value.absent(), - this.frequency = const Value.absent(), - this.lastUsed = const Value.absent(), - this.rowid = const Value.absent(), - }); - BangFrequencyCompanion.insert({ - required String trigger, - required int frequency, - required DateTime lastUsed, - this.rowid = const Value.absent(), - }) : trigger = Value(trigger), - frequency = Value(frequency), - lastUsed = Value(lastUsed); - static Insertable custom({ - Expression? trigger, - Expression? frequency, - Expression? lastUsed, - Expression? rowid, - }) { - return RawValuesInsertable({ - if (trigger != null) 'trigger': trigger, - if (frequency != null) 'frequency': frequency, - if (lastUsed != null) 'last_used': lastUsed, - if (rowid != null) 'rowid': rowid, - }); - } - - BangFrequencyCompanion copyWith({ - Value? trigger, - Value? frequency, - Value? lastUsed, - Value? rowid, - }) { - return BangFrequencyCompanion( - trigger: trigger ?? this.trigger, - frequency: frequency ?? this.frequency, - lastUsed: lastUsed ?? this.lastUsed, - rowid: rowid ?? this.rowid, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (trigger.present) { - map['trigger'] = Variable(trigger.value); - } - if (frequency.present) { - map['frequency'] = Variable(frequency.value); - } - if (lastUsed.present) { - map['last_used'] = Variable(lastUsed.value); - } - if (rowid.present) { - map['rowid'] = Variable(rowid.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('BangFrequencyCompanion(') - ..write('trigger: $trigger, ') - ..write('frequency: $frequency, ') - ..write('lastUsed: $lastUsed, ') - ..write('rowid: $rowid') - ..write(')')) - .toString(); - } -} - -class BangHistory extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - BangHistory(this.attachedDatabase, [this._alias]); - late final GeneratedColumn searchQuery = GeneratedColumn( - 'search_query', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'UNIQUE NOT NULL', - ); - late final GeneratedColumn trigger = GeneratedColumn( - 'trigger', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES bang("trigger")', - ); - late final GeneratedColumn searchDate = GeneratedColumn( - 'search_date', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [searchQuery, trigger, searchDate]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'bang_history'; - @override - Set get $primaryKey => const {}; - @override - BangHistoryData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return BangHistoryData( - searchQuery: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}search_query'], - )!, - trigger: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}trigger'], - )!, - searchDate: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}search_date'], - )!, - ); - } - - @override - BangHistory createAlias(String alias) { - return BangHistory(attachedDatabase, alias); - } - - @override - bool get dontWriteConstraints => true; -} - -class BangHistoryData extends DataClass implements Insertable { - final String searchQuery; - final String trigger; - final DateTime searchDate; - const BangHistoryData({ - required this.searchQuery, - required this.trigger, - required this.searchDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['search_query'] = Variable(searchQuery); - map['trigger'] = Variable(trigger); - map['search_date'] = Variable(searchDate); - return map; - } - - factory BangHistoryData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return BangHistoryData( - searchQuery: serializer.fromJson(json['search_query']), - trigger: serializer.fromJson(json['trigger']), - searchDate: serializer.fromJson(json['search_date']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'search_query': serializer.toJson(searchQuery), - 'trigger': serializer.toJson(trigger), - 'search_date': serializer.toJson(searchDate), - }; - } - - BangHistoryData copyWith({ - String? searchQuery, - String? trigger, - DateTime? searchDate, - }) => BangHistoryData( - searchQuery: searchQuery ?? this.searchQuery, - trigger: trigger ?? this.trigger, - searchDate: searchDate ?? this.searchDate, - ); - BangHistoryData copyWithCompanion(BangHistoryCompanion data) { - return BangHistoryData( - searchQuery: data.searchQuery.present - ? data.searchQuery.value - : this.searchQuery, - trigger: data.trigger.present ? data.trigger.value : this.trigger, - searchDate: data.searchDate.present - ? data.searchDate.value - : this.searchDate, - ); - } - - @override - String toString() { - return (StringBuffer('BangHistoryData(') - ..write('searchQuery: $searchQuery, ') - ..write('trigger: $trigger, ') - ..write('searchDate: $searchDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(searchQuery, trigger, searchDate); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is BangHistoryData && - other.searchQuery == this.searchQuery && - other.trigger == this.trigger && - other.searchDate == this.searchDate); -} - -class BangHistoryCompanion extends UpdateCompanion { - final Value searchQuery; - final Value trigger; - final Value searchDate; - final Value rowid; - const BangHistoryCompanion({ - this.searchQuery = const Value.absent(), - this.trigger = const Value.absent(), - this.searchDate = const Value.absent(), - this.rowid = const Value.absent(), - }); - BangHistoryCompanion.insert({ - required String searchQuery, - required String trigger, - required DateTime searchDate, - this.rowid = const Value.absent(), - }) : searchQuery = Value(searchQuery), - trigger = Value(trigger), - searchDate = Value(searchDate); - static Insertable custom({ - Expression? searchQuery, - Expression? trigger, - Expression? searchDate, - Expression? rowid, - }) { - return RawValuesInsertable({ - if (searchQuery != null) 'search_query': searchQuery, - if (trigger != null) 'trigger': trigger, - if (searchDate != null) 'search_date': searchDate, - if (rowid != null) 'rowid': rowid, - }); - } - - BangHistoryCompanion copyWith({ - Value? searchQuery, - Value? trigger, - Value? searchDate, - Value? rowid, - }) { - return BangHistoryCompanion( - searchQuery: searchQuery ?? this.searchQuery, - trigger: trigger ?? this.trigger, - searchDate: searchDate ?? this.searchDate, - rowid: rowid ?? this.rowid, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (searchQuery.present) { - map['search_query'] = Variable(searchQuery.value); - } - if (trigger.present) { - map['trigger'] = Variable(trigger.value); - } - if (searchDate.present) { - map['search_date'] = Variable(searchDate.value); - } - if (rowid.present) { - map['rowid'] = Variable(rowid.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('BangHistoryCompanion(') - ..write('searchQuery: $searchQuery, ') - ..write('trigger: $trigger, ') - ..write('searchDate: $searchDate, ') - ..write('rowid: $rowid') - ..write(')')) - .toString(); - } -} - -class BangFts extends Table - with TableInfo, VirtualTableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - BangFts(this.attachedDatabase, [this._alias]); - late final GeneratedColumn trigger = GeneratedColumn( - 'trigger', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: '', - ); - late final GeneratedColumn websiteName = GeneratedColumn( - 'website_name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: '', - ); - @override - List get $columns => [trigger, websiteName]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'bang_fts'; - @override - Set get $primaryKey => const {}; - @override - BangFt map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return BangFt( - trigger: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}trigger'], - )!, - websiteName: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}website_name'], - )!, - ); - } - - @override - BangFts createAlias(String alias) { - return BangFts(attachedDatabase, alias); - } - - @override - bool get dontWriteConstraints => true; - @override - String get moduleAndArgs => - 'fts5(trigger, website_name, content=bang, prefix=\'2 3\')'; -} - -class BangFt extends DataClass implements Insertable { - final String trigger; - final String websiteName; - const BangFt({required this.trigger, required this.websiteName}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['trigger'] = Variable(trigger); - map['website_name'] = Variable(websiteName); - return map; - } - - factory BangFt.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return BangFt( - trigger: serializer.fromJson(json['trigger']), - websiteName: serializer.fromJson(json['website_name']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'trigger': serializer.toJson(trigger), - 'website_name': serializer.toJson(websiteName), - }; - } - - BangFt copyWith({String? trigger, String? websiteName}) => BangFt( - trigger: trigger ?? this.trigger, - websiteName: websiteName ?? this.websiteName, - ); - BangFt copyWithCompanion(BangFtsCompanion data) { - return BangFt( - trigger: data.trigger.present ? data.trigger.value : this.trigger, - websiteName: data.websiteName.present - ? data.websiteName.value - : this.websiteName, - ); - } - - @override - String toString() { - return (StringBuffer('BangFt(') - ..write('trigger: $trigger, ') - ..write('websiteName: $websiteName') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(trigger, websiteName); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is BangFt && - other.trigger == this.trigger && - other.websiteName == this.websiteName); -} - -class BangFtsCompanion extends UpdateCompanion { - final Value trigger; - final Value websiteName; - final Value rowid; - const BangFtsCompanion({ - this.trigger = const Value.absent(), - this.websiteName = const Value.absent(), - this.rowid = const Value.absent(), - }); - BangFtsCompanion.insert({ - required String trigger, - required String websiteName, - this.rowid = const Value.absent(), - }) : trigger = Value(trigger), - websiteName = Value(websiteName); - static Insertable custom({ - Expression? trigger, - Expression? websiteName, - Expression? rowid, - }) { - return RawValuesInsertable({ - if (trigger != null) 'trigger': trigger, - if (websiteName != null) 'website_name': websiteName, - if (rowid != null) 'rowid': rowid, - }); - } - - BangFtsCompanion copyWith({ - Value? trigger, - Value? websiteName, - Value? rowid, - }) { - return BangFtsCompanion( - trigger: trigger ?? this.trigger, - websiteName: websiteName ?? this.websiteName, - rowid: rowid ?? this.rowid, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (trigger.present) { - map['trigger'] = Variable(trigger.value); - } - if (websiteName.present) { - map['website_name'] = Variable(websiteName.value); - } - if (rowid.present) { - map['rowid'] = Variable(rowid.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('BangFtsCompanion(') - ..write('trigger: $trigger, ') - ..write('websiteName: $websiteName, ') - ..write('rowid: $rowid') - ..write(')')) - .toString(); - } -} - -class BangDataView extends ViewInfo - implements HasResultSet { - final String? _alias; - @override - final _$BangDatabase attachedDatabase; - BangDataView(this.attachedDatabase, [this._alias]); - @override - List get $columns => [ - trigger, - group, - websiteName, - domain, - urlTemplate, - category, - subCategory, - format, - frequency, - lastUsed, - ]; - @override - String get aliasedName => _alias ?? entityName; - @override - String get entityName => 'bang_data_view'; - @override - Map get createViewStatements => { - SqlDialect.sqlite: - 'CREATE VIEW bang_data_view AS SELECT b.*, bf.frequency, bf.last_used FROM bang AS b LEFT JOIN bang_frequency AS bf ON b."trigger" = bf."trigger"', - }; - @override - BangDataView get asDslTable => this; - @override - BangData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return BangData( - websiteName: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}website_name'], - )!, - domain: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}domain'], - )!, - trigger: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}trigger'], - )!, - urlTemplate: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}url_template'], - )!, - category: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}category'], - ), - subCategory: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}sub_category'], - ), - format: BangTable.$converterformat.fromSql( - attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}format'], - ), - ), - frequency: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}frequency'], - ), - lastUsed: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}last_used'], - ), - ); - } - - late final GeneratedColumn trigger = GeneratedColumn( - 'trigger', - aliasedName, - false, - type: DriftSqlType.string, - ); - late final GeneratedColumnWithTypeConverter group = - GeneratedColumn( - 'group', - aliasedName, - false, - type: DriftSqlType.int, - ).withConverter(BangTable.$convertergroup); - late final GeneratedColumn websiteName = GeneratedColumn( - 'website_name', - aliasedName, - false, - type: DriftSqlType.string, - ); - late final GeneratedColumn domain = GeneratedColumn( - 'domain', - aliasedName, - false, - type: DriftSqlType.string, - ); - late final GeneratedColumn urlTemplate = GeneratedColumn( - 'url_template', - aliasedName, - false, - type: DriftSqlType.string, - ); - late final GeneratedColumn category = GeneratedColumn( - 'category', - aliasedName, - true, - type: DriftSqlType.string, - ); - late final GeneratedColumn subCategory = GeneratedColumn( - 'sub_category', - aliasedName, - true, - type: DriftSqlType.string, - ); - late final GeneratedColumnWithTypeConverter?, String> format = - GeneratedColumn( - 'format', - aliasedName, - true, - type: DriftSqlType.string, - ).withConverter?>(BangTable.$converterformat); - late final GeneratedColumn frequency = GeneratedColumn( - 'frequency', - aliasedName, - true, - type: DriftSqlType.int, - ); - late final GeneratedColumn lastUsed = GeneratedColumn( - 'last_used', - aliasedName, - true, - type: DriftSqlType.dateTime, - ); - @override - BangDataView createAlias(String alias) { - return BangDataView(attachedDatabase, alias); - } - - @override - Query? get query => null; - @override - Set get readTables => const {'bang', 'bang_frequency'}; -} - -abstract class _$BangDatabase extends GeneratedDatabase { - _$BangDatabase(QueryExecutor e) : super(e); - $BangDatabaseManager get managers => $BangDatabaseManager(this); - late final BangTable bang = BangTable(this); - late final BangSync bangSync = BangSync(this); - late final BangFrequency bangFrequency = BangFrequency(this); - late final BangHistory bangHistory = BangHistory(this); - late final BangFts bangFts = BangFts(this); - late final BangDataView bangDataView = BangDataView(this); - late final Trigger bangAfterInsert = Trigger( - 'CREATE TRIGGER bang_after_insert AFTER INSERT ON bang BEGIN INSERT INTO bang_fts ("rowid", "trigger", website_name) VALUES (new."rowid", new."trigger", new.website_name);END', - 'bang_after_insert', - ); - late final Trigger bangAfterDelete = Trigger( - 'CREATE TRIGGER bang_after_delete AFTER DELETE ON bang BEGIN INSERT INTO bang_fts (bang_fts, "rowid", "trigger", website_name) VALUES (\'delete\', old."rowid", old."trigger", old.website_name);END', - 'bang_after_delete', - ); - late final Trigger bangAfterUpdate = Trigger( - 'CREATE TRIGGER bang_after_update AFTER UPDATE ON bang BEGIN INSERT INTO bang_fts (bang_fts, "rowid", "trigger", website_name) VALUES (\'delete\', old."rowid", old."trigger", old.website_name);INSERT INTO bang_fts ("rowid", "trigger", website_name) VALUES (new."rowid", new."trigger", new.website_name);END', - 'bang_after_update', - ); - late final BangDao bangDao = BangDao(this as BangDatabase); - late final SyncDao syncDao = SyncDao(this as BangDatabase); - Future optimizeFtsIndex() { - return customInsert( - 'INSERT INTO bang_fts (bang_fts) VALUES (\'optimize\')', - variables: [], - updates: {bangFts}, - ); - } - - Selectable queryBangs({required String query}) { - return customSelect( - 'WITH weights AS (SELECT 10.0 AS "trigger", 5.0 AS website_name) SELECT b.*, bf.frequency, bf.last_used, bm25(bang_fts, weights."trigger", weights.website_name) AS weighted_rank FROM bang_fts(?1)AS fts INNER JOIN bang AS b ON b."rowid" = fts."rowid" LEFT JOIN bang_frequency AS bf ON b."trigger" = bf."trigger" CROSS JOIN weights ORDER BY weighted_rank ASC, bf.frequency NULLS LAST', - variables: [Variable(query)], - readsFrom: {bangFrequency, bangFts, bang}, - ).map( - (QueryRow row) => BangData( - websiteName: row.read('website_name'), - domain: row.read('domain'), - trigger: row.read('trigger'), - urlTemplate: row.read('url_template'), - category: row.readNullable('category'), - subCategory: row.readNullable('sub_category'), - format: BangTable.$converterformat.fromSql( - row.readNullable('format'), - ), - frequency: row.readNullable('frequency'), - lastUsed: row.readNullable('last_used'), - ), - ); - } - - Selectable queryBangsBasic({required String query}) { - return customSelect( - 'WITH weights AS (SELECT 10.0 AS "trigger", 5.0 AS website_name) SELECT b.*, bf.frequency, bf.last_used, bm25(bang_fts, weights."trigger", weights.website_name) AS weighted_rank FROM bang_fts AS fts INNER JOIN bang AS b ON b."rowid" = fts."rowid" LEFT JOIN bang_frequency AS bf ON b."trigger" = bf."trigger" CROSS JOIN weights WHERE fts."trigger" LIKE ?1 OR fts.website_name LIKE ?1 ORDER BY weighted_rank ASC, bf.frequency NULLS LAST', - variables: [Variable(query)], - readsFrom: {bangFrequency, bangFts, bang}, - ).map( - (QueryRow row) => BangData( - websiteName: row.read('website_name'), - domain: row.read('domain'), - trigger: row.read('trigger'), - urlTemplate: row.read('url_template'), - category: row.readNullable('category'), - subCategory: row.readNullable('sub_category'), - format: BangTable.$converterformat.fromSql( - row.readNullable('format'), - ), - frequency: row.readNullable('frequency'), - lastUsed: row.readNullable('last_used'), - ), - ); - } - - Selectable categoriesJson() { - return customSelect( - 'WITH categories AS (SELECT b.category, json_group_array(DISTINCT b.sub_category ORDER BY b.sub_category)AS sub_categories FROM bang AS b WHERE b.category IS NOT NULL AND b.sub_category IS NOT NULL GROUP BY b.category ORDER BY b.category) SELECT json_group_object(c.category, json(c.sub_categories)) AS categories_json FROM categories AS c', - variables: [], - readsFrom: {bang}, - ).map((QueryRow row) => row.read('categories_json')); - } - - Selectable searchHistoryEntries({required int limit}) { - return customSelect( - 'SELECT * FROM bang_history ORDER BY search_date DESC LIMIT ?1', - variables: [Variable(limit)], - readsFrom: {bangHistory}, - ).map( - (QueryRow row) => SearchHistoryEntry( - searchQuery: row.read('search_query'), - trigger: row.read('trigger'), - searchDate: row.read('search_date'), - ), - ); - } - - Future evictHistoryEntries({required int limit}) { - return customUpdate( - 'DELETE FROM bang_history WHERE "rowid" IN (SELECT "rowid" FROM bang_history ORDER BY search_date DESC LIMIT -1 OFFSET ?1)', - variables: [Variable(limit)], - updates: {bangHistory}, - updateKind: UpdateKind.delete, - ); - } - - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - bang, - bangSync, - bangFrequency, - bangHistory, - bangFts, - bangDataView, - bangAfterInsert, - bangAfterDelete, - bangAfterUpdate, - ]; - @override - StreamQueryUpdateRules get streamUpdateRules => const StreamQueryUpdateRules([ - WritePropagation( - on: TableUpdateQuery.onTableName( - 'bang', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('bang_frequency', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'bang', - limitUpdateKind: UpdateKind.insert, - ), - result: [TableUpdate('bang_fts', kind: UpdateKind.insert)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'bang', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('bang_fts', kind: UpdateKind.insert)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'bang', - limitUpdateKind: UpdateKind.update, - ), - result: [TableUpdate('bang_fts', kind: UpdateKind.insert)], - ), - ]); -} - -typedef $BangTableCreateCompanionBuilder = - BangCompanion Function({ - required String trigger, - required BangGroup group, - required String websiteName, - required String domain, - required String urlTemplate, - Value category, - Value subCategory, - Value?> format, - Value rowid, - }); -typedef $BangTableUpdateCompanionBuilder = - BangCompanion Function({ - Value trigger, - Value group, - Value websiteName, - Value domain, - Value urlTemplate, - Value category, - Value subCategory, - Value?> format, - Value rowid, - }); - -final class $BangTableReferences - extends BaseReferences<_$BangDatabase, BangTable, Bang> { - $BangTableReferences(super.$_db, super.$_table, super.$_typedResult); - - static MultiTypedResultKey> - _bangFrequencyRefsTable(_$BangDatabase db) => MultiTypedResultKey.fromTable( - db.bangFrequency, - aliasName: $_aliasNameGenerator(db.bang.trigger, db.bangFrequency.trigger), - ); - - $BangFrequencyProcessedTableManager get bangFrequencyRefs { - final manager = $BangFrequencyTableManager($_db, $_db.bangFrequency).filter( - (f) => f.trigger.trigger.sqlEquals($_itemColumn('trigger')!), - ); - - final cache = $_typedResult.readTableOrNull(_bangFrequencyRefsTable($_db)); - return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: cache), - ); - } - - static MultiTypedResultKey> - _bangHistoryRefsTable(_$BangDatabase db) => MultiTypedResultKey.fromTable( - db.bangHistory, - aliasName: $_aliasNameGenerator(db.bang.trigger, db.bangHistory.trigger), - ); - - $BangHistoryProcessedTableManager get bangHistoryRefs { - final manager = $BangHistoryTableManager($_db, $_db.bangHistory).filter( - (f) => f.trigger.trigger.sqlEquals($_itemColumn('trigger')!), - ); - - final cache = $_typedResult.readTableOrNull(_bangHistoryRefsTable($_db)); - return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: cache), - ); - } -} - -class $BangTableFilterComposer extends Composer<_$BangDatabase, BangTable> { - $BangTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnFilters get trigger => $composableBuilder( - column: $table.trigger, - builder: (column) => ColumnFilters(column), - ); - - ColumnWithTypeConverterFilters get group => - $composableBuilder( - column: $table.group, - builder: (column) => ColumnWithTypeConverterFilters(column), - ); - - ColumnFilters get websiteName => $composableBuilder( - column: $table.websiteName, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get domain => $composableBuilder( - column: $table.domain, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get urlTemplate => $composableBuilder( - column: $table.urlTemplate, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get category => $composableBuilder( - column: $table.category, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get subCategory => $composableBuilder( - column: $table.subCategory, - builder: (column) => ColumnFilters(column), - ); - - ColumnWithTypeConverterFilters?, Set, String> - get format => $composableBuilder( - column: $table.format, - builder: (column) => ColumnWithTypeConverterFilters(column), - ); - - Expression bangFrequencyRefs( - Expression Function($BangFrequencyFilterComposer f) f, - ) { - final $BangFrequencyFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.trigger, - referencedTable: $db.bangFrequency, - getReferencedColumn: (t) => t.trigger, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $BangFrequencyFilterComposer( - $db: $db, - $table: $db.bangFrequency, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return f(composer); - } - - Expression bangHistoryRefs( - Expression Function($BangHistoryFilterComposer f) f, - ) { - final $BangHistoryFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.trigger, - referencedTable: $db.bangHistory, - getReferencedColumn: (t) => t.trigger, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $BangHistoryFilterComposer( - $db: $db, - $table: $db.bangHistory, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return f(composer); - } -} - -class $BangTableOrderingComposer extends Composer<_$BangDatabase, BangTable> { - $BangTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnOrderings get trigger => $composableBuilder( - column: $table.trigger, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get group => $composableBuilder( - column: $table.group, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get websiteName => $composableBuilder( - column: $table.websiteName, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get domain => $composableBuilder( - column: $table.domain, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get urlTemplate => $composableBuilder( - column: $table.urlTemplate, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get category => $composableBuilder( - column: $table.category, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get subCategory => $composableBuilder( - column: $table.subCategory, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get format => $composableBuilder( - column: $table.format, - builder: (column) => ColumnOrderings(column), - ); -} - -class $BangTableAnnotationComposer extends Composer<_$BangDatabase, BangTable> { - $BangTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - GeneratedColumn get trigger => - $composableBuilder(column: $table.trigger, builder: (column) => column); - - GeneratedColumnWithTypeConverter get group => - $composableBuilder(column: $table.group, builder: (column) => column); - - GeneratedColumn get websiteName => $composableBuilder( - column: $table.websiteName, - builder: (column) => column, - ); - - GeneratedColumn get domain => - $composableBuilder(column: $table.domain, builder: (column) => column); - - GeneratedColumn get urlTemplate => $composableBuilder( - column: $table.urlTemplate, - builder: (column) => column, - ); - - GeneratedColumn get category => - $composableBuilder(column: $table.category, builder: (column) => column); - - GeneratedColumn get subCategory => $composableBuilder( - column: $table.subCategory, - builder: (column) => column, - ); - - GeneratedColumnWithTypeConverter?, String> get format => - $composableBuilder(column: $table.format, builder: (column) => column); - - Expression bangFrequencyRefs( - Expression Function($BangFrequencyAnnotationComposer a) f, - ) { - final $BangFrequencyAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.trigger, - referencedTable: $db.bangFrequency, - getReferencedColumn: (t) => t.trigger, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $BangFrequencyAnnotationComposer( - $db: $db, - $table: $db.bangFrequency, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return f(composer); - } - - Expression bangHistoryRefs( - Expression Function($BangHistoryAnnotationComposer a) f, - ) { - final $BangHistoryAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.trigger, - referencedTable: $db.bangHistory, - getReferencedColumn: (t) => t.trigger, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $BangHistoryAnnotationComposer( - $db: $db, - $table: $db.bangHistory, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return f(composer); - } -} - -class $BangTableTableManager - extends - RootTableManager< - _$BangDatabase, - BangTable, - Bang, - $BangTableFilterComposer, - $BangTableOrderingComposer, - $BangTableAnnotationComposer, - $BangTableCreateCompanionBuilder, - $BangTableUpdateCompanionBuilder, - (Bang, $BangTableReferences), - Bang, - PrefetchHooks Function({bool bangFrequencyRefs, bool bangHistoryRefs}) - > { - $BangTableTableManager(_$BangDatabase db, BangTable table) - : super( - TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - $BangTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $BangTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $BangTableAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - Value trigger = const Value.absent(), - Value group = const Value.absent(), - Value websiteName = const Value.absent(), - Value domain = const Value.absent(), - Value urlTemplate = const Value.absent(), - Value category = const Value.absent(), - Value subCategory = const Value.absent(), - Value?> format = const Value.absent(), - Value rowid = const Value.absent(), - }) => BangCompanion( - trigger: trigger, - group: group, - websiteName: websiteName, - domain: domain, - urlTemplate: urlTemplate, - category: category, - subCategory: subCategory, - format: format, - rowid: rowid, - ), - createCompanionCallback: - ({ - required String trigger, - required BangGroup group, - required String websiteName, - required String domain, - required String urlTemplate, - Value category = const Value.absent(), - Value subCategory = const Value.absent(), - Value?> format = const Value.absent(), - Value rowid = const Value.absent(), - }) => BangCompanion.insert( - trigger: trigger, - group: group, - websiteName: websiteName, - domain: domain, - urlTemplate: urlTemplate, - category: category, - subCategory: subCategory, - format: format, - rowid: rowid, - ), - withReferenceMapper: (p0) => p0 - .map( - (e) => (e.readTable(table), $BangTableReferences(db, table, e)), - ) - .toList(), - prefetchHooksCallback: - ({bangFrequencyRefs = false, bangHistoryRefs = false}) { - return PrefetchHooks( - db: db, - explicitlyWatchedTables: [ - if (bangFrequencyRefs) db.bangFrequency, - if (bangHistoryRefs) db.bangHistory, - ], - addJoins: null, - getPrefetchedDataCallback: (items) async { - return [ - if (bangFrequencyRefs) - await $_getPrefetchedData< - Bang, - BangTable, - BangFrequencyData - >( - currentTable: table, - referencedTable: $BangTableReferences - ._bangFrequencyRefsTable(db), - managerFromTypedResult: (p0) => $BangTableReferences( - db, - table, - p0, - ).bangFrequencyRefs, - referencedItemsForCurrentItem: - (item, referencedItems) => referencedItems.where( - (e) => e.trigger == item.trigger, - ), - typedResults: items, - ), - if (bangHistoryRefs) - await $_getPrefetchedData< - Bang, - BangTable, - BangHistoryData - >( - currentTable: table, - referencedTable: $BangTableReferences - ._bangHistoryRefsTable(db), - managerFromTypedResult: (p0) => $BangTableReferences( - db, - table, - p0, - ).bangHistoryRefs, - referencedItemsForCurrentItem: - (item, referencedItems) => referencedItems.where( - (e) => e.trigger == item.trigger, - ), - typedResults: items, - ), - ]; - }, - ); - }, - ), - ); -} - -typedef $BangTableProcessedTableManager = - ProcessedTableManager< - _$BangDatabase, - BangTable, - Bang, - $BangTableFilterComposer, - $BangTableOrderingComposer, - $BangTableAnnotationComposer, - $BangTableCreateCompanionBuilder, - $BangTableUpdateCompanionBuilder, - (Bang, $BangTableReferences), - Bang, - PrefetchHooks Function({bool bangFrequencyRefs, bool bangHistoryRefs}) - >; -typedef $BangSyncCreateCompanionBuilder = - BangSyncCompanion Function({ - Value group, - required DateTime lastSync, - }); -typedef $BangSyncUpdateCompanionBuilder = - BangSyncCompanion Function({ - Value group, - Value lastSync, - }); - -class $BangSyncFilterComposer extends Composer<_$BangDatabase, BangSync> { - $BangSyncFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnWithTypeConverterFilters get group => - $composableBuilder( - column: $table.group, - builder: (column) => ColumnWithTypeConverterFilters(column), - ); - - ColumnFilters get lastSync => $composableBuilder( - column: $table.lastSync, - builder: (column) => ColumnFilters(column), - ); -} - -class $BangSyncOrderingComposer extends Composer<_$BangDatabase, BangSync> { - $BangSyncOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnOrderings get group => $composableBuilder( - column: $table.group, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get lastSync => $composableBuilder( - column: $table.lastSync, - builder: (column) => ColumnOrderings(column), - ); -} - -class $BangSyncAnnotationComposer extends Composer<_$BangDatabase, BangSync> { - $BangSyncAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - GeneratedColumnWithTypeConverter get group => - $composableBuilder(column: $table.group, builder: (column) => column); - - GeneratedColumn get lastSync => - $composableBuilder(column: $table.lastSync, builder: (column) => column); -} - -class $BangSyncTableManager - extends - RootTableManager< - _$BangDatabase, - BangSync, - BangSyncData, - $BangSyncFilterComposer, - $BangSyncOrderingComposer, - $BangSyncAnnotationComposer, - $BangSyncCreateCompanionBuilder, - $BangSyncUpdateCompanionBuilder, - ( - BangSyncData, - BaseReferences<_$BangDatabase, BangSync, BangSyncData>, - ), - BangSyncData, - PrefetchHooks Function() - > { - $BangSyncTableManager(_$BangDatabase db, BangSync table) - : super( - TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - $BangSyncFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $BangSyncOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $BangSyncAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - Value group = const Value.absent(), - Value lastSync = const Value.absent(), - }) => BangSyncCompanion(group: group, lastSync: lastSync), - createCompanionCallback: - ({ - Value group = const Value.absent(), - required DateTime lastSync, - }) => BangSyncCompanion.insert(group: group, lastSync: lastSync), - withReferenceMapper: (p0) => p0 - .map((e) => (e.readTable(table), BaseReferences(db, table, e))) - .toList(), - prefetchHooksCallback: null, - ), - ); -} - -typedef $BangSyncProcessedTableManager = - ProcessedTableManager< - _$BangDatabase, - BangSync, - BangSyncData, - $BangSyncFilterComposer, - $BangSyncOrderingComposer, - $BangSyncAnnotationComposer, - $BangSyncCreateCompanionBuilder, - $BangSyncUpdateCompanionBuilder, - (BangSyncData, BaseReferences<_$BangDatabase, BangSync, BangSyncData>), - BangSyncData, - PrefetchHooks Function() - >; -typedef $BangFrequencyCreateCompanionBuilder = - BangFrequencyCompanion Function({ - required String trigger, - required int frequency, - required DateTime lastUsed, - Value rowid, - }); -typedef $BangFrequencyUpdateCompanionBuilder = - BangFrequencyCompanion Function({ - Value trigger, - Value frequency, - Value lastUsed, - Value rowid, - }); - -final class $BangFrequencyReferences - extends BaseReferences<_$BangDatabase, BangFrequency, BangFrequencyData> { - $BangFrequencyReferences(super.$_db, super.$_table, super.$_typedResult); - - static BangTable _triggerTable(_$BangDatabase db) => db.bang.createAlias( - $_aliasNameGenerator(db.bangFrequency.trigger, db.bang.trigger), - ); - - $BangTableProcessedTableManager get trigger { - final $_column = $_itemColumn('trigger')!; - - final manager = $BangTableTableManager( - $_db, - $_db.bang, - ).filter((f) => f.trigger.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_triggerTable($_db)); - if (item == null) return manager; - return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } -} - -class $BangFrequencyFilterComposer - extends Composer<_$BangDatabase, BangFrequency> { - $BangFrequencyFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnFilters get frequency => $composableBuilder( - column: $table.frequency, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get lastUsed => $composableBuilder( - column: $table.lastUsed, - builder: (column) => ColumnFilters(column), - ); - - $BangTableFilterComposer get trigger { - final $BangTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.trigger, - referencedTable: $db.bang, - getReferencedColumn: (t) => t.trigger, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $BangTableFilterComposer( - $db: $db, - $table: $db.bang, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $BangFrequencyOrderingComposer - extends Composer<_$BangDatabase, BangFrequency> { - $BangFrequencyOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnOrderings get frequency => $composableBuilder( - column: $table.frequency, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get lastUsed => $composableBuilder( - column: $table.lastUsed, - builder: (column) => ColumnOrderings(column), - ); - - $BangTableOrderingComposer get trigger { - final $BangTableOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.trigger, - referencedTable: $db.bang, - getReferencedColumn: (t) => t.trigger, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $BangTableOrderingComposer( - $db: $db, - $table: $db.bang, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $BangFrequencyAnnotationComposer - extends Composer<_$BangDatabase, BangFrequency> { - $BangFrequencyAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - GeneratedColumn get frequency => - $composableBuilder(column: $table.frequency, builder: (column) => column); - - GeneratedColumn get lastUsed => - $composableBuilder(column: $table.lastUsed, builder: (column) => column); - - $BangTableAnnotationComposer get trigger { - final $BangTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.trigger, - referencedTable: $db.bang, - getReferencedColumn: (t) => t.trigger, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $BangTableAnnotationComposer( - $db: $db, - $table: $db.bang, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $BangFrequencyTableManager - extends - RootTableManager< - _$BangDatabase, - BangFrequency, - BangFrequencyData, - $BangFrequencyFilterComposer, - $BangFrequencyOrderingComposer, - $BangFrequencyAnnotationComposer, - $BangFrequencyCreateCompanionBuilder, - $BangFrequencyUpdateCompanionBuilder, - (BangFrequencyData, $BangFrequencyReferences), - BangFrequencyData, - PrefetchHooks Function({bool trigger}) - > { - $BangFrequencyTableManager(_$BangDatabase db, BangFrequency table) - : super( - TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - $BangFrequencyFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $BangFrequencyOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $BangFrequencyAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - Value trigger = const Value.absent(), - Value frequency = const Value.absent(), - Value lastUsed = const Value.absent(), - Value rowid = const Value.absent(), - }) => BangFrequencyCompanion( - trigger: trigger, - frequency: frequency, - lastUsed: lastUsed, - rowid: rowid, - ), - createCompanionCallback: - ({ - required String trigger, - required int frequency, - required DateTime lastUsed, - Value rowid = const Value.absent(), - }) => BangFrequencyCompanion.insert( - trigger: trigger, - frequency: frequency, - lastUsed: lastUsed, - rowid: rowid, - ), - withReferenceMapper: (p0) => p0 - .map( - (e) => ( - e.readTable(table), - $BangFrequencyReferences(db, table, e), - ), - ) - .toList(), - prefetchHooksCallback: ({trigger = false}) { - return PrefetchHooks( - db: db, - explicitlyWatchedTables: [], - addJoins: - < - T extends TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic - > - >(state) { - if (trigger) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.trigger, - referencedTable: $BangFrequencyReferences - ._triggerTable(db), - referencedColumn: $BangFrequencyReferences - ._triggerTable(db) - .trigger, - ) - as T; - } - - return state; - }, - getPrefetchedDataCallback: (items) async { - return []; - }, - ); - }, - ), - ); -} - -typedef $BangFrequencyProcessedTableManager = - ProcessedTableManager< - _$BangDatabase, - BangFrequency, - BangFrequencyData, - $BangFrequencyFilterComposer, - $BangFrequencyOrderingComposer, - $BangFrequencyAnnotationComposer, - $BangFrequencyCreateCompanionBuilder, - $BangFrequencyUpdateCompanionBuilder, - (BangFrequencyData, $BangFrequencyReferences), - BangFrequencyData, - PrefetchHooks Function({bool trigger}) - >; -typedef $BangHistoryCreateCompanionBuilder = - BangHistoryCompanion Function({ - required String searchQuery, - required String trigger, - required DateTime searchDate, - Value rowid, - }); -typedef $BangHistoryUpdateCompanionBuilder = - BangHistoryCompanion Function({ - Value searchQuery, - Value trigger, - Value searchDate, - Value rowid, - }); - -final class $BangHistoryReferences - extends BaseReferences<_$BangDatabase, BangHistory, BangHistoryData> { - $BangHistoryReferences(super.$_db, super.$_table, super.$_typedResult); - - static BangTable _triggerTable(_$BangDatabase db) => db.bang.createAlias( - $_aliasNameGenerator(db.bangHistory.trigger, db.bang.trigger), - ); - - $BangTableProcessedTableManager get trigger { - final $_column = $_itemColumn('trigger')!; - - final manager = $BangTableTableManager( - $_db, - $_db.bang, - ).filter((f) => f.trigger.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_triggerTable($_db)); - if (item == null) return manager; - return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } -} - -class $BangHistoryFilterComposer extends Composer<_$BangDatabase, BangHistory> { - $BangHistoryFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnFilters get searchQuery => $composableBuilder( - column: $table.searchQuery, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get searchDate => $composableBuilder( - column: $table.searchDate, - builder: (column) => ColumnFilters(column), - ); - - $BangTableFilterComposer get trigger { - final $BangTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.trigger, - referencedTable: $db.bang, - getReferencedColumn: (t) => t.trigger, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $BangTableFilterComposer( - $db: $db, - $table: $db.bang, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $BangHistoryOrderingComposer - extends Composer<_$BangDatabase, BangHistory> { - $BangHistoryOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnOrderings get searchQuery => $composableBuilder( - column: $table.searchQuery, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get searchDate => $composableBuilder( - column: $table.searchDate, - builder: (column) => ColumnOrderings(column), - ); - - $BangTableOrderingComposer get trigger { - final $BangTableOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.trigger, - referencedTable: $db.bang, - getReferencedColumn: (t) => t.trigger, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $BangTableOrderingComposer( - $db: $db, - $table: $db.bang, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $BangHistoryAnnotationComposer - extends Composer<_$BangDatabase, BangHistory> { - $BangHistoryAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - GeneratedColumn get searchQuery => $composableBuilder( - column: $table.searchQuery, - builder: (column) => column, - ); - - GeneratedColumn get searchDate => $composableBuilder( - column: $table.searchDate, - builder: (column) => column, - ); - - $BangTableAnnotationComposer get trigger { - final $BangTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.trigger, - referencedTable: $db.bang, - getReferencedColumn: (t) => t.trigger, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $BangTableAnnotationComposer( - $db: $db, - $table: $db.bang, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $BangHistoryTableManager - extends - RootTableManager< - _$BangDatabase, - BangHistory, - BangHistoryData, - $BangHistoryFilterComposer, - $BangHistoryOrderingComposer, - $BangHistoryAnnotationComposer, - $BangHistoryCreateCompanionBuilder, - $BangHistoryUpdateCompanionBuilder, - (BangHistoryData, $BangHistoryReferences), - BangHistoryData, - PrefetchHooks Function({bool trigger}) - > { - $BangHistoryTableManager(_$BangDatabase db, BangHistory table) - : super( - TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - $BangHistoryFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $BangHistoryOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $BangHistoryAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - Value searchQuery = const Value.absent(), - Value trigger = const Value.absent(), - Value searchDate = const Value.absent(), - Value rowid = const Value.absent(), - }) => BangHistoryCompanion( - searchQuery: searchQuery, - trigger: trigger, - searchDate: searchDate, - rowid: rowid, - ), - createCompanionCallback: - ({ - required String searchQuery, - required String trigger, - required DateTime searchDate, - Value rowid = const Value.absent(), - }) => BangHistoryCompanion.insert( - searchQuery: searchQuery, - trigger: trigger, - searchDate: searchDate, - rowid: rowid, - ), - withReferenceMapper: (p0) => p0 - .map( - (e) => - (e.readTable(table), $BangHistoryReferences(db, table, e)), - ) - .toList(), - prefetchHooksCallback: ({trigger = false}) { - return PrefetchHooks( - db: db, - explicitlyWatchedTables: [], - addJoins: - < - T extends TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic - > - >(state) { - if (trigger) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.trigger, - referencedTable: $BangHistoryReferences - ._triggerTable(db), - referencedColumn: $BangHistoryReferences - ._triggerTable(db) - .trigger, - ) - as T; - } - - return state; - }, - getPrefetchedDataCallback: (items) async { - return []; - }, - ); - }, - ), - ); -} - -typedef $BangHistoryProcessedTableManager = - ProcessedTableManager< - _$BangDatabase, - BangHistory, - BangHistoryData, - $BangHistoryFilterComposer, - $BangHistoryOrderingComposer, - $BangHistoryAnnotationComposer, - $BangHistoryCreateCompanionBuilder, - $BangHistoryUpdateCompanionBuilder, - (BangHistoryData, $BangHistoryReferences), - BangHistoryData, - PrefetchHooks Function({bool trigger}) - >; -typedef $BangFtsCreateCompanionBuilder = - BangFtsCompanion Function({ - required String trigger, - required String websiteName, - Value rowid, - }); -typedef $BangFtsUpdateCompanionBuilder = - BangFtsCompanion Function({ - Value trigger, - Value websiteName, - Value rowid, - }); - -class $BangFtsFilterComposer extends Composer<_$BangDatabase, BangFts> { - $BangFtsFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnFilters get trigger => $composableBuilder( - column: $table.trigger, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get websiteName => $composableBuilder( - column: $table.websiteName, - builder: (column) => ColumnFilters(column), - ); -} - -class $BangFtsOrderingComposer extends Composer<_$BangDatabase, BangFts> { - $BangFtsOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnOrderings get trigger => $composableBuilder( - column: $table.trigger, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get websiteName => $composableBuilder( - column: $table.websiteName, - builder: (column) => ColumnOrderings(column), - ); -} - -class $BangFtsAnnotationComposer extends Composer<_$BangDatabase, BangFts> { - $BangFtsAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - GeneratedColumn get trigger => - $composableBuilder(column: $table.trigger, builder: (column) => column); - - GeneratedColumn get websiteName => $composableBuilder( - column: $table.websiteName, - builder: (column) => column, - ); -} - -class $BangFtsTableManager - extends - RootTableManager< - _$BangDatabase, - BangFts, - BangFt, - $BangFtsFilterComposer, - $BangFtsOrderingComposer, - $BangFtsAnnotationComposer, - $BangFtsCreateCompanionBuilder, - $BangFtsUpdateCompanionBuilder, - (BangFt, BaseReferences<_$BangDatabase, BangFts, BangFt>), - BangFt, - PrefetchHooks Function() - > { - $BangFtsTableManager(_$BangDatabase db, BangFts table) - : super( - TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - $BangFtsFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $BangFtsOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $BangFtsAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - Value trigger = const Value.absent(), - Value websiteName = const Value.absent(), - Value rowid = const Value.absent(), - }) => BangFtsCompanion( - trigger: trigger, - websiteName: websiteName, - rowid: rowid, - ), - createCompanionCallback: - ({ - required String trigger, - required String websiteName, - Value rowid = const Value.absent(), - }) => BangFtsCompanion.insert( - trigger: trigger, - websiteName: websiteName, - rowid: rowid, - ), - withReferenceMapper: (p0) => p0 - .map((e) => (e.readTable(table), BaseReferences(db, table, e))) - .toList(), - prefetchHooksCallback: null, - ), - ); -} - -typedef $BangFtsProcessedTableManager = - ProcessedTableManager< - _$BangDatabase, - BangFts, - BangFt, - $BangFtsFilterComposer, - $BangFtsOrderingComposer, - $BangFtsAnnotationComposer, - $BangFtsCreateCompanionBuilder, - $BangFtsUpdateCompanionBuilder, - (BangFt, BaseReferences<_$BangDatabase, BangFts, BangFt>), - BangFt, - PrefetchHooks Function() - >; - -class $BangDatabaseManager { - final _$BangDatabase _db; - $BangDatabaseManager(this._db); - $BangTableTableManager get bang => $BangTableTableManager(_db, _db.bang); - $BangSyncTableManager get bangSync => - $BangSyncTableManager(_db, _db.bangSync); - $BangFrequencyTableManager get bangFrequency => - $BangFrequencyTableManager(_db, _db.bangFrequency); - $BangHistoryTableManager get bangHistory => - $BangHistoryTableManager(_db, _db.bangHistory); - $BangFtsTableManager get bangFts => $BangFtsTableManager(_db, _db.bangFts); -} diff --git a/app/lib/features/bangs/data/database/database.drift b/app/lib/features/bangs/data/database/definitions.drift similarity index 100% rename from app/lib/features/bangs/data/database/database.drift rename to app/lib/features/bangs/data/database/definitions.drift diff --git a/app/lib/features/bangs/data/database/definitions.drift.dart b/app/lib/features/bangs/data/database/definitions.drift.dart new file mode 100644 index 00000000..d0388ea3 --- /dev/null +++ b/app/lib/features/bangs/data/database/definitions.drift.dart @@ -0,0 +1,2803 @@ +// dart format width=80 +// ignore_for_file: type=lint +import 'package:drift/drift.dart' as i0; +import 'package:weblibre/features/bangs/data/models/bang.dart' as i1; +import 'package:weblibre/features/bangs/data/models/bang_group.dart' as i2; +import 'package:weblibre/features/bangs/data/database/definitions.drift.dart' + as i3; +import 'package:weblibre/features/bangs/data/database/drift/converters/bang_format.dart' + as i4; +import 'package:weblibre/features/bangs/data/models/bang_data.dart' as i5; +import 'package:drift/internal/modular.dart' as i6; +import 'package:weblibre/features/bangs/data/models/search_history_entry.dart' + as i7; + +typedef $BangTableCreateCompanionBuilder = + i3.BangCompanion Function({ + required String trigger, + required i2.BangGroup group, + required String websiteName, + required String domain, + required String urlTemplate, + i0.Value category, + i0.Value subCategory, + i0.Value?> format, + i0.Value rowid, + }); +typedef $BangTableUpdateCompanionBuilder = + i3.BangCompanion Function({ + i0.Value trigger, + i0.Value group, + i0.Value websiteName, + i0.Value domain, + i0.Value urlTemplate, + i0.Value category, + i0.Value subCategory, + i0.Value?> format, + i0.Value rowid, + }); + +final class $BangTableReferences + extends i0.BaseReferences { + $BangTableReferences(super.$_db, super.$_table, super.$_typedResult); + + static i0.MultiTypedResultKey> + _bangFrequencyRefsTable(i0.GeneratedDatabase db) => + i0.MultiTypedResultKey.fromTable( + i6.ReadDatabaseContainer( + db, + ).resultSet('bang_frequency'), + aliasName: i0.$_aliasNameGenerator( + i6.ReadDatabaseContainer(db).resultSet('bang').trigger, + i6.ReadDatabaseContainer( + db, + ).resultSet('bang_frequency').trigger, + ), + ); + + i3.$BangFrequencyProcessedTableManager get bangFrequencyRefs { + final manager = i3 + .$BangFrequencyTableManager( + $_db, + i6.ReadDatabaseContainer( + $_db, + ).resultSet('bang_frequency'), + ) + .filter( + (f) => f.trigger.trigger.sqlEquals($_itemColumn('trigger')!), + ); + + final cache = $_typedResult.readTableOrNull(_bangFrequencyRefsTable($_db)); + return i0.ProcessedTableManager( + manager.$state.copyWith(prefetchedData: cache), + ); + } + + static i0.MultiTypedResultKey> + _bangHistoryRefsTable(i0.GeneratedDatabase db) => + i0.MultiTypedResultKey.fromTable( + i6.ReadDatabaseContainer(db).resultSet('bang_history'), + aliasName: i0.$_aliasNameGenerator( + i6.ReadDatabaseContainer(db).resultSet('bang').trigger, + i6.ReadDatabaseContainer( + db, + ).resultSet('bang_history').trigger, + ), + ); + + i3.$BangHistoryProcessedTableManager get bangHistoryRefs { + final manager = i3 + .$BangHistoryTableManager( + $_db, + i6.ReadDatabaseContainer( + $_db, + ).resultSet('bang_history'), + ) + .filter( + (f) => f.trigger.trigger.sqlEquals($_itemColumn('trigger')!), + ); + + final cache = $_typedResult.readTableOrNull(_bangHistoryRefsTable($_db)); + return i0.ProcessedTableManager( + manager.$state.copyWith(prefetchedData: cache), + ); + } +} + +class $BangTableFilterComposer + extends i0.Composer { + $BangTableFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.ColumnFilters get trigger => $composableBuilder( + column: $table.trigger, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnWithTypeConverterFilters + get group => $composableBuilder( + column: $table.group, + builder: (column) => i0.ColumnWithTypeConverterFilters(column), + ); + + i0.ColumnFilters get websiteName => $composableBuilder( + column: $table.websiteName, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get domain => $composableBuilder( + column: $table.domain, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get urlTemplate => $composableBuilder( + column: $table.urlTemplate, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get category => $composableBuilder( + column: $table.category, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get subCategory => $composableBuilder( + column: $table.subCategory, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnWithTypeConverterFilters< + Set?, + Set, + String + > + get format => $composableBuilder( + column: $table.format, + builder: (column) => i0.ColumnWithTypeConverterFilters(column), + ); + + i0.Expression bangFrequencyRefs( + i0.Expression Function(i3.$BangFrequencyFilterComposer f) f, + ) { + final i3.$BangFrequencyFilterComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.trigger, + referencedTable: i6.ReadDatabaseContainer( + $db, + ).resultSet('bang_frequency'), + getReferencedColumn: (t) => t.trigger, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => i3.$BangFrequencyFilterComposer( + $db: $db, + $table: i6.ReadDatabaseContainer( + $db, + ).resultSet('bang_frequency'), + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); + return f(composer); + } + + i0.Expression bangHistoryRefs( + i0.Expression Function(i3.$BangHistoryFilterComposer f) f, + ) { + final i3.$BangHistoryFilterComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.trigger, + referencedTable: i6.ReadDatabaseContainer( + $db, + ).resultSet('bang_history'), + getReferencedColumn: (t) => t.trigger, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => i3.$BangHistoryFilterComposer( + $db: $db, + $table: i6.ReadDatabaseContainer( + $db, + ).resultSet('bang_history'), + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); + return f(composer); + } +} + +class $BangTableOrderingComposer + extends i0.Composer { + $BangTableOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.ColumnOrderings get trigger => $composableBuilder( + column: $table.trigger, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get group => $composableBuilder( + column: $table.group, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get websiteName => $composableBuilder( + column: $table.websiteName, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get domain => $composableBuilder( + column: $table.domain, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get urlTemplate => $composableBuilder( + column: $table.urlTemplate, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get category => $composableBuilder( + column: $table.category, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get subCategory => $composableBuilder( + column: $table.subCategory, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get format => $composableBuilder( + column: $table.format, + builder: (column) => i0.ColumnOrderings(column), + ); +} + +class $BangTableAnnotationComposer + extends i0.Composer { + $BangTableAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.GeneratedColumn get trigger => + $composableBuilder(column: $table.trigger, builder: (column) => column); + + i0.GeneratedColumnWithTypeConverter get group => + $composableBuilder(column: $table.group, builder: (column) => column); + + i0.GeneratedColumn get websiteName => $composableBuilder( + column: $table.websiteName, + builder: (column) => column, + ); + + i0.GeneratedColumn get domain => + $composableBuilder(column: $table.domain, builder: (column) => column); + + i0.GeneratedColumn get urlTemplate => $composableBuilder( + column: $table.urlTemplate, + builder: (column) => column, + ); + + i0.GeneratedColumn get category => + $composableBuilder(column: $table.category, builder: (column) => column); + + i0.GeneratedColumn get subCategory => $composableBuilder( + column: $table.subCategory, + builder: (column) => column, + ); + + i0.GeneratedColumnWithTypeConverter?, String> get format => + $composableBuilder(column: $table.format, builder: (column) => column); + + i0.Expression bangFrequencyRefs( + i0.Expression Function(i3.$BangFrequencyAnnotationComposer a) f, + ) { + final i3.$BangFrequencyAnnotationComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.trigger, + referencedTable: i6.ReadDatabaseContainer( + $db, + ).resultSet('bang_frequency'), + getReferencedColumn: (t) => t.trigger, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => i3.$BangFrequencyAnnotationComposer( + $db: $db, + $table: i6.ReadDatabaseContainer( + $db, + ).resultSet('bang_frequency'), + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); + return f(composer); + } + + i0.Expression bangHistoryRefs( + i0.Expression Function(i3.$BangHistoryAnnotationComposer a) f, + ) { + final i3.$BangHistoryAnnotationComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.trigger, + referencedTable: i6.ReadDatabaseContainer( + $db, + ).resultSet('bang_history'), + getReferencedColumn: (t) => t.trigger, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => i3.$BangHistoryAnnotationComposer( + $db: $db, + $table: i6.ReadDatabaseContainer( + $db, + ).resultSet('bang_history'), + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); + return f(composer); + } +} + +class $BangTableTableManager + extends + i0.RootTableManager< + i0.GeneratedDatabase, + i3.BangTable, + i1.Bang, + i3.$BangTableFilterComposer, + i3.$BangTableOrderingComposer, + i3.$BangTableAnnotationComposer, + $BangTableCreateCompanionBuilder, + $BangTableUpdateCompanionBuilder, + (i1.Bang, i3.$BangTableReferences), + i1.Bang, + i0.PrefetchHooks Function({ + bool bangFrequencyRefs, + bool bangHistoryRefs, + }) + > { + $BangTableTableManager(i0.GeneratedDatabase db, i3.BangTable table) + : super( + i0.TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + i3.$BangTableFilterComposer($db: db, $table: table), + createOrderingComposer: () => + i3.$BangTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + i3.$BangTableAnnotationComposer($db: db, $table: table), + updateCompanionCallback: + ({ + i0.Value trigger = const i0.Value.absent(), + i0.Value group = const i0.Value.absent(), + i0.Value websiteName = const i0.Value.absent(), + i0.Value domain = const i0.Value.absent(), + i0.Value urlTemplate = const i0.Value.absent(), + i0.Value category = const i0.Value.absent(), + i0.Value subCategory = const i0.Value.absent(), + i0.Value?> format = const i0.Value.absent(), + i0.Value rowid = const i0.Value.absent(), + }) => i3.BangCompanion( + trigger: trigger, + group: group, + websiteName: websiteName, + domain: domain, + urlTemplate: urlTemplate, + category: category, + subCategory: subCategory, + format: format, + rowid: rowid, + ), + createCompanionCallback: + ({ + required String trigger, + required i2.BangGroup group, + required String websiteName, + required String domain, + required String urlTemplate, + i0.Value category = const i0.Value.absent(), + i0.Value subCategory = const i0.Value.absent(), + i0.Value?> format = const i0.Value.absent(), + i0.Value rowid = const i0.Value.absent(), + }) => i3.BangCompanion.insert( + trigger: trigger, + group: group, + websiteName: websiteName, + domain: domain, + urlTemplate: urlTemplate, + category: category, + subCategory: subCategory, + format: format, + rowid: rowid, + ), + withReferenceMapper: (p0) => p0 + .map( + (e) => + (e.readTable(table), i3.$BangTableReferences(db, table, e)), + ) + .toList(), + prefetchHooksCallback: + ({bangFrequencyRefs = false, bangHistoryRefs = false}) { + return i0.PrefetchHooks( + db: db, + explicitlyWatchedTables: [ + if (bangFrequencyRefs) + i6.ReadDatabaseContainer( + db, + ).resultSet('bang_frequency'), + if (bangHistoryRefs) + i6.ReadDatabaseContainer( + db, + ).resultSet('bang_history'), + ], + addJoins: null, + getPrefetchedDataCallback: (items) async { + return [ + if (bangFrequencyRefs) + await i0.$_getPrefetchedData< + i1.Bang, + i3.BangTable, + i3.BangFrequencyData + >( + currentTable: table, + referencedTable: i3.$BangTableReferences + ._bangFrequencyRefsTable(db), + managerFromTypedResult: (p0) => i3 + .$BangTableReferences(db, table, p0) + .bangFrequencyRefs, + referencedItemsForCurrentItem: + (item, referencedItems) => referencedItems.where( + (e) => e.trigger == item.trigger, + ), + typedResults: items, + ), + if (bangHistoryRefs) + await i0.$_getPrefetchedData< + i1.Bang, + i3.BangTable, + i3.BangHistoryData + >( + currentTable: table, + referencedTable: i3.$BangTableReferences + ._bangHistoryRefsTable(db), + managerFromTypedResult: (p0) => i3 + .$BangTableReferences(db, table, p0) + .bangHistoryRefs, + referencedItemsForCurrentItem: + (item, referencedItems) => referencedItems.where( + (e) => e.trigger == item.trigger, + ), + typedResults: items, + ), + ]; + }, + ); + }, + ), + ); +} + +typedef $BangTableProcessedTableManager = + i0.ProcessedTableManager< + i0.GeneratedDatabase, + i3.BangTable, + i1.Bang, + i3.$BangTableFilterComposer, + i3.$BangTableOrderingComposer, + i3.$BangTableAnnotationComposer, + $BangTableCreateCompanionBuilder, + $BangTableUpdateCompanionBuilder, + (i1.Bang, i3.$BangTableReferences), + i1.Bang, + i0.PrefetchHooks Function({bool bangFrequencyRefs, bool bangHistoryRefs}) + >; +typedef $BangSyncCreateCompanionBuilder = + i3.BangSyncCompanion Function({ + i0.Value group, + required DateTime lastSync, + }); +typedef $BangSyncUpdateCompanionBuilder = + i3.BangSyncCompanion Function({ + i0.Value group, + i0.Value lastSync, + }); + +class $BangSyncFilterComposer + extends i0.Composer { + $BangSyncFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.ColumnWithTypeConverterFilters + get group => $composableBuilder( + column: $table.group, + builder: (column) => i0.ColumnWithTypeConverterFilters(column), + ); + + i0.ColumnFilters get lastSync => $composableBuilder( + column: $table.lastSync, + builder: (column) => i0.ColumnFilters(column), + ); +} + +class $BangSyncOrderingComposer + extends i0.Composer { + $BangSyncOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.ColumnOrderings get group => $composableBuilder( + column: $table.group, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get lastSync => $composableBuilder( + column: $table.lastSync, + builder: (column) => i0.ColumnOrderings(column), + ); +} + +class $BangSyncAnnotationComposer + extends i0.Composer { + $BangSyncAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.GeneratedColumnWithTypeConverter get group => + $composableBuilder(column: $table.group, builder: (column) => column); + + i0.GeneratedColumn get lastSync => + $composableBuilder(column: $table.lastSync, builder: (column) => column); +} + +class $BangSyncTableManager + extends + i0.RootTableManager< + i0.GeneratedDatabase, + i3.BangSync, + i3.BangSyncData, + i3.$BangSyncFilterComposer, + i3.$BangSyncOrderingComposer, + i3.$BangSyncAnnotationComposer, + $BangSyncCreateCompanionBuilder, + $BangSyncUpdateCompanionBuilder, + ( + i3.BangSyncData, + i0.BaseReferences< + i0.GeneratedDatabase, + i3.BangSync, + i3.BangSyncData + >, + ), + i3.BangSyncData, + i0.PrefetchHooks Function() + > { + $BangSyncTableManager(i0.GeneratedDatabase db, i3.BangSync table) + : super( + i0.TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + i3.$BangSyncFilterComposer($db: db, $table: table), + createOrderingComposer: () => + i3.$BangSyncOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + i3.$BangSyncAnnotationComposer($db: db, $table: table), + updateCompanionCallback: + ({ + i0.Value group = const i0.Value.absent(), + i0.Value lastSync = const i0.Value.absent(), + }) => i3.BangSyncCompanion(group: group, lastSync: lastSync), + createCompanionCallback: + ({ + i0.Value group = const i0.Value.absent(), + required DateTime lastSync, + }) => + i3.BangSyncCompanion.insert(group: group, lastSync: lastSync), + withReferenceMapper: (p0) => p0 + .map((e) => (e.readTable(table), i0.BaseReferences(db, table, e))) + .toList(), + prefetchHooksCallback: null, + ), + ); +} + +typedef $BangSyncProcessedTableManager = + i0.ProcessedTableManager< + i0.GeneratedDatabase, + i3.BangSync, + i3.BangSyncData, + i3.$BangSyncFilterComposer, + i3.$BangSyncOrderingComposer, + i3.$BangSyncAnnotationComposer, + $BangSyncCreateCompanionBuilder, + $BangSyncUpdateCompanionBuilder, + ( + i3.BangSyncData, + i0.BaseReferences, + ), + i3.BangSyncData, + i0.PrefetchHooks Function() + >; +typedef $BangFrequencyCreateCompanionBuilder = + i3.BangFrequencyCompanion Function({ + required String trigger, + required int frequency, + required DateTime lastUsed, + i0.Value rowid, + }); +typedef $BangFrequencyUpdateCompanionBuilder = + i3.BangFrequencyCompanion Function({ + i0.Value trigger, + i0.Value frequency, + i0.Value lastUsed, + i0.Value rowid, + }); + +final class $BangFrequencyReferences + extends + i0.BaseReferences< + i0.GeneratedDatabase, + i3.BangFrequency, + i3.BangFrequencyData + > { + $BangFrequencyReferences(super.$_db, super.$_table, super.$_typedResult); + + static i3.BangTable _triggerTable(i0.GeneratedDatabase db) => + i6.ReadDatabaseContainer(db) + .resultSet('bang') + .createAlias( + i0.$_aliasNameGenerator( + i6.ReadDatabaseContainer( + db, + ).resultSet('bang_frequency').trigger, + i6.ReadDatabaseContainer( + db, + ).resultSet('bang').trigger, + ), + ); + + i3.$BangTableProcessedTableManager get trigger { + final $_column = $_itemColumn('trigger')!; + + final manager = i3 + .$BangTableTableManager( + $_db, + i6.ReadDatabaseContainer($_db).resultSet('bang'), + ) + .filter((f) => f.trigger.sqlEquals($_column)); + final item = $_typedResult.readTableOrNull(_triggerTable($_db)); + if (item == null) return manager; + return i0.ProcessedTableManager( + manager.$state.copyWith(prefetchedData: [item]), + ); + } +} + +class $BangFrequencyFilterComposer + extends i0.Composer { + $BangFrequencyFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.ColumnFilters get frequency => $composableBuilder( + column: $table.frequency, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get lastUsed => $composableBuilder( + column: $table.lastUsed, + builder: (column) => i0.ColumnFilters(column), + ); + + i3.$BangTableFilterComposer get trigger { + final i3.$BangTableFilterComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.trigger, + referencedTable: i6.ReadDatabaseContainer( + $db, + ).resultSet('bang'), + getReferencedColumn: (t) => t.trigger, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => i3.$BangTableFilterComposer( + $db: $db, + $table: i6.ReadDatabaseContainer( + $db, + ).resultSet('bang'), + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); + return composer; + } +} + +class $BangFrequencyOrderingComposer + extends i0.Composer { + $BangFrequencyOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.ColumnOrderings get frequency => $composableBuilder( + column: $table.frequency, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get lastUsed => $composableBuilder( + column: $table.lastUsed, + builder: (column) => i0.ColumnOrderings(column), + ); + + i3.$BangTableOrderingComposer get trigger { + final i3.$BangTableOrderingComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.trigger, + referencedTable: i6.ReadDatabaseContainer( + $db, + ).resultSet('bang'), + getReferencedColumn: (t) => t.trigger, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => i3.$BangTableOrderingComposer( + $db: $db, + $table: i6.ReadDatabaseContainer( + $db, + ).resultSet('bang'), + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); + return composer; + } +} + +class $BangFrequencyAnnotationComposer + extends i0.Composer { + $BangFrequencyAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.GeneratedColumn get frequency => + $composableBuilder(column: $table.frequency, builder: (column) => column); + + i0.GeneratedColumn get lastUsed => + $composableBuilder(column: $table.lastUsed, builder: (column) => column); + + i3.$BangTableAnnotationComposer get trigger { + final i3.$BangTableAnnotationComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.trigger, + referencedTable: i6.ReadDatabaseContainer( + $db, + ).resultSet('bang'), + getReferencedColumn: (t) => t.trigger, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => i3.$BangTableAnnotationComposer( + $db: $db, + $table: i6.ReadDatabaseContainer( + $db, + ).resultSet('bang'), + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); + return composer; + } +} + +class $BangFrequencyTableManager + extends + i0.RootTableManager< + i0.GeneratedDatabase, + i3.BangFrequency, + i3.BangFrequencyData, + i3.$BangFrequencyFilterComposer, + i3.$BangFrequencyOrderingComposer, + i3.$BangFrequencyAnnotationComposer, + $BangFrequencyCreateCompanionBuilder, + $BangFrequencyUpdateCompanionBuilder, + (i3.BangFrequencyData, i3.$BangFrequencyReferences), + i3.BangFrequencyData, + i0.PrefetchHooks Function({bool trigger}) + > { + $BangFrequencyTableManager(i0.GeneratedDatabase db, i3.BangFrequency table) + : super( + i0.TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + i3.$BangFrequencyFilterComposer($db: db, $table: table), + createOrderingComposer: () => + i3.$BangFrequencyOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + i3.$BangFrequencyAnnotationComposer($db: db, $table: table), + updateCompanionCallback: + ({ + i0.Value trigger = const i0.Value.absent(), + i0.Value frequency = const i0.Value.absent(), + i0.Value lastUsed = const i0.Value.absent(), + i0.Value rowid = const i0.Value.absent(), + }) => i3.BangFrequencyCompanion( + trigger: trigger, + frequency: frequency, + lastUsed: lastUsed, + rowid: rowid, + ), + createCompanionCallback: + ({ + required String trigger, + required int frequency, + required DateTime lastUsed, + i0.Value rowid = const i0.Value.absent(), + }) => i3.BangFrequencyCompanion.insert( + trigger: trigger, + frequency: frequency, + lastUsed: lastUsed, + rowid: rowid, + ), + withReferenceMapper: (p0) => p0 + .map( + (e) => ( + e.readTable(table), + i3.$BangFrequencyReferences(db, table, e), + ), + ) + .toList(), + prefetchHooksCallback: ({trigger = false}) { + return i0.PrefetchHooks( + db: db, + explicitlyWatchedTables: [], + addJoins: + < + T extends i0.TableManagerState< + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic + > + >(state) { + if (trigger) { + state = + state.withJoin( + currentTable: table, + currentColumn: table.trigger, + referencedTable: i3.$BangFrequencyReferences + ._triggerTable(db), + referencedColumn: i3.$BangFrequencyReferences + ._triggerTable(db) + .trigger, + ) + as T; + } + + return state; + }, + getPrefetchedDataCallback: (items) async { + return []; + }, + ); + }, + ), + ); +} + +typedef $BangFrequencyProcessedTableManager = + i0.ProcessedTableManager< + i0.GeneratedDatabase, + i3.BangFrequency, + i3.BangFrequencyData, + i3.$BangFrequencyFilterComposer, + i3.$BangFrequencyOrderingComposer, + i3.$BangFrequencyAnnotationComposer, + $BangFrequencyCreateCompanionBuilder, + $BangFrequencyUpdateCompanionBuilder, + (i3.BangFrequencyData, i3.$BangFrequencyReferences), + i3.BangFrequencyData, + i0.PrefetchHooks Function({bool trigger}) + >; +typedef $BangHistoryCreateCompanionBuilder = + i3.BangHistoryCompanion Function({ + required String searchQuery, + required String trigger, + required DateTime searchDate, + i0.Value rowid, + }); +typedef $BangHistoryUpdateCompanionBuilder = + i3.BangHistoryCompanion Function({ + i0.Value searchQuery, + i0.Value trigger, + i0.Value searchDate, + i0.Value rowid, + }); + +final class $BangHistoryReferences + extends + i0.BaseReferences< + i0.GeneratedDatabase, + i3.BangHistory, + i3.BangHistoryData + > { + $BangHistoryReferences(super.$_db, super.$_table, super.$_typedResult); + + static i3.BangTable _triggerTable(i0.GeneratedDatabase db) => + i6.ReadDatabaseContainer(db) + .resultSet('bang') + .createAlias( + i0.$_aliasNameGenerator( + i6.ReadDatabaseContainer( + db, + ).resultSet('bang_history').trigger, + i6.ReadDatabaseContainer( + db, + ).resultSet('bang').trigger, + ), + ); + + i3.$BangTableProcessedTableManager get trigger { + final $_column = $_itemColumn('trigger')!; + + final manager = i3 + .$BangTableTableManager( + $_db, + i6.ReadDatabaseContainer($_db).resultSet('bang'), + ) + .filter((f) => f.trigger.sqlEquals($_column)); + final item = $_typedResult.readTableOrNull(_triggerTable($_db)); + if (item == null) return manager; + return i0.ProcessedTableManager( + manager.$state.copyWith(prefetchedData: [item]), + ); + } +} + +class $BangHistoryFilterComposer + extends i0.Composer { + $BangHistoryFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.ColumnFilters get searchQuery => $composableBuilder( + column: $table.searchQuery, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get searchDate => $composableBuilder( + column: $table.searchDate, + builder: (column) => i0.ColumnFilters(column), + ); + + i3.$BangTableFilterComposer get trigger { + final i3.$BangTableFilterComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.trigger, + referencedTable: i6.ReadDatabaseContainer( + $db, + ).resultSet('bang'), + getReferencedColumn: (t) => t.trigger, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => i3.$BangTableFilterComposer( + $db: $db, + $table: i6.ReadDatabaseContainer( + $db, + ).resultSet('bang'), + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); + return composer; + } +} + +class $BangHistoryOrderingComposer + extends i0.Composer { + $BangHistoryOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.ColumnOrderings get searchQuery => $composableBuilder( + column: $table.searchQuery, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get searchDate => $composableBuilder( + column: $table.searchDate, + builder: (column) => i0.ColumnOrderings(column), + ); + + i3.$BangTableOrderingComposer get trigger { + final i3.$BangTableOrderingComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.trigger, + referencedTable: i6.ReadDatabaseContainer( + $db, + ).resultSet('bang'), + getReferencedColumn: (t) => t.trigger, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => i3.$BangTableOrderingComposer( + $db: $db, + $table: i6.ReadDatabaseContainer( + $db, + ).resultSet('bang'), + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); + return composer; + } +} + +class $BangHistoryAnnotationComposer + extends i0.Composer { + $BangHistoryAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.GeneratedColumn get searchQuery => $composableBuilder( + column: $table.searchQuery, + builder: (column) => column, + ); + + i0.GeneratedColumn get searchDate => $composableBuilder( + column: $table.searchDate, + builder: (column) => column, + ); + + i3.$BangTableAnnotationComposer get trigger { + final i3.$BangTableAnnotationComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.trigger, + referencedTable: i6.ReadDatabaseContainer( + $db, + ).resultSet('bang'), + getReferencedColumn: (t) => t.trigger, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => i3.$BangTableAnnotationComposer( + $db: $db, + $table: i6.ReadDatabaseContainer( + $db, + ).resultSet('bang'), + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); + return composer; + } +} + +class $BangHistoryTableManager + extends + i0.RootTableManager< + i0.GeneratedDatabase, + i3.BangHistory, + i3.BangHistoryData, + i3.$BangHistoryFilterComposer, + i3.$BangHistoryOrderingComposer, + i3.$BangHistoryAnnotationComposer, + $BangHistoryCreateCompanionBuilder, + $BangHistoryUpdateCompanionBuilder, + (i3.BangHistoryData, i3.$BangHistoryReferences), + i3.BangHistoryData, + i0.PrefetchHooks Function({bool trigger}) + > { + $BangHistoryTableManager(i0.GeneratedDatabase db, i3.BangHistory table) + : super( + i0.TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + i3.$BangHistoryFilterComposer($db: db, $table: table), + createOrderingComposer: () => + i3.$BangHistoryOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + i3.$BangHistoryAnnotationComposer($db: db, $table: table), + updateCompanionCallback: + ({ + i0.Value searchQuery = const i0.Value.absent(), + i0.Value trigger = const i0.Value.absent(), + i0.Value searchDate = const i0.Value.absent(), + i0.Value rowid = const i0.Value.absent(), + }) => i3.BangHistoryCompanion( + searchQuery: searchQuery, + trigger: trigger, + searchDate: searchDate, + rowid: rowid, + ), + createCompanionCallback: + ({ + required String searchQuery, + required String trigger, + required DateTime searchDate, + i0.Value rowid = const i0.Value.absent(), + }) => i3.BangHistoryCompanion.insert( + searchQuery: searchQuery, + trigger: trigger, + searchDate: searchDate, + rowid: rowid, + ), + withReferenceMapper: (p0) => p0 + .map( + (e) => ( + e.readTable(table), + i3.$BangHistoryReferences(db, table, e), + ), + ) + .toList(), + prefetchHooksCallback: ({trigger = false}) { + return i0.PrefetchHooks( + db: db, + explicitlyWatchedTables: [], + addJoins: + < + T extends i0.TableManagerState< + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic + > + >(state) { + if (trigger) { + state = + state.withJoin( + currentTable: table, + currentColumn: table.trigger, + referencedTable: i3.$BangHistoryReferences + ._triggerTable(db), + referencedColumn: i3.$BangHistoryReferences + ._triggerTable(db) + .trigger, + ) + as T; + } + + return state; + }, + getPrefetchedDataCallback: (items) async { + return []; + }, + ); + }, + ), + ); +} + +typedef $BangHistoryProcessedTableManager = + i0.ProcessedTableManager< + i0.GeneratedDatabase, + i3.BangHistory, + i3.BangHistoryData, + i3.$BangHistoryFilterComposer, + i3.$BangHistoryOrderingComposer, + i3.$BangHistoryAnnotationComposer, + $BangHistoryCreateCompanionBuilder, + $BangHistoryUpdateCompanionBuilder, + (i3.BangHistoryData, i3.$BangHistoryReferences), + i3.BangHistoryData, + i0.PrefetchHooks Function({bool trigger}) + >; +typedef $BangFtsCreateCompanionBuilder = + i3.BangFtsCompanion Function({ + required String trigger, + required String websiteName, + i0.Value rowid, + }); +typedef $BangFtsUpdateCompanionBuilder = + i3.BangFtsCompanion Function({ + i0.Value trigger, + i0.Value websiteName, + i0.Value rowid, + }); + +class $BangFtsFilterComposer + extends i0.Composer { + $BangFtsFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.ColumnFilters get trigger => $composableBuilder( + column: $table.trigger, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get websiteName => $composableBuilder( + column: $table.websiteName, + builder: (column) => i0.ColumnFilters(column), + ); +} + +class $BangFtsOrderingComposer + extends i0.Composer { + $BangFtsOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.ColumnOrderings get trigger => $composableBuilder( + column: $table.trigger, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get websiteName => $composableBuilder( + column: $table.websiteName, + builder: (column) => i0.ColumnOrderings(column), + ); +} + +class $BangFtsAnnotationComposer + extends i0.Composer { + $BangFtsAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.GeneratedColumn get trigger => + $composableBuilder(column: $table.trigger, builder: (column) => column); + + i0.GeneratedColumn get websiteName => $composableBuilder( + column: $table.websiteName, + builder: (column) => column, + ); +} + +class $BangFtsTableManager + extends + i0.RootTableManager< + i0.GeneratedDatabase, + i3.BangFts, + i3.BangFt, + i3.$BangFtsFilterComposer, + i3.$BangFtsOrderingComposer, + i3.$BangFtsAnnotationComposer, + $BangFtsCreateCompanionBuilder, + $BangFtsUpdateCompanionBuilder, + ( + i3.BangFt, + i0.BaseReferences, + ), + i3.BangFt, + i0.PrefetchHooks Function() + > { + $BangFtsTableManager(i0.GeneratedDatabase db, i3.BangFts table) + : super( + i0.TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + i3.$BangFtsFilterComposer($db: db, $table: table), + createOrderingComposer: () => + i3.$BangFtsOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + i3.$BangFtsAnnotationComposer($db: db, $table: table), + updateCompanionCallback: + ({ + i0.Value trigger = const i0.Value.absent(), + i0.Value websiteName = const i0.Value.absent(), + i0.Value rowid = const i0.Value.absent(), + }) => i3.BangFtsCompanion( + trigger: trigger, + websiteName: websiteName, + rowid: rowid, + ), + createCompanionCallback: + ({ + required String trigger, + required String websiteName, + i0.Value rowid = const i0.Value.absent(), + }) => i3.BangFtsCompanion.insert( + trigger: trigger, + websiteName: websiteName, + rowid: rowid, + ), + withReferenceMapper: (p0) => p0 + .map((e) => (e.readTable(table), i0.BaseReferences(db, table, e))) + .toList(), + prefetchHooksCallback: null, + ), + ); +} + +typedef $BangFtsProcessedTableManager = + i0.ProcessedTableManager< + i0.GeneratedDatabase, + i3.BangFts, + i3.BangFt, + i3.$BangFtsFilterComposer, + i3.$BangFtsOrderingComposer, + i3.$BangFtsAnnotationComposer, + $BangFtsCreateCompanionBuilder, + $BangFtsUpdateCompanionBuilder, + ( + i3.BangFt, + i0.BaseReferences, + ), + i3.BangFt, + i0.PrefetchHooks Function() + >; + +class BangTable extends i0.Table with i0.TableInfo { + @override + final i0.GeneratedDatabase attachedDatabase; + final String? _alias; + BangTable(this.attachedDatabase, [this._alias]); + late final i0.GeneratedColumn trigger = i0.GeneratedColumn( + 'trigger', + aliasedName, + false, + type: i0.DriftSqlType.string, + requiredDuringInsert: true, + $customConstraints: 'PRIMARY KEY NOT NULL', + ); + late final i0.GeneratedColumnWithTypeConverter group = + i0.GeneratedColumn( + 'group', + aliasedName, + false, + type: i0.DriftSqlType.int, + requiredDuringInsert: true, + $customConstraints: 'NOT NULL', + ).withConverter(i3.BangTable.$convertergroup); + late final i0.GeneratedColumn websiteName = + i0.GeneratedColumn( + 'website_name', + aliasedName, + false, + type: i0.DriftSqlType.string, + requiredDuringInsert: true, + $customConstraints: 'NOT NULL', + ); + late final i0.GeneratedColumn domain = i0.GeneratedColumn( + 'domain', + aliasedName, + false, + type: i0.DriftSqlType.string, + requiredDuringInsert: true, + $customConstraints: 'NOT NULL', + ); + late final i0.GeneratedColumn urlTemplate = + i0.GeneratedColumn( + 'url_template', + aliasedName, + false, + type: i0.DriftSqlType.string, + requiredDuringInsert: true, + $customConstraints: 'NOT NULL', + ); + late final i0.GeneratedColumn category = i0.GeneratedColumn( + 'category', + aliasedName, + true, + type: i0.DriftSqlType.string, + requiredDuringInsert: false, + $customConstraints: '', + ); + late final i0.GeneratedColumn subCategory = + i0.GeneratedColumn( + 'sub_category', + aliasedName, + true, + type: i0.DriftSqlType.string, + requiredDuringInsert: false, + $customConstraints: '', + ); + late final i0.GeneratedColumnWithTypeConverter?, String> + format = i0.GeneratedColumn( + 'format', + aliasedName, + true, + type: i0.DriftSqlType.string, + requiredDuringInsert: false, + $customConstraints: '', + ).withConverter?>(i3.BangTable.$converterformat); + @override + List get $columns => [ + trigger, + group, + websiteName, + domain, + urlTemplate, + category, + subCategory, + format, + ]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'bang'; + @override + Set get $primaryKey => {trigger}; + @override + i1.Bang map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return i1.Bang( + websiteName: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}website_name'], + )!, + domain: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}domain'], + )!, + trigger: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}trigger'], + )!, + urlTemplate: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}url_template'], + )!, + group: i3.BangTable.$convertergroup.fromSql( + attachedDatabase.typeMapping.read( + i0.DriftSqlType.int, + data['${effectivePrefix}group'], + )!, + ), + category: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}category'], + ), + subCategory: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}sub_category'], + ), + format: i3.BangTable.$converterformat.fromSql( + attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}format'], + ), + ), + ); + } + + @override + BangTable createAlias(String alias) { + return BangTable(attachedDatabase, alias); + } + + static i0.JsonTypeConverter2 $convertergroup = + const i0.EnumIndexConverter(i2.BangGroup.values); + static i0.TypeConverter?, String?> $converterformat = + const i4.BangFormatConverter(); + @override + bool get dontWriteConstraints => true; +} + +class BangCompanion extends i0.UpdateCompanion { + final i0.Value trigger; + final i0.Value group; + final i0.Value websiteName; + final i0.Value domain; + final i0.Value urlTemplate; + final i0.Value category; + final i0.Value subCategory; + final i0.Value?> format; + final i0.Value rowid; + const BangCompanion({ + this.trigger = const i0.Value.absent(), + this.group = const i0.Value.absent(), + this.websiteName = const i0.Value.absent(), + this.domain = const i0.Value.absent(), + this.urlTemplate = const i0.Value.absent(), + this.category = const i0.Value.absent(), + this.subCategory = const i0.Value.absent(), + this.format = const i0.Value.absent(), + this.rowid = const i0.Value.absent(), + }); + BangCompanion.insert({ + required String trigger, + required i2.BangGroup group, + required String websiteName, + required String domain, + required String urlTemplate, + this.category = const i0.Value.absent(), + this.subCategory = const i0.Value.absent(), + this.format = const i0.Value.absent(), + this.rowid = const i0.Value.absent(), + }) : trigger = i0.Value(trigger), + group = i0.Value(group), + websiteName = i0.Value(websiteName), + domain = i0.Value(domain), + urlTemplate = i0.Value(urlTemplate); + static i0.Insertable custom({ + i0.Expression? trigger, + i0.Expression? group, + i0.Expression? websiteName, + i0.Expression? domain, + i0.Expression? urlTemplate, + i0.Expression? category, + i0.Expression? subCategory, + i0.Expression? format, + i0.Expression? rowid, + }) { + return i0.RawValuesInsertable({ + if (trigger != null) 'trigger': trigger, + if (group != null) 'group': group, + if (websiteName != null) 'website_name': websiteName, + if (domain != null) 'domain': domain, + if (urlTemplate != null) 'url_template': urlTemplate, + if (category != null) 'category': category, + if (subCategory != null) 'sub_category': subCategory, + if (format != null) 'format': format, + if (rowid != null) 'rowid': rowid, + }); + } + + i3.BangCompanion copyWith({ + i0.Value? trigger, + i0.Value? group, + i0.Value? websiteName, + i0.Value? domain, + i0.Value? urlTemplate, + i0.Value? category, + i0.Value? subCategory, + i0.Value?>? format, + i0.Value? rowid, + }) { + return i3.BangCompanion( + trigger: trigger ?? this.trigger, + group: group ?? this.group, + websiteName: websiteName ?? this.websiteName, + domain: domain ?? this.domain, + urlTemplate: urlTemplate ?? this.urlTemplate, + category: category ?? this.category, + subCategory: subCategory ?? this.subCategory, + format: format ?? this.format, + rowid: rowid ?? this.rowid, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (trigger.present) { + map['trigger'] = i0.Variable(trigger.value); + } + if (group.present) { + map['group'] = i0.Variable( + i3.BangTable.$convertergroup.toSql(group.value), + ); + } + if (websiteName.present) { + map['website_name'] = i0.Variable(websiteName.value); + } + if (domain.present) { + map['domain'] = i0.Variable(domain.value); + } + if (urlTemplate.present) { + map['url_template'] = i0.Variable(urlTemplate.value); + } + if (category.present) { + map['category'] = i0.Variable(category.value); + } + if (subCategory.present) { + map['sub_category'] = i0.Variable(subCategory.value); + } + if (format.present) { + map['format'] = i0.Variable( + i3.BangTable.$converterformat.toSql(format.value), + ); + } + if (rowid.present) { + map['rowid'] = i0.Variable(rowid.value); + } + return map; + } + + @override + String toString() { + return (StringBuffer('BangCompanion(') + ..write('trigger: $trigger, ') + ..write('group: $group, ') + ..write('websiteName: $websiteName, ') + ..write('domain: $domain, ') + ..write('urlTemplate: $urlTemplate, ') + ..write('category: $category, ') + ..write('subCategory: $subCategory, ') + ..write('format: $format, ') + ..write('rowid: $rowid') + ..write(')')) + .toString(); + } +} + +class BangSync extends i0.Table with i0.TableInfo { + @override + final i0.GeneratedDatabase attachedDatabase; + final String? _alias; + BangSync(this.attachedDatabase, [this._alias]); + late final i0.GeneratedColumnWithTypeConverter group = + i0.GeneratedColumn( + 'group', + aliasedName, + false, + type: i0.DriftSqlType.int, + requiredDuringInsert: false, + $customConstraints: 'PRIMARY KEY NOT NULL', + ).withConverter(i3.BangSync.$convertergroup); + late final i0.GeneratedColumn lastSync = + i0.GeneratedColumn( + 'last_sync', + aliasedName, + false, + type: i0.DriftSqlType.dateTime, + requiredDuringInsert: true, + $customConstraints: 'NOT NULL', + ); + @override + List get $columns => [group, lastSync]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'bang_sync'; + @override + Set get $primaryKey => {group}; + @override + i3.BangSyncData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return i3.BangSyncData( + group: i3.BangSync.$convertergroup.fromSql( + attachedDatabase.typeMapping.read( + i0.DriftSqlType.int, + data['${effectivePrefix}group'], + )!, + ), + lastSync: attachedDatabase.typeMapping.read( + i0.DriftSqlType.dateTime, + data['${effectivePrefix}last_sync'], + )!, + ); + } + + @override + BangSync createAlias(String alias) { + return BangSync(attachedDatabase, alias); + } + + static i0.JsonTypeConverter2 $convertergroup = + const i0.EnumIndexConverter(i2.BangGroup.values); + @override + bool get dontWriteConstraints => true; +} + +class BangSyncData extends i0.DataClass + implements i0.Insertable { + final i2.BangGroup group; + final DateTime lastSync; + const BangSyncData({required this.group, required this.lastSync}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + { + map['group'] = i0.Variable(i3.BangSync.$convertergroup.toSql(group)); + } + map['last_sync'] = i0.Variable(lastSync); + return map; + } + + factory BangSyncData.fromJson( + Map json, { + i0.ValueSerializer? serializer, + }) { + serializer ??= i0.driftRuntimeOptions.defaultSerializer; + return BangSyncData( + group: i3.BangSync.$convertergroup.fromJson( + serializer.fromJson(json['group']), + ), + lastSync: serializer.fromJson(json['last_sync']), + ); + } + @override + Map toJson({i0.ValueSerializer? serializer}) { + serializer ??= i0.driftRuntimeOptions.defaultSerializer; + return { + 'group': serializer.toJson( + i3.BangSync.$convertergroup.toJson(group), + ), + 'last_sync': serializer.toJson(lastSync), + }; + } + + i3.BangSyncData copyWith({i2.BangGroup? group, DateTime? lastSync}) => + i3.BangSyncData( + group: group ?? this.group, + lastSync: lastSync ?? this.lastSync, + ); + BangSyncData copyWithCompanion(i3.BangSyncCompanion data) { + return BangSyncData( + group: data.group.present ? data.group.value : this.group, + lastSync: data.lastSync.present ? data.lastSync.value : this.lastSync, + ); + } + + @override + String toString() { + return (StringBuffer('BangSyncData(') + ..write('group: $group, ') + ..write('lastSync: $lastSync') + ..write(')')) + .toString(); + } + + @override + int get hashCode => Object.hash(group, lastSync); + @override + bool operator ==(Object other) => + identical(this, other) || + (other is i3.BangSyncData && + other.group == this.group && + other.lastSync == this.lastSync); +} + +class BangSyncCompanion extends i0.UpdateCompanion { + final i0.Value group; + final i0.Value lastSync; + const BangSyncCompanion({ + this.group = const i0.Value.absent(), + this.lastSync = const i0.Value.absent(), + }); + BangSyncCompanion.insert({ + this.group = const i0.Value.absent(), + required DateTime lastSync, + }) : lastSync = i0.Value(lastSync); + static i0.Insertable custom({ + i0.Expression? group, + i0.Expression? lastSync, + }) { + return i0.RawValuesInsertable({ + if (group != null) 'group': group, + if (lastSync != null) 'last_sync': lastSync, + }); + } + + i3.BangSyncCompanion copyWith({ + i0.Value? group, + i0.Value? lastSync, + }) { + return i3.BangSyncCompanion( + group: group ?? this.group, + lastSync: lastSync ?? this.lastSync, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (group.present) { + map['group'] = i0.Variable( + i3.BangSync.$convertergroup.toSql(group.value), + ); + } + if (lastSync.present) { + map['last_sync'] = i0.Variable(lastSync.value); + } + return map; + } + + @override + String toString() { + return (StringBuffer('BangSyncCompanion(') + ..write('group: $group, ') + ..write('lastSync: $lastSync') + ..write(')')) + .toString(); + } +} + +class BangFrequency extends i0.Table + with i0.TableInfo { + @override + final i0.GeneratedDatabase attachedDatabase; + final String? _alias; + BangFrequency(this.attachedDatabase, [this._alias]); + late final i0.GeneratedColumn trigger = i0.GeneratedColumn( + 'trigger', + aliasedName, + false, + type: i0.DriftSqlType.string, + requiredDuringInsert: true, + $customConstraints: + 'PRIMARY KEY NOT NULL REFERENCES bang("trigger")ON DELETE CASCADE', + ); + late final i0.GeneratedColumn frequency = i0.GeneratedColumn( + 'frequency', + aliasedName, + false, + type: i0.DriftSqlType.int, + requiredDuringInsert: true, + $customConstraints: 'NOT NULL', + ); + late final i0.GeneratedColumn lastUsed = + i0.GeneratedColumn( + 'last_used', + aliasedName, + false, + type: i0.DriftSqlType.dateTime, + requiredDuringInsert: true, + $customConstraints: 'NOT NULL', + ); + @override + List get $columns => [trigger, frequency, lastUsed]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'bang_frequency'; + @override + Set get $primaryKey => {trigger}; + @override + i3.BangFrequencyData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return i3.BangFrequencyData( + trigger: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}trigger'], + )!, + frequency: attachedDatabase.typeMapping.read( + i0.DriftSqlType.int, + data['${effectivePrefix}frequency'], + )!, + lastUsed: attachedDatabase.typeMapping.read( + i0.DriftSqlType.dateTime, + data['${effectivePrefix}last_used'], + )!, + ); + } + + @override + BangFrequency createAlias(String alias) { + return BangFrequency(attachedDatabase, alias); + } + + @override + bool get dontWriteConstraints => true; +} + +class BangFrequencyData extends i0.DataClass + implements i0.Insertable { + final String trigger; + final int frequency; + final DateTime lastUsed; + const BangFrequencyData({ + required this.trigger, + required this.frequency, + required this.lastUsed, + }); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['trigger'] = i0.Variable(trigger); + map['frequency'] = i0.Variable(frequency); + map['last_used'] = i0.Variable(lastUsed); + return map; + } + + factory BangFrequencyData.fromJson( + Map json, { + i0.ValueSerializer? serializer, + }) { + serializer ??= i0.driftRuntimeOptions.defaultSerializer; + return BangFrequencyData( + trigger: serializer.fromJson(json['trigger']), + frequency: serializer.fromJson(json['frequency']), + lastUsed: serializer.fromJson(json['last_used']), + ); + } + @override + Map toJson({i0.ValueSerializer? serializer}) { + serializer ??= i0.driftRuntimeOptions.defaultSerializer; + return { + 'trigger': serializer.toJson(trigger), + 'frequency': serializer.toJson(frequency), + 'last_used': serializer.toJson(lastUsed), + }; + } + + i3.BangFrequencyData copyWith({ + String? trigger, + int? frequency, + DateTime? lastUsed, + }) => i3.BangFrequencyData( + trigger: trigger ?? this.trigger, + frequency: frequency ?? this.frequency, + lastUsed: lastUsed ?? this.lastUsed, + ); + BangFrequencyData copyWithCompanion(i3.BangFrequencyCompanion data) { + return BangFrequencyData( + trigger: data.trigger.present ? data.trigger.value : this.trigger, + frequency: data.frequency.present ? data.frequency.value : this.frequency, + lastUsed: data.lastUsed.present ? data.lastUsed.value : this.lastUsed, + ); + } + + @override + String toString() { + return (StringBuffer('BangFrequencyData(') + ..write('trigger: $trigger, ') + ..write('frequency: $frequency, ') + ..write('lastUsed: $lastUsed') + ..write(')')) + .toString(); + } + + @override + int get hashCode => Object.hash(trigger, frequency, lastUsed); + @override + bool operator ==(Object other) => + identical(this, other) || + (other is i3.BangFrequencyData && + other.trigger == this.trigger && + other.frequency == this.frequency && + other.lastUsed == this.lastUsed); +} + +class BangFrequencyCompanion extends i0.UpdateCompanion { + final i0.Value trigger; + final i0.Value frequency; + final i0.Value lastUsed; + final i0.Value rowid; + const BangFrequencyCompanion({ + this.trigger = const i0.Value.absent(), + this.frequency = const i0.Value.absent(), + this.lastUsed = const i0.Value.absent(), + this.rowid = const i0.Value.absent(), + }); + BangFrequencyCompanion.insert({ + required String trigger, + required int frequency, + required DateTime lastUsed, + this.rowid = const i0.Value.absent(), + }) : trigger = i0.Value(trigger), + frequency = i0.Value(frequency), + lastUsed = i0.Value(lastUsed); + static i0.Insertable custom({ + i0.Expression? trigger, + i0.Expression? frequency, + i0.Expression? lastUsed, + i0.Expression? rowid, + }) { + return i0.RawValuesInsertable({ + if (trigger != null) 'trigger': trigger, + if (frequency != null) 'frequency': frequency, + if (lastUsed != null) 'last_used': lastUsed, + if (rowid != null) 'rowid': rowid, + }); + } + + i3.BangFrequencyCompanion copyWith({ + i0.Value? trigger, + i0.Value? frequency, + i0.Value? lastUsed, + i0.Value? rowid, + }) { + return i3.BangFrequencyCompanion( + trigger: trigger ?? this.trigger, + frequency: frequency ?? this.frequency, + lastUsed: lastUsed ?? this.lastUsed, + rowid: rowid ?? this.rowid, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (trigger.present) { + map['trigger'] = i0.Variable(trigger.value); + } + if (frequency.present) { + map['frequency'] = i0.Variable(frequency.value); + } + if (lastUsed.present) { + map['last_used'] = i0.Variable(lastUsed.value); + } + if (rowid.present) { + map['rowid'] = i0.Variable(rowid.value); + } + return map; + } + + @override + String toString() { + return (StringBuffer('BangFrequencyCompanion(') + ..write('trigger: $trigger, ') + ..write('frequency: $frequency, ') + ..write('lastUsed: $lastUsed, ') + ..write('rowid: $rowid') + ..write(')')) + .toString(); + } +} + +class BangHistory extends i0.Table + with i0.TableInfo { + @override + final i0.GeneratedDatabase attachedDatabase; + final String? _alias; + BangHistory(this.attachedDatabase, [this._alias]); + late final i0.GeneratedColumn searchQuery = + i0.GeneratedColumn( + 'search_query', + aliasedName, + false, + type: i0.DriftSqlType.string, + requiredDuringInsert: true, + $customConstraints: 'UNIQUE NOT NULL', + ); + late final i0.GeneratedColumn trigger = i0.GeneratedColumn( + 'trigger', + aliasedName, + false, + type: i0.DriftSqlType.string, + requiredDuringInsert: true, + $customConstraints: 'NOT NULL REFERENCES bang("trigger")', + ); + late final i0.GeneratedColumn searchDate = + i0.GeneratedColumn( + 'search_date', + aliasedName, + false, + type: i0.DriftSqlType.dateTime, + requiredDuringInsert: true, + $customConstraints: 'NOT NULL', + ); + @override + List get $columns => [searchQuery, trigger, searchDate]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'bang_history'; + @override + Set get $primaryKey => const {}; + @override + i3.BangHistoryData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return i3.BangHistoryData( + searchQuery: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}search_query'], + )!, + trigger: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}trigger'], + )!, + searchDate: attachedDatabase.typeMapping.read( + i0.DriftSqlType.dateTime, + data['${effectivePrefix}search_date'], + )!, + ); + } + + @override + BangHistory createAlias(String alias) { + return BangHistory(attachedDatabase, alias); + } + + @override + bool get dontWriteConstraints => true; +} + +class BangHistoryData extends i0.DataClass + implements i0.Insertable { + final String searchQuery; + final String trigger; + final DateTime searchDate; + const BangHistoryData({ + required this.searchQuery, + required this.trigger, + required this.searchDate, + }); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['search_query'] = i0.Variable(searchQuery); + map['trigger'] = i0.Variable(trigger); + map['search_date'] = i0.Variable(searchDate); + return map; + } + + factory BangHistoryData.fromJson( + Map json, { + i0.ValueSerializer? serializer, + }) { + serializer ??= i0.driftRuntimeOptions.defaultSerializer; + return BangHistoryData( + searchQuery: serializer.fromJson(json['search_query']), + trigger: serializer.fromJson(json['trigger']), + searchDate: serializer.fromJson(json['search_date']), + ); + } + @override + Map toJson({i0.ValueSerializer? serializer}) { + serializer ??= i0.driftRuntimeOptions.defaultSerializer; + return { + 'search_query': serializer.toJson(searchQuery), + 'trigger': serializer.toJson(trigger), + 'search_date': serializer.toJson(searchDate), + }; + } + + i3.BangHistoryData copyWith({ + String? searchQuery, + String? trigger, + DateTime? searchDate, + }) => i3.BangHistoryData( + searchQuery: searchQuery ?? this.searchQuery, + trigger: trigger ?? this.trigger, + searchDate: searchDate ?? this.searchDate, + ); + BangHistoryData copyWithCompanion(i3.BangHistoryCompanion data) { + return BangHistoryData( + searchQuery: data.searchQuery.present + ? data.searchQuery.value + : this.searchQuery, + trigger: data.trigger.present ? data.trigger.value : this.trigger, + searchDate: data.searchDate.present + ? data.searchDate.value + : this.searchDate, + ); + } + + @override + String toString() { + return (StringBuffer('BangHistoryData(') + ..write('searchQuery: $searchQuery, ') + ..write('trigger: $trigger, ') + ..write('searchDate: $searchDate') + ..write(')')) + .toString(); + } + + @override + int get hashCode => Object.hash(searchQuery, trigger, searchDate); + @override + bool operator ==(Object other) => + identical(this, other) || + (other is i3.BangHistoryData && + other.searchQuery == this.searchQuery && + other.trigger == this.trigger && + other.searchDate == this.searchDate); +} + +class BangHistoryCompanion extends i0.UpdateCompanion { + final i0.Value searchQuery; + final i0.Value trigger; + final i0.Value searchDate; + final i0.Value rowid; + const BangHistoryCompanion({ + this.searchQuery = const i0.Value.absent(), + this.trigger = const i0.Value.absent(), + this.searchDate = const i0.Value.absent(), + this.rowid = const i0.Value.absent(), + }); + BangHistoryCompanion.insert({ + required String searchQuery, + required String trigger, + required DateTime searchDate, + this.rowid = const i0.Value.absent(), + }) : searchQuery = i0.Value(searchQuery), + trigger = i0.Value(trigger), + searchDate = i0.Value(searchDate); + static i0.Insertable custom({ + i0.Expression? searchQuery, + i0.Expression? trigger, + i0.Expression? searchDate, + i0.Expression? rowid, + }) { + return i0.RawValuesInsertable({ + if (searchQuery != null) 'search_query': searchQuery, + if (trigger != null) 'trigger': trigger, + if (searchDate != null) 'search_date': searchDate, + if (rowid != null) 'rowid': rowid, + }); + } + + i3.BangHistoryCompanion copyWith({ + i0.Value? searchQuery, + i0.Value? trigger, + i0.Value? searchDate, + i0.Value? rowid, + }) { + return i3.BangHistoryCompanion( + searchQuery: searchQuery ?? this.searchQuery, + trigger: trigger ?? this.trigger, + searchDate: searchDate ?? this.searchDate, + rowid: rowid ?? this.rowid, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (searchQuery.present) { + map['search_query'] = i0.Variable(searchQuery.value); + } + if (trigger.present) { + map['trigger'] = i0.Variable(trigger.value); + } + if (searchDate.present) { + map['search_date'] = i0.Variable(searchDate.value); + } + if (rowid.present) { + map['rowid'] = i0.Variable(rowid.value); + } + return map; + } + + @override + String toString() { + return (StringBuffer('BangHistoryCompanion(') + ..write('searchQuery: $searchQuery, ') + ..write('trigger: $trigger, ') + ..write('searchDate: $searchDate, ') + ..write('rowid: $rowid') + ..write(')')) + .toString(); + } +} + +class BangFts extends i0.Table + with + i0.TableInfo, + i0.VirtualTableInfo { + @override + final i0.GeneratedDatabase attachedDatabase; + final String? _alias; + BangFts(this.attachedDatabase, [this._alias]); + late final i0.GeneratedColumn trigger = i0.GeneratedColumn( + 'trigger', + aliasedName, + false, + type: i0.DriftSqlType.string, + requiredDuringInsert: true, + $customConstraints: '', + ); + late final i0.GeneratedColumn websiteName = + i0.GeneratedColumn( + 'website_name', + aliasedName, + false, + type: i0.DriftSqlType.string, + requiredDuringInsert: true, + $customConstraints: '', + ); + @override + List get $columns => [trigger, websiteName]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'bang_fts'; + @override + Set get $primaryKey => const {}; + @override + i3.BangFt map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return i3.BangFt( + trigger: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}trigger'], + )!, + websiteName: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}website_name'], + )!, + ); + } + + @override + BangFts createAlias(String alias) { + return BangFts(attachedDatabase, alias); + } + + @override + bool get dontWriteConstraints => true; + @override + String get moduleAndArgs => + 'fts5(trigger, website_name, content=bang, prefix=\'2 3\')'; +} + +class BangFt extends i0.DataClass implements i0.Insertable { + final String trigger; + final String websiteName; + const BangFt({required this.trigger, required this.websiteName}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['trigger'] = i0.Variable(trigger); + map['website_name'] = i0.Variable(websiteName); + return map; + } + + factory BangFt.fromJson( + Map json, { + i0.ValueSerializer? serializer, + }) { + serializer ??= i0.driftRuntimeOptions.defaultSerializer; + return BangFt( + trigger: serializer.fromJson(json['trigger']), + websiteName: serializer.fromJson(json['website_name']), + ); + } + @override + Map toJson({i0.ValueSerializer? serializer}) { + serializer ??= i0.driftRuntimeOptions.defaultSerializer; + return { + 'trigger': serializer.toJson(trigger), + 'website_name': serializer.toJson(websiteName), + }; + } + + i3.BangFt copyWith({String? trigger, String? websiteName}) => i3.BangFt( + trigger: trigger ?? this.trigger, + websiteName: websiteName ?? this.websiteName, + ); + BangFt copyWithCompanion(i3.BangFtsCompanion data) { + return BangFt( + trigger: data.trigger.present ? data.trigger.value : this.trigger, + websiteName: data.websiteName.present + ? data.websiteName.value + : this.websiteName, + ); + } + + @override + String toString() { + return (StringBuffer('BangFt(') + ..write('trigger: $trigger, ') + ..write('websiteName: $websiteName') + ..write(')')) + .toString(); + } + + @override + int get hashCode => Object.hash(trigger, websiteName); + @override + bool operator ==(Object other) => + identical(this, other) || + (other is i3.BangFt && + other.trigger == this.trigger && + other.websiteName == this.websiteName); +} + +class BangFtsCompanion extends i0.UpdateCompanion { + final i0.Value trigger; + final i0.Value websiteName; + final i0.Value rowid; + const BangFtsCompanion({ + this.trigger = const i0.Value.absent(), + this.websiteName = const i0.Value.absent(), + this.rowid = const i0.Value.absent(), + }); + BangFtsCompanion.insert({ + required String trigger, + required String websiteName, + this.rowid = const i0.Value.absent(), + }) : trigger = i0.Value(trigger), + websiteName = i0.Value(websiteName); + static i0.Insertable custom({ + i0.Expression? trigger, + i0.Expression? websiteName, + i0.Expression? rowid, + }) { + return i0.RawValuesInsertable({ + if (trigger != null) 'trigger': trigger, + if (websiteName != null) 'website_name': websiteName, + if (rowid != null) 'rowid': rowid, + }); + } + + i3.BangFtsCompanion copyWith({ + i0.Value? trigger, + i0.Value? websiteName, + i0.Value? rowid, + }) { + return i3.BangFtsCompanion( + trigger: trigger ?? this.trigger, + websiteName: websiteName ?? this.websiteName, + rowid: rowid ?? this.rowid, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (trigger.present) { + map['trigger'] = i0.Variable(trigger.value); + } + if (websiteName.present) { + map['website_name'] = i0.Variable(websiteName.value); + } + if (rowid.present) { + map['rowid'] = i0.Variable(rowid.value); + } + return map; + } + + @override + String toString() { + return (StringBuffer('BangFtsCompanion(') + ..write('trigger: $trigger, ') + ..write('websiteName: $websiteName, ') + ..write('rowid: $rowid') + ..write(')')) + .toString(); + } +} + +class BangDataView extends i0.ViewInfo + implements i0.HasResultSet { + final String? _alias; + @override + final i0.GeneratedDatabase attachedDatabase; + BangDataView(this.attachedDatabase, [this._alias]); + @override + List get $columns => [ + trigger, + group, + websiteName, + domain, + urlTemplate, + category, + subCategory, + format, + frequency, + lastUsed, + ]; + @override + String get aliasedName => _alias ?? entityName; + @override + String get entityName => 'bang_data_view'; + @override + Map get createViewStatements => { + i0.SqlDialect.sqlite: + 'CREATE VIEW bang_data_view AS SELECT b.*, bf.frequency, bf.last_used FROM bang AS b LEFT JOIN bang_frequency AS bf ON b."trigger" = bf."trigger"', + }; + @override + BangDataView get asDslTable => this; + @override + i5.BangData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return i5.BangData( + websiteName: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}website_name'], + )!, + domain: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}domain'], + )!, + trigger: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}trigger'], + )!, + urlTemplate: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}url_template'], + )!, + category: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}category'], + ), + subCategory: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}sub_category'], + ), + format: i3.BangTable.$converterformat.fromSql( + attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}format'], + ), + ), + frequency: attachedDatabase.typeMapping.read( + i0.DriftSqlType.int, + data['${effectivePrefix}frequency'], + ), + lastUsed: attachedDatabase.typeMapping.read( + i0.DriftSqlType.dateTime, + data['${effectivePrefix}last_used'], + ), + ); + } + + late final i0.GeneratedColumn trigger = i0.GeneratedColumn( + 'trigger', + aliasedName, + false, + type: i0.DriftSqlType.string, + ); + late final i0.GeneratedColumnWithTypeConverter group = + i0.GeneratedColumn( + 'group', + aliasedName, + false, + type: i0.DriftSqlType.int, + ).withConverter(i3.BangTable.$convertergroup); + late final i0.GeneratedColumn websiteName = + i0.GeneratedColumn( + 'website_name', + aliasedName, + false, + type: i0.DriftSqlType.string, + ); + late final i0.GeneratedColumn domain = i0.GeneratedColumn( + 'domain', + aliasedName, + false, + type: i0.DriftSqlType.string, + ); + late final i0.GeneratedColumn urlTemplate = + i0.GeneratedColumn( + 'url_template', + aliasedName, + false, + type: i0.DriftSqlType.string, + ); + late final i0.GeneratedColumn category = i0.GeneratedColumn( + 'category', + aliasedName, + true, + type: i0.DriftSqlType.string, + ); + late final i0.GeneratedColumn subCategory = + i0.GeneratedColumn( + 'sub_category', + aliasedName, + true, + type: i0.DriftSqlType.string, + ); + late final i0.GeneratedColumnWithTypeConverter?, String> + format = i0.GeneratedColumn( + 'format', + aliasedName, + true, + type: i0.DriftSqlType.string, + ).withConverter?>(i3.BangTable.$converterformat); + late final i0.GeneratedColumn frequency = i0.GeneratedColumn( + 'frequency', + aliasedName, + true, + type: i0.DriftSqlType.int, + ); + late final i0.GeneratedColumn lastUsed = + i0.GeneratedColumn( + 'last_used', + aliasedName, + true, + type: i0.DriftSqlType.dateTime, + ); + @override + BangDataView createAlias(String alias) { + return BangDataView(attachedDatabase, alias); + } + + @override + i0.Query? get query => null; + @override + Set get readTables => const {'bang', 'bang_frequency'}; +} + +i0.Trigger get bangAfterInsert => i0.Trigger( + 'CREATE TRIGGER bang_after_insert AFTER INSERT ON bang BEGIN INSERT INTO bang_fts ("rowid", "trigger", website_name) VALUES (new."rowid", new."trigger", new.website_name);END', + 'bang_after_insert', +); +i0.Trigger get bangAfterDelete => i0.Trigger( + 'CREATE TRIGGER bang_after_delete AFTER DELETE ON bang BEGIN INSERT INTO bang_fts (bang_fts, "rowid", "trigger", website_name) VALUES (\'delete\', old."rowid", old."trigger", old.website_name);END', + 'bang_after_delete', +); +i0.Trigger get bangAfterUpdate => i0.Trigger( + 'CREATE TRIGGER bang_after_update AFTER UPDATE ON bang BEGIN INSERT INTO bang_fts (bang_fts, "rowid", "trigger", website_name) VALUES (\'delete\', old."rowid", old."trigger", old.website_name);INSERT INTO bang_fts ("rowid", "trigger", website_name) VALUES (new."rowid", new."trigger", new.website_name);END', + 'bang_after_update', +); + +class DefinitionsDrift extends i6.ModularAccessor { + DefinitionsDrift(i0.GeneratedDatabase db) : super(db); + Future optimizeFtsIndex() { + return customInsert( + 'INSERT INTO bang_fts (bang_fts) VALUES (\'optimize\')', + variables: [], + updates: {bangFts}, + ); + } + + i0.Selectable queryBangs({required String query}) { + return customSelect( + 'WITH weights AS (SELECT 10.0 AS "trigger", 5.0 AS website_name) SELECT b.*, bf.frequency, bf.last_used, bm25(bang_fts, weights."trigger", weights.website_name) AS weighted_rank FROM bang_fts(?1)AS fts INNER JOIN bang AS b ON b."rowid" = fts."rowid" LEFT JOIN bang_frequency AS bf ON b."trigger" = bf."trigger" CROSS JOIN weights ORDER BY weighted_rank ASC, bf.frequency NULLS LAST', + variables: [i0.Variable(query)], + readsFrom: {bangFrequency, bangFts, bang}, + ).map( + (i0.QueryRow row) => i5.BangData( + websiteName: row.read('website_name'), + domain: row.read('domain'), + trigger: row.read('trigger'), + urlTemplate: row.read('url_template'), + category: row.readNullable('category'), + subCategory: row.readNullable('sub_category'), + format: i3.BangTable.$converterformat.fromSql( + row.readNullable('format'), + ), + frequency: row.readNullable('frequency'), + lastUsed: row.readNullable('last_used'), + ), + ); + } + + i0.Selectable queryBangsBasic({required String query}) { + return customSelect( + 'WITH weights AS (SELECT 10.0 AS "trigger", 5.0 AS website_name) SELECT b.*, bf.frequency, bf.last_used, bm25(bang_fts, weights."trigger", weights.website_name) AS weighted_rank FROM bang_fts AS fts INNER JOIN bang AS b ON b."rowid" = fts."rowid" LEFT JOIN bang_frequency AS bf ON b."trigger" = bf."trigger" CROSS JOIN weights WHERE fts."trigger" LIKE ?1 OR fts.website_name LIKE ?1 ORDER BY weighted_rank ASC, bf.frequency NULLS LAST', + variables: [i0.Variable(query)], + readsFrom: {bangFrequency, bangFts, bang}, + ).map( + (i0.QueryRow row) => i5.BangData( + websiteName: row.read('website_name'), + domain: row.read('domain'), + trigger: row.read('trigger'), + urlTemplate: row.read('url_template'), + category: row.readNullable('category'), + subCategory: row.readNullable('sub_category'), + format: i3.BangTable.$converterformat.fromSql( + row.readNullable('format'), + ), + frequency: row.readNullable('frequency'), + lastUsed: row.readNullable('last_used'), + ), + ); + } + + i0.Selectable categoriesJson() { + return customSelect( + 'WITH categories AS (SELECT b.category, json_group_array(DISTINCT b.sub_category ORDER BY b.sub_category)AS sub_categories FROM bang AS b WHERE b.category IS NOT NULL AND b.sub_category IS NOT NULL GROUP BY b.category ORDER BY b.category) SELECT json_group_object(c.category, json(c.sub_categories)) AS categories_json FROM categories AS c', + variables: [], + readsFrom: {bang}, + ).map((i0.QueryRow row) => row.read('categories_json')); + } + + i0.Selectable searchHistoryEntries({ + required int limit, + }) { + return customSelect( + 'SELECT * FROM bang_history ORDER BY search_date DESC LIMIT ?1', + variables: [i0.Variable(limit)], + readsFrom: {bangHistory}, + ).map( + (i0.QueryRow row) => i7.SearchHistoryEntry( + searchQuery: row.read('search_query'), + trigger: row.read('trigger'), + searchDate: row.read('search_date'), + ), + ); + } + + Future evictHistoryEntries({required int limit}) { + return customUpdate( + 'DELETE FROM bang_history WHERE "rowid" IN (SELECT "rowid" FROM bang_history ORDER BY search_date DESC LIMIT -1 OFFSET ?1)', + variables: [i0.Variable(limit)], + updates: {bangHistory}, + updateKind: i0.UpdateKind.delete, + ); + } + + i3.BangFts get bangFts => i6.ReadDatabaseContainer( + attachedDatabase, + ).resultSet('bang_fts'); + i3.BangTable get bang => i6.ReadDatabaseContainer( + attachedDatabase, + ).resultSet('bang'); + i3.BangFrequency get bangFrequency => i6.ReadDatabaseContainer( + attachedDatabase, + ).resultSet('bang_frequency'); + i3.BangHistory get bangHistory => i6.ReadDatabaseContainer( + attachedDatabase, + ).resultSet('bang_history'); +} diff --git a/app/lib/features/bangs/data/models/bang.dart b/app/lib/features/bangs/data/models/bang.dart index 906b9eba..a295a239 100644 --- a/app/lib/features/bangs/data/models/bang.dart +++ b/app/lib/features/bangs/data/models/bang.dart @@ -21,8 +21,7 @@ import 'package:copy_with_extension/copy_with_extension.dart'; import 'package:drift/drift.dart' show Expression, Insertable, Value; import 'package:fast_equatable/fast_equatable.dart'; import 'package:json_annotation/json_annotation.dart'; -import 'package:weblibre/features/bangs/data/database/database.dart' - show BangCompanion; +import 'package:weblibre/features/bangs/data/database/definitions.drift.dart'; import 'package:weblibre/features/bangs/data/models/bang_group.dart'; part 'bang.g.dart'; diff --git a/app/lib/features/bangs/data/models/bang.g.dart b/app/lib/features/bangs/data/models/bang.g.dart index e423d21b..5bd00599 100644 --- a/app/lib/features/bangs/data/models/bang.g.dart +++ b/app/lib/features/bangs/data/models/bang.g.dart @@ -23,12 +23,13 @@ abstract class _$BangCWProxy { Bang format(Set? format); - /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `Bang(...).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 `Bang(...).copyWith.fieldName(value)`. /// - /// Usage + /// Example: /// ```dart /// Bang(...).copyWith(id: 12, name: "My name") - /// ```` + /// ``` Bang call({ String websiteName, String domain, @@ -41,43 +42,45 @@ abstract class _$BangCWProxy { }); } -/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfBang.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfBang.copyWith.fieldName(...)` +/// Callable proxy for `copyWith` functionality. +/// Use as `instanceOfBang.copyWith(...)` or call `instanceOfBang.copyWith.fieldName(value)` for a single field. class _$BangCWProxyImpl implements _$BangCWProxy { const _$BangCWProxyImpl(this._value); final Bang _value; @override - Bang websiteName(String websiteName) => this(websiteName: websiteName); + Bang websiteName(String websiteName) => call(websiteName: websiteName); @override - Bang domain(String domain) => this(domain: domain); + Bang domain(String domain) => call(domain: domain); @override - Bang trigger(String trigger) => this(trigger: trigger); + Bang trigger(String trigger) => call(trigger: trigger); @override - Bang urlTemplate(String urlTemplate) => this(urlTemplate: urlTemplate); + Bang urlTemplate(String urlTemplate) => call(urlTemplate: urlTemplate); @override - Bang group(BangGroup? group) => this(group: group); + Bang group(BangGroup? group) => call(group: group); @override - Bang category(String? category) => this(category: category); + Bang category(String? category) => call(category: category); @override - Bang subCategory(String? subCategory) => this(subCategory: subCategory); + Bang subCategory(String? subCategory) => call(subCategory: subCategory); @override - Bang format(Set? format) => this(format: format); + Bang format(Set? format) => call(format: format); @override - /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `Bang(...).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 `Bang(...).copyWith.fieldName(value)`. /// - /// Usage + /// Example: /// ```dart /// Bang(...).copyWith(id: 12, name: "My name") - /// ```` + /// ``` Bang call({ Object? websiteName = const $CopyWithPlaceholder(), Object? domain = const $CopyWithPlaceholder(), @@ -89,19 +92,21 @@ class _$BangCWProxyImpl implements _$BangCWProxy { Object? format = const $CopyWithPlaceholder(), }) { return Bang( - websiteName: websiteName == const $CopyWithPlaceholder() + websiteName: + websiteName == const $CopyWithPlaceholder() || websiteName == null ? _value.websiteName // ignore: cast_nullable_to_non_nullable : websiteName as String, - domain: domain == const $CopyWithPlaceholder() + domain: domain == const $CopyWithPlaceholder() || domain == null ? _value.domain // ignore: cast_nullable_to_non_nullable : domain as String, - trigger: trigger == const $CopyWithPlaceholder() + trigger: trigger == const $CopyWithPlaceholder() || trigger == null ? _value.trigger // ignore: cast_nullable_to_non_nullable : trigger as String, - urlTemplate: urlTemplate == const $CopyWithPlaceholder() + urlTemplate: + urlTemplate == const $CopyWithPlaceholder() || urlTemplate == null ? _value.urlTemplate // ignore: cast_nullable_to_non_nullable : urlTemplate as String, @@ -126,7 +131,8 @@ class _$BangCWProxyImpl implements _$BangCWProxy { } extension $BangCopyWith on Bang { - /// Returns a callable class that can be used as follows: `instanceOfBang.copyWith(...)` or like so:`instanceOfBang.copyWith.fieldName(...)`. + /// Returns a callable class used to build a new instance with modified fields. + /// Example: `instanceOfBang.copyWith(...)` or `instanceOfBang.copyWith.fieldName(...)`. // ignore: library_private_types_in_public_api _$BangCWProxy get copyWith => _$BangCWProxyImpl(this); } diff --git a/app/lib/features/bangs/data/models/bang_data.g.dart b/app/lib/features/bangs/data/models/bang_data.g.dart index 92106af5..79c80a42 100644 --- a/app/lib/features/bangs/data/models/bang_data.g.dart +++ b/app/lib/features/bangs/data/models/bang_data.g.dart @@ -27,12 +27,13 @@ abstract class _$BangDataCWProxy { BangData icon(BrowserIcon? icon); - /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BangData(...).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 `BangData(...).copyWith.fieldName(value)`. /// - /// Usage + /// Example: /// ```dart /// BangData(...).copyWith(id: 12, name: "My name") - /// ```` + /// ``` BangData call({ String websiteName, String domain, @@ -47,49 +48,51 @@ abstract class _$BangDataCWProxy { }); } -/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfBangData.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfBangData.copyWith.fieldName(...)` +/// Callable proxy for `copyWith` functionality. +/// Use as `instanceOfBangData.copyWith(...)` or call `instanceOfBangData.copyWith.fieldName(value)` for a single field. class _$BangDataCWProxyImpl implements _$BangDataCWProxy { const _$BangDataCWProxyImpl(this._value); final BangData _value; @override - BangData websiteName(String websiteName) => this(websiteName: websiteName); + BangData websiteName(String websiteName) => call(websiteName: websiteName); @override - BangData domain(String domain) => this(domain: domain); + BangData domain(String domain) => call(domain: domain); @override - BangData trigger(String trigger) => this(trigger: trigger); + BangData trigger(String trigger) => call(trigger: trigger); @override - BangData urlTemplate(String urlTemplate) => this(urlTemplate: urlTemplate); + BangData urlTemplate(String urlTemplate) => call(urlTemplate: urlTemplate); @override - BangData category(String? category) => this(category: category); + BangData category(String? category) => call(category: category); @override - BangData subCategory(String? subCategory) => this(subCategory: subCategory); + BangData subCategory(String? subCategory) => call(subCategory: subCategory); @override - BangData format(Set? format) => this(format: format); + BangData format(Set? format) => call(format: format); @override - BangData frequency(int? frequency) => this(frequency: frequency); + BangData frequency(int? frequency) => call(frequency: frequency); @override - BangData lastUsed(DateTime? lastUsed) => this(lastUsed: lastUsed); + BangData lastUsed(DateTime? lastUsed) => call(lastUsed: lastUsed); @override - BangData icon(BrowserIcon? icon) => this(icon: icon); + BangData icon(BrowserIcon? icon) => call(icon: icon); @override - /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BangData(...).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 `BangData(...).copyWith.fieldName(value)`. /// - /// Usage + /// Example: /// ```dart /// BangData(...).copyWith(id: 12, name: "My name") - /// ```` + /// ``` BangData call({ Object? websiteName = const $CopyWithPlaceholder(), Object? domain = const $CopyWithPlaceholder(), @@ -103,19 +106,21 @@ class _$BangDataCWProxyImpl implements _$BangDataCWProxy { Object? icon = const $CopyWithPlaceholder(), }) { return BangData( - websiteName: websiteName == const $CopyWithPlaceholder() + websiteName: + websiteName == const $CopyWithPlaceholder() || websiteName == null ? _value.websiteName // ignore: cast_nullable_to_non_nullable : websiteName as String, - domain: domain == const $CopyWithPlaceholder() + domain: domain == const $CopyWithPlaceholder() || domain == null ? _value.domain // ignore: cast_nullable_to_non_nullable : domain as String, - trigger: trigger == const $CopyWithPlaceholder() + trigger: trigger == const $CopyWithPlaceholder() || trigger == null ? _value.trigger // ignore: cast_nullable_to_non_nullable : trigger as String, - urlTemplate: urlTemplate == const $CopyWithPlaceholder() + urlTemplate: + urlTemplate == const $CopyWithPlaceholder() || urlTemplate == null ? _value.urlTemplate // ignore: cast_nullable_to_non_nullable : urlTemplate as String, @@ -148,7 +153,8 @@ class _$BangDataCWProxyImpl implements _$BangDataCWProxy { } extension $BangDataCopyWith on BangData { - /// Returns a callable class that can be used as follows: `instanceOfBangData.copyWith(...)` or like so:`instanceOfBangData.copyWith.fieldName(...)`. + /// Returns a callable class used to build a new instance with modified fields. + /// Example: `instanceOfBangData.copyWith(...)` or `instanceOfBangData.copyWith.fieldName(...)`. // ignore: library_private_types_in_public_api _$BangDataCWProxy get copyWith => _$BangDataCWProxyImpl(this); } diff --git a/app/lib/features/bangs/data/providers.g.dart b/app/lib/features/bangs/data/providers.g.dart index 4c401644..2977021d 100644 --- a/app/lib/features/bangs/data/providers.g.dart +++ b/app/lib/features/bangs/data/providers.g.dart @@ -6,22 +6,46 @@ part of 'providers.dart'; // RiverpodGenerator // ************************************************************************** -String _$bangDatabaseHash() => r'e31cf4b499300aff65174a16fb74c7dd8ec3d6f0'; +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning -/// See also [bangDatabase]. @ProviderFor(bangDatabase) -final bangDatabaseProvider = Provider.internal( - bangDatabase, - name: r'bangDatabaseProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$bangDatabaseHash, - dependencies: null, - allTransitiveDependencies: null, -); +const bangDatabaseProvider = BangDatabaseProvider._(); -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef BangDatabaseRef = ProviderRef; -// 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 BangDatabaseProvider + extends $FunctionalProvider + with $Provider { + const BangDatabaseProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'bangDatabaseProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$bangDatabaseHash(); + + @$internal + @override + $ProviderElement $createElement($ProviderPointer pointer) => + $ProviderElement(pointer); + + @override + BangDatabase create(Ref ref) { + return bangDatabase(ref); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(BangDatabase value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + +String _$bangDatabaseHash() => r'e31cf4b499300aff65174a16fb74c7dd8ec3d6f0'; diff --git a/app/lib/features/bangs/data/services/data_source.g.dart b/app/lib/features/bangs/data/services/data_source.g.dart index 9c9efabb..21c0e9d6 100644 --- a/app/lib/features/bangs/data/services/data_source.g.dart +++ b/app/lib/features/bangs/data/services/data_source.g.dart @@ -6,22 +6,59 @@ part of 'data_source.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(BangDataSourceService) +const bangDataSourceServiceProvider = BangDataSourceServiceProvider._(); + +final class BangDataSourceServiceProvider + extends $NotifierProvider { + const BangDataSourceServiceProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'bangDataSourceServiceProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$bangDataSourceServiceHash(); + + @$internal + @override + BangDataSourceService create() => BangDataSourceService(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(void value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + String _$bangDataSourceServiceHash() => r'2ff811ece417ae498dacc04a2fa963cffb34c8a9'; -/// See also [BangDataSourceService]. -@ProviderFor(BangDataSourceService) -final bangDataSourceServiceProvider = - NotifierProvider.internal( - BangDataSourceService.new, - name: r'bangDataSourceServiceProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$bangDataSourceServiceHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$BangDataSourceService = Notifier; -// 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 +abstract class _$BangDataSourceService extends $Notifier { + void build(); + @$mustCallSuper + @override + void runBuild() { + build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + void, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} diff --git a/app/lib/features/bangs/domain/providers/bangs.g.dart b/app/lib/features/bangs/domain/providers/bangs.g.dart index 5e462632..0f54ce4c 100644 --- a/app/lib/features/bangs/domain/providers/bangs.g.dart +++ b/app/lib/features/bangs/domain/providers/bangs.g.dart @@ -6,651 +6,491 @@ part of 'bangs.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(defaultSearchBangData) +const defaultSearchBangDataProvider = DefaultSearchBangDataProvider._(); + +final class DefaultSearchBangDataProvider + extends + $FunctionalProvider, BangData?, Stream> + with $FutureModifier, $StreamProvider { + const DefaultSearchBangDataProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'defaultSearchBangDataProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$defaultSearchBangDataHash(); + + @$internal + @override + $StreamProviderElement $createElement($ProviderPointer pointer) => + $StreamProviderElement(pointer); + + @override + Stream create(Ref ref) { + return defaultSearchBangData(ref); + } +} + String _$defaultSearchBangDataHash() => r'5fa3f588b57a82dd8fffb2082e495108a242ef72'; -/// See also [defaultSearchBangData]. -@ProviderFor(defaultSearchBangData) -final defaultSearchBangDataProvider = StreamProvider.internal( - defaultSearchBangData, - name: r'defaultSearchBangDataProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$defaultSearchBangDataHash, - dependencies: null, - allTransitiveDependencies: null, -); - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef DefaultSearchBangDataRef = StreamProviderRef; -String _$bangDataHash() => r'b10d3a74e19d30fc372b9ecbf7146bccd9fdf83b'; - -/// Copied from Dart SDK -class _SystemHash { - _SystemHash._(); - - static int combine(int hash, int value) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + value); - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10)); - return hash ^ (hash >> 6); - } - - static int finish(int hash) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); - // ignore: parameter_assignments - hash = hash ^ (hash >> 11); - return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); - } -} - -/// See also [bangData]. @ProviderFor(bangData) -const bangDataProvider = BangDataFamily(); +const bangDataProvider = BangDataFamily._(); -/// See also [bangData]. -class BangDataFamily extends Family> { - /// See also [bangData]. - const BangDataFamily(); +final class BangDataProvider + extends + $FunctionalProvider, BangData?, Stream> + with $FutureModifier, $StreamProvider { + const BangDataProvider._({ + required BangDataFamily super.from, + required String super.argument, + }) : super( + retry: null, + name: r'bangDataProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); - /// See also [bangData]. - BangDataProvider call(String trigger) { - return BangDataProvider(trigger); + @override + String debugGetCreateSourceHash() => _$bangDataHash(); + + @override + String toString() { + return r'bangDataProvider' + '' + '($argument)'; } + @$internal @override - BangDataProvider getProviderOverride(covariant BangDataProvider provider) { - return call(provider.trigger); - } - - static const Iterable? _dependencies = null; + $StreamProviderElement $createElement($ProviderPointer pointer) => + $StreamProviderElement(pointer); @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'bangDataProvider'; -} - -/// See also [bangData]. -class BangDataProvider extends AutoDisposeStreamProvider { - /// See also [bangData]. - BangDataProvider(String trigger) - : this._internal( - (ref) => bangData(ref as BangDataRef, trigger), - from: bangDataProvider, - name: r'bangDataProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$bangDataHash, - dependencies: BangDataFamily._dependencies, - allTransitiveDependencies: BangDataFamily._allTransitiveDependencies, - trigger: trigger, - ); - - BangDataProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.trigger, - }) : super.internal(); - - final String trigger; - - @override - Override overrideWith( - Stream Function(BangDataRef provider) create, - ) { - return ProviderOverride( - origin: this, - override: BangDataProvider._internal( - (ref) => create(ref as BangDataRef), - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - trigger: trigger, - ), - ); - } - - @override - AutoDisposeStreamProviderElement createElement() { - return _BangDataProviderElement(this); + Stream create(Ref ref) { + final argument = this.argument as String; + return bangData(ref, argument); } @override bool operator ==(Object other) { - return other is BangDataProvider && other.trigger == trigger; + return other is BangDataProvider && other.argument == argument; } @override int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, trigger.hashCode); - - return _SystemHash.finish(hash); + return argument.hashCode; } } -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin BangDataRef on AutoDisposeStreamProviderRef { - /// The parameter `trigger` of this provider. - String get trigger; -} +String _$bangDataHash() => r'b10d3a74e19d30fc372b9ecbf7146bccd9fdf83b'; -class _BangDataProviderElement - extends AutoDisposeStreamProviderElement - with BangDataRef { - _BangDataProviderElement(super.provider); +final class BangDataFamily extends $Family + with $FunctionalFamilyOverride, String> { + const BangDataFamily._() + : super( + retry: null, + name: r'bangDataProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, + ); + + BangDataProvider call(String trigger) => + BangDataProvider._(argument: trigger, from: this); @override - String get trigger => (origin as BangDataProvider).trigger; + String toString() => r'bangDataProvider'; +} + +@ProviderFor(bangCategories) +const bangCategoriesProvider = BangCategoriesProvider._(); + +final class BangCategoriesProvider + extends + $FunctionalProvider< + AsyncValue>>, + Map>, + Stream>> + > + with + $FutureModifier>>, + $StreamProvider>> { + const BangCategoriesProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'bangCategoriesProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$bangCategoriesHash(); + + @$internal + @override + $StreamProviderElement>> $createElement( + $ProviderPointer pointer, + ) => $StreamProviderElement(pointer); + + @override + Stream>> create(Ref ref) { + return bangCategories(ref); + } } String _$bangCategoriesHash() => r'947fcfd2dffcc7f585c6ed7379d319f4fe72293a'; -/// See also [bangCategories]. -@ProviderFor(bangCategories) -final bangCategoriesProvider = - AutoDisposeStreamProvider>>.internal( - bangCategories, - name: r'bangCategoriesProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$bangCategoriesHash, - dependencies: null, - allTransitiveDependencies: null, - ); +@ProviderFor(bangList) +const bangListProvider = BangListFamily._(); + +final class BangListProvider + extends + $FunctionalProvider< + AsyncValue>, + List, + Stream> + > + with $FutureModifier>, $StreamProvider> { + const BangListProvider._({ + required BangListFamily super.from, + required ({ + List? triggers, + List? groups, + String? domain, + ({String category, String? subCategory})? categoryFilter, + bool? orderMostFrequentFirst, + }) + super.argument, + }) : super( + retry: null, + name: r'bangListProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$bangListHash(); + + @override + String toString() { + return r'bangListProvider' + '' + '$argument'; + } + + @$internal + @override + $StreamProviderElement> $createElement( + $ProviderPointer pointer, + ) => $StreamProviderElement(pointer); + + @override + Stream> create(Ref ref) { + final argument = + this.argument + as ({ + List? triggers, + List? groups, + String? domain, + ({String category, String? subCategory})? categoryFilter, + bool? orderMostFrequentFirst, + }); + return bangList( + ref, + triggers: argument.triggers, + groups: argument.groups, + domain: argument.domain, + categoryFilter: argument.categoryFilter, + orderMostFrequentFirst: argument.orderMostFrequentFirst, + ); + } + + @override + bool operator ==(Object other) { + return other is BangListProvider && other.argument == argument; + } + + @override + int get hashCode { + return argument.hashCode; + } +} -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef BangCategoriesRef = - AutoDisposeStreamProviderRef>>; String _$bangListHash() => r'd1e0bb9fa4f523ce516e075c0d149bf7803ebb2b'; -/// See also [bangList]. -@ProviderFor(bangList) -const bangListProvider = BangListFamily(); +final class BangListFamily extends $Family + with + $FunctionalFamilyOverride< + Stream>, + ({ + List? triggers, + List? groups, + String? domain, + ({String category, String? subCategory})? categoryFilter, + bool? orderMostFrequentFirst, + }) + > { + const BangListFamily._() + : super( + retry: null, + name: r'bangListProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, + ); -/// See also [bangList]. -class BangListFamily extends Family>> { - /// See also [bangList]. - const BangListFamily(); - - /// See also [bangList]. BangListProvider call({ List? triggers, List? groups, String? domain, ({String category, String? subCategory})? categoryFilter, bool? orderMostFrequentFirst, - }) { - return BangListProvider( + }) => BangListProvider._( + argument: ( triggers: triggers, groups: groups, domain: domain, categoryFilter: categoryFilter, orderMostFrequentFirst: orderMostFrequentFirst, - ); - } + ), + from: this, + ); @override - BangListProvider getProviderOverride(covariant BangListProvider provider) { - return call( - triggers: provider.triggers, - groups: provider.groups, - domain: provider.domain, - categoryFilter: provider.categoryFilter, - orderMostFrequentFirst: provider.orderMostFrequentFirst, - ); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'bangListProvider'; + String toString() => r'bangListProvider'; } -/// See also [bangList]. -class BangListProvider extends AutoDisposeStreamProvider> { - /// See also [bangList]. - BangListProvider({ - List? triggers, - List? groups, - String? domain, - ({String category, String? subCategory})? categoryFilter, - bool? orderMostFrequentFirst, - }) : this._internal( - (ref) => bangList( - ref as BangListRef, - triggers: triggers, - groups: groups, - domain: domain, - categoryFilter: categoryFilter, - orderMostFrequentFirst: orderMostFrequentFirst, - ), - from: bangListProvider, - name: r'bangListProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$bangListHash, - dependencies: BangListFamily._dependencies, - allTransitiveDependencies: BangListFamily._allTransitiveDependencies, - triggers: triggers, - groups: groups, - domain: domain, - categoryFilter: categoryFilter, - orderMostFrequentFirst: orderMostFrequentFirst, - ); +@ProviderFor(frequentBangList) +const frequentBangListProvider = FrequentBangListProvider._(); - BangListProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.triggers, - required this.groups, - required this.domain, - required this.categoryFilter, - required this.orderMostFrequentFirst, - }) : super.internal(); - - final List? triggers; - final List? groups; - final String? domain; - final ({String category, String? subCategory})? categoryFilter; - final bool? orderMostFrequentFirst; - - @override - Override overrideWith( - Stream> Function(BangListRef provider) create, - ) { - return ProviderOverride( - origin: this, - override: BangListProvider._internal( - (ref) => create(ref as BangListRef), - from: from, - name: null, +final class FrequentBangListProvider + extends + $FunctionalProvider< + AsyncValue>, + List, + Stream> + > + with $FutureModifier>, $StreamProvider> { + const FrequentBangListProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'frequentBangListProvider', + isAutoDispose: true, dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - triggers: triggers, - groups: groups, - domain: domain, - categoryFilter: categoryFilter, - orderMostFrequentFirst: orderMostFrequentFirst, - ), - ); + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$frequentBangListHash(); + + @$internal + @override + $StreamProviderElement> $createElement( + $ProviderPointer pointer, + ) => $StreamProviderElement(pointer); + + @override + Stream> create(Ref ref) { + return frequentBangList(ref); } - - @override - AutoDisposeStreamProviderElement> createElement() { - return _BangListProviderElement(this); - } - - @override - bool operator ==(Object other) { - return other is BangListProvider && - other.triggers == triggers && - other.groups == groups && - other.domain == domain && - other.categoryFilter == categoryFilter && - other.orderMostFrequentFirst == orderMostFrequentFirst; - } - - @override - int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, triggers.hashCode); - hash = _SystemHash.combine(hash, groups.hashCode); - hash = _SystemHash.combine(hash, domain.hashCode); - hash = _SystemHash.combine(hash, categoryFilter.hashCode); - hash = _SystemHash.combine(hash, orderMostFrequentFirst.hashCode); - - return _SystemHash.finish(hash); - } -} - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin BangListRef on AutoDisposeStreamProviderRef> { - /// The parameter `triggers` of this provider. - List? get triggers; - - /// The parameter `groups` of this provider. - List? get groups; - - /// The parameter `domain` of this provider. - String? get domain; - - /// The parameter `categoryFilter` of this provider. - ({String category, String? subCategory})? get categoryFilter; - - /// The parameter `orderMostFrequentFirst` of this provider. - bool? get orderMostFrequentFirst; -} - -class _BangListProviderElement - extends AutoDisposeStreamProviderElement> - with BangListRef { - _BangListProviderElement(super.provider); - - @override - List? get triggers => (origin as BangListProvider).triggers; - @override - List? get groups => (origin as BangListProvider).groups; - @override - String? get domain => (origin as BangListProvider).domain; - @override - ({String category, String? subCategory})? get categoryFilter => - (origin as BangListProvider).categoryFilter; - @override - bool? get orderMostFrequentFirst => - (origin as BangListProvider).orderMostFrequentFirst; } String _$frequentBangListHash() => r'2c1ecb7e9416772fc1c32d01d767e1eb4f865975'; -/// See also [frequentBangList]. -@ProviderFor(frequentBangList) -final frequentBangListProvider = - AutoDisposeStreamProvider>.internal( - frequentBangList, - name: r'frequentBangListProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$frequentBangListHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef FrequentBangListRef = AutoDisposeStreamProviderRef>; -String _$searchHistoryHash() => r'7b97798729643de8e44fd8024cdc02f35124b08b'; - -/// See also [searchHistory]. @ProviderFor(searchHistory) -final searchHistoryProvider = - AutoDisposeStreamProvider>.internal( - searchHistory, - name: r'searchHistoryProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$searchHistoryHash, - dependencies: null, - allTransitiveDependencies: null, - ); +const searchHistoryProvider = SearchHistoryProvider._(); -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef SearchHistoryRef = - AutoDisposeStreamProviderRef>; -String _$lastSyncOfGroupHash() => r'23d07f3132ba9bb35a31f74e3a69698d31d4c569'; - -/// See also [lastSyncOfGroup]. -@ProviderFor(lastSyncOfGroup) -const lastSyncOfGroupProvider = LastSyncOfGroupFamily(); - -/// See also [lastSyncOfGroup]. -class LastSyncOfGroupFamily extends Family> { - /// See also [lastSyncOfGroup]. - const LastSyncOfGroupFamily(); - - /// See also [lastSyncOfGroup]. - LastSyncOfGroupProvider call(BangGroup group) { - return LastSyncOfGroupProvider(group); - } - - @override - LastSyncOfGroupProvider getProviderOverride( - covariant LastSyncOfGroupProvider provider, - ) { - return call(provider.group); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'lastSyncOfGroupProvider'; -} - -/// See also [lastSyncOfGroup]. -class LastSyncOfGroupProvider extends AutoDisposeStreamProvider { - /// See also [lastSyncOfGroup]. - LastSyncOfGroupProvider(BangGroup group) - : this._internal( - (ref) => lastSyncOfGroup(ref as LastSyncOfGroupRef, group), - from: lastSyncOfGroupProvider, - name: r'lastSyncOfGroupProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$lastSyncOfGroupHash, - dependencies: LastSyncOfGroupFamily._dependencies, - allTransitiveDependencies: - LastSyncOfGroupFamily._allTransitiveDependencies, - group: group, +final class SearchHistoryProvider + extends + $FunctionalProvider< + AsyncValue>, + List, + Stream> + > + with + $FutureModifier>, + $StreamProvider> { + const SearchHistoryProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'searchHistoryProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, ); - LastSyncOfGroupProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.group, - }) : super.internal(); + @override + String debugGetCreateSourceHash() => _$searchHistoryHash(); - final BangGroup group; + @$internal + @override + $StreamProviderElement> $createElement( + $ProviderPointer pointer, + ) => $StreamProviderElement(pointer); @override - Override overrideWith( - Stream Function(LastSyncOfGroupRef provider) create, - ) { - return ProviderOverride( - origin: this, - override: LastSyncOfGroupProvider._internal( - (ref) => create(ref as LastSyncOfGroupRef), - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - group: group, - ), - ); + Stream> create(Ref ref) { + return searchHistory(ref); + } +} + +String _$searchHistoryHash() => r'7b97798729643de8e44fd8024cdc02f35124b08b'; + +@ProviderFor(lastSyncOfGroup) +const lastSyncOfGroupProvider = LastSyncOfGroupFamily._(); + +final class LastSyncOfGroupProvider + extends + $FunctionalProvider, DateTime?, Stream> + with $FutureModifier, $StreamProvider { + const LastSyncOfGroupProvider._({ + required LastSyncOfGroupFamily super.from, + required BangGroup super.argument, + }) : super( + retry: null, + name: r'lastSyncOfGroupProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$lastSyncOfGroupHash(); + + @override + String toString() { + return r'lastSyncOfGroupProvider' + '' + '($argument)'; } + @$internal @override - AutoDisposeStreamProviderElement createElement() { - return _LastSyncOfGroupProviderElement(this); + $StreamProviderElement $createElement($ProviderPointer pointer) => + $StreamProviderElement(pointer); + + @override + Stream create(Ref ref) { + final argument = this.argument as BangGroup; + return lastSyncOfGroup(ref, argument); } @override bool operator ==(Object other) { - return other is LastSyncOfGroupProvider && other.group == group; + return other is LastSyncOfGroupProvider && other.argument == argument; } @override int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, group.hashCode); - - return _SystemHash.finish(hash); + return argument.hashCode; } } -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin LastSyncOfGroupRef on AutoDisposeStreamProviderRef { - /// The parameter `group` of this provider. - BangGroup get group; -} +String _$lastSyncOfGroupHash() => r'23d07f3132ba9bb35a31f74e3a69698d31d4c569'; -class _LastSyncOfGroupProviderElement - extends AutoDisposeStreamProviderElement - with LastSyncOfGroupRef { - _LastSyncOfGroupProviderElement(super.provider); +final class LastSyncOfGroupFamily extends $Family + with $FunctionalFamilyOverride, BangGroup> { + const LastSyncOfGroupFamily._() + : super( + retry: null, + name: r'lastSyncOfGroupProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, + ); + + LastSyncOfGroupProvider call(BangGroup group) => + LastSyncOfGroupProvider._(argument: group, from: this); @override - BangGroup get group => (origin as LastSyncOfGroupProvider).group; + String toString() => r'lastSyncOfGroupProvider'; +} + +@ProviderFor(bangCountOfGroup) +const bangCountOfGroupProvider = BangCountOfGroupFamily._(); + +final class BangCountOfGroupProvider + extends $FunctionalProvider, int, Stream> + with $FutureModifier, $StreamProvider { + const BangCountOfGroupProvider._({ + required BangCountOfGroupFamily super.from, + required BangGroup super.argument, + }) : super( + retry: null, + name: r'bangCountOfGroupProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$bangCountOfGroupHash(); + + @override + String toString() { + return r'bangCountOfGroupProvider' + '' + '($argument)'; + } + + @$internal + @override + $StreamProviderElement $createElement($ProviderPointer pointer) => + $StreamProviderElement(pointer); + + @override + Stream create(Ref ref) { + final argument = this.argument as BangGroup; + return bangCountOfGroup(ref, argument); + } + + @override + bool operator ==(Object other) { + return other is BangCountOfGroupProvider && other.argument == argument; + } + + @override + int get hashCode { + return argument.hashCode; + } } String _$bangCountOfGroupHash() => r'211ffcd7f49b637a7953f913dc5eafda344423f3'; -/// See also [bangCountOfGroup]. -@ProviderFor(bangCountOfGroup) -const bangCountOfGroupProvider = BangCountOfGroupFamily(); - -/// See also [bangCountOfGroup]. -class BangCountOfGroupFamily extends Family> { - /// See also [bangCountOfGroup]. - const BangCountOfGroupFamily(); - - /// See also [bangCountOfGroup]. - BangCountOfGroupProvider call(BangGroup group) { - return BangCountOfGroupProvider(group); - } - - @override - BangCountOfGroupProvider getProviderOverride( - covariant BangCountOfGroupProvider provider, - ) { - return call(provider.group); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'bangCountOfGroupProvider'; -} - -/// See also [bangCountOfGroup]. -class BangCountOfGroupProvider extends AutoDisposeStreamProvider { - /// See also [bangCountOfGroup]. - BangCountOfGroupProvider(BangGroup group) - : this._internal( - (ref) => bangCountOfGroup(ref as BangCountOfGroupRef, group), - from: bangCountOfGroupProvider, +final class BangCountOfGroupFamily extends $Family + with $FunctionalFamilyOverride, BangGroup> { + const BangCountOfGroupFamily._() + : super( + retry: null, name: r'bangCountOfGroupProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$bangCountOfGroupHash, - dependencies: BangCountOfGroupFamily._dependencies, - allTransitiveDependencies: - BangCountOfGroupFamily._allTransitiveDependencies, - group: group, + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, ); - BangCountOfGroupProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.group, - }) : super.internal(); - - final BangGroup group; + BangCountOfGroupProvider call(BangGroup group) => + BangCountOfGroupProvider._(argument: group, from: this); @override - Override overrideWith( - Stream Function(BangCountOfGroupRef provider) create, - ) { - return ProviderOverride( - origin: this, - override: BangCountOfGroupProvider._internal( - (ref) => create(ref as BangCountOfGroupRef), - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - group: group, - ), - ); - } - - @override - AutoDisposeStreamProviderElement createElement() { - return _BangCountOfGroupProviderElement(this); - } - - @override - bool operator ==(Object other) { - return other is BangCountOfGroupProvider && other.group == group; - } - - @override - int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, group.hashCode); - - return _SystemHash.finish(hash); - } + String toString() => r'bangCountOfGroupProvider'; } - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin BangCountOfGroupRef on AutoDisposeStreamProviderRef { - /// The parameter `group` of this provider. - BangGroup get group; -} - -class _BangCountOfGroupProviderElement - extends AutoDisposeStreamProviderElement - with BangCountOfGroupRef { - _BangCountOfGroupProviderElement(super.provider); - - @override - BangGroup get group => (origin as BangCountOfGroupProvider).group; -} - -// 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 diff --git a/app/lib/features/bangs/domain/providers/search.g.dart b/app/lib/features/bangs/domain/providers/search.g.dart index 1556c548..d79760a6 100644 --- a/app/lib/features/bangs/domain/providers/search.g.dart +++ b/app/lib/features/bangs/domain/providers/search.g.dart @@ -6,40 +6,108 @@ part of 'search.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(BangSearch) +const bangSearchProvider = BangSearchProvider._(); + +final class BangSearchProvider + extends $StreamNotifierProvider> { + const BangSearchProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'bangSearchProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$bangSearchHash(); + + @$internal + @override + BangSearch create() => BangSearch(); +} + String _$bangSearchHash() => r'6b7452d48698c01870c5c75f0c10cadaafc481c8'; -/// See also [BangSearch]. -@ProviderFor(BangSearch) -final bangSearchProvider = - AutoDisposeStreamNotifierProvider>.internal( - BangSearch.new, - name: r'bangSearchProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$bangSearchHash, - dependencies: null, - allTransitiveDependencies: null, - ); +abstract class _$BangSearch extends $StreamNotifier> { + Stream> build(); + @$mustCallSuper + @override + void runBuild() { + final created = build(); + final ref = this.ref as $Ref>, List>; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier>, List>, + AsyncValue>, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} + +@ProviderFor(SeamlessBang) +const seamlessBangProvider = SeamlessBangProvider._(); + +final class SeamlessBangProvider + extends $NotifierProvider>> { + const SeamlessBangProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'seamlessBangProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$seamlessBangHash(); + + @$internal + @override + SeamlessBang create() => SeamlessBang(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(AsyncValue> value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider>>(value), + ); + } +} -typedef _$BangSearch = AutoDisposeStreamNotifier>; String _$seamlessBangHash() => r'8bd7a2cbe4c302ae08f85167290666a7437f8b9b'; -/// See also [SeamlessBang]. -@ProviderFor(SeamlessBang) -final seamlessBangProvider = - AutoDisposeNotifierProvider< - SeamlessBang, - AsyncValue> - >.internal( - SeamlessBang.new, - name: r'seamlessBangProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$seamlessBangHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$SeamlessBang = AutoDisposeNotifier>>; -// 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 +abstract class _$SeamlessBang extends $Notifier>> { + AsyncValue> build(); + @$mustCallSuper + @override + void runBuild() { + final created = build(); + final ref = + this.ref + as $Ref>, AsyncValue>>; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier< + AsyncValue>, + AsyncValue> + >, + AsyncValue>, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} diff --git a/app/lib/features/bangs/domain/repositories/data.dart b/app/lib/features/bangs/domain/repositories/data.dart index 297efb0c..7b85826a 100644 --- a/app/lib/features/bangs/domain/repositories/data.dart +++ b/app/lib/features/bangs/domain/repositories/data.dart @@ -46,14 +46,17 @@ class BangDataRepository extends _$BangDataRepository { } Stream>> watchCategories() { - return ref.read(bangDatabaseProvider).categoriesJson().watchSingle().map(( - json, - ) { - final decoded = jsonDecode(json) as Map; - return decoded.map( - (key, value) => MapEntry(key, (value as List).cast()), - ); - }); + return ref + .read(bangDatabaseProvider) + .definitionsDrift + .categoriesJson() + .watchSingle() + .map((json) { + final decoded = jsonDecode(json) as Map; + return decoded.map( + (key, value) => MapEntry(key, (value as List).cast()), + ); + }); } Stream watchBangCount(BangGroup group) { @@ -96,6 +99,7 @@ class BangDataRepository extends _$BangDataRepository { Stream> watchSearchHistory({required int limit}) { return ref .read(bangDatabaseProvider) + .definitionsDrift .searchHistoryEntries(limit: limit) .watch(); } @@ -116,7 +120,7 @@ class BangDataRepository extends _$BangDataRepository { //Pack in a transaction to bundle rebuilds of watch() queries return db.transaction(() async { await db.bangDao.addSearchEntry(trigger, searchQuery); - await db.evictHistoryEntries(limit: maxEntryCount); + await db.definitionsDrift.evictHistoryEntries(limit: maxEntryCount); }); } diff --git a/app/lib/features/bangs/domain/repositories/data.g.dart b/app/lib/features/bangs/domain/repositories/data.g.dart index 8a997b5f..bc0b8618 100644 --- a/app/lib/features/bangs/domain/repositories/data.g.dart +++ b/app/lib/features/bangs/domain/repositories/data.g.dart @@ -6,22 +6,59 @@ part of 'data.dart'; // RiverpodGenerator // ************************************************************************** -String _$bangDataRepositoryHash() => - r'095708cfffe8d0fb604dc02f69e77ae1c050a893'; +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning -/// See also [BangDataRepository]. @ProviderFor(BangDataRepository) -final bangDataRepositoryProvider = - NotifierProvider.internal( - BangDataRepository.new, - name: r'bangDataRepositoryProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$bangDataRepositoryHash, - dependencies: null, - allTransitiveDependencies: null, - ); +const bangDataRepositoryProvider = BangDataRepositoryProvider._(); -typedef _$BangDataRepository = Notifier; -// 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 BangDataRepositoryProvider + extends $NotifierProvider { + const BangDataRepositoryProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'bangDataRepositoryProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$bangDataRepositoryHash(); + + @$internal + @override + BangDataRepository create() => BangDataRepository(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(void value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + +String _$bangDataRepositoryHash() => + r'5e25ce123d4667a0b12316f5b771b6776c40f280'; + +abstract class _$BangDataRepository extends $Notifier { + void build(); + @$mustCallSuper + @override + void runBuild() { + build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + void, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} diff --git a/app/lib/features/bangs/domain/repositories/sync.dart b/app/lib/features/bangs/domain/repositories/sync.dart index 00777c73..f3517595 100644 --- a/app/lib/features/bangs/domain/repositories/sync.dart +++ b/app/lib/features/bangs/domain/repositories/sync.dart @@ -55,7 +55,7 @@ class BangSyncRepository extends _$BangSyncRepository { remoteBangs: remoteBangs, syncTime: DateTime.now(), ); - await db.optimizeFtsIndex(); + await db.definitionsDrift.optimizeFtsIndex(); }); } @@ -85,7 +85,7 @@ class BangSyncRepository extends _$BangSyncRepository { remoteBangs: remoteBangs, syncTime: sourceDate, ); - await db.optimizeFtsIndex(); + await db.definitionsDrift.optimizeFtsIndex(); }); } diff --git a/app/lib/features/bangs/domain/repositories/sync.g.dart b/app/lib/features/bangs/domain/repositories/sync.g.dart index fda49080..cf304c91 100644 --- a/app/lib/features/bangs/domain/repositories/sync.g.dart +++ b/app/lib/features/bangs/domain/repositories/sync.g.dart @@ -6,22 +6,59 @@ part of 'sync.dart'; // RiverpodGenerator // ************************************************************************** -String _$bangSyncRepositoryHash() => - r'0b83cd341c7a6b84cc59a4b077274e0cb0dd495a'; +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning -/// See also [BangSyncRepository]. @ProviderFor(BangSyncRepository) -final bangSyncRepositoryProvider = - NotifierProvider.internal( - BangSyncRepository.new, - name: r'bangSyncRepositoryProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$bangSyncRepositoryHash, - dependencies: null, - allTransitiveDependencies: null, - ); +const bangSyncRepositoryProvider = BangSyncRepositoryProvider._(); -typedef _$BangSyncRepository = Notifier; -// 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 BangSyncRepositoryProvider + extends $NotifierProvider { + const BangSyncRepositoryProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'bangSyncRepositoryProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$bangSyncRepositoryHash(); + + @$internal + @override + BangSyncRepository create() => BangSyncRepository(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(void value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + +String _$bangSyncRepositoryHash() => + r'bb977652087d2ff2cb75b093adcfc45dafa21d2a'; + +abstract class _$BangSyncRepository extends $Notifier { + void build(); + @$mustCallSuper + @override + void runBuild() { + build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + void, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} diff --git a/app/lib/features/bangs/presentation/widgets/site_search.dart b/app/lib/features/bangs/presentation/widgets/site_search.dart index b05397f4..44d921e1 100644 --- a/app/lib/features/bangs/presentation/widgets/site_search.dart +++ b/app/lib/features/bangs/presentation/widgets/site_search.dart @@ -69,7 +69,7 @@ class SiteSearch extends HookConsumerWidget { final selectedBang = ref.watch(selectedBangDataProvider(domain: domain)); final defaultSearchBang = ref.watch( - defaultSearchBangDataProvider.select((value) => value.valueOrNull), + defaultSearchBangDataProvider.select((value) => value.value), ); Future submitSearch(String value) async { diff --git a/app/lib/features/geckoview/domain/controllers/bottom_sheet.g.dart b/app/lib/features/geckoview/domain/controllers/bottom_sheet.g.dart index 42f5e36a..5848fc80 100644 --- a/app/lib/features/geckoview/domain/controllers/bottom_sheet.g.dart +++ b/app/lib/features/geckoview/domain/controllers/bottom_sheet.g.dart @@ -6,38 +6,104 @@ part of 'bottom_sheet.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(BottomSheetController) +const bottomSheetControllerProvider = BottomSheetControllerProvider._(); + +final class BottomSheetControllerProvider + extends $NotifierProvider { + const BottomSheetControllerProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'bottomSheetControllerProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$bottomSheetControllerHash(); + + @$internal + @override + BottomSheetController create() => BottomSheetController(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(Sheet? value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + String _$bottomSheetControllerHash() => r'0b0ea53a96b80b8c1cba79b1d5913274b7127d5b'; -/// See also [BottomSheetController]. -@ProviderFor(BottomSheetController) -final bottomSheetControllerProvider = - AutoDisposeNotifierProvider.internal( - BottomSheetController.new, - name: r'bottomSheetControllerProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$bottomSheetControllerHash, - dependencies: null, - allTransitiveDependencies: null, - ); +abstract class _$BottomSheetController extends $Notifier { + Sheet? build(); + @$mustCallSuper + @override + void runBuild() { + final created = build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + Sheet?, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} + +@ProviderFor(BottomSheetExtend) +const bottomSheetExtendProvider = BottomSheetExtendProvider._(); + +final class BottomSheetExtendProvider + extends $StreamNotifierProvider { + const BottomSheetExtendProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'bottomSheetExtendProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$bottomSheetExtendHash(); + + @$internal + @override + BottomSheetExtend create() => BottomSheetExtend(); +} -typedef _$BottomSheetController = AutoDisposeNotifier; String _$bottomSheetExtendHash() => r'7e11b9047c15bdeb4dfcb488a8573daadb64e25c'; -/// See also [BottomSheetExtend]. -@ProviderFor(BottomSheetExtend) -final bottomSheetExtendProvider = - StreamNotifierProvider.internal( - BottomSheetExtend.new, - name: r'bottomSheetExtendProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$bottomSheetExtendHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$BottomSheetExtend = StreamNotifier; -// 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 +abstract class _$BottomSheetExtend extends $StreamNotifier { + Stream build(); + @$mustCallSuper + @override + void runBuild() { + final created = build(); + final ref = this.ref as $Ref, double>; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, double>, + AsyncValue, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} diff --git a/app/lib/features/geckoview/domain/controllers/overlay.g.dart b/app/lib/features/geckoview/domain/controllers/overlay.g.dart index e86fa940..f993203d 100644 --- a/app/lib/features/geckoview/domain/controllers/overlay.g.dart +++ b/app/lib/features/geckoview/domain/controllers/overlay.g.dart @@ -6,21 +6,58 @@ part of 'overlay.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(OverlayController) +const overlayControllerProvider = OverlayControllerProvider._(); + +final class OverlayControllerProvider + extends $NotifierProvider { + const OverlayControllerProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'overlayControllerProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$overlayControllerHash(); + + @$internal + @override + OverlayController create() => OverlayController(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(WidgetBuilder? value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + String _$overlayControllerHash() => r'7b7885e07ae557c14199b6942b5d6392592ab747'; -/// See also [OverlayController]. -@ProviderFor(OverlayController) -final overlayControllerProvider = - AutoDisposeNotifierProvider.internal( - OverlayController.new, - name: r'overlayControllerProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$overlayControllerHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$OverlayController = AutoDisposeNotifier; -// 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 +abstract class _$OverlayController extends $Notifier { + WidgetBuilder? build(); + @$mustCallSuper + @override + void runBuild() { + final created = build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + WidgetBuilder?, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} diff --git a/app/lib/features/geckoview/domain/entities/states/tab.g.dart b/app/lib/features/geckoview/domain/entities/states/tab.g.dart index 817bab07..023199a2 100644 --- a/app/lib/features/geckoview/domain/entities/states/tab.g.dart +++ b/app/lib/features/geckoview/domain/entities/states/tab.g.dart @@ -35,12 +35,13 @@ abstract class _$TabStateCWProxy { TabState findResultState(FindResultState findResultState); - /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TabState(...).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 `TabState(...).copyWith.fieldName(value)`. /// - /// Usage + /// Example: /// ```dart /// TabState(...).copyWith(id: 12, name: "My name") - /// ```` + /// ``` TabState call({ String? parentId, String? contextId, @@ -59,65 +60,67 @@ abstract class _$TabStateCWProxy { }); } -/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfTabState.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfTabState.copyWith.fieldName(...)` +/// Callable proxy for `copyWith` functionality. +/// Use as `instanceOfTabState.copyWith(...)` or call `instanceOfTabState.copyWith.fieldName(value)` for a single field. class _$TabStateCWProxyImpl implements _$TabStateCWProxy { const _$TabStateCWProxyImpl(this._value); final TabState _value; @override - TabState parentId(String? parentId) => this(parentId: parentId); + TabState parentId(String? parentId) => call(parentId: parentId); @override - TabState contextId(String? contextId) => this(contextId: contextId); + TabState contextId(String? contextId) => call(contextId: contextId); @override - TabState url(Uri url) => this(url: url); + TabState url(Uri url) => call(url: url); @override - TabState title(String title) => this(title: title); + TabState title(String title) => call(title: title); @override - TabState icon(EquatableImage? icon) => this(icon: icon); + TabState icon(EquatableImage? icon) => call(icon: icon); @override - TabState thumbnail(EquatableImage? thumbnail) => this(thumbnail: thumbnail); + TabState thumbnail(EquatableImage? thumbnail) => call(thumbnail: thumbnail); @override - TabState progress(int progress) => this(progress: progress); + TabState progress(int progress) => call(progress: progress); @override - TabState isPrivate(bool isPrivate) => this(isPrivate: isPrivate); + TabState isPrivate(bool isPrivate) => call(isPrivate: isPrivate); @override - TabState isFullScreen(bool isFullScreen) => this(isFullScreen: isFullScreen); + TabState isFullScreen(bool isFullScreen) => call(isFullScreen: isFullScreen); @override - TabState isLoading(bool isLoading) => this(isLoading: isLoading); + TabState isLoading(bool isLoading) => call(isLoading: isLoading); @override TabState securityInfoState(SecurityState securityInfoState) => - this(securityInfoState: securityInfoState); + call(securityInfoState: securityInfoState); @override TabState historyState(HistoryState historyState) => - this(historyState: historyState); + call(historyState: historyState); @override TabState readerableState(ReaderableState readerableState) => - this(readerableState: readerableState); + call(readerableState: readerableState); @override TabState findResultState(FindResultState findResultState) => - this(findResultState: findResultState); + call(findResultState: findResultState); @override - /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TabState(...).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 `TabState(...).copyWith.fieldName(value)`. /// - /// Usage + /// Example: /// ```dart /// TabState(...).copyWith(id: 12, name: "My name") - /// ```` + /// ``` TabState call({ Object? parentId = const $CopyWithPlaceholder(), Object? contextId = const $CopyWithPlaceholder(), @@ -144,11 +147,11 @@ class _$TabStateCWProxyImpl implements _$TabStateCWProxy { ? _value.contextId // ignore: cast_nullable_to_non_nullable : contextId as String?, - url: url == const $CopyWithPlaceholder() + url: url == const $CopyWithPlaceholder() || url == null ? _value.url // ignore: cast_nullable_to_non_nullable : url as Uri, - title: title == const $CopyWithPlaceholder() + title: title == const $CopyWithPlaceholder() || title == null ? _value.title // ignore: cast_nullable_to_non_nullable : title as String, @@ -160,35 +163,43 @@ class _$TabStateCWProxyImpl implements _$TabStateCWProxy { ? _value.thumbnail // ignore: cast_nullable_to_non_nullable : thumbnail as EquatableImage?, - progress: progress == const $CopyWithPlaceholder() + progress: progress == const $CopyWithPlaceholder() || progress == null ? _value.progress // ignore: cast_nullable_to_non_nullable : progress as int, - isPrivate: isPrivate == const $CopyWithPlaceholder() + isPrivate: isPrivate == const $CopyWithPlaceholder() || isPrivate == null ? _value.isPrivate // ignore: cast_nullable_to_non_nullable : isPrivate as bool, - isFullScreen: isFullScreen == const $CopyWithPlaceholder() + isFullScreen: + isFullScreen == const $CopyWithPlaceholder() || isFullScreen == null ? _value.isFullScreen // ignore: cast_nullable_to_non_nullable : isFullScreen as bool, - isLoading: isLoading == const $CopyWithPlaceholder() + isLoading: isLoading == const $CopyWithPlaceholder() || isLoading == null ? _value.isLoading // ignore: cast_nullable_to_non_nullable : isLoading as bool, - securityInfoState: securityInfoState == const $CopyWithPlaceholder() + securityInfoState: + securityInfoState == const $CopyWithPlaceholder() || + securityInfoState == null ? _value.securityInfoState // ignore: cast_nullable_to_non_nullable : securityInfoState as SecurityState, - historyState: historyState == const $CopyWithPlaceholder() + historyState: + historyState == const $CopyWithPlaceholder() || historyState == null ? _value.historyState // ignore: cast_nullable_to_non_nullable : historyState as HistoryState, - readerableState: readerableState == const $CopyWithPlaceholder() + readerableState: + readerableState == const $CopyWithPlaceholder() || + readerableState == null ? _value.readerableState // ignore: cast_nullable_to_non_nullable : readerableState as ReaderableState, - findResultState: findResultState == const $CopyWithPlaceholder() + findResultState: + findResultState == const $CopyWithPlaceholder() || + findResultState == null ? _value.findResultState // ignore: cast_nullable_to_non_nullable : findResultState as FindResultState, @@ -197,7 +208,8 @@ class _$TabStateCWProxyImpl implements _$TabStateCWProxy { } extension $TabStateCopyWith on TabState { - /// Returns a callable class that can be used as follows: `instanceOfTabState.copyWith(...)` or like so:`instanceOfTabState.copyWith.fieldName(...)`. + /// Returns a callable class used to build a new instance with modified fields. + /// Example: `instanceOfTabState.copyWith(...)` or `instanceOfTabState.copyWith.fieldName(...)`. // ignore: library_private_types_in_public_api _$TabStateCWProxy get copyWith => _$TabStateCWProxyImpl(this); } diff --git a/app/lib/features/geckoview/domain/entities/states/web_extension.g.dart b/app/lib/features/geckoview/domain/entities/states/web_extension.g.dart index add69f90..f7303617 100644 --- a/app/lib/features/geckoview/domain/entities/states/web_extension.g.dart +++ b/app/lib/features/geckoview/domain/entities/states/web_extension.g.dart @@ -21,12 +21,13 @@ abstract class _$WebExtensionStateCWProxy { WebExtensionState icon(EquatableImage? icon); - /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `WebExtensionState(...).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 `WebExtensionState(...).copyWith.fieldName(value)`. /// - /// Usage + /// Example: /// ```dart /// WebExtensionState(...).copyWith(id: 12, name: "My name") - /// ```` + /// ``` WebExtensionState call({ String extensionId, bool enabled, @@ -38,7 +39,8 @@ abstract class _$WebExtensionStateCWProxy { }); } -/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfWebExtensionState.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfWebExtensionState.copyWith.fieldName(...)` +/// Callable proxy for `copyWith` functionality. +/// Use as `instanceOfWebExtensionState.copyWith(...)` or call `instanceOfWebExtensionState.copyWith.fieldName(value)` for a single field. class _$WebExtensionStateCWProxyImpl implements _$WebExtensionStateCWProxy { const _$WebExtensionStateCWProxyImpl(this._value); @@ -46,35 +48,36 @@ class _$WebExtensionStateCWProxyImpl implements _$WebExtensionStateCWProxy { @override WebExtensionState extensionId(String extensionId) => - this(extensionId: extensionId); + call(extensionId: extensionId); @override - WebExtensionState enabled(bool enabled) => this(enabled: enabled); + WebExtensionState enabled(bool enabled) => call(enabled: enabled); @override - WebExtensionState title(String? title) => this(title: title); + WebExtensionState title(String? title) => call(title: title); @override - WebExtensionState badgeText(String? badgeText) => this(badgeText: badgeText); + WebExtensionState badgeText(String? badgeText) => call(badgeText: badgeText); @override WebExtensionState badgeTextColor(Color? badgeTextColor) => - this(badgeTextColor: badgeTextColor); + call(badgeTextColor: badgeTextColor); @override WebExtensionState badgeBackgroundColor(Color? badgeBackgroundColor) => - this(badgeBackgroundColor: badgeBackgroundColor); + call(badgeBackgroundColor: badgeBackgroundColor); @override - WebExtensionState icon(EquatableImage? icon) => this(icon: icon); + WebExtensionState icon(EquatableImage? icon) => call(icon: icon); @override - /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `WebExtensionState(...).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 `WebExtensionState(...).copyWith.fieldName(value)`. /// - /// Usage + /// Example: /// ```dart /// WebExtensionState(...).copyWith(id: 12, name: "My name") - /// ```` + /// ``` WebExtensionState call({ Object? extensionId = const $CopyWithPlaceholder(), Object? enabled = const $CopyWithPlaceholder(), @@ -85,11 +88,12 @@ class _$WebExtensionStateCWProxyImpl implements _$WebExtensionStateCWProxy { Object? icon = const $CopyWithPlaceholder(), }) { return WebExtensionState( - extensionId: extensionId == const $CopyWithPlaceholder() + extensionId: + extensionId == const $CopyWithPlaceholder() || extensionId == null ? _value.extensionId // ignore: cast_nullable_to_non_nullable : extensionId as String, - enabled: enabled == const $CopyWithPlaceholder() + enabled: enabled == const $CopyWithPlaceholder() || enabled == null ? _value.enabled // ignore: cast_nullable_to_non_nullable : enabled as bool, @@ -118,7 +122,8 @@ class _$WebExtensionStateCWProxyImpl implements _$WebExtensionStateCWProxy { } extension $WebExtensionStateCopyWith on WebExtensionState { - /// Returns a callable class that can be used as follows: `instanceOfWebExtensionState.copyWith(...)` or like so:`instanceOfWebExtensionState.copyWith.fieldName(...)`. + /// Returns a callable class used to build a new instance with modified fields. + /// Example: `instanceOfWebExtensionState.copyWith(...)` or `instanceOfWebExtensionState.copyWith.fieldName(...)`. // ignore: library_private_types_in_public_api _$WebExtensionStateCWProxy get copyWith => _$WebExtensionStateCWProxyImpl(this); diff --git a/app/lib/features/geckoview/domain/providers.g.dart b/app/lib/features/geckoview/domain/providers.g.dart index 885d4bf4..fc6d8ba2 100644 --- a/app/lib/features/geckoview/domain/providers.g.dart +++ b/app/lib/features/geckoview/domain/providers.g.dart @@ -6,110 +6,295 @@ part of 'providers.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(selectionActionService) +const selectionActionServiceProvider = SelectionActionServiceProvider._(); + +final class SelectionActionServiceProvider + extends + $FunctionalProvider< + GeckoSelectionActionService, + GeckoSelectionActionService, + GeckoSelectionActionService + > + with $Provider { + const SelectionActionServiceProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'selectionActionServiceProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$selectionActionServiceHash(); + + @$internal + @override + $ProviderElement $createElement( + $ProviderPointer pointer, + ) => $ProviderElement(pointer); + + @override + GeckoSelectionActionService create(Ref ref) { + return selectionActionService(ref); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(GeckoSelectionActionService value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + String _$selectionActionServiceHash() => r'c89d981c2ba253ed940887fa59c11ad93d8589a8'; -/// See also [selectionActionService]. -@ProviderFor(selectionActionService) -final selectionActionServiceProvider = - Provider.internal( - selectionActionService, - name: r'selectionActionServiceProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$selectionActionServiceHash, - dependencies: null, - allTransitiveDependencies: null, - ); +@ProviderFor(eventService) +const eventServiceProvider = EventServiceProvider._(); + +final class EventServiceProvider + extends + $FunctionalProvider< + GeckoEventService, + GeckoEventService, + GeckoEventService + > + with $Provider { + const EventServiceProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'eventServiceProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$eventServiceHash(); + + @$internal + @override + $ProviderElement $createElement( + $ProviderPointer pointer, + ) => $ProviderElement(pointer); + + @override + GeckoEventService create(Ref ref) { + return eventService(ref); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(GeckoEventService value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef SelectionActionServiceRef = ProviderRef; String _$eventServiceHash() => r'166b01f636fbdd4355dbc55a18ca4f83e0006de8'; -/// See also [eventService]. -@ProviderFor(eventService) -final eventServiceProvider = Provider.internal( - eventService, - name: r'eventServiceProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$eventServiceHash, - dependencies: null, - allTransitiveDependencies: null, -); +@ProviderFor(addonService) +const addonServiceProvider = AddonServiceProvider._(); + +final class AddonServiceProvider + extends + $FunctionalProvider< + GeckoAddonService, + GeckoAddonService, + GeckoAddonService + > + with $Provider { + const AddonServiceProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'addonServiceProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$addonServiceHash(); + + @$internal + @override + $ProviderElement $createElement( + $ProviderPointer pointer, + ) => $ProviderElement(pointer); + + @override + GeckoAddonService create(Ref ref) { + return addonService(ref); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(GeckoAddonService value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef EventServiceRef = ProviderRef; String _$addonServiceHash() => r'c7aca09b99c3810908176f3464f5f90a185aa5e7'; -/// See also [addonService]. -@ProviderFor(addonService) -final addonServiceProvider = Provider.internal( - addonService, - name: r'addonServiceProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$addonServiceHash, - dependencies: null, - allTransitiveDependencies: null, -); +@ProviderFor(tabContentService) +const tabContentServiceProvider = TabContentServiceProvider._(); + +final class TabContentServiceProvider + extends + $FunctionalProvider< + GeckoTabContentService, + GeckoTabContentService, + GeckoTabContentService + > + with $Provider { + const TabContentServiceProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'tabContentServiceProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$tabContentServiceHash(); + + @$internal + @override + $ProviderElement $createElement( + $ProviderPointer pointer, + ) => $ProviderElement(pointer); + + @override + GeckoTabContentService create(Ref ref) { + return tabContentService(ref); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(GeckoTabContentService value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef AddonServiceRef = ProviderRef; String _$tabContentServiceHash() => r'd9a991add907ecc138c62790883e59d8e9aa9266'; -/// See also [tabContentService]. -@ProviderFor(tabContentService) -final tabContentServiceProvider = Provider.internal( - tabContentService, - name: r'tabContentServiceProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$tabContentServiceHash, - dependencies: null, - allTransitiveDependencies: null, -); +@ProviderFor(engineSuggestionsService) +const engineSuggestionsServiceProvider = EngineSuggestionsServiceProvider._(); + +final class EngineSuggestionsServiceProvider + extends + $FunctionalProvider< + GeckoSuggestionsService, + GeckoSuggestionsService, + GeckoSuggestionsService + > + with $Provider { + const EngineSuggestionsServiceProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'engineSuggestionsServiceProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$engineSuggestionsServiceHash(); + + @$internal + @override + $ProviderElement $createElement( + $ProviderPointer pointer, + ) => $ProviderElement(pointer); + + @override + GeckoSuggestionsService create(Ref ref) { + return engineSuggestionsService(ref); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(GeckoSuggestionsService value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef TabContentServiceRef = ProviderRef; String _$engineSuggestionsServiceHash() => r'f7414b335564578b2c7f6a86baf8bf13f2d5ba2d'; -/// See also [engineSuggestionsService]. -@ProviderFor(engineSuggestionsService) -final engineSuggestionsServiceProvider = - Provider.internal( - engineSuggestionsService, - name: r'engineSuggestionsServiceProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$engineSuggestionsServiceHash, - dependencies: null, - allTransitiveDependencies: null, - ); +@ProviderFor(EngineReadyState) +const engineReadyStateProvider = EngineReadyStateProvider._(); + +final class EngineReadyStateProvider + extends $NotifierProvider { + const EngineReadyStateProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'engineReadyStateProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$engineReadyStateHash(); + + @$internal + @override + EngineReadyState create() => EngineReadyState(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(bool value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef EngineSuggestionsServiceRef = ProviderRef; String _$engineReadyStateHash() => r'a892c48ffc29e3414de12e66d9bfec522e4f40a8'; -/// See also [EngineReadyState]. -@ProviderFor(EngineReadyState) -final engineReadyStateProvider = - NotifierProvider.internal( - EngineReadyState.new, - name: r'engineReadyStateProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$engineReadyStateHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$EngineReadyState = Notifier; -// 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 +abstract class _$EngineReadyState extends $Notifier { + bool build(); + @$mustCallSuper + @override + void runBuild() { + final created = build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + bool, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} diff --git a/app/lib/features/geckoview/domain/providers/browser_extension.g.dart b/app/lib/features/geckoview/domain/providers/browser_extension.g.dart index c0384913..35f4293a 100644 --- a/app/lib/features/geckoview/domain/providers/browser_extension.g.dart +++ b/app/lib/features/geckoview/domain/providers/browser_extension.g.dart @@ -6,41 +6,86 @@ part of 'browser_extension.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(browserExtensionService) +const browserExtensionServiceProvider = BrowserExtensionServiceProvider._(); + +final class BrowserExtensionServiceProvider + extends + $FunctionalProvider< + GeckoBrowserExtensionService, + GeckoBrowserExtensionService, + GeckoBrowserExtensionService + > + with $Provider { + const BrowserExtensionServiceProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'browserExtensionServiceProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$browserExtensionServiceHash(); + + @$internal + @override + $ProviderElement $createElement( + $ProviderPointer pointer, + ) => $ProviderElement(pointer); + + @override + GeckoBrowserExtensionService create(Ref ref) { + return browserExtensionService(ref); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(GeckoBrowserExtensionService value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + String _$browserExtensionServiceHash() => r'c3f67763e0abb10039b407fced6e175e5ec7c6c3'; -/// See also [browserExtensionService]. -@ProviderFor(browserExtensionService) -final browserExtensionServiceProvider = - Provider.internal( - browserExtensionService, - name: r'browserExtensionServiceProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$browserExtensionServiceHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef BrowserExtensionServiceRef = ProviderRef; -String _$feedRequestedHash() => r'4f179d0878072a77a87422ff6afdac53a3d57c04'; - -/// See also [feedRequested]. @ProviderFor(feedRequested) -final feedRequestedProvider = AutoDisposeStreamProvider.internal( - feedRequested, - name: r'feedRequestedProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$feedRequestedHash, - dependencies: null, - allTransitiveDependencies: null, -); +const feedRequestedProvider = FeedRequestedProvider._(); -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef FeedRequestedRef = AutoDisposeStreamProviderRef; -// 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 FeedRequestedProvider + extends $FunctionalProvider, String, Stream> + with $FutureModifier, $StreamProvider { + const FeedRequestedProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'feedRequestedProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$feedRequestedHash(); + + @$internal + @override + $StreamProviderElement $createElement($ProviderPointer pointer) => + $StreamProviderElement(pointer); + + @override + Stream create(Ref ref) { + return feedRequested(ref); + } +} + +String _$feedRequestedHash() => r'4f179d0878072a77a87422ff6afdac53a3d57c04'; diff --git a/app/lib/features/geckoview/domain/providers/selected_tab.g.dart b/app/lib/features/geckoview/domain/providers/selected_tab.g.dart index 10b87276..c279333b 100644 --- a/app/lib/features/geckoview/domain/providers/selected_tab.g.dart +++ b/app/lib/features/geckoview/domain/providers/selected_tab.g.dart @@ -6,20 +6,58 @@ part of 'selected_tab.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(SelectedTab) +const selectedTabProvider = SelectedTabProvider._(); + +final class SelectedTabProvider + extends $NotifierProvider { + const SelectedTabProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'selectedTabProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$selectedTabHash(); + + @$internal + @override + SelectedTab create() => SelectedTab(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(String? value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + String _$selectedTabHash() => r'26d1bb90c777d7011f4f27f7b962584a4a62a0a7'; -/// See also [SelectedTab]. -@ProviderFor(SelectedTab) -final selectedTabProvider = NotifierProvider.internal( - SelectedTab.new, - name: r'selectedTabProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$selectedTabHash, - dependencies: null, - allTransitiveDependencies: null, -); - -typedef _$SelectedTab = Notifier; -// 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 +abstract class _$SelectedTab extends $Notifier { + String? build(); + @$mustCallSuper + @override + void runBuild() { + final created = build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + String?, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} diff --git a/app/lib/features/geckoview/domain/providers/tab_list.g.dart b/app/lib/features/geckoview/domain/providers/tab_list.g.dart index a187dbac..39530d30 100644 --- a/app/lib/features/geckoview/domain/providers/tab_list.g.dart +++ b/app/lib/features/geckoview/domain/providers/tab_list.g.dart @@ -6,21 +6,63 @@ part of 'tab_list.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(TabList) +const tabListProvider = TabListProvider._(); + +final class TabListProvider + extends $NotifierProvider>> { + const TabListProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'tabListProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$tabListHash(); + + @$internal + @override + TabList create() => TabList(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(EquatableValue> value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider>>(value), + ); + } +} + String _$tabListHash() => r'0b9ca1e089a59895df4cbf28691c2849a7004f08'; -/// See also [TabList]. -@ProviderFor(TabList) -final tabListProvider = - NotifierProvider>>.internal( - TabList.new, - name: r'tabListProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$tabListHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$TabList = Notifier>>; -// 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 +abstract class _$TabList extends $Notifier>> { + EquatableValue> build(); + @$mustCallSuper + @override + void runBuild() { + final created = build(); + final ref = + this.ref + as $Ref>, EquatableValue>>; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier< + EquatableValue>, + EquatableValue> + >, + EquatableValue>, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} diff --git a/app/lib/features/geckoview/domain/providers/tab_session.g.dart b/app/lib/features/geckoview/domain/providers/tab_session.g.dart index 1a3d51f3..e6413536 100644 --- a/app/lib/features/geckoview/domain/providers/tab_session.g.dart +++ b/app/lib/features/geckoview/domain/providers/tab_session.g.dart @@ -6,174 +6,138 @@ part of 'tab_session.dart'; // RiverpodGenerator // ************************************************************************** -String _$selectedTabSessionNotifierHash() => - r'aef19991d5b05a2bb28e8a6ccb57dc75c2f3148f'; +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning -/// See also [selectedTabSessionNotifier]. -@ProviderFor(selectedTabSessionNotifier) -final selectedTabSessionNotifierProvider = - AutoDisposeProvider>.internal( - selectedTabSessionNotifier, - name: r'selectedTabSessionNotifierProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$selectedTabSessionNotifierHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef SelectedTabSessionNotifierRef = AutoDisposeProviderRef>; -String _$tabSessionHash() => r'33d68f3860b3bc9a92db386535c7482bf4416008'; - -/// Copied from Dart SDK -class _SystemHash { - _SystemHash._(); - - static int combine(int hash, int value) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + value); - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10)); - return hash ^ (hash >> 6); - } - - static int finish(int hash) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); - // ignore: parameter_assignments - hash = hash ^ (hash >> 11); - return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); - } -} - -abstract class _$TabSession extends BuildlessAutoDisposeNotifier { - late final String? tabId; - - void build({required String? tabId}); -} - -/// See also [TabSession]. @ProviderFor(TabSession) -const tabSessionProvider = TabSessionFamily(); +const tabSessionProvider = TabSessionFamily._(); -/// See also [TabSession]. -class TabSessionFamily extends Family { - /// See also [TabSession]. - const TabSessionFamily(); +final class TabSessionProvider extends $NotifierProvider { + const TabSessionProvider._({ + required TabSessionFamily super.from, + required String? super.argument, + }) : super( + retry: null, + name: r'tabSessionProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); - /// See also [TabSession]. - TabSessionProvider call({required String? tabId}) { - return TabSessionProvider(tabId: tabId); + @override + String debugGetCreateSourceHash() => _$tabSessionHash(); + + @override + String toString() { + return r'tabSessionProvider' + '' + '($argument)'; } + @$internal @override - TabSessionProvider getProviderOverride( - covariant TabSessionProvider provider, - ) { - return call(tabId: provider.tabId); - } + TabSession create() => TabSession(); - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'tabSessionProvider'; -} - -/// See also [TabSession]. -class TabSessionProvider - extends AutoDisposeNotifierProviderImpl { - /// See also [TabSession]. - TabSessionProvider({required String? tabId}) - : this._internal( - () => TabSession()..tabId = tabId, - from: tabSessionProvider, - name: r'tabSessionProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$tabSessionHash, - dependencies: TabSessionFamily._dependencies, - allTransitiveDependencies: TabSessionFamily._allTransitiveDependencies, - tabId: tabId, - ); - - TabSessionProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.tabId, - }) : super.internal(); - - final String? tabId; - - @override - void runNotifierBuild(covariant TabSession notifier) { - return notifier.build(tabId: tabId); - } - - @override - Override overrideWith(TabSession Function() create) { - return ProviderOverride( + /// {@macro riverpod.override_with_value} + Override overrideWithValue(void value) { + return $ProviderOverride( origin: this, - override: TabSessionProvider._internal( - () => create()..tabId = tabId, - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - tabId: tabId, - ), + providerOverride: $SyncValueProvider(value), ); } - @override - AutoDisposeNotifierProviderElement createElement() { - return _TabSessionProviderElement(this); - } - @override bool operator ==(Object other) { - return other is TabSessionProvider && other.tabId == tabId; + return other is TabSessionProvider && other.argument == argument; } @override int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, tabId.hashCode); - - return _SystemHash.finish(hash); + return argument.hashCode; } } -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin TabSessionRef on AutoDisposeNotifierProviderRef { - /// The parameter `tabId` of this provider. - String? get tabId; -} +String _$tabSessionHash() => r'33d68f3860b3bc9a92db386535c7482bf4416008'; -class _TabSessionProviderElement - extends AutoDisposeNotifierProviderElement - with TabSessionRef { - _TabSessionProviderElement(super.provider); +final class TabSessionFamily extends $Family + with $ClassFamilyOverride { + const TabSessionFamily._() + : super( + retry: null, + name: r'tabSessionProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, + ); + + TabSessionProvider call({required String? tabId}) => + TabSessionProvider._(argument: tabId, from: this); @override - String? get tabId => (origin as TabSessionProvider).tabId; + String toString() => r'tabSessionProvider'; } -// 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 +abstract class _$TabSession extends $Notifier { + late final _$args = ref.$arg as String?; + String? get tabId => _$args; + + void build({required String? tabId}); + @$mustCallSuper + @override + void runBuild() { + build(tabId: _$args); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + void, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} + +@ProviderFor(selectedTabSessionNotifier) +const selectedTabSessionProvider = SelectedTabSessionNotifierProvider._(); + +final class SelectedTabSessionNotifierProvider + extends + $FunctionalProvider, Raw, Raw> + with $Provider> { + const SelectedTabSessionNotifierProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'selectedTabSessionProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$selectedTabSessionNotifierHash(); + + @$internal + @override + $ProviderElement> $createElement($ProviderPointer pointer) => + $ProviderElement(pointer); + + @override + Raw create(Ref ref) { + return selectedTabSessionNotifier(ref); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(Raw value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider>(value), + ); + } +} + +String _$selectedTabSessionNotifierHash() => + r'aef19991d5b05a2bb28e8a6ccb57dc75c2f3148f'; diff --git a/app/lib/features/geckoview/domain/providers/tab_state.g.dart b/app/lib/features/geckoview/domain/providers/tab_state.g.dart index eab67fbc..3c11a36b 100644 --- a/app/lib/features/geckoview/domain/providers/tab_state.g.dart +++ b/app/lib/features/geckoview/domain/providers/tab_state.g.dart @@ -6,336 +6,334 @@ part of 'tab_state.dart'; // RiverpodGenerator // ************************************************************************** -String _$tabStateHash() => r'f57b2353acc99ca73670d504b45ea5ff19df38c7'; +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning -/// Copied from Dart SDK -class _SystemHash { - _SystemHash._(); +@ProviderFor(TabStates) +const tabStatesProvider = TabStatesProvider._(); - static int combine(int hash, int value) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + value); - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10)); - return hash ^ (hash >> 6); - } - - static int finish(int hash) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); - // ignore: parameter_assignments - hash = hash ^ (hash >> 11); - return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); - } -} - -/// See also [tabState]. -@ProviderFor(tabState) -const tabStateProvider = TabStateFamily(); - -/// See also [tabState]. -class TabStateFamily extends Family { - /// See also [tabState]. - const TabStateFamily(); - - /// See also [tabState]. - TabStateProvider call(String? tabId) { - return TabStateProvider(tabId); - } - - @override - TabStateProvider getProviderOverride(covariant TabStateProvider provider) { - return call(provider.tabId); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'tabStateProvider'; -} - -/// See also [tabState]. -class TabStateProvider extends AutoDisposeProvider { - /// See also [tabState]. - TabStateProvider(String? tabId) - : this._internal( - (ref) => tabState(ref as TabStateRef, tabId), - from: tabStateProvider, - name: r'tabStateProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$tabStateHash, - dependencies: TabStateFamily._dependencies, - allTransitiveDependencies: TabStateFamily._allTransitiveDependencies, - tabId: tabId, +final class TabStatesProvider + extends $NotifierProvider> { + const TabStatesProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'tabStatesProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, ); - TabStateProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.tabId, - }) : super.internal(); - - final String? tabId; - @override - Override overrideWith(TabState? Function(TabStateRef provider) create) { - return ProviderOverride( + String debugGetCreateSourceHash() => _$tabStatesHash(); + + @$internal + @override + TabStates create() => TabStates(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(Map value) { + return $ProviderOverride( origin: this, - override: TabStateProvider._internal( - (ref) => create(ref as TabStateRef), - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - tabId: tabId, - ), + providerOverride: $SyncValueProvider>(value), ); } - - @override - AutoDisposeProviderElement createElement() { - return _TabStateProviderElement(this); - } - - @override - bool operator ==(Object other) { - return other is TabStateProvider && other.tabId == tabId; - } - - @override - int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, tabId.hashCode); - - return _SystemHash.finish(hash); - } -} - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin TabStateRef on AutoDisposeProviderRef { - /// The parameter `tabId` of this provider. - String? get tabId; -} - -class _TabStateProviderElement extends AutoDisposeProviderElement - with TabStateRef { - _TabStateProviderElement(super.provider); - - @override - String? get tabId => (origin as TabStateProvider).tabId; -} - -String _$selectedTabStateHash() => r'dbd36af7af286bd9d079f30e8e11bbda23bf7728'; - -/// See also [selectedTabState]. -@ProviderFor(selectedTabState) -final selectedTabStateProvider = AutoDisposeProvider.internal( - selectedTabState, - name: r'selectedTabStateProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$selectedTabStateHash, - dependencies: null, - allTransitiveDependencies: null, -); - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef SelectedTabStateRef = AutoDisposeProviderRef; -String _$selectedTabTypeHash() => r'53093fc6db8becde7500163661e087fb0a2eb955'; - -/// See also [selectedTabType]. -@ProviderFor(selectedTabType) -final selectedTabTypeProvider = AutoDisposeProvider.internal( - selectedTabType, - name: r'selectedTabTypeProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$selectedTabTypeHash, - dependencies: null, - allTransitiveDependencies: null, -); - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef SelectedTabTypeRef = AutoDisposeProviderRef; -String _$selectedTabContainerIdHash() => - r'9f0246a02a069b1a66211a3924f32e9d75f0f344'; - -/// See also [selectedTabContainerId]. -@ProviderFor(selectedTabContainerId) -final selectedTabContainerIdProvider = Provider>.internal( - selectedTabContainerId, - name: r'selectedTabContainerIdProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$selectedTabContainerIdHash, - dependencies: null, - allTransitiveDependencies: null, -); - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef SelectedTabContainerIdRef = ProviderRef>; -String _$tabScrollYHash() => r'dcb1e82b42bab98c4fc2ee4c7a22f37a28b8ce9e'; - -/// See also [tabScrollY]. -@ProviderFor(tabScrollY) -const tabScrollYProvider = TabScrollYFamily(); - -/// See also [tabScrollY]. -class TabScrollYFamily extends Family> { - /// See also [tabScrollY]. - const TabScrollYFamily(); - - /// See also [tabScrollY]. - TabScrollYProvider call(String? tabId, Duration sampleTime) { - return TabScrollYProvider(tabId, sampleTime); - } - - @override - TabScrollYProvider getProviderOverride( - covariant TabScrollYProvider provider, - ) { - return call(provider.tabId, provider.sampleTime); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'tabScrollYProvider'; -} - -/// See also [tabScrollY]. -class TabScrollYProvider extends AutoDisposeStreamProvider { - /// See also [tabScrollY]. - TabScrollYProvider(String? tabId, Duration sampleTime) - : this._internal( - (ref) => tabScrollY(ref as TabScrollYRef, tabId, sampleTime), - from: tabScrollYProvider, - name: r'tabScrollYProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$tabScrollYHash, - dependencies: TabScrollYFamily._dependencies, - allTransitiveDependencies: TabScrollYFamily._allTransitiveDependencies, - tabId: tabId, - sampleTime: sampleTime, - ); - - TabScrollYProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.tabId, - required this.sampleTime, - }) : super.internal(); - - final String? tabId; - final Duration sampleTime; - - @override - Override overrideWith(Stream Function(TabScrollYRef provider) create) { - return ProviderOverride( - origin: this, - override: TabScrollYProvider._internal( - (ref) => create(ref as TabScrollYRef), - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - tabId: tabId, - sampleTime: sampleTime, - ), - ); - } - - @override - AutoDisposeStreamProviderElement createElement() { - return _TabScrollYProviderElement(this); - } - - @override - bool operator ==(Object other) { - return other is TabScrollYProvider && - other.tabId == tabId && - other.sampleTime == sampleTime; - } - - @override - int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, tabId.hashCode); - hash = _SystemHash.combine(hash, sampleTime.hashCode); - - return _SystemHash.finish(hash); - } -} - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin TabScrollYRef on AutoDisposeStreamProviderRef { - /// The parameter `tabId` of this provider. - String? get tabId; - - /// The parameter `sampleTime` of this provider. - Duration get sampleTime; -} - -class _TabScrollYProviderElement extends AutoDisposeStreamProviderElement - with TabScrollYRef { - _TabScrollYProviderElement(super.provider); - - @override - String? get tabId => (origin as TabScrollYProvider).tabId; - @override - Duration get sampleTime => (origin as TabScrollYProvider).sampleTime; } String _$tabStatesHash() => r'66cff6a7b36328ee23b89fdd53046987b346bfcd'; -/// See also [TabStates]. -@ProviderFor(TabStates) -final tabStatesProvider = - NotifierProvider>.internal( - TabStates.new, - name: r'tabStatesProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$tabStatesHash, - dependencies: null, - allTransitiveDependencies: null, - ); +abstract class _$TabStates extends $Notifier> { + Map build(); + @$mustCallSuper + @override + void runBuild() { + final created = build(); + final ref = this.ref as $Ref, Map>; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, Map>, + Map, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} -typedef _$TabStates = Notifier>; -// 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 +@ProviderFor(tabState) +const tabStateProvider = TabStateFamily._(); + +final class TabStateProvider + extends $FunctionalProvider + with $Provider { + const TabStateProvider._({ + required TabStateFamily super.from, + required String? super.argument, + }) : super( + retry: null, + name: r'tabStateProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$tabStateHash(); + + @override + String toString() { + return r'tabStateProvider' + '' + '($argument)'; + } + + @$internal + @override + $ProviderElement $createElement($ProviderPointer pointer) => + $ProviderElement(pointer); + + @override + TabState? create(Ref ref) { + final argument = this.argument as String?; + return tabState(ref, argument); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(TabState? value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } + + @override + bool operator ==(Object other) { + return other is TabStateProvider && other.argument == argument; + } + + @override + int get hashCode { + return argument.hashCode; + } +} + +String _$tabStateHash() => r'f57b2353acc99ca73670d504b45ea5ff19df38c7'; + +final class TabStateFamily extends $Family + with $FunctionalFamilyOverride { + const TabStateFamily._() + : super( + retry: null, + name: r'tabStateProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, + ); + + TabStateProvider call(String? tabId) => + TabStateProvider._(argument: tabId, from: this); + + @override + String toString() => r'tabStateProvider'; +} + +@ProviderFor(selectedTabState) +const selectedTabStateProvider = SelectedTabStateProvider._(); + +final class SelectedTabStateProvider + extends $FunctionalProvider + with $Provider { + const SelectedTabStateProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'selectedTabStateProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$selectedTabStateHash(); + + @$internal + @override + $ProviderElement $createElement($ProviderPointer pointer) => + $ProviderElement(pointer); + + @override + TabState? create(Ref ref) { + return selectedTabState(ref); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(TabState? value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + +String _$selectedTabStateHash() => r'dbd36af7af286bd9d079f30e8e11bbda23bf7728'; + +@ProviderFor(selectedTabType) +const selectedTabTypeProvider = SelectedTabTypeProvider._(); + +final class SelectedTabTypeProvider + extends $FunctionalProvider + with $Provider { + const SelectedTabTypeProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'selectedTabTypeProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$selectedTabTypeHash(); + + @$internal + @override + $ProviderElement $createElement($ProviderPointer pointer) => + $ProviderElement(pointer); + + @override + TabType? create(Ref ref) { + return selectedTabType(ref); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(TabType? value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + +String _$selectedTabTypeHash() => r'53093fc6db8becde7500163661e087fb0a2eb955'; + +@ProviderFor(selectedTabContainerId) +const selectedTabContainerIdProvider = SelectedTabContainerIdProvider._(); + +final class SelectedTabContainerIdProvider + extends + $FunctionalProvider< + AsyncValue, + AsyncValue, + AsyncValue + > + with $Provider> { + const SelectedTabContainerIdProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'selectedTabContainerIdProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$selectedTabContainerIdHash(); + + @$internal + @override + $ProviderElement> $createElement( + $ProviderPointer pointer, + ) => $ProviderElement(pointer); + + @override + AsyncValue create(Ref ref) { + return selectedTabContainerId(ref); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(AsyncValue value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider>(value), + ); + } +} + +String _$selectedTabContainerIdHash() => + r'9f0246a02a069b1a66211a3924f32e9d75f0f344'; + +@ProviderFor(tabScrollY) +const tabScrollYProvider = TabScrollYFamily._(); + +final class TabScrollYProvider + extends $FunctionalProvider, int, Stream> + with $FutureModifier, $StreamProvider { + const TabScrollYProvider._({ + required TabScrollYFamily super.from, + required (String?, Duration) super.argument, + }) : super( + retry: null, + name: r'tabScrollYProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$tabScrollYHash(); + + @override + String toString() { + return r'tabScrollYProvider' + '' + '$argument'; + } + + @$internal + @override + $StreamProviderElement $createElement($ProviderPointer pointer) => + $StreamProviderElement(pointer); + + @override + Stream create(Ref ref) { + final argument = this.argument as (String?, Duration); + return tabScrollY(ref, argument.$1, argument.$2); + } + + @override + bool operator ==(Object other) { + return other is TabScrollYProvider && other.argument == argument; + } + + @override + int get hashCode { + return argument.hashCode; + } +} + +String _$tabScrollYHash() => r'dcb1e82b42bab98c4fc2ee4c7a22f37a28b8ce9e'; + +final class TabScrollYFamily extends $Family + with $FunctionalFamilyOverride, (String?, Duration)> { + const TabScrollYFamily._() + : super( + retry: null, + name: r'tabScrollYProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, + ); + + TabScrollYProvider call(String? tabId, Duration sampleTime) => + TabScrollYProvider._(argument: (tabId, sampleTime), from: this); + + @override + String toString() => r'tabScrollYProvider'; +} diff --git a/app/lib/features/geckoview/domain/providers/web_extensions_state.g.dart b/app/lib/features/geckoview/domain/providers/web_extensions_state.g.dart index a7a3e276..6834f528 100644 --- a/app/lib/features/geckoview/domain/providers/web_extensions_state.g.dart +++ b/app/lib/features/geckoview/domain/providers/web_extensions_state.g.dart @@ -6,172 +6,116 @@ part of 'web_extensions_state.dart'; // RiverpodGenerator // ************************************************************************** -String _$webExtensionsStateHash() => - r'6fb44ab543250f2b2554e410ee749fdd035cd4e7'; +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning -/// Copied from Dart SDK -class _SystemHash { - _SystemHash._(); - - static int combine(int hash, int value) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + value); - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10)); - return hash ^ (hash >> 6); - } - - static int finish(int hash) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); - // ignore: parameter_assignments - hash = hash ^ (hash >> 11); - return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); - } -} - -abstract class _$WebExtensionsState - extends BuildlessNotifier> { - late final WebExtensionActionType actionType; - - Map build(WebExtensionActionType actionType); -} - -/// See also [WebExtensionsState]. @ProviderFor(WebExtensionsState) -const webExtensionsStateProvider = WebExtensionsStateFamily(); +const webExtensionsStateProvider = WebExtensionsStateFamily._(); -/// See also [WebExtensionsState]. -class WebExtensionsStateFamily extends Family> { - /// See also [WebExtensionsState]. - const WebExtensionsStateFamily(); - - /// See also [WebExtensionsState]. - WebExtensionsStateProvider call(WebExtensionActionType actionType) { - return WebExtensionsStateProvider(actionType); - } - - @override - WebExtensionsStateProvider getProviderOverride( - covariant WebExtensionsStateProvider provider, - ) { - return call(provider.actionType); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'webExtensionsStateProvider'; -} - -/// See also [WebExtensionsState]. -class WebExtensionsStateProvider +final class WebExtensionsStateProvider extends - NotifierProviderImpl< - WebExtensionsState, - Map - > { - /// See also [WebExtensionsState]. - WebExtensionsStateProvider(WebExtensionActionType actionType) - : this._internal( - () => WebExtensionsState()..actionType = actionType, - from: webExtensionsStateProvider, - name: r'webExtensionsStateProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$webExtensionsStateHash, - dependencies: WebExtensionsStateFamily._dependencies, - allTransitiveDependencies: - WebExtensionsStateFamily._allTransitiveDependencies, - actionType: actionType, - ); - - WebExtensionsStateProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.actionType, - }) : super.internal(); - - final WebExtensionActionType actionType; + $NotifierProvider> { + const WebExtensionsStateProvider._({ + required WebExtensionsStateFamily super.from, + required WebExtensionActionType super.argument, + }) : super( + retry: null, + name: r'webExtensionsStateProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); @override - Map runNotifierBuild( - covariant WebExtensionsState notifier, - ) { - return notifier.build(actionType); + String debugGetCreateSourceHash() => _$webExtensionsStateHash(); + + @override + String toString() { + return r'webExtensionsStateProvider' + '' + '($argument)'; } + @$internal @override - Override overrideWith(WebExtensionsState Function() create) { - return ProviderOverride( + WebExtensionsState create() => WebExtensionsState(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(Map value) { + return $ProviderOverride( origin: this, - override: WebExtensionsStateProvider._internal( - () => create()..actionType = actionType, - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - actionType: actionType, + providerOverride: $SyncValueProvider>( + value, ), ); } - @override - NotifierProviderElement> - createElement() { - return _WebExtensionsStateProviderElement(this); - } - @override bool operator ==(Object other) { - return other is WebExtensionsStateProvider && - other.actionType == actionType; + return other is WebExtensionsStateProvider && other.argument == argument; } @override int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, actionType.hashCode); - - return _SystemHash.finish(hash); + return argument.hashCode; } } -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin WebExtensionsStateRef - on NotifierProviderRef> { - /// The parameter `actionType` of this provider. - WebExtensionActionType get actionType; -} +String _$webExtensionsStateHash() => + r'6fb44ab543250f2b2554e410ee749fdd035cd4e7'; -class _WebExtensionsStateProviderElement - extends - NotifierProviderElement< +final class WebExtensionsStateFamily extends $Family + with + $ClassFamilyOverride< WebExtensionsState, - Map - > - with WebExtensionsStateRef { - _WebExtensionsStateProviderElement(super.provider); + Map, + Map, + Map, + WebExtensionActionType + > { + const WebExtensionsStateFamily._() + : super( + retry: null, + name: r'webExtensionsStateProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: false, + ); + + WebExtensionsStateProvider call(WebExtensionActionType actionType) => + WebExtensionsStateProvider._(argument: actionType, from: this); @override - WebExtensionActionType get actionType => - (origin as WebExtensionsStateProvider).actionType; + String toString() => r'webExtensionsStateProvider'; } -// 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 +abstract class _$WebExtensionsState + extends $Notifier> { + late final _$args = ref.$arg as WebExtensionActionType; + WebExtensionActionType get actionType => _$args; + + Map build(WebExtensionActionType actionType); + @$mustCallSuper + @override + void runBuild() { + final created = build(_$args); + final ref = + this.ref + as $Ref< + Map, + Map + >; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier< + Map, + Map + >, + Map, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} diff --git a/app/lib/features/geckoview/domain/repositories/tab.dart b/app/lib/features/geckoview/domain/repositories/tab.dart index a527073f..feac8fef 100644 --- a/app/lib/features/geckoview/domain/repositories/tab.dart +++ b/app/lib/features/geckoview/domain/repositories/tab.dart @@ -131,6 +131,7 @@ class TabRepository extends _$TabRepository { Future selectPreviouslyOpenedTab(String tabId) async { final previousTabId = await ref .read(tabDatabaseProvider) + .definitionsDrift .previousTabByTimestamp(tabId: tabId) .getSingleOrNull(); @@ -144,6 +145,7 @@ class TabRepository extends _$TabRepository { Future selectPreviousTab(String tabId) async { final previousTabId = await ref .read(tabDatabaseProvider) + .definitionsDrift .previousTabByOrderKey(tabId: tabId) .getSingleOrNull(); @@ -157,6 +159,7 @@ class TabRepository extends _$TabRepository { Future selectNextTab(String tabId) async { final previousTabId = await ref .read(tabDatabaseProvider) + .definitionsDrift .nextTabByOrderKey(tabId: tabId) .getSingleOrNull(); diff --git a/app/lib/features/geckoview/domain/repositories/tab.g.dart b/app/lib/features/geckoview/domain/repositories/tab.g.dart index 889ccfa8..858853f9 100644 --- a/app/lib/features/geckoview/domain/repositories/tab.g.dart +++ b/app/lib/features/geckoview/domain/repositories/tab.g.dart @@ -6,20 +6,58 @@ part of 'tab.dart'; // RiverpodGenerator // ************************************************************************** -String _$tabRepositoryHash() => r'45af26417881bca38973cf702073b1c7857f1cfa'; +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning -/// See also [TabRepository]. @ProviderFor(TabRepository) -final tabRepositoryProvider = NotifierProvider.internal( - TabRepository.new, - name: r'tabRepositoryProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$tabRepositoryHash, - dependencies: null, - allTransitiveDependencies: null, -); +const tabRepositoryProvider = TabRepositoryProvider._(); -typedef _$TabRepository = Notifier; -// 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 TabRepositoryProvider + extends $NotifierProvider { + const TabRepositoryProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'tabRepositoryProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$tabRepositoryHash(); + + @$internal + @override + TabRepository create() => TabRepository(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(void value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + +String _$tabRepositoryHash() => r'7cb56001fbb038321197d237148c9ebf35740521'; + +abstract class _$TabRepository extends $Notifier { + void build(); + @$mustCallSuper + @override + void runBuild() { + build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + void, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} diff --git a/app/lib/features/geckoview/features/browser/domain/providers.dart b/app/lib/features/geckoview/features/browser/domain/providers.dart index ab4e005a..8995bbbe 100644 --- a/app/lib/features/geckoview/features/browser/domain/providers.dart +++ b/app/lib/features/geckoview/features/browser/domain/providers.dart @@ -83,9 +83,7 @@ EquatableValue> availableTabIds( ContainerFilter containerFilter, ) { final containerTabs = ref.watch( - containerTabIdsProvider( - containerFilter, - ).select((value) => value.valueOrNull), + containerTabIdsProvider(containerFilter).select((value) => value.value), ); final tabList = ref.watch(tabListProvider); @@ -118,13 +116,13 @@ EquatableValue> suggestedTabEntities( containerTabIdsProvider( // ignore: provider_parameters ContainerFilterById(containerId: containerId), - ).select((value) => EquatableValue(value.valueOrNull)), + ).select((value) => EquatableValue(value.value)), ); final suggestions = ref.watch( containerTabSuggestionsProvider(containerId).select( (value) => EquatableValue( - value.valueOrNull.mapNotNull( + value.value.mapNotNull( (result) => result .whereNot( (tabId) => excludedTabIds.value?.contains(tabId) ?? false, @@ -151,7 +149,7 @@ EquatableValue> seamlessFilteredTabEntities( .watch( tabSearchRepositoryProvider(searchPartition).select( (value) => EquatableValue( - value.valueOrNull.mapNotNull( + value.value.mapNotNull( (result) => result.results .map( (tab) => SearchResultTabEntity( @@ -179,7 +177,7 @@ EquatableValue> seamlessFilteredTabEntities( final trees = ref.watch( tabTreesProvider.select( (value) => EquatableValue( - value.valueOrNull + value.value ?.map( (tree) => TabTreeEntity( tabId: tree.latestTabId, @@ -228,7 +226,7 @@ EquatableValue> seamlessFilteredTabPreviews( .watch( tabSearchRepositoryProvider( searchPartition, - ).select((value) => EquatableValue(value.valueOrNull)), + ).select((value) => EquatableValue(value.value)), ) .value; diff --git a/app/lib/features/geckoview/features/browser/domain/providers.g.dart b/app/lib/features/geckoview/features/browser/domain/providers.g.dart index 03830ee3..57540a2d 100644 --- a/app/lib/features/geckoview/features/browser/domain/providers.g.dart +++ b/app/lib/features/geckoview/features/browser/domain/providers.g.dart @@ -6,998 +6,683 @@ part of 'providers.dart'; // RiverpodGenerator // ************************************************************************** -String _$availableTabIdsHash() => r'ec3691063293e1c19c997f7b60178938ae631c7f'; - -/// Copied from Dart SDK -class _SystemHash { - _SystemHash._(); - - static int combine(int hash, int value) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + value); - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10)); - return hash ^ (hash >> 6); - } - - static int finish(int hash) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); - // ignore: parameter_assignments - hash = hash ^ (hash >> 11); - return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); - } -} - -/// See also [availableTabIds]. -@ProviderFor(availableTabIds) -const availableTabIdsProvider = AvailableTabIdsFamily(); - -/// See also [availableTabIds]. -class AvailableTabIdsFamily extends Family>> { - /// See also [availableTabIds]. - const AvailableTabIdsFamily(); - - /// See also [availableTabIds]. - AvailableTabIdsProvider call(ContainerFilter containerFilter) { - return AvailableTabIdsProvider(containerFilter); - } - - @override - AvailableTabIdsProvider getProviderOverride( - covariant AvailableTabIdsProvider provider, - ) { - return call(provider.containerFilter); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'availableTabIdsProvider'; -} - -/// See also [availableTabIds]. -class AvailableTabIdsProvider - extends AutoDisposeProvider>> { - /// See also [availableTabIds]. - AvailableTabIdsProvider(ContainerFilter containerFilter) - : this._internal( - (ref) => availableTabIds(ref as AvailableTabIdsRef, containerFilter), - from: availableTabIdsProvider, - name: r'availableTabIdsProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$availableTabIdsHash, - dependencies: AvailableTabIdsFamily._dependencies, - allTransitiveDependencies: - AvailableTabIdsFamily._allTransitiveDependencies, - containerFilter: containerFilter, - ); - - AvailableTabIdsProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.containerFilter, - }) : super.internal(); - - final ContainerFilter containerFilter; - - @override - Override overrideWith( - EquatableValue> Function(AvailableTabIdsRef provider) create, - ) { - return ProviderOverride( - origin: this, - override: AvailableTabIdsProvider._internal( - (ref) => create(ref as AvailableTabIdsRef), - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - containerFilter: containerFilter, - ), - ); - } - - @override - AutoDisposeProviderElement>> createElement() { - return _AvailableTabIdsProviderElement(this); - } - - @override - bool operator ==(Object other) { - return other is AvailableTabIdsProvider && - other.containerFilter == containerFilter; - } - - @override - int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, containerFilter.hashCode); - - return _SystemHash.finish(hash); - } -} - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin AvailableTabIdsRef - on AutoDisposeProviderRef>> { - /// The parameter `containerFilter` of this provider. - ContainerFilter get containerFilter; -} - -class _AvailableTabIdsProviderElement - extends AutoDisposeProviderElement>> - with AvailableTabIdsRef { - _AvailableTabIdsProviderElement(super.provider); - - @override - ContainerFilter get containerFilter => - (origin as AvailableTabIdsProvider).containerFilter; -} - -String _$availableTabStatesHash() => - r'f506b050e1dc4f50fbd2699d97af5a16a037bc4b'; - -/// See also [availableTabStates]. -@ProviderFor(availableTabStates) -const availableTabStatesProvider = AvailableTabStatesFamily(); - -/// See also [availableTabStates]. -class AvailableTabStatesFamily - extends Family>> { - /// See also [availableTabStates]. - const AvailableTabStatesFamily(); - - /// See also [availableTabStates]. - AvailableTabStatesProvider call(ContainerFilter containerFilter) { - return AvailableTabStatesProvider(containerFilter); - } - - @override - AvailableTabStatesProvider getProviderOverride( - covariant AvailableTabStatesProvider provider, - ) { - return call(provider.containerFilter); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'availableTabStatesProvider'; -} - -/// See also [availableTabStates]. -class AvailableTabStatesProvider - extends AutoDisposeProvider>> { - /// See also [availableTabStates]. - AvailableTabStatesProvider(ContainerFilter containerFilter) - : this._internal( - (ref) => - availableTabStates(ref as AvailableTabStatesRef, containerFilter), - from: availableTabStatesProvider, - name: r'availableTabStatesProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$availableTabStatesHash, - dependencies: AvailableTabStatesFamily._dependencies, - allTransitiveDependencies: - AvailableTabStatesFamily._allTransitiveDependencies, - containerFilter: containerFilter, - ); - - AvailableTabStatesProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.containerFilter, - }) : super.internal(); - - final ContainerFilter containerFilter; - - @override - Override overrideWith( - EquatableValue> Function( - AvailableTabStatesRef provider, - ) - create, - ) { - return ProviderOverride( - origin: this, - override: AvailableTabStatesProvider._internal( - (ref) => create(ref as AvailableTabStatesRef), - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - containerFilter: containerFilter, - ), - ); - } - - @override - AutoDisposeProviderElement>> - createElement() { - return _AvailableTabStatesProviderElement(this); - } - - @override - bool operator ==(Object other) { - return other is AvailableTabStatesProvider && - other.containerFilter == containerFilter; - } - - @override - int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, containerFilter.hashCode); - - return _SystemHash.finish(hash); - } -} - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin AvailableTabStatesRef - on AutoDisposeProviderRef>> { - /// The parameter `containerFilter` of this provider. - ContainerFilter get containerFilter; -} - -class _AvailableTabStatesProviderElement - extends AutoDisposeProviderElement>> - with AvailableTabStatesRef { - _AvailableTabStatesProviderElement(super.provider); - - @override - ContainerFilter get containerFilter => - (origin as AvailableTabStatesProvider).containerFilter; -} - -String _$suggestedTabEntitiesHash() => - r'f8c41ea3136ae0761e558323afb9d33bf5b8fd21'; - -/// See also [suggestedTabEntities]. -@ProviderFor(suggestedTabEntities) -const suggestedTabEntitiesProvider = SuggestedTabEntitiesFamily(); - -/// See also [suggestedTabEntities]. -class SuggestedTabEntitiesFamily - extends Family>> { - /// See also [suggestedTabEntities]. - const SuggestedTabEntitiesFamily(); - - /// See also [suggestedTabEntities]. - SuggestedTabEntitiesProvider call(String? containerId) { - return SuggestedTabEntitiesProvider(containerId); - } - - @override - SuggestedTabEntitiesProvider getProviderOverride( - covariant SuggestedTabEntitiesProvider provider, - ) { - return call(provider.containerId); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'suggestedTabEntitiesProvider'; -} - -/// See also [suggestedTabEntities]. -class SuggestedTabEntitiesProvider - extends AutoDisposeProvider>> { - /// See also [suggestedTabEntities]. - SuggestedTabEntitiesProvider(String? containerId) - : this._internal( - (ref) => - suggestedTabEntities(ref as SuggestedTabEntitiesRef, containerId), - from: suggestedTabEntitiesProvider, - name: r'suggestedTabEntitiesProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$suggestedTabEntitiesHash, - dependencies: SuggestedTabEntitiesFamily._dependencies, - allTransitiveDependencies: - SuggestedTabEntitiesFamily._allTransitiveDependencies, - containerId: containerId, - ); - - SuggestedTabEntitiesProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.containerId, - }) : super.internal(); - - final String? containerId; - - @override - Override overrideWith( - EquatableValue> Function(SuggestedTabEntitiesRef provider) - create, - ) { - return ProviderOverride( - origin: this, - override: SuggestedTabEntitiesProvider._internal( - (ref) => create(ref as SuggestedTabEntitiesRef), - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - containerId: containerId, - ), - ); - } - - @override - AutoDisposeProviderElement>> createElement() { - return _SuggestedTabEntitiesProviderElement(this); - } - - @override - bool operator ==(Object other) { - return other is SuggestedTabEntitiesProvider && - other.containerId == containerId; - } - - @override - int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, containerId.hashCode); - - return _SystemHash.finish(hash); - } -} - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin SuggestedTabEntitiesRef - on AutoDisposeProviderRef>> { - /// The parameter `containerId` of this provider. - String? get containerId; -} - -class _SuggestedTabEntitiesProviderElement - extends AutoDisposeProviderElement>> - with SuggestedTabEntitiesRef { - _SuggestedTabEntitiesProviderElement(super.provider); - - @override - String? get containerId => - (origin as SuggestedTabEntitiesProvider).containerId; -} - -String _$seamlessFilteredTabEntitiesHash() => - r'2cd698d4e7c9d9cda9e17abbf9a99e512425e4cd'; - -/// See also [seamlessFilteredTabEntities]. -@ProviderFor(seamlessFilteredTabEntities) -const seamlessFilteredTabEntitiesProvider = SeamlessFilteredTabEntitiesFamily(); - -/// See also [seamlessFilteredTabEntities]. -class SeamlessFilteredTabEntitiesFamily - extends Family>> { - /// See also [seamlessFilteredTabEntities]. - const SeamlessFilteredTabEntitiesFamily(); - - /// See also [seamlessFilteredTabEntities]. - SeamlessFilteredTabEntitiesProvider call({ - required TabSearchPartition searchPartition, - required ContainerFilter containerFilter, - required bool groupTrees, - }) { - return SeamlessFilteredTabEntitiesProvider( - searchPartition: searchPartition, - containerFilter: containerFilter, - groupTrees: groupTrees, - ); - } - - @override - SeamlessFilteredTabEntitiesProvider getProviderOverride( - covariant SeamlessFilteredTabEntitiesProvider provider, - ) { - return call( - searchPartition: provider.searchPartition, - containerFilter: provider.containerFilter, - groupTrees: provider.groupTrees, - ); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'seamlessFilteredTabEntitiesProvider'; -} - -/// See also [seamlessFilteredTabEntities]. -class SeamlessFilteredTabEntitiesProvider - extends AutoDisposeProvider>> { - /// See also [seamlessFilteredTabEntities]. - SeamlessFilteredTabEntitiesProvider({ - required TabSearchPartition searchPartition, - required ContainerFilter containerFilter, - required bool groupTrees, - }) : this._internal( - (ref) => seamlessFilteredTabEntities( - ref as SeamlessFilteredTabEntitiesRef, - searchPartition: searchPartition, - containerFilter: containerFilter, - groupTrees: groupTrees, - ), - from: seamlessFilteredTabEntitiesProvider, - name: r'seamlessFilteredTabEntitiesProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$seamlessFilteredTabEntitiesHash, - dependencies: SeamlessFilteredTabEntitiesFamily._dependencies, - allTransitiveDependencies: - SeamlessFilteredTabEntitiesFamily._allTransitiveDependencies, - searchPartition: searchPartition, - containerFilter: containerFilter, - groupTrees: groupTrees, +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(SelectedBangTrigger) +const selectedBangTriggerProvider = SelectedBangTriggerFamily._(); + +final class SelectedBangTriggerProvider + extends $NotifierProvider { + const SelectedBangTriggerProvider._({ + required SelectedBangTriggerFamily super.from, + required String? super.argument, + }) : super( + retry: null, + name: r'selectedBangTriggerProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, ); - SeamlessFilteredTabEntitiesProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.searchPartition, - required this.containerFilter, - required this.groupTrees, - }) : super.internal(); - - final TabSearchPartition searchPartition; - final ContainerFilter containerFilter; - final bool groupTrees; + @override + String debugGetCreateSourceHash() => _$selectedBangTriggerHash(); @override - Override overrideWith( - EquatableValue> Function( - SeamlessFilteredTabEntitiesRef provider, - ) - create, - ) { - return ProviderOverride( - origin: this, - override: SeamlessFilteredTabEntitiesProvider._internal( - (ref) => create(ref as SeamlessFilteredTabEntitiesRef), - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - searchPartition: searchPartition, - containerFilter: containerFilter, - groupTrees: groupTrees, - ), - ); + String toString() { + return r'selectedBangTriggerProvider' + '' + '($argument)'; } + @$internal @override - AutoDisposeProviderElement>> createElement() { - return _SeamlessFilteredTabEntitiesProviderElement(this); + SelectedBangTrigger create() => SelectedBangTrigger(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(String? value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); } @override bool operator ==(Object other) { - return other is SeamlessFilteredTabEntitiesProvider && - other.searchPartition == searchPartition && - other.containerFilter == containerFilter && - other.groupTrees == groupTrees; + return other is SelectedBangTriggerProvider && other.argument == argument; } @override int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, searchPartition.hashCode); - hash = _SystemHash.combine(hash, containerFilter.hashCode); - hash = _SystemHash.combine(hash, groupTrees.hashCode); - - return _SystemHash.finish(hash); + return argument.hashCode; } } -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin SeamlessFilteredTabEntitiesRef - on AutoDisposeProviderRef>> { - /// The parameter `searchPartition` of this provider. - TabSearchPartition get searchPartition; - - /// The parameter `containerFilter` of this provider. - ContainerFilter get containerFilter; - - /// The parameter `groupTrees` of this provider. - bool get groupTrees; -} - -class _SeamlessFilteredTabEntitiesProviderElement - extends AutoDisposeProviderElement>> - with SeamlessFilteredTabEntitiesRef { - _SeamlessFilteredTabEntitiesProviderElement(super.provider); - - @override - TabSearchPartition get searchPartition => - (origin as SeamlessFilteredTabEntitiesProvider).searchPartition; - @override - ContainerFilter get containerFilter => - (origin as SeamlessFilteredTabEntitiesProvider).containerFilter; - @override - bool get groupTrees => - (origin as SeamlessFilteredTabEntitiesProvider).groupTrees; -} - -String _$seamlessFilteredTabPreviewsHash() => - r'c50a2d0f9f3ba2bc3db7c96e74d9acdcac2e84e4'; - -/// See also [seamlessFilteredTabPreviews]. -@ProviderFor(seamlessFilteredTabPreviews) -const seamlessFilteredTabPreviewsProvider = SeamlessFilteredTabPreviewsFamily(); - -/// See also [seamlessFilteredTabPreviews]. -class SeamlessFilteredTabPreviewsFamily - extends Family>> { - /// See also [seamlessFilteredTabPreviews]. - const SeamlessFilteredTabPreviewsFamily(); - - /// See also [seamlessFilteredTabPreviews]. - SeamlessFilteredTabPreviewsProvider call( - TabSearchPartition searchPartition, - ContainerFilter containerFilter, - ) { - return SeamlessFilteredTabPreviewsProvider( - searchPartition, - containerFilter, - ); - } - - @override - SeamlessFilteredTabPreviewsProvider getProviderOverride( - covariant SeamlessFilteredTabPreviewsProvider provider, - ) { - return call(provider.searchPartition, provider.containerFilter); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'seamlessFilteredTabPreviewsProvider'; -} - -/// See also [seamlessFilteredTabPreviews]. -class SeamlessFilteredTabPreviewsProvider - extends AutoDisposeProvider>> { - /// See also [seamlessFilteredTabPreviews]. - SeamlessFilteredTabPreviewsProvider( - TabSearchPartition searchPartition, - ContainerFilter containerFilter, - ) : this._internal( - (ref) => seamlessFilteredTabPreviews( - ref as SeamlessFilteredTabPreviewsRef, - searchPartition, - containerFilter, - ), - from: seamlessFilteredTabPreviewsProvider, - name: r'seamlessFilteredTabPreviewsProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$seamlessFilteredTabPreviewsHash, - dependencies: SeamlessFilteredTabPreviewsFamily._dependencies, - allTransitiveDependencies: - SeamlessFilteredTabPreviewsFamily._allTransitiveDependencies, - searchPartition: searchPartition, - containerFilter: containerFilter, - ); - - SeamlessFilteredTabPreviewsProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.searchPartition, - required this.containerFilter, - }) : super.internal(); - - final TabSearchPartition searchPartition; - final ContainerFilter containerFilter; - - @override - Override overrideWith( - EquatableValue> Function( - SeamlessFilteredTabPreviewsRef provider, - ) - create, - ) { - return ProviderOverride( - origin: this, - override: SeamlessFilteredTabPreviewsProvider._internal( - (ref) => create(ref as SeamlessFilteredTabPreviewsRef), - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - searchPartition: searchPartition, - containerFilter: containerFilter, - ), - ); - } - - @override - AutoDisposeProviderElement>> createElement() { - return _SeamlessFilteredTabPreviewsProviderElement(this); - } - - @override - bool operator ==(Object other) { - return other is SeamlessFilteredTabPreviewsProvider && - other.searchPartition == searchPartition && - other.containerFilter == containerFilter; - } - - @override - int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, searchPartition.hashCode); - hash = _SystemHash.combine(hash, containerFilter.hashCode); - - return _SystemHash.finish(hash); - } -} - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin SeamlessFilteredTabPreviewsRef - on AutoDisposeProviderRef>> { - /// The parameter `searchPartition` of this provider. - TabSearchPartition get searchPartition; - - /// The parameter `containerFilter` of this provider. - ContainerFilter get containerFilter; -} - -class _SeamlessFilteredTabPreviewsProviderElement - extends AutoDisposeProviderElement>> - with SeamlessFilteredTabPreviewsRef { - _SeamlessFilteredTabPreviewsProviderElement(super.provider); - - @override - TabSearchPartition get searchPartition => - (origin as SeamlessFilteredTabPreviewsProvider).searchPartition; - @override - ContainerFilter get containerFilter => - (origin as SeamlessFilteredTabPreviewsProvider).containerFilter; -} - String _$selectedBangTriggerHash() => r'b0e12bc95e93d50d04f1c658230cea9f15ff0385'; -abstract class _$SelectedBangTrigger extends BuildlessNotifier { - late final String? domain; - - String? build({String? domain}); -} - -/// See also [SelectedBangTrigger]. -@ProviderFor(SelectedBangTrigger) -const selectedBangTriggerProvider = SelectedBangTriggerFamily(); - -/// See also [SelectedBangTrigger]. -class SelectedBangTriggerFamily extends Family { - /// See also [SelectedBangTrigger]. - const SelectedBangTriggerFamily(); - - /// See also [SelectedBangTrigger]. - SelectedBangTriggerProvider call({String? domain}) { - return SelectedBangTriggerProvider(domain: domain); - } - - @override - SelectedBangTriggerProvider getProviderOverride( - covariant SelectedBangTriggerProvider provider, - ) { - return call(domain: provider.domain); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'selectedBangTriggerProvider'; -} - -/// See also [SelectedBangTrigger]. -class SelectedBangTriggerProvider - extends NotifierProviderImpl { - /// See also [SelectedBangTrigger]. - SelectedBangTriggerProvider({String? domain}) - : this._internal( - () => SelectedBangTrigger()..domain = domain, - from: selectedBangTriggerProvider, +final class SelectedBangTriggerFamily extends $Family + with + $ClassFamilyOverride< + SelectedBangTrigger, + String?, + String?, + String?, + String? + > { + const SelectedBangTriggerFamily._() + : super( + retry: null, name: r'selectedBangTriggerProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$selectedBangTriggerHash, - dependencies: SelectedBangTriggerFamily._dependencies, - allTransitiveDependencies: - SelectedBangTriggerFamily._allTransitiveDependencies, - domain: domain, + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: false, ); - SelectedBangTriggerProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.domain, - }) : super.internal(); - - final String? domain; + SelectedBangTriggerProvider call({String? domain}) => + SelectedBangTriggerProvider._(argument: domain, from: this); @override - String? runNotifierBuild(covariant SelectedBangTrigger notifier) { - return notifier.build(domain: domain); + String toString() => r'selectedBangTriggerProvider'; +} + +abstract class _$SelectedBangTrigger extends $Notifier { + late final _$args = ref.$arg as String?; + String? get domain => _$args; + + String? build({String? domain}); + @$mustCallSuper + @override + void runBuild() { + final created = build(domain: _$args); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + String?, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} + +@ProviderFor(SelectedBangData) +const selectedBangDataProvider = SelectedBangDataFamily._(); + +final class SelectedBangDataProvider + extends $NotifierProvider { + const SelectedBangDataProvider._({ + required SelectedBangDataFamily super.from, + required String? super.argument, + }) : super( + retry: null, + name: r'selectedBangDataProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$selectedBangDataHash(); + + @override + String toString() { + return r'selectedBangDataProvider' + '' + '($argument)'; } + @$internal @override - Override overrideWith(SelectedBangTrigger Function() create) { - return ProviderOverride( + SelectedBangData create() => SelectedBangData(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(BangData? value) { + return $ProviderOverride( origin: this, - override: SelectedBangTriggerProvider._internal( - () => create()..domain = domain, - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - domain: domain, - ), + providerOverride: $SyncValueProvider(value), ); } - @override - NotifierProviderElement createElement() { - return _SelectedBangTriggerProviderElement(this); - } - @override bool operator ==(Object other) { - return other is SelectedBangTriggerProvider && other.domain == domain; + return other is SelectedBangDataProvider && other.argument == argument; } @override int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, domain.hashCode); - - return _SystemHash.finish(hash); + return argument.hashCode; } } -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin SelectedBangTriggerRef on NotifierProviderRef { - /// The parameter `domain` of this provider. - String? get domain; -} - -class _SelectedBangTriggerProviderElement - extends NotifierProviderElement - with SelectedBangTriggerRef { - _SelectedBangTriggerProviderElement(super.provider); - - @override - String? get domain => (origin as SelectedBangTriggerProvider).domain; -} - String _$selectedBangDataHash() => r'666858556efe59d2de38a04fda30e8ec227c6675'; -abstract class _$SelectedBangData - extends BuildlessAutoDisposeNotifier { - late final String? domain; - - BangData? build({String? domain}); -} - -/// See also [SelectedBangData]. -@ProviderFor(SelectedBangData) -const selectedBangDataProvider = SelectedBangDataFamily(); - -/// See also [SelectedBangData]. -class SelectedBangDataFamily extends Family { - /// See also [SelectedBangData]. - const SelectedBangDataFamily(); - - /// See also [SelectedBangData]. - SelectedBangDataProvider call({String? domain}) { - return SelectedBangDataProvider(domain: domain); - } - - @override - SelectedBangDataProvider getProviderOverride( - covariant SelectedBangDataProvider provider, - ) { - return call(domain: provider.domain); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'selectedBangDataProvider'; -} - -/// See also [SelectedBangData]. -class SelectedBangDataProvider - extends AutoDisposeNotifierProviderImpl { - /// See also [SelectedBangData]. - SelectedBangDataProvider({String? domain}) - : this._internal( - () => SelectedBangData()..domain = domain, - from: selectedBangDataProvider, +final class SelectedBangDataFamily extends $Family + with + $ClassFamilyOverride< + SelectedBangData, + BangData?, + BangData?, + BangData?, + String? + > { + const SelectedBangDataFamily._() + : super( + retry: null, name: r'selectedBangDataProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$selectedBangDataHash, - dependencies: SelectedBangDataFamily._dependencies, - allTransitiveDependencies: - SelectedBangDataFamily._allTransitiveDependencies, - domain: domain, + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, ); - SelectedBangDataProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.domain, - }) : super.internal(); - - final String? domain; + SelectedBangDataProvider call({String? domain}) => + SelectedBangDataProvider._(argument: domain, from: this); @override - BangData? runNotifierBuild(covariant SelectedBangData notifier) { - return notifier.build(domain: domain); + String toString() => r'selectedBangDataProvider'; +} + +abstract class _$SelectedBangData extends $Notifier { + late final _$args = ref.$arg as String?; + String? get domain => _$args; + + BangData? build({String? domain}); + @$mustCallSuper + @override + void runBuild() { + final created = build(domain: _$args); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + BangData?, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} + +@ProviderFor(availableTabIds) +const availableTabIdsProvider = AvailableTabIdsFamily._(); + +final class AvailableTabIdsProvider + extends + $FunctionalProvider< + EquatableValue>, + EquatableValue>, + EquatableValue> + > + with $Provider>> { + const AvailableTabIdsProvider._({ + required AvailableTabIdsFamily super.from, + required ContainerFilter super.argument, + }) : super( + retry: null, + name: r'availableTabIdsProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$availableTabIdsHash(); + + @override + String toString() { + return r'availableTabIdsProvider' + '' + '($argument)'; + } + + @$internal + @override + $ProviderElement>> $createElement( + $ProviderPointer pointer, + ) => $ProviderElement(pointer); + + @override + EquatableValue> create(Ref ref) { + final argument = this.argument as ContainerFilter; + return availableTabIds(ref, argument); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(EquatableValue> value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider>>(value), + ); } @override - Override overrideWith(SelectedBangData Function() create) { - return ProviderOverride( - origin: this, - override: SelectedBangDataProvider._internal( - () => create()..domain = domain, - from: from, - name: null, + bool operator ==(Object other) { + return other is AvailableTabIdsProvider && other.argument == argument; + } + + @override + int get hashCode { + return argument.hashCode; + } +} + +String _$availableTabIdsHash() => r'6926ca03f97b12ebf9a46a48ed3da1b2cd559a74'; + +final class AvailableTabIdsFamily extends $Family + with + $FunctionalFamilyOverride< + EquatableValue>, + ContainerFilter + > { + const AvailableTabIdsFamily._() + : super( + retry: null, + name: r'availableTabIdsProvider', dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - domain: domain, + $allTransitiveDependencies: null, + isAutoDispose: true, + ); + + AvailableTabIdsProvider call(ContainerFilter containerFilter) => + AvailableTabIdsProvider._(argument: containerFilter, from: this); + + @override + String toString() => r'availableTabIdsProvider'; +} + +@ProviderFor(availableTabStates) +const availableTabStatesProvider = AvailableTabStatesFamily._(); + +final class AvailableTabStatesProvider + extends + $FunctionalProvider< + EquatableValue>, + EquatableValue>, + EquatableValue> + > + with $Provider>> { + const AvailableTabStatesProvider._({ + required AvailableTabStatesFamily super.from, + required ContainerFilter super.argument, + }) : super( + retry: null, + name: r'availableTabStatesProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$availableTabStatesHash(); + + @override + String toString() { + return r'availableTabStatesProvider' + '' + '($argument)'; + } + + @$internal + @override + $ProviderElement>> $createElement( + $ProviderPointer pointer, + ) => $ProviderElement(pointer); + + @override + EquatableValue> create(Ref ref) { + final argument = this.argument as ContainerFilter; + return availableTabStates(ref, argument); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(EquatableValue> value) { + return $ProviderOverride( + origin: this, + providerOverride: + $SyncValueProvider>>(value), + ); + } + + @override + bool operator ==(Object other) { + return other is AvailableTabStatesProvider && other.argument == argument; + } + + @override + int get hashCode { + return argument.hashCode; + } +} + +String _$availableTabStatesHash() => + r'f506b050e1dc4f50fbd2699d97af5a16a037bc4b'; + +final class AvailableTabStatesFamily extends $Family + with + $FunctionalFamilyOverride< + EquatableValue>, + ContainerFilter + > { + const AvailableTabStatesFamily._() + : super( + retry: null, + name: r'availableTabStatesProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, + ); + + AvailableTabStatesProvider call(ContainerFilter containerFilter) => + AvailableTabStatesProvider._(argument: containerFilter, from: this); + + @override + String toString() => r'availableTabStatesProvider'; +} + +@ProviderFor(suggestedTabEntities) +const suggestedTabEntitiesProvider = SuggestedTabEntitiesFamily._(); + +final class SuggestedTabEntitiesProvider + extends + $FunctionalProvider< + EquatableValue>, + EquatableValue>, + EquatableValue> + > + with $Provider>> { + const SuggestedTabEntitiesProvider._({ + required SuggestedTabEntitiesFamily super.from, + required String? super.argument, + }) : super( + retry: null, + name: r'suggestedTabEntitiesProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$suggestedTabEntitiesHash(); + + @override + String toString() { + return r'suggestedTabEntitiesProvider' + '' + '($argument)'; + } + + @$internal + @override + $ProviderElement>> $createElement( + $ProviderPointer pointer, + ) => $ProviderElement(pointer); + + @override + EquatableValue> create(Ref ref) { + final argument = this.argument as String?; + return suggestedTabEntities(ref, argument); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(EquatableValue> value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider>>( + value, ), ); } - @override - AutoDisposeNotifierProviderElement - createElement() { - return _SelectedBangDataProviderElement(this); - } - @override bool operator ==(Object other) { - return other is SelectedBangDataProvider && other.domain == domain; + return other is SuggestedTabEntitiesProvider && other.argument == argument; } @override int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, domain.hashCode); - - return _SystemHash.finish(hash); + return argument.hashCode; } } -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin SelectedBangDataRef on AutoDisposeNotifierProviderRef { - /// The parameter `domain` of this provider. - String? get domain; -} +String _$suggestedTabEntitiesHash() => + r'84a85520dc589e4bcc4afa2a63691ad08be25ddd'; -class _SelectedBangDataProviderElement - extends AutoDisposeNotifierProviderElement - with SelectedBangDataRef { - _SelectedBangDataProviderElement(super.provider); +final class SuggestedTabEntitiesFamily extends $Family + with $FunctionalFamilyOverride>, String?> { + const SuggestedTabEntitiesFamily._() + : super( + retry: null, + name: r'suggestedTabEntitiesProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, + ); + + SuggestedTabEntitiesProvider call(String? containerId) => + SuggestedTabEntitiesProvider._(argument: containerId, from: this); @override - String? get domain => (origin as SelectedBangDataProvider).domain; + String toString() => r'suggestedTabEntitiesProvider'; } -// 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 +@ProviderFor(seamlessFilteredTabEntities) +const seamlessFilteredTabEntitiesProvider = + SeamlessFilteredTabEntitiesFamily._(); + +final class SeamlessFilteredTabEntitiesProvider + extends + $FunctionalProvider< + EquatableValue>, + EquatableValue>, + EquatableValue> + > + with $Provider>> { + const SeamlessFilteredTabEntitiesProvider._({ + required SeamlessFilteredTabEntitiesFamily super.from, + required ({ + TabSearchPartition searchPartition, + ContainerFilter containerFilter, + bool groupTrees, + }) + super.argument, + }) : super( + retry: null, + name: r'seamlessFilteredTabEntitiesProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$seamlessFilteredTabEntitiesHash(); + + @override + String toString() { + return r'seamlessFilteredTabEntitiesProvider' + '' + '$argument'; + } + + @$internal + @override + $ProviderElement>> $createElement( + $ProviderPointer pointer, + ) => $ProviderElement(pointer); + + @override + EquatableValue> create(Ref ref) { + final argument = + this.argument + as ({ + TabSearchPartition searchPartition, + ContainerFilter containerFilter, + bool groupTrees, + }); + return seamlessFilteredTabEntities( + ref, + searchPartition: argument.searchPartition, + containerFilter: argument.containerFilter, + groupTrees: argument.groupTrees, + ); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(EquatableValue> value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider>>( + value, + ), + ); + } + + @override + bool operator ==(Object other) { + return other is SeamlessFilteredTabEntitiesProvider && + other.argument == argument; + } + + @override + int get hashCode { + return argument.hashCode; + } +} + +String _$seamlessFilteredTabEntitiesHash() => + r'18b8ec876116eaa6e60fa321faba18a3bd7dd004'; + +final class SeamlessFilteredTabEntitiesFamily extends $Family + with + $FunctionalFamilyOverride< + EquatableValue>, + ({ + TabSearchPartition searchPartition, + ContainerFilter containerFilter, + bool groupTrees, + }) + > { + const SeamlessFilteredTabEntitiesFamily._() + : super( + retry: null, + name: r'seamlessFilteredTabEntitiesProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, + ); + + SeamlessFilteredTabEntitiesProvider call({ + required TabSearchPartition searchPartition, + required ContainerFilter containerFilter, + required bool groupTrees, + }) => SeamlessFilteredTabEntitiesProvider._( + argument: ( + searchPartition: searchPartition, + containerFilter: containerFilter, + groupTrees: groupTrees, + ), + from: this, + ); + + @override + String toString() => r'seamlessFilteredTabEntitiesProvider'; +} + +@ProviderFor(seamlessFilteredTabPreviews) +const seamlessFilteredTabPreviewsProvider = + SeamlessFilteredTabPreviewsFamily._(); + +final class SeamlessFilteredTabPreviewsProvider + extends + $FunctionalProvider< + EquatableValue>, + EquatableValue>, + EquatableValue> + > + with $Provider>> { + const SeamlessFilteredTabPreviewsProvider._({ + required SeamlessFilteredTabPreviewsFamily super.from, + required (TabSearchPartition, ContainerFilter) super.argument, + }) : super( + retry: null, + name: r'seamlessFilteredTabPreviewsProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$seamlessFilteredTabPreviewsHash(); + + @override + String toString() { + return r'seamlessFilteredTabPreviewsProvider' + '' + '$argument'; + } + + @$internal + @override + $ProviderElement>> $createElement( + $ProviderPointer pointer, + ) => $ProviderElement(pointer); + + @override + EquatableValue> create(Ref ref) { + final argument = this.argument as (TabSearchPartition, ContainerFilter); + return seamlessFilteredTabPreviews(ref, argument.$1, argument.$2); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(EquatableValue> value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider>>( + value, + ), + ); + } + + @override + bool operator ==(Object other) { + return other is SeamlessFilteredTabPreviewsProvider && + other.argument == argument; + } + + @override + int get hashCode { + return argument.hashCode; + } +} + +String _$seamlessFilteredTabPreviewsHash() => + r'ee1d441ca5f5822e201de8fc0b264ea7b8db0776'; + +final class SeamlessFilteredTabPreviewsFamily extends $Family + with + $FunctionalFamilyOverride< + EquatableValue>, + (TabSearchPartition, ContainerFilter) + > { + const SeamlessFilteredTabPreviewsFamily._() + : super( + retry: null, + name: r'seamlessFilteredTabPreviewsProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, + ); + + SeamlessFilteredTabPreviewsProvider call( + TabSearchPartition searchPartition, + ContainerFilter containerFilter, + ) => SeamlessFilteredTabPreviewsProvider._( + argument: (searchPartition, containerFilter), + from: this, + ); + + @override + String toString() => r'seamlessFilteredTabPreviewsProvider'; +} diff --git a/app/lib/features/geckoview/features/browser/domain/providers/intent.g.dart b/app/lib/features/geckoview/features/browser/domain/providers/intent.g.dart index e27e8ba2..5557cb45 100644 --- a/app/lib/features/geckoview/features/browser/domain/providers/intent.g.dart +++ b/app/lib/features/geckoview/features/browser/domain/providers/intent.g.dart @@ -6,25 +6,52 @@ part of 'intent.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(EngineBoundIntentStream) +const engineBoundIntentStreamProvider = EngineBoundIntentStreamProvider._(); + +final class EngineBoundIntentStreamProvider + extends $StreamNotifierProvider { + const EngineBoundIntentStreamProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'engineBoundIntentStreamProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$engineBoundIntentStreamHash(); + + @$internal + @override + EngineBoundIntentStream create() => EngineBoundIntentStream(); +} + String _$engineBoundIntentStreamHash() => r'860e39a7b608d579f7383e2199719067ad26f268'; -/// See also [EngineBoundIntentStream]. -@ProviderFor(EngineBoundIntentStream) -final engineBoundIntentStreamProvider = - AutoDisposeStreamNotifierProvider< - EngineBoundIntentStream, - SharedContent - >.internal( - EngineBoundIntentStream.new, - name: r'engineBoundIntentStreamProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$engineBoundIntentStreamHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$EngineBoundIntentStream = AutoDisposeStreamNotifier; -// 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 +abstract class _$EngineBoundIntentStream + extends $StreamNotifier { + Stream build(); + @$mustCallSuper + @override + void runBuild() { + final created = build(); + final ref = this.ref as $Ref, SharedContent>; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, SharedContent>, + AsyncValue, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} diff --git a/app/lib/features/geckoview/features/browser/domain/providers/lifecycle.g.dart b/app/lib/features/geckoview/features/browser/domain/providers/lifecycle.g.dart index 7ae4f55d..66125413 100644 --- a/app/lib/features/geckoview/features/browser/domain/providers/lifecycle.g.dart +++ b/app/lib/features/geckoview/features/browser/domain/providers/lifecycle.g.dart @@ -6,22 +6,59 @@ part of 'lifecycle.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(BrowserViewLifecycle) +const browserViewLifecycleProvider = BrowserViewLifecycleProvider._(); + +final class BrowserViewLifecycleProvider + extends $NotifierProvider { + const BrowserViewLifecycleProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'browserViewLifecycleProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$browserViewLifecycleHash(); + + @$internal + @override + BrowserViewLifecycle create() => BrowserViewLifecycle(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(AppLifecycleState? value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + String _$browserViewLifecycleHash() => r'9082d058611aaaae268b60b8ce130150f73d453d'; -/// See also [BrowserViewLifecycle]. -@ProviderFor(BrowserViewLifecycle) -final browserViewLifecycleProvider = - NotifierProvider.internal( - BrowserViewLifecycle.new, - name: r'browserViewLifecycleProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$browserViewLifecycleHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$BrowserViewLifecycle = Notifier; -// 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 +abstract class _$BrowserViewLifecycle extends $Notifier { + AppLifecycleState? build(); + @$mustCallSuper + @override + void runBuild() { + final created = build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + AppLifecycleState?, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} diff --git a/app/lib/features/geckoview/features/browser/domain/services/browser_addon.g.dart b/app/lib/features/geckoview/features/browser/domain/services/browser_addon.g.dart index b26a23cb..b7a047ba 100644 --- a/app/lib/features/geckoview/features/browser/domain/services/browser_addon.g.dart +++ b/app/lib/features/geckoview/features/browser/domain/services/browser_addon.g.dart @@ -6,22 +6,59 @@ part of 'browser_addon.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(BrowserAddonService) +const browserAddonServiceProvider = BrowserAddonServiceProvider._(); + +final class BrowserAddonServiceProvider + extends $NotifierProvider { + const BrowserAddonServiceProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'browserAddonServiceProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$browserAddonServiceHash(); + + @$internal + @override + BrowserAddonService create() => BrowserAddonService(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(void value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + String _$browserAddonServiceHash() => r'1dd73c322e712e1492d74f1af844d5b5cc8f81bb'; -/// See also [BrowserAddonService]. -@ProviderFor(BrowserAddonService) -final browserAddonServiceProvider = - AutoDisposeNotifierProvider.internal( - BrowserAddonService.new, - name: r'browserAddonServiceProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$browserAddonServiceHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$BrowserAddonService = AutoDisposeNotifier; -// 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 +abstract class _$BrowserAddonService extends $Notifier { + void build(); + @$mustCallSuper + @override + void runBuild() { + build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + void, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} diff --git a/app/lib/features/geckoview/features/browser/domain/services/browser_data.g.dart b/app/lib/features/geckoview/features/browser/domain/services/browser_data.g.dart index c71537d6..0c1f9df4 100644 --- a/app/lib/features/geckoview/features/browser/domain/services/browser_data.g.dart +++ b/app/lib/features/geckoview/features/browser/domain/services/browser_data.g.dart @@ -6,22 +6,59 @@ part of 'browser_data.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(BrowserDataService) +const browserDataServiceProvider = BrowserDataServiceProvider._(); + +final class BrowserDataServiceProvider + extends $NotifierProvider { + const BrowserDataServiceProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'browserDataServiceProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$browserDataServiceHash(); + + @$internal + @override + BrowserDataService create() => BrowserDataService(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(void value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + String _$browserDataServiceHash() => r'0a00db5b143d3851f2c171f4f939940f959b67bb'; -/// See also [BrowserDataService]. -@ProviderFor(BrowserDataService) -final browserDataServiceProvider = - NotifierProvider.internal( - BrowserDataService.new, - name: r'browserDataServiceProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$browserDataServiceHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$BrowserDataService = Notifier; -// 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 +abstract class _$BrowserDataService extends $Notifier { + void build(); + @$mustCallSuper + @override + void runBuild() { + build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + void, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} diff --git a/app/lib/features/geckoview/features/browser/domain/services/engine_settings_replication.dart b/app/lib/features/geckoview/features/browser/domain/services/engine_settings_replication.dart index fbd642ca..74b31c2c 100644 --- a/app/lib/features/geckoview/features/browser/domain/services/engine_settings_replication.dart +++ b/app/lib/features/geckoview/features/browser/domain/services/engine_settings_replication.dart @@ -19,6 +19,7 @@ */ import 'package:flutter/material.dart' show ThemeMode; import 'package:flutter_mozilla_components/flutter_mozilla_components.dart'; +import 'package:riverpod/riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; import 'package:weblibre/core/logger.dart'; import 'package:weblibre/features/user/domain/repositories/engine_settings.dart'; @@ -62,69 +63,66 @@ class EngineSettingsReplicationService fireImmediately: true, engineSettingsRepositoryProvider, (previous, next) async { - final settings = next.valueOrNull; + final settings = next.value; if (settings != null) { if (initialSettingsSent && previous != null) { - if (previous.valueOrNull?.javascriptEnabled != + if (previous.value?.javascriptEnabled != settings.javascriptEnabled) { await _service.javascriptEnabled(settings.javascriptEnabled); } - if (previous.valueOrNull?.trackingProtectionPolicy != + if (previous.value?.trackingProtectionPolicy != settings.trackingProtectionPolicy) { await _service.trackingProtectionPolicy( settings.trackingProtectionPolicy, ); } - if (previous.valueOrNull?.httpsOnlyMode != settings.httpsOnlyMode) { + if (previous.value?.httpsOnlyMode != settings.httpsOnlyMode) { await _service.httpsOnlyMode(settings.httpsOnlyMode); } - if (previous.valueOrNull?.globalPrivacyControlEnabled != + if (previous.value?.globalPrivacyControlEnabled != settings.globalPrivacyControlEnabled) { await _service.globalPrivacyControlEnabled( settings.globalPrivacyControlEnabled, ); } - if (previous.valueOrNull?.preferredColorScheme != + if (previous.value?.preferredColorScheme != settings.preferredColorScheme) { await _service.preferredColorScheme( settings.preferredColorScheme, ); } - if (previous.valueOrNull?.cookieBannerHandlingMode != + if (previous.value?.cookieBannerHandlingMode != settings.cookieBannerHandlingMode) { await _service.cookieBannerHandlingMode( settings.cookieBannerHandlingMode, ); } - if (previous.valueOrNull?.cookieBannerHandlingModePrivateBrowsing != + if (previous.value?.cookieBannerHandlingModePrivateBrowsing != settings.cookieBannerHandlingModePrivateBrowsing) { await _service.cookieBannerHandlingModePrivateBrowsing( settings.cookieBannerHandlingModePrivateBrowsing, ); } - if (previous.valueOrNull?.cookieBannerHandlingGlobalRules != + if (previous.value?.cookieBannerHandlingGlobalRules != settings.cookieBannerHandlingGlobalRules) { await _service.cookieBannerHandlingGlobalRules( settings.cookieBannerHandlingGlobalRules, ); } - if (previous - .valueOrNull - ?.cookieBannerHandlingGlobalRulesSubFrames != + if (previous.value?.cookieBannerHandlingGlobalRulesSubFrames != settings.cookieBannerHandlingGlobalRulesSubFrames) { await _service.cookieBannerHandlingGlobalRulesSubFrames( settings.cookieBannerHandlingGlobalRulesSubFrames, ); } - if (previous.valueOrNull?.webContentIsolationStrategy != + if (previous.value?.webContentIsolationStrategy != settings.webContentIsolationStrategy) { await _service.webContentIsolationStrategy( settings.webContentIsolationStrategy, ); } - if (previous.valueOrNull?.contentBlocking != - settings.contentBlocking) { + if (previous.value?.contentBlocking != settings.contentBlocking) { await _service.contentBlocking(settings.contentBlocking); } } else { diff --git a/app/lib/features/geckoview/features/browser/domain/services/engine_settings_replication.g.dart b/app/lib/features/geckoview/features/browser/domain/services/engine_settings_replication.g.dart index 8014e3f0..5cf610ef 100644 --- a/app/lib/features/geckoview/features/browser/domain/services/engine_settings_replication.g.dart +++ b/app/lib/features/geckoview/features/browser/domain/services/engine_settings_replication.g.dart @@ -6,22 +6,61 @@ part of 'engine_settings_replication.dart'; // RiverpodGenerator // ************************************************************************** -String _$engineSettingsReplicationServiceHash() => - r'be3001c952dac6c7c6be3927f6834dae57280601'; +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning -/// See also [EngineSettingsReplicationService]. @ProviderFor(EngineSettingsReplicationService) -final engineSettingsReplicationServiceProvider = - NotifierProvider.internal( - EngineSettingsReplicationService.new, - name: r'engineSettingsReplicationServiceProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$engineSettingsReplicationServiceHash, - dependencies: null, - allTransitiveDependencies: null, - ); +const engineSettingsReplicationServiceProvider = + EngineSettingsReplicationServiceProvider._(); -typedef _$EngineSettingsReplicationService = Notifier; -// 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 EngineSettingsReplicationServiceProvider + extends $NotifierProvider { + const EngineSettingsReplicationServiceProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'engineSettingsReplicationServiceProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$engineSettingsReplicationServiceHash(); + + @$internal + @override + EngineSettingsReplicationService create() => + EngineSettingsReplicationService(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(void value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + +String _$engineSettingsReplicationServiceHash() => + r'015bd9c923de0c09109d0fd489967f52a35ee944'; + +abstract class _$EngineSettingsReplicationService extends $Notifier { + void build(); + @$mustCallSuper + @override + void runBuild() { + build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + void, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} diff --git a/app/lib/features/geckoview/features/browser/domain/services/proxy_settings_replication.dart b/app/lib/features/geckoview/features/browser/domain/services/proxy_settings_replication.dart index e816237c..1592eb64 100644 --- a/app/lib/features/geckoview/features/browser/domain/services/proxy_settings_replication.dart +++ b/app/lib/features/geckoview/features/browser/domain/services/proxy_settings_replication.dart @@ -20,6 +20,7 @@ import 'package:fast_equatable/fast_equatable.dart'; import 'package:flutter_mozilla_components/flutter_mozilla_components.dart'; import 'package:nullability/nullability.dart'; +import 'package:riverpod/riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; import 'package:weblibre/core/logger.dart'; import 'package:weblibre/features/geckoview/features/tabs/domain/providers.dart'; @@ -36,7 +37,7 @@ class ProxySettingsReplication extends _$ProxySettingsReplication { void build() { ref.listen( fireImmediately: true, - torProxyServiceProvider.select((data) => data.valueOrNull), + torProxyServiceProvider.select((data) => data.value), (previous, next) async { if (next != null) { await _service.setProxyPort(next); @@ -54,7 +55,7 @@ class ProxySettingsReplication extends _$ProxySettingsReplication { ref.listen( fireImmediately: true, containersWithCountProvider.select( - (value) => EquatableValue(value.valueOrNull), + (value) => EquatableValue(value.value), ), (previous, next) async { if (next.value != null) { diff --git a/app/lib/features/geckoview/features/browser/domain/services/proxy_settings_replication.g.dart b/app/lib/features/geckoview/features/browser/domain/services/proxy_settings_replication.g.dart index 1d1b8b4c..a81d6a89 100644 --- a/app/lib/features/geckoview/features/browser/domain/services/proxy_settings_replication.g.dart +++ b/app/lib/features/geckoview/features/browser/domain/services/proxy_settings_replication.g.dart @@ -6,22 +6,59 @@ part of 'proxy_settings_replication.dart'; // RiverpodGenerator // ************************************************************************** -String _$proxySettingsReplicationHash() => - r'95e68c06df280d11730ec35f0cd93cf2b1e3c02d'; +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning -/// See also [ProxySettingsReplication]. @ProviderFor(ProxySettingsReplication) -final proxySettingsReplicationProvider = - NotifierProvider.internal( - ProxySettingsReplication.new, - name: r'proxySettingsReplicationProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$proxySettingsReplicationHash, - dependencies: null, - allTransitiveDependencies: null, - ); +const proxySettingsReplicationProvider = ProxySettingsReplicationProvider._(); -typedef _$ProxySettingsReplication = Notifier; -// 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 ProxySettingsReplicationProvider + extends $NotifierProvider { + const ProxySettingsReplicationProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'proxySettingsReplicationProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$proxySettingsReplicationHash(); + + @$internal + @override + ProxySettingsReplication create() => ProxySettingsReplication(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(void value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + +String _$proxySettingsReplicationHash() => + r'787545f882b97274dc67007a6404f170d40bdb64'; + +abstract class _$ProxySettingsReplication extends $Notifier { + void build(); + @$mustCallSuper + @override + void runBuild() { + build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + void, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} diff --git a/app/lib/features/geckoview/features/browser/presentation/controllers/tab_suggestions.g.dart b/app/lib/features/geckoview/features/browser/presentation/controllers/tab_suggestions.g.dart index 1de40eb1..0472be63 100644 --- a/app/lib/features/geckoview/features/browser/presentation/controllers/tab_suggestions.g.dart +++ b/app/lib/features/geckoview/features/browser/presentation/controllers/tab_suggestions.g.dart @@ -6,22 +6,59 @@ part of 'tab_suggestions.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(TabSuggestionsController) +const tabSuggestionsControllerProvider = TabSuggestionsControllerProvider._(); + +final class TabSuggestionsControllerProvider + extends $NotifierProvider { + const TabSuggestionsControllerProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'tabSuggestionsControllerProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$tabSuggestionsControllerHash(); + + @$internal + @override + TabSuggestionsController create() => TabSuggestionsController(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(bool value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + String _$tabSuggestionsControllerHash() => r'5ce7f385b8aba14d432912cf0acb06aad04433fc'; -/// See also [TabSuggestionsController]. -@ProviderFor(TabSuggestionsController) -final tabSuggestionsControllerProvider = - NotifierProvider.internal( - TabSuggestionsController.new, - name: r'tabSuggestionsControllerProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$tabSuggestionsControllerHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$TabSuggestionsController = Notifier; -// 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 +abstract class _$TabSuggestionsController extends $Notifier { + bool build(); + @$mustCallSuper + @override + void runBuild() { + final created = build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + bool, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} diff --git a/app/lib/features/geckoview/features/browser/presentation/controllers/tree_view.g.dart b/app/lib/features/geckoview/features/browser/presentation/controllers/tree_view.g.dart index 856b4e10..4eb9a43a 100644 --- a/app/lib/features/geckoview/features/browser/presentation/controllers/tree_view.g.dart +++ b/app/lib/features/geckoview/features/browser/presentation/controllers/tree_view.g.dart @@ -6,22 +6,59 @@ part of 'tree_view.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(TreeViewController) +const treeViewControllerProvider = TreeViewControllerProvider._(); + +final class TreeViewControllerProvider + extends $NotifierProvider { + const TreeViewControllerProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'treeViewControllerProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$treeViewControllerHash(); + + @$internal + @override + TreeViewController create() => TreeViewController(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(bool value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + String _$treeViewControllerHash() => r'1fac2a133d369e3bd3f8f75cdd2d0c862a6ab942'; -/// See also [TreeViewController]. -@ProviderFor(TreeViewController) -final treeViewControllerProvider = - NotifierProvider.internal( - TreeViewController.new, - name: r'treeViewControllerProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$treeViewControllerHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$TreeViewController = Notifier; -// 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 +abstract class _$TreeViewController extends $Notifier { + bool build(); + @$mustCallSuper + @override + void runBuild() { + final created = build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + bool, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} diff --git a/app/lib/features/geckoview/features/browser/presentation/dialogs/tab_tree.dart b/app/lib/features/geckoview/features/browser/presentation/dialogs/tab_tree.dart index 4dc94e06..7274709a 100644 --- a/app/lib/features/geckoview/features/browser/presentation/dialogs/tab_tree.dart +++ b/app/lib/features/geckoview/features/browser/presentation/dialogs/tab_tree.dart @@ -102,7 +102,7 @@ class TabTreeDialog extends HookConsumerWidget { final graph = Graph()..isTree = true; if (tabs.hasValue) { - for (final MapEntry(:key, :value) in tabs.valueOrNull!.entries) { + for (final MapEntry(:key, :value) in tabs.value!.entries) { if (value != null) { final current = Node.Id(key); final parent = Node.Id(value); @@ -113,7 +113,7 @@ class TabTreeDialog extends HookConsumerWidget { } return graph; - }, [EquatableValue(tabs.valueOrNull), selectedTabId]); + }, [EquatableValue(tabs.value), selectedTabId]); final graphAlgo = useMemoized(() { final config = BuchheimWalkerConfiguration() @@ -168,7 +168,7 @@ class TabTreeDialog extends HookConsumerWidget { minScale: 0.1, maxScale: 5.0, child: Skeletonizer( - enabled: !tabs.hasValue || tabs.valueOrNull?.isEmpty == true, + enabled: !tabs.hasValue || tabs.value?.isEmpty == true, child: Skeleton.replace( replacement: const Bone.square(), child: GraphView( diff --git a/app/lib/features/geckoview/features/browser/presentation/screens/browser.dart b/app/lib/features/geckoview/features/browser/presentation/screens/browser.dart index 7104b67f..d729a634 100644 --- a/app/lib/features/geckoview/features/browser/presentation/screens/browser.dart +++ b/app/lib/features/geckoview/features/browser/presentation/screens/browser.dart @@ -180,8 +180,7 @@ class BrowserScreen extends HookConsumerWidget { ref.listen( tabScrollYProvider(tabId, const Duration(milliseconds: 50)), (previous, next) { - if (previous?.valueOrNull != null && - next.valueOrNull != null) { + if (previous?.value != null && next.value != null) { final diff = previous!.value! - next.value!; if (diff < 0) { if (diffAcc.value > 0) { @@ -279,7 +278,7 @@ class BrowserScreen extends HookConsumerWidget { if (tabState?.isFullScreen == true) { await ref - .read(selectedTabSessionNotifierProvider) + .read(selectedTabSessionProvider) .exitFullscreen(); return true; } @@ -288,7 +287,7 @@ class BrowserScreen extends HookConsumerWidget { lastBackButtonPress.value = null; final controller = ref.read( - selectedTabSessionNotifierProvider, + selectedTabSessionProvider, ); await controller.stopLoading(); @@ -305,7 +304,7 @@ class BrowserScreen extends HookConsumerWidget { lastBackButtonPress.value = null; final controller = ref.read( - selectedTabSessionNotifierProvider, + selectedTabSessionProvider, ); await controller.goBack(); diff --git a/app/lib/features/geckoview/features/browser/presentation/widgets/browser_modules/browser_view.dart b/app/lib/features/geckoview/features/browser/presentation/widgets/browser_modules/browser_view.dart index 45217b2a..3bd864f5 100644 --- a/app/lib/features/geckoview/features/browser/presentation/widgets/browser_modules/browser_view.dart +++ b/app/lib/features/geckoview/features/browser/presentation/widgets/browser_modules/browser_view.dart @@ -72,7 +72,7 @@ class _BrowserViewState extends ConsumerState Future _timerTick(Timer timer) async { await ref - .read(selectedTabSessionNotifierProvider) + .read(selectedTabSessionProvider) .requestScreenshot(requireImageResult: false) .onError((error, stackTrace) { logger.e(error, stackTrace: stackTrace); @@ -129,7 +129,7 @@ class _BrowserViewState extends ConsumerState ); ref.listen(feedRequestedProvider, (previous, next) async { - if (next.valueOrNull.mapNotNull(Uri.tryParse) case final Uri url) { + if (next.value.mapNotNull(Uri.tryParse) case final Uri url) { if (GoRouterState.of(context).topRoute?.name != FeedAddRoute.name) { if (ref.read(addFeedDialogBlockingProvider.notifier).canPush(url)) { await FeedAddRoute($extra: url).push(context); diff --git a/app/lib/features/geckoview/features/browser/presentation/widgets/sheets/view_tab.dart b/app/lib/features/geckoview/features/browser/presentation/widgets/sheets/view_tab.dart index 9f0bb960..20868706 100644 --- a/app/lib/features/geckoview/features/browser/presentation/widgets/sheets/view_tab.dart +++ b/app/lib/features/geckoview/features/browser/presentation/widgets/sheets/view_tab.dart @@ -80,7 +80,7 @@ class ViewTabSheetWidget extends HookConsumerWidget { bangListProvider( domain: initialTabState.url.host, orderMostFrequentFirst: true, - ).select((value) => value.valueOrNull ?? const []), + ).select((value) => value.value ?? const []), ); final scrolledTo = useRef(0.0); @@ -306,7 +306,7 @@ class ViewTabSheetWidget extends HookConsumerWidget { final containerId = ref.watch( watchContainerTabIdProvider( initialTabState.id, - ).select((value) => value.valueOrNull), + ).select((value) => value.value), ); return Visibility( @@ -332,7 +332,7 @@ class ViewTabSheetWidget extends HookConsumerWidget { title: const Text('Share screenshot'), onTap: () async { final screenshot = await ref - .read(selectedTabSessionNotifierProvider) + .read(selectedTabSessionProvider) .requestScreenshot(); if (screenshot != null) { diff --git a/app/lib/features/geckoview/features/browser/presentation/widgets/sheets/view_tabs.dart b/app/lib/features/geckoview/features/browser/presentation/widgets/sheets/view_tabs.dart index 168a2d5b..ced0ebc4 100644 --- a/app/lib/features/geckoview/features/browser/presentation/widgets/sheets/view_tabs.dart +++ b/app/lib/features/geckoview/features/browser/presentation/widgets/sheets/view_tabs.dart @@ -272,7 +272,7 @@ class _TabSheetHeader extends HookConsumerWidget { builder: (context, ref, child) { final selectedContainer = ref.watch( selectedContainerDataProvider.select( - (value) => value.valueOrNull, + (value) => value.value, ), ); diff --git a/app/lib/features/geckoview/features/find_in_page/domain/entities/find_in_page_state.g.dart b/app/lib/features/geckoview/features/find_in_page/domain/entities/find_in_page_state.g.dart index 1106dc8f..182e40b0 100644 --- a/app/lib/features/geckoview/features/find_in_page/domain/entities/find_in_page_state.g.dart +++ b/app/lib/features/geckoview/features/find_in_page/domain/entities/find_in_page_state.g.dart @@ -11,41 +11,44 @@ abstract class _$FindInPageStateCWProxy { FindInPageState lastSearchText(String? lastSearchText); - /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `FindInPageState(...).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 `FindInPageState(...).copyWith.fieldName(value)`. /// - /// Usage + /// Example: /// ```dart /// FindInPageState(...).copyWith(id: 12, name: "My name") - /// ```` + /// ``` FindInPageState call({bool visible, String? lastSearchText}); } -/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfFindInPageState.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfFindInPageState.copyWith.fieldName(...)` +/// Callable proxy for `copyWith` functionality. +/// Use as `instanceOfFindInPageState.copyWith(...)` or call `instanceOfFindInPageState.copyWith.fieldName(value)` for a single field. class _$FindInPageStateCWProxyImpl implements _$FindInPageStateCWProxy { const _$FindInPageStateCWProxyImpl(this._value); final FindInPageState _value; @override - FindInPageState visible(bool visible) => this(visible: visible); + FindInPageState visible(bool visible) => call(visible: visible); @override FindInPageState lastSearchText(String? lastSearchText) => - this(lastSearchText: lastSearchText); + call(lastSearchText: lastSearchText); @override - /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `FindInPageState(...).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 `FindInPageState(...).copyWith.fieldName(value)`. /// - /// Usage + /// Example: /// ```dart /// FindInPageState(...).copyWith(id: 12, name: "My name") - /// ```` + /// ``` FindInPageState call({ Object? visible = const $CopyWithPlaceholder(), Object? lastSearchText = const $CopyWithPlaceholder(), }) { return FindInPageState( - visible: visible == const $CopyWithPlaceholder() + visible: visible == const $CopyWithPlaceholder() || visible == null ? _value.visible // ignore: cast_nullable_to_non_nullable : visible as bool, @@ -58,7 +61,8 @@ class _$FindInPageStateCWProxyImpl implements _$FindInPageStateCWProxy { } extension $FindInPageStateCopyWith on FindInPageState { - /// Returns a callable class that can be used as follows: `instanceOfFindInPageState.copyWith(...)` or like so:`instanceOfFindInPageState.copyWith.fieldName(...)`. + /// Returns a callable class used to build a new instance with modified fields. + /// Example: `instanceOfFindInPageState.copyWith(...)` or `instanceOfFindInPageState.copyWith.fieldName(...)`. // ignore: library_private_types_in_public_api _$FindInPageStateCWProxy get copyWith => _$FindInPageStateCWProxyImpl(this); } diff --git a/app/lib/features/geckoview/features/find_in_page/domain/repositories/find_in_page.g.dart b/app/lib/features/geckoview/features/find_in_page/domain/repositories/find_in_page.g.dart index 7be05a8d..3775bd18 100644 --- a/app/lib/features/geckoview/features/find_in_page/domain/repositories/find_in_page.g.dart +++ b/app/lib/features/geckoview/features/find_in_page/domain/repositories/find_in_page.g.dart @@ -6,157 +6,104 @@ part of 'find_in_page.dart'; // RiverpodGenerator // ************************************************************************** -String _$findInPageRepositoryHash() => - r'c289f136c27a22978f15668a13d7044eb39c3355'; +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning -/// Copied from Dart SDK -class _SystemHash { - _SystemHash._(); - - static int combine(int hash, int value) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + value); - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10)); - return hash ^ (hash >> 6); - } - - static int finish(int hash) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); - // ignore: parameter_assignments - hash = hash ^ (hash >> 11); - return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); - } -} - -abstract class _$FindInPageRepository extends BuildlessNotifier { - late final String? tabId; - - String? build(String? tabId); -} - -/// See also [FindInPageRepository]. @ProviderFor(FindInPageRepository) -const findInPageRepositoryProvider = FindInPageRepositoryFamily(); +const findInPageRepositoryProvider = FindInPageRepositoryFamily._(); -/// See also [FindInPageRepository]. -class FindInPageRepositoryFamily extends Family { - /// See also [FindInPageRepository]. - const FindInPageRepositoryFamily(); +final class FindInPageRepositoryProvider + extends $NotifierProvider { + const FindInPageRepositoryProvider._({ + required FindInPageRepositoryFamily super.from, + required String? super.argument, + }) : super( + retry: null, + name: r'findInPageRepositoryProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); - /// See also [FindInPageRepository]. - FindInPageRepositoryProvider call(String? tabId) { - return FindInPageRepositoryProvider(tabId); + @override + String debugGetCreateSourceHash() => _$findInPageRepositoryHash(); + + @override + String toString() { + return r'findInPageRepositoryProvider' + '' + '($argument)'; } + @$internal @override - FindInPageRepositoryProvider getProviderOverride( - covariant FindInPageRepositoryProvider provider, - ) { - return call(provider.tabId); - } + FindInPageRepository create() => FindInPageRepository(); - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'findInPageRepositoryProvider'; -} - -/// See also [FindInPageRepository]. -class FindInPageRepositoryProvider - extends NotifierProviderImpl { - /// See also [FindInPageRepository]. - FindInPageRepositoryProvider(String? tabId) - : this._internal( - () => FindInPageRepository()..tabId = tabId, - from: findInPageRepositoryProvider, - name: r'findInPageRepositoryProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$findInPageRepositoryHash, - dependencies: FindInPageRepositoryFamily._dependencies, - allTransitiveDependencies: - FindInPageRepositoryFamily._allTransitiveDependencies, - tabId: tabId, - ); - - FindInPageRepositoryProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.tabId, - }) : super.internal(); - - final String? tabId; - - @override - String? runNotifierBuild(covariant FindInPageRepository notifier) { - return notifier.build(tabId); - } - - @override - Override overrideWith(FindInPageRepository Function() create) { - return ProviderOverride( + /// {@macro riverpod.override_with_value} + Override overrideWithValue(String? value) { + return $ProviderOverride( origin: this, - override: FindInPageRepositoryProvider._internal( - () => create()..tabId = tabId, - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - tabId: tabId, - ), + providerOverride: $SyncValueProvider(value), ); } - @override - NotifierProviderElement createElement() { - return _FindInPageRepositoryProviderElement(this); - } - @override bool operator ==(Object other) { - return other is FindInPageRepositoryProvider && other.tabId == tabId; + return other is FindInPageRepositoryProvider && other.argument == argument; } @override int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, tabId.hashCode); - - return _SystemHash.finish(hash); + return argument.hashCode; } } -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin FindInPageRepositoryRef on NotifierProviderRef { - /// The parameter `tabId` of this provider. - String? get tabId; -} +String _$findInPageRepositoryHash() => + r'c289f136c27a22978f15668a13d7044eb39c3355'; -class _FindInPageRepositoryProviderElement - extends NotifierProviderElement - with FindInPageRepositoryRef { - _FindInPageRepositoryProviderElement(super.provider); +final class FindInPageRepositoryFamily extends $Family + with + $ClassFamilyOverride< + FindInPageRepository, + String?, + String?, + String?, + String? + > { + const FindInPageRepositoryFamily._() + : super( + retry: null, + name: r'findInPageRepositoryProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: false, + ); + + FindInPageRepositoryProvider call(String? tabId) => + FindInPageRepositoryProvider._(argument: tabId, from: this); @override - String? get tabId => (origin as FindInPageRepositoryProvider).tabId; + String toString() => r'findInPageRepositoryProvider'; } -// 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 +abstract class _$FindInPageRepository extends $Notifier { + late final _$args = ref.$arg as String?; + String? get tabId => _$args; + + String? build(String? tabId); + @$mustCallSuper + @override + void runBuild() { + final created = build(_$args); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + String?, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} diff --git a/app/lib/features/geckoview/features/find_in_page/presentation/controllers/find_in_page.g.dart b/app/lib/features/geckoview/features/find_in_page/presentation/controllers/find_in_page.g.dart index cfe8a5b4..2aea3f6e 100644 --- a/app/lib/features/geckoview/features/find_in_page/presentation/controllers/find_in_page.g.dart +++ b/app/lib/features/geckoview/features/find_in_page/presentation/controllers/find_in_page.g.dart @@ -6,159 +6,104 @@ part of 'find_in_page.dart'; // RiverpodGenerator // ************************************************************************** -String _$findInPageControllerHash() => - r'da72e38225809af5c78a372e949a80207d7ce7c9'; +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning -/// Copied from Dart SDK -class _SystemHash { - _SystemHash._(); - - static int combine(int hash, int value) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + value); - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10)); - return hash ^ (hash >> 6); - } - - static int finish(int hash) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); - // ignore: parameter_assignments - hash = hash ^ (hash >> 11); - return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); - } -} - -abstract class _$FindInPageController - extends BuildlessNotifier { - late final String tabId; - - FindInPageState build(String tabId); -} - -/// See also [FindInPageController]. @ProviderFor(FindInPageController) -const findInPageControllerProvider = FindInPageControllerFamily(); +const findInPageControllerProvider = FindInPageControllerFamily._(); -/// See also [FindInPageController]. -class FindInPageControllerFamily extends Family { - /// See also [FindInPageController]. - const FindInPageControllerFamily(); +final class FindInPageControllerProvider + extends $NotifierProvider { + const FindInPageControllerProvider._({ + required FindInPageControllerFamily super.from, + required String super.argument, + }) : super( + retry: null, + name: r'findInPageControllerProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); - /// See also [FindInPageController]. - FindInPageControllerProvider call(String tabId) { - return FindInPageControllerProvider(tabId); + @override + String debugGetCreateSourceHash() => _$findInPageControllerHash(); + + @override + String toString() { + return r'findInPageControllerProvider' + '' + '($argument)'; } + @$internal @override - FindInPageControllerProvider getProviderOverride( - covariant FindInPageControllerProvider provider, - ) { - return call(provider.tabId); - } + FindInPageController create() => FindInPageController(); - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'findInPageControllerProvider'; -} - -/// See also [FindInPageController]. -class FindInPageControllerProvider - extends NotifierProviderImpl { - /// See also [FindInPageController]. - FindInPageControllerProvider(String tabId) - : this._internal( - () => FindInPageController()..tabId = tabId, - from: findInPageControllerProvider, - name: r'findInPageControllerProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$findInPageControllerHash, - dependencies: FindInPageControllerFamily._dependencies, - allTransitiveDependencies: - FindInPageControllerFamily._allTransitiveDependencies, - tabId: tabId, - ); - - FindInPageControllerProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.tabId, - }) : super.internal(); - - final String tabId; - - @override - FindInPageState runNotifierBuild(covariant FindInPageController notifier) { - return notifier.build(tabId); - } - - @override - Override overrideWith(FindInPageController Function() create) { - return ProviderOverride( + /// {@macro riverpod.override_with_value} + Override overrideWithValue(FindInPageState value) { + return $ProviderOverride( origin: this, - override: FindInPageControllerProvider._internal( - () => create()..tabId = tabId, - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - tabId: tabId, - ), + providerOverride: $SyncValueProvider(value), ); } - @override - NotifierProviderElement - createElement() { - return _FindInPageControllerProviderElement(this); - } - @override bool operator ==(Object other) { - return other is FindInPageControllerProvider && other.tabId == tabId; + return other is FindInPageControllerProvider && other.argument == argument; } @override int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, tabId.hashCode); - - return _SystemHash.finish(hash); + return argument.hashCode; } } -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin FindInPageControllerRef on NotifierProviderRef { - /// The parameter `tabId` of this provider. - String get tabId; -} +String _$findInPageControllerHash() => + r'da72e38225809af5c78a372e949a80207d7ce7c9'; -class _FindInPageControllerProviderElement - extends NotifierProviderElement - with FindInPageControllerRef { - _FindInPageControllerProviderElement(super.provider); +final class FindInPageControllerFamily extends $Family + with + $ClassFamilyOverride< + FindInPageController, + FindInPageState, + FindInPageState, + FindInPageState, + String + > { + const FindInPageControllerFamily._() + : super( + retry: null, + name: r'findInPageControllerProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: false, + ); + + FindInPageControllerProvider call(String tabId) => + FindInPageControllerProvider._(argument: tabId, from: this); @override - String get tabId => (origin as FindInPageControllerProvider).tabId; + String toString() => r'findInPageControllerProvider'; } -// 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 +abstract class _$FindInPageController extends $Notifier { + late final _$args = ref.$arg as String; + String get tabId => _$args; + + FindInPageState build(String tabId); + @$mustCallSuper + @override + void runBuild() { + final created = build(_$args); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + FindInPageState, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} diff --git a/app/lib/features/geckoview/features/history/domain/entities/history_filter_options.g.dart b/app/lib/features/geckoview/features/history/domain/entities/history_filter_options.g.dart index a08b7190..9d617379 100644 --- a/app/lib/features/geckoview/features/history/domain/entities/history_filter_options.g.dart +++ b/app/lib/features/geckoview/features/history/domain/entities/history_filter_options.g.dart @@ -11,19 +11,21 @@ abstract class _$HistoryFilterOptionsCWProxy { HistoryFilterOptions visitTypes(Set visitTypes); - /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `HistoryFilterOptions(...).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 `HistoryFilterOptions(...).copyWith.fieldName(value)`. /// - /// Usage + /// Example: /// ```dart /// HistoryFilterOptions(...).copyWith(id: 12, name: "My name") - /// ```` + /// ``` HistoryFilterOptions call({ DateTimeRange? dateRange, Set visitTypes, }); } -/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfHistoryFilterOptions.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfHistoryFilterOptions.copyWith.fieldName(...)` +/// Callable proxy for `copyWith` functionality. +/// Use as `instanceOfHistoryFilterOptions.copyWith(...)` or call `instanceOfHistoryFilterOptions.copyWith.fieldName(value)` for a single field. class _$HistoryFilterOptionsCWProxyImpl implements _$HistoryFilterOptionsCWProxy { const _$HistoryFilterOptionsCWProxyImpl(this._value); @@ -32,19 +34,20 @@ class _$HistoryFilterOptionsCWProxyImpl @override HistoryFilterOptions dateRange(DateTimeRange? dateRange) => - this(dateRange: dateRange); + call(dateRange: dateRange); @override HistoryFilterOptions visitTypes(Set visitTypes) => - this(visitTypes: visitTypes); + call(visitTypes: visitTypes); @override - /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `HistoryFilterOptions(...).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 `HistoryFilterOptions(...).copyWith.fieldName(value)`. /// - /// Usage + /// Example: /// ```dart /// HistoryFilterOptions(...).copyWith(id: 12, name: "My name") - /// ```` + /// ``` HistoryFilterOptions call({ Object? dateRange = const $CopyWithPlaceholder(), Object? visitTypes = const $CopyWithPlaceholder(), @@ -54,7 +57,8 @@ class _$HistoryFilterOptionsCWProxyImpl ? _value.dateRange // ignore: cast_nullable_to_non_nullable : dateRange as DateTimeRange?, - visitTypes: visitTypes == const $CopyWithPlaceholder() + visitTypes: + visitTypes == const $CopyWithPlaceholder() || visitTypes == null ? _value.visitTypes // ignore: cast_nullable_to_non_nullable : visitTypes as Set, @@ -63,7 +67,8 @@ class _$HistoryFilterOptionsCWProxyImpl } extension $HistoryFilterOptionsCopyWith on HistoryFilterOptions { - /// Returns a callable class that can be used as follows: `instanceOfHistoryFilterOptions.copyWith(...)` or like so:`instanceOfHistoryFilterOptions.copyWith.fieldName(...)`. + /// Returns a callable class used to build a new instance with modified fields. + /// Example: `instanceOfHistoryFilterOptions.copyWith(...)` or `instanceOfHistoryFilterOptions.copyWith.fieldName(...)`. // ignore: library_private_types_in_public_api _$HistoryFilterOptionsCWProxy get copyWith => _$HistoryFilterOptionsCWProxyImpl(this); diff --git a/app/lib/features/geckoview/features/history/domain/providers.g.dart b/app/lib/features/geckoview/features/history/domain/providers.g.dart index cfd16f05..1e7f498d 100644 --- a/app/lib/features/geckoview/features/history/domain/providers.g.dart +++ b/app/lib/features/geckoview/features/history/domain/providers.g.dart @@ -6,39 +6,97 @@ part of 'providers.dart'; // RiverpodGenerator // ************************************************************************** -String _$browsingHistoryHash() => r'6447fd4d8209c3befb07f2d82fa41a24bd3accb1'; +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning -/// See also [browsingHistory]. -@ProviderFor(browsingHistory) -final browsingHistoryProvider = - AutoDisposeFutureProvider>.internal( - browsingHistory, - name: r'browsingHistoryProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$browsingHistoryHash, - dependencies: null, - allTransitiveDependencies: null, +@ProviderFor(HistoryFilter) +const historyFilterProvider = HistoryFilterProvider._(); + +final class HistoryFilterProvider + extends $NotifierProvider { + const HistoryFilterProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'historyFilterProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$historyFilterHash(); + + @$internal + @override + HistoryFilter create() => HistoryFilter(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(HistoryFilterOptions value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), ); + } +} -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef BrowsingHistoryRef = AutoDisposeFutureProviderRef>; String _$historyFilterHash() => r'68a604fe857476f7c15be89352a7b10bc456c3d6'; -/// See also [HistoryFilter]. -@ProviderFor(HistoryFilter) -final historyFilterProvider = - NotifierProvider.internal( - HistoryFilter.new, - name: r'historyFilterProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$historyFilterHash, - dependencies: null, - allTransitiveDependencies: null, - ); +abstract class _$HistoryFilter extends $Notifier { + HistoryFilterOptions build(); + @$mustCallSuper + @override + void runBuild() { + final created = build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + HistoryFilterOptions, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} -typedef _$HistoryFilter = Notifier; -// 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 +@ProviderFor(browsingHistory) +const browsingHistoryProvider = BrowsingHistoryProvider._(); + +final class BrowsingHistoryProvider + extends + $FunctionalProvider< + AsyncValue>, + List, + FutureOr> + > + with $FutureModifier>, $FutureProvider> { + const BrowsingHistoryProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'browsingHistoryProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$browsingHistoryHash(); + + @$internal + @override + $FutureProviderElement> $createElement( + $ProviderPointer pointer, + ) => $FutureProviderElement(pointer); + + @override + FutureOr> create(Ref ref) { + return browsingHistory(ref); + } +} + +String _$browsingHistoryHash() => r'6447fd4d8209c3befb07f2d82fa41a24bd3accb1'; diff --git a/app/lib/features/geckoview/features/preferences/data/models/preference_setting.g.dart b/app/lib/features/geckoview/features/preferences/data/models/preference_setting.g.dart index ef29fe49..6b33f5a0 100644 --- a/app/lib/features/geckoview/features/preferences/data/models/preference_setting.g.dart +++ b/app/lib/features/geckoview/features/preferences/data/models/preference_setting.g.dart @@ -11,19 +11,21 @@ abstract class _$PreferenceSettingGroupCWProxy { PreferenceSettingGroup settings(Map settings); - /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PreferenceSettingGroup(...).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 `PreferenceSettingGroup(...).copyWith.fieldName(value)`. /// - /// Usage + /// Example: /// ```dart /// PreferenceSettingGroup(...).copyWith(id: 12, name: "My name") - /// ```` + /// ``` PreferenceSettingGroup call({ String? description, Map settings, }); } -/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfPreferenceSettingGroup.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfPreferenceSettingGroup.copyWith.fieldName(...)` +/// Callable proxy for `copyWith` functionality. +/// Use as `instanceOfPreferenceSettingGroup.copyWith(...)` or call `instanceOfPreferenceSettingGroup.copyWith.fieldName(value)` for a single field. class _$PreferenceSettingGroupCWProxyImpl implements _$PreferenceSettingGroupCWProxy { const _$PreferenceSettingGroupCWProxyImpl(this._value); @@ -32,19 +34,20 @@ class _$PreferenceSettingGroupCWProxyImpl @override PreferenceSettingGroup description(String? description) => - this(description: description); + call(description: description); @override PreferenceSettingGroup settings(Map settings) => - this(settings: settings); + call(settings: settings); @override - /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PreferenceSettingGroup(...).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 `PreferenceSettingGroup(...).copyWith.fieldName(value)`. /// - /// Usage + /// Example: /// ```dart /// PreferenceSettingGroup(...).copyWith(id: 12, name: "My name") - /// ```` + /// ``` PreferenceSettingGroup call({ Object? description = const $CopyWithPlaceholder(), Object? settings = const $CopyWithPlaceholder(), @@ -54,7 +57,7 @@ class _$PreferenceSettingGroupCWProxyImpl ? _value.description // ignore: cast_nullable_to_non_nullable : description as String?, - settings: settings == const $CopyWithPlaceholder() + settings: settings == const $CopyWithPlaceholder() || settings == null ? _value.settings // ignore: cast_nullable_to_non_nullable : settings as Map, @@ -63,7 +66,8 @@ class _$PreferenceSettingGroupCWProxyImpl } extension $PreferenceSettingGroupCopyWith on PreferenceSettingGroup { - /// Returns a callable class that can be used as follows: `instanceOfPreferenceSettingGroup.copyWith(...)` or like so:`instanceOfPreferenceSettingGroup.copyWith.fieldName(...)`. + /// Returns a callable class used to build a new instance with modified fields. + /// Example: `instanceOfPreferenceSettingGroup.copyWith(...)` or `instanceOfPreferenceSettingGroup.copyWith.fieldName(...)`. // ignore: library_private_types_in_public_api _$PreferenceSettingGroupCWProxy get copyWith => _$PreferenceSettingGroupCWProxyImpl(this); @@ -82,12 +86,13 @@ abstract class _$PreferenceSettingCWProxy { PreferenceSetting shouldBeDefault(bool shouldBeDefault); - /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PreferenceSetting(...).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 `PreferenceSetting(...).copyWith.fieldName(value)`. /// - /// Usage + /// Example: /// ```dart /// PreferenceSetting(...).copyWith(id: 12, name: "My name") - /// ```` + /// ``` PreferenceSetting call({ Object value, String? title, @@ -98,41 +103,43 @@ abstract class _$PreferenceSettingCWProxy { }); } -/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfPreferenceSetting.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfPreferenceSetting.copyWith.fieldName(...)` +/// Callable proxy for `copyWith` functionality. +/// Use as `instanceOfPreferenceSetting.copyWith(...)` or call `instanceOfPreferenceSetting.copyWith.fieldName(value)` for a single field. class _$PreferenceSettingCWProxyImpl implements _$PreferenceSettingCWProxy { const _$PreferenceSettingCWProxyImpl(this._value); final PreferenceSetting _value; @override - PreferenceSetting value(Object value) => this(value: value); + PreferenceSetting value(Object value) => call(value: value); @override - PreferenceSetting title(String? title) => this(title: title); + PreferenceSetting title(String? title) => call(title: title); @override PreferenceSetting description(String? description) => - this(description: description); + call(description: description); @override PreferenceSetting actualValue(Object? actualValue) => - this(actualValue: actualValue); + call(actualValue: actualValue); @override PreferenceSetting requireUserOptIn(bool requireUserOptIn) => - this(requireUserOptIn: requireUserOptIn); + call(requireUserOptIn: requireUserOptIn); @override PreferenceSetting shouldBeDefault(bool shouldBeDefault) => - this(shouldBeDefault: shouldBeDefault); + call(shouldBeDefault: shouldBeDefault); @override - /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PreferenceSetting(...).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 `PreferenceSetting(...).copyWith.fieldName(value)`. /// - /// Usage + /// Example: /// ```dart /// PreferenceSetting(...).copyWith(id: 12, name: "My name") - /// ```` + /// ``` PreferenceSetting call({ Object? value = const $CopyWithPlaceholder(), Object? title = const $CopyWithPlaceholder(), @@ -142,7 +149,7 @@ class _$PreferenceSettingCWProxyImpl implements _$PreferenceSettingCWProxy { Object? shouldBeDefault = const $CopyWithPlaceholder(), }) { return PreferenceSetting( - value: value == const $CopyWithPlaceholder() + value: value == const $CopyWithPlaceholder() || value == null ? _value.value // ignore: cast_nullable_to_non_nullable : value as Object, @@ -158,11 +165,15 @@ class _$PreferenceSettingCWProxyImpl implements _$PreferenceSettingCWProxy { ? _value.actualValue // ignore: cast_nullable_to_non_nullable : actualValue as Object?, - requireUserOptIn: requireUserOptIn == const $CopyWithPlaceholder() + requireUserOptIn: + requireUserOptIn == const $CopyWithPlaceholder() || + requireUserOptIn == null ? _value.requireUserOptIn // ignore: cast_nullable_to_non_nullable : requireUserOptIn as bool, - shouldBeDefault: shouldBeDefault == const $CopyWithPlaceholder() + shouldBeDefault: + shouldBeDefault == const $CopyWithPlaceholder() || + shouldBeDefault == null ? _value.shouldBeDefault // ignore: cast_nullable_to_non_nullable : shouldBeDefault as bool, @@ -171,7 +182,8 @@ class _$PreferenceSettingCWProxyImpl implements _$PreferenceSettingCWProxy { } extension $PreferenceSettingCopyWith on PreferenceSetting { - /// Returns a callable class that can be used as follows: `instanceOfPreferenceSetting.copyWith(...)` or like so:`instanceOfPreferenceSetting.copyWith.fieldName(...)`. + /// Returns a callable class used to build a new instance with modified fields. + /// Example: `instanceOfPreferenceSetting.copyWith(...)` or `instanceOfPreferenceSetting.copyWith.fieldName(...)`. // ignore: library_private_types_in_public_api _$PreferenceSettingCWProxy get copyWith => _$PreferenceSettingCWProxyImpl(this); diff --git a/app/lib/features/geckoview/features/preferences/data/repositories/preference_settings.g.dart b/app/lib/features/geckoview/features/preferences/data/repositories/preference_settings.g.dart index 6ceef00b..abc84a79 100644 --- a/app/lib/features/geckoview/features/preferences/data/repositories/preference_settings.g.dart +++ b/app/lib/features/geckoview/features/preferences/data/repositories/preference_settings.g.dart @@ -6,683 +6,515 @@ part of 'preference_settings.dart'; // RiverpodGenerator // ************************************************************************** -String _$preferenceSettingContentHash() => - r'a8a61fdf8800cb7adb365c100409ddce09c574b1'; +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning -/// See also [_preferenceSettingContent]. @ProviderFor(_preferenceSettingContent) -final _preferenceSettingContentProvider = - FutureProvider>.internal( - _preferenceSettingContent, - name: r'_preferenceSettingContentProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$preferenceSettingContentHash, - dependencies: null, - allTransitiveDependencies: null, - ); +const _preferenceSettingContentProvider = _PreferenceSettingContentProvider._(); -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef _PreferenceSettingContentRef = FutureProviderRef>; -String _$preferenceSettingGroupsHash() => - r'd267dacf82a11568c9cf0cc864f434db35f93394'; - -/// Copied from Dart SDK -class _SystemHash { - _SystemHash._(); - - static int combine(int hash, int value) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + value); - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10)); - return hash ^ (hash >> 6); - } - - static int finish(int hash) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); - // ignore: parameter_assignments - hash = hash ^ (hash >> 11); - return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); - } -} - -/// See also [_preferenceSettingGroups]. -@ProviderFor(_preferenceSettingGroups) -const _preferenceSettingGroupsProvider = _PreferenceSettingGroupsFamily(); - -/// See also [_preferenceSettingGroups]. -class _PreferenceSettingGroupsFamily - extends Family>> { - /// See also [_preferenceSettingGroups]. - const _PreferenceSettingGroupsFamily(); - - /// See also [_preferenceSettingGroups]. - _PreferenceSettingGroupsProvider call(PreferencePartition partition) { - return _PreferenceSettingGroupsProvider(partition); - } - - @override - _PreferenceSettingGroupsProvider getProviderOverride( - covariant _PreferenceSettingGroupsProvider provider, - ) { - return call(provider.partition); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'_preferenceSettingGroupsProvider'; -} - -/// See also [_preferenceSettingGroups]. -class _PreferenceSettingGroupsProvider - extends FutureProvider> { - /// See also [_preferenceSettingGroups]. - _PreferenceSettingGroupsProvider(PreferencePartition partition) - : this._internal( - (ref) => _preferenceSettingGroups( - ref as _PreferenceSettingGroupsRef, - partition, - ), - from: _preferenceSettingGroupsProvider, - name: r'_preferenceSettingGroupsProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$preferenceSettingGroupsHash, - dependencies: _PreferenceSettingGroupsFamily._dependencies, - allTransitiveDependencies: - _PreferenceSettingGroupsFamily._allTransitiveDependencies, - partition: partition, +final class _PreferenceSettingContentProvider + extends + $FunctionalProvider< + AsyncValue>, + Map, + FutureOr> + > + with + $FutureModifier>, + $FutureProvider> { + const _PreferenceSettingContentProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'_preferenceSettingContentProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, ); - _PreferenceSettingGroupsProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.partition, - }) : super.internal(); + @override + String debugGetCreateSourceHash() => _$_preferenceSettingContentHash(); - final PreferencePartition partition; + @$internal + @override + $FutureProviderElement> $createElement( + $ProviderPointer pointer, + ) => $FutureProviderElement(pointer); @override - Override overrideWith( - FutureOr> Function( - _PreferenceSettingGroupsRef provider, - ) - create, - ) { - return ProviderOverride( - origin: this, - override: _PreferenceSettingGroupsProvider._internal( - (ref) => create(ref as _PreferenceSettingGroupsRef), - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - partition: partition, - ), - ); + FutureOr> create(Ref ref) { + return _preferenceSettingContent(ref); + } +} + +String _$_preferenceSettingContentHash() => + r'a8a61fdf8800cb7adb365c100409ddce09c574b1'; + +@ProviderFor(_preferenceSettingGroups) +const _preferenceSettingGroupsProvider = _PreferenceSettingGroupsFamily._(); + +final class _PreferenceSettingGroupsProvider + extends + $FunctionalProvider< + AsyncValue>, + Map, + FutureOr> + > + with + $FutureModifier>, + $FutureProvider> { + const _PreferenceSettingGroupsProvider._({ + required _PreferenceSettingGroupsFamily super.from, + required PreferencePartition super.argument, + }) : super( + retry: null, + name: r'_preferenceSettingGroupsProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$_preferenceSettingGroupsHash(); + + @override + String toString() { + return r'_preferenceSettingGroupsProvider' + '' + '($argument)'; } + @$internal @override - FutureProviderElement> createElement() { - return _PreferenceSettingGroupsProviderElement(this); + $FutureProviderElement> $createElement( + $ProviderPointer pointer, + ) => $FutureProviderElement(pointer); + + @override + FutureOr> create(Ref ref) { + final argument = this.argument as PreferencePartition; + return _preferenceSettingGroups(ref, argument); } @override bool operator ==(Object other) { return other is _PreferenceSettingGroupsProvider && - other.partition == partition; + other.argument == argument; } @override int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, partition.hashCode); - - return _SystemHash.finish(hash); + return argument.hashCode; } } -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin _PreferenceSettingGroupsRef - on FutureProviderRef> { - /// The parameter `partition` of this provider. - PreferencePartition get partition; -} +String _$_preferenceSettingGroupsHash() => + r'd267dacf82a11568c9cf0cc864f434db35f93394'; -class _PreferenceSettingGroupsProviderElement - extends FutureProviderElement> - with _PreferenceSettingGroupsRef { - _PreferenceSettingGroupsProviderElement(super.provider); - - @override - PreferencePartition get partition => - (origin as _PreferenceSettingGroupsProvider).partition; -} - -String _$preferenceSettingGroupHash() => - r'64d80a37928d7e5aea7d3d567dde8ade7292cd5f'; - -/// See also [_preferenceSettingGroup]. -@ProviderFor(_preferenceSettingGroup) -const _preferenceSettingGroupProvider = _PreferenceSettingGroupFamily(); - -/// See also [_preferenceSettingGroup]. -class _PreferenceSettingGroupFamily - extends Family> { - /// See also [_preferenceSettingGroup]. - const _PreferenceSettingGroupFamily(); - - /// See also [_preferenceSettingGroup]. - _PreferenceSettingGroupProvider call( - PreferencePartition partition, - String groupName, - ) { - return _PreferenceSettingGroupProvider(partition, groupName); - } - - @override - _PreferenceSettingGroupProvider getProviderOverride( - covariant _PreferenceSettingGroupProvider provider, - ) { - return call(provider.partition, provider.groupName); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'_preferenceSettingGroupProvider'; -} - -/// See also [_preferenceSettingGroup]. -class _PreferenceSettingGroupProvider - extends FutureProvider { - /// See also [_preferenceSettingGroup]. - _PreferenceSettingGroupProvider( - PreferencePartition partition, - String groupName, - ) : this._internal( - (ref) => _preferenceSettingGroup( - ref as _PreferenceSettingGroupRef, - partition, - groupName, - ), - from: _preferenceSettingGroupProvider, - name: r'_preferenceSettingGroupProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$preferenceSettingGroupHash, - dependencies: _PreferenceSettingGroupFamily._dependencies, - allTransitiveDependencies: - _PreferenceSettingGroupFamily._allTransitiveDependencies, - partition: partition, - groupName: groupName, +final class _PreferenceSettingGroupsFamily extends $Family + with + $FunctionalFamilyOverride< + FutureOr>, + PreferencePartition + > { + const _PreferenceSettingGroupsFamily._() + : super( + retry: null, + name: r'_preferenceSettingGroupsProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: false, ); - _PreferenceSettingGroupProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.partition, - required this.groupName, - }) : super.internal(); - - final PreferencePartition partition; - final String groupName; + _PreferenceSettingGroupsProvider call(PreferencePartition partition) => + _PreferenceSettingGroupsProvider._(argument: partition, from: this); @override - Override overrideWith( - FutureOr Function( - _PreferenceSettingGroupRef provider, - ) - create, - ) { - return ProviderOverride( - origin: this, - override: _PreferenceSettingGroupProvider._internal( - (ref) => create(ref as _PreferenceSettingGroupRef), - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - partition: partition, - groupName: groupName, - ), - ); + String toString() => r'_preferenceSettingGroupsProvider'; +} + +@ProviderFor(_preferenceSettingGroup) +const _preferenceSettingGroupProvider = _PreferenceSettingGroupFamily._(); + +final class _PreferenceSettingGroupProvider + extends + $FunctionalProvider< + AsyncValue, + PreferenceSettingGroup, + FutureOr + > + with + $FutureModifier, + $FutureProvider { + const _PreferenceSettingGroupProvider._({ + required _PreferenceSettingGroupFamily super.from, + required (PreferencePartition, String) super.argument, + }) : super( + retry: null, + name: r'_preferenceSettingGroupProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$_preferenceSettingGroupHash(); + + @override + String toString() { + return r'_preferenceSettingGroupProvider' + '' + '$argument'; } + @$internal @override - FutureProviderElement createElement() { - return _PreferenceSettingGroupProviderElement(this); + $FutureProviderElement $createElement( + $ProviderPointer pointer, + ) => $FutureProviderElement(pointer); + + @override + FutureOr create(Ref ref) { + final argument = this.argument as (PreferencePartition, String); + return _preferenceSettingGroup(ref, argument.$1, argument.$2); } @override bool operator ==(Object other) { return other is _PreferenceSettingGroupProvider && - other.partition == partition && - other.groupName == groupName; + other.argument == argument; } @override int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, partition.hashCode); - hash = _SystemHash.combine(hash, groupName.hashCode); - - return _SystemHash.finish(hash); + return argument.hashCode; } } -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin _PreferenceSettingGroupRef on FutureProviderRef { - /// The parameter `partition` of this provider. - PreferencePartition get partition; +String _$_preferenceSettingGroupHash() => + r'64d80a37928d7e5aea7d3d567dde8ade7292cd5f'; - /// The parameter `groupName` of this provider. - String get groupName; -} - -class _PreferenceSettingGroupProviderElement - extends FutureProviderElement - with _PreferenceSettingGroupRef { - _PreferenceSettingGroupProviderElement(super.provider); - - @override - PreferencePartition get partition => - (origin as _PreferenceSettingGroupProvider).partition; - @override - String get groupName => (origin as _PreferenceSettingGroupProvider).groupName; -} - -String _$preferenceRepositoryHash() => - r'b2b7f75b3d30842b3006bb18af89f7ff90ba4ce7'; - -/// See also [_PreferenceRepository]. -@ProviderFor(_PreferenceRepository) -final _preferenceRepositoryProvider = - AutoDisposeNotifierProvider< - _PreferenceRepository, - Raw>> - >.internal( - _PreferenceRepository.new, - name: r'_preferenceRepositoryProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$preferenceRepositoryHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$PreferenceRepository = - AutoDisposeNotifier>>>; -String _$unifiedPreferenceSettingsRepositoryHash() => - r'35aa16ffa7aa1453c8331ed7470ef85a68d27178'; - -abstract class _$UnifiedPreferenceSettingsRepository - extends - BuildlessAutoDisposeStreamNotifier< - Map +final class _PreferenceSettingGroupFamily extends $Family + with + $FunctionalFamilyOverride< + FutureOr, + (PreferencePartition, String) > { - late final PreferencePartition partition; - - Stream> build( - PreferencePartition partition, - ); -} - -/// See also [UnifiedPreferenceSettingsRepository]. -@ProviderFor(UnifiedPreferenceSettingsRepository) -const unifiedPreferenceSettingsRepositoryProvider = - UnifiedPreferenceSettingsRepositoryFamily(); - -/// See also [UnifiedPreferenceSettingsRepository]. -class UnifiedPreferenceSettingsRepositoryFamily - extends Family>> { - /// See also [UnifiedPreferenceSettingsRepository]. - const UnifiedPreferenceSettingsRepositoryFamily(); - - /// See also [UnifiedPreferenceSettingsRepository]. - UnifiedPreferenceSettingsRepositoryProvider call( - PreferencePartition partition, - ) { - return UnifiedPreferenceSettingsRepositoryProvider(partition); - } - - @override - UnifiedPreferenceSettingsRepositoryProvider getProviderOverride( - covariant UnifiedPreferenceSettingsRepositoryProvider provider, - ) { - return call(provider.partition); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'unifiedPreferenceSettingsRepositoryProvider'; -} - -/// See also [UnifiedPreferenceSettingsRepository]. -class UnifiedPreferenceSettingsRepositoryProvider - extends - AutoDisposeStreamNotifierProviderImpl< - UnifiedPreferenceSettingsRepository, - Map - > { - /// See also [UnifiedPreferenceSettingsRepository]. - UnifiedPreferenceSettingsRepositoryProvider(PreferencePartition partition) - : this._internal( - () => UnifiedPreferenceSettingsRepository()..partition = partition, - from: unifiedPreferenceSettingsRepositoryProvider, - name: r'unifiedPreferenceSettingsRepositoryProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$unifiedPreferenceSettingsRepositoryHash, - dependencies: UnifiedPreferenceSettingsRepositoryFamily._dependencies, - allTransitiveDependencies: UnifiedPreferenceSettingsRepositoryFamily - ._allTransitiveDependencies, - partition: partition, + const _PreferenceSettingGroupFamily._() + : super( + retry: null, + name: r'_preferenceSettingGroupProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: false, ); - UnifiedPreferenceSettingsRepositoryProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.partition, - }) : super.internal(); - - final PreferencePartition partition; + _PreferenceSettingGroupProvider call( + PreferencePartition partition, + String groupName, + ) => _PreferenceSettingGroupProvider._( + argument: (partition, groupName), + from: this, + ); @override - Stream> runNotifierBuild( - covariant UnifiedPreferenceSettingsRepository notifier, - ) { - return notifier.build(partition); - } + String toString() => r'_preferenceSettingGroupProvider'; +} - @override - Override overrideWith(UnifiedPreferenceSettingsRepository Function() create) { - return ProviderOverride( - origin: this, - override: UnifiedPreferenceSettingsRepositoryProvider._internal( - () => create()..partition = partition, - from: from, - name: null, +@ProviderFor(_PreferenceRepository) +const _preferenceRepositoryProvider = _PreferenceRepositoryProvider._(); + +final class _PreferenceRepositoryProvider + extends + $NotifierProvider< + _PreferenceRepository, + Raw>> + > { + const _PreferenceRepositoryProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'_preferenceRepositoryProvider', + isAutoDispose: true, dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - partition: partition, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$_preferenceRepositoryHash(); + + @$internal + @override + _PreferenceRepository create() => _PreferenceRepository(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(Raw>> value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider>>>( + value, ), ); } +} + +String _$_preferenceRepositoryHash() => + r'b2b7f75b3d30842b3006bb18af89f7ff90ba4ce7'; + +abstract class _$PreferenceRepository + extends $Notifier>>> { + Raw>> build(); + @$mustCallSuper + @override + void runBuild() { + final created = build(); + final ref = + this.ref + as $Ref< + Raw>>, + Raw>> + >; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier< + Raw>>, + Raw>> + >, + Raw>>, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} + +@ProviderFor(UnifiedPreferenceSettingsRepository) +const unifiedPreferenceSettingsRepositoryProvider = + UnifiedPreferenceSettingsRepositoryFamily._(); + +final class UnifiedPreferenceSettingsRepositoryProvider + extends + $StreamNotifierProvider< + UnifiedPreferenceSettingsRepository, + Map + > { + const UnifiedPreferenceSettingsRepositoryProvider._({ + required UnifiedPreferenceSettingsRepositoryFamily super.from, + required PreferencePartition super.argument, + }) : super( + retry: null, + name: r'unifiedPreferenceSettingsRepositoryProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); @override - AutoDisposeStreamNotifierProviderElement< - UnifiedPreferenceSettingsRepository, - Map - > - createElement() { - return _UnifiedPreferenceSettingsRepositoryProviderElement(this); + String debugGetCreateSourceHash() => + _$unifiedPreferenceSettingsRepositoryHash(); + + @override + String toString() { + return r'unifiedPreferenceSettingsRepositoryProvider' + '' + '($argument)'; } + @$internal + @override + UnifiedPreferenceSettingsRepository create() => + UnifiedPreferenceSettingsRepository(); + @override bool operator ==(Object other) { return other is UnifiedPreferenceSettingsRepositoryProvider && - other.partition == partition; + other.argument == argument; } @override int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, partition.hashCode); - - return _SystemHash.finish(hash); + return argument.hashCode; } } -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin UnifiedPreferenceSettingsRepositoryRef - on - AutoDisposeStreamNotifierProviderRef< - Map - > { - /// The parameter `partition` of this provider. - PreferencePartition get partition; -} +String _$unifiedPreferenceSettingsRepositoryHash() => + r'35aa16ffa7aa1453c8331ed7470ef85a68d27178'; -class _UnifiedPreferenceSettingsRepositoryProviderElement - extends - AutoDisposeStreamNotifierProviderElement< +final class UnifiedPreferenceSettingsRepositoryFamily extends $Family + with + $ClassFamilyOverride< UnifiedPreferenceSettingsRepository, - Map - > - with UnifiedPreferenceSettingsRepositoryRef { - _UnifiedPreferenceSettingsRepositoryProviderElement(super.provider); + AsyncValue>, + Map, + Stream>, + PreferencePartition + > { + const UnifiedPreferenceSettingsRepositoryFamily._() + : super( + retry: null, + name: r'unifiedPreferenceSettingsRepositoryProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, + ); + + UnifiedPreferenceSettingsRepositoryProvider call( + PreferencePartition partition, + ) => UnifiedPreferenceSettingsRepositoryProvider._( + argument: partition, + from: this, + ); @override - PreferencePartition get partition => - (origin as UnifiedPreferenceSettingsRepositoryProvider).partition; + String toString() => r'unifiedPreferenceSettingsRepositoryProvider'; +} + +abstract class _$UnifiedPreferenceSettingsRepository + extends $StreamNotifier> { + late final _$args = ref.$arg as PreferencePartition; + PreferencePartition get partition => _$args; + + Stream> build( + PreferencePartition partition, + ); + @$mustCallSuper + @override + void runBuild() { + final created = build(_$args); + final ref = + this.ref + as $Ref< + AsyncValue>, + Map + >; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier< + AsyncValue>, + Map + >, + AsyncValue>, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} + +@ProviderFor(PreferenceSettingsGroupRepository) +const preferenceSettingsGroupRepositoryProvider = + PreferenceSettingsGroupRepositoryFamily._(); + +final class PreferenceSettingsGroupRepositoryProvider + extends + $StreamNotifierProvider< + PreferenceSettingsGroupRepository, + PreferenceSettingGroup + > { + const PreferenceSettingsGroupRepositoryProvider._({ + required PreferenceSettingsGroupRepositoryFamily super.from, + required (PreferencePartition, String) super.argument, + }) : super( + retry: null, + name: r'preferenceSettingsGroupRepositoryProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => + _$preferenceSettingsGroupRepositoryHash(); + + @override + String toString() { + return r'preferenceSettingsGroupRepositoryProvider' + '' + '$argument'; + } + + @$internal + @override + PreferenceSettingsGroupRepository create() => + PreferenceSettingsGroupRepository(); + + @override + bool operator ==(Object other) { + return other is PreferenceSettingsGroupRepositoryProvider && + other.argument == argument; + } + + @override + int get hashCode { + return argument.hashCode; + } } String _$preferenceSettingsGroupRepositoryHash() => r'60f416ffe1cde4d535fb5b643a80aead20836bae'; +final class PreferenceSettingsGroupRepositoryFamily extends $Family + with + $ClassFamilyOverride< + PreferenceSettingsGroupRepository, + AsyncValue, + PreferenceSettingGroup, + Stream, + (PreferencePartition, String) + > { + const PreferenceSettingsGroupRepositoryFamily._() + : super( + retry: null, + name: r'preferenceSettingsGroupRepositoryProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, + ); + + PreferenceSettingsGroupRepositoryProvider call( + PreferencePartition partition, + String groupName, + ) => PreferenceSettingsGroupRepositoryProvider._( + argument: (partition, groupName), + from: this, + ); + + @override + String toString() => r'preferenceSettingsGroupRepositoryProvider'; +} + abstract class _$PreferenceSettingsGroupRepository - extends BuildlessAutoDisposeStreamNotifier { - late final PreferencePartition partition; - late final String groupName; + extends $StreamNotifier { + late final _$args = ref.$arg as (PreferencePartition, String); + PreferencePartition get partition => _$args.$1; + String get groupName => _$args.$2; Stream build( PreferencePartition partition, String groupName, ); -} - -/// See also [PreferenceSettingsGroupRepository]. -@ProviderFor(PreferenceSettingsGroupRepository) -const preferenceSettingsGroupRepositoryProvider = - PreferenceSettingsGroupRepositoryFamily(); - -/// See also [PreferenceSettingsGroupRepository]. -class PreferenceSettingsGroupRepositoryFamily - extends Family> { - /// See also [PreferenceSettingsGroupRepository]. - const PreferenceSettingsGroupRepositoryFamily(); - - /// See also [PreferenceSettingsGroupRepository]. - PreferenceSettingsGroupRepositoryProvider call( - PreferencePartition partition, - String groupName, - ) { - return PreferenceSettingsGroupRepositoryProvider(partition, groupName); - } - + @$mustCallSuper @override - PreferenceSettingsGroupRepositoryProvider getProviderOverride( - covariant PreferenceSettingsGroupRepositoryProvider provider, - ) { - return call(provider.partition, provider.groupName); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'preferenceSettingsGroupRepositoryProvider'; -} - -/// See also [PreferenceSettingsGroupRepository]. -class PreferenceSettingsGroupRepositoryProvider - extends - AutoDisposeStreamNotifierProviderImpl< - PreferenceSettingsGroupRepository, - PreferenceSettingGroup - > { - /// See also [PreferenceSettingsGroupRepository]. - PreferenceSettingsGroupRepositoryProvider( - PreferencePartition partition, - String groupName, - ) : this._internal( - () => PreferenceSettingsGroupRepository() - ..partition = partition - ..groupName = groupName, - from: preferenceSettingsGroupRepositoryProvider, - name: r'preferenceSettingsGroupRepositoryProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$preferenceSettingsGroupRepositoryHash, - dependencies: PreferenceSettingsGroupRepositoryFamily._dependencies, - allTransitiveDependencies: - PreferenceSettingsGroupRepositoryFamily._allTransitiveDependencies, - partition: partition, - groupName: groupName, - ); - - PreferenceSettingsGroupRepositoryProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.partition, - required this.groupName, - }) : super.internal(); - - final PreferencePartition partition; - final String groupName; - - @override - Stream runNotifierBuild( - covariant PreferenceSettingsGroupRepository notifier, - ) { - return notifier.build(partition, groupName); - } - - @override - Override overrideWith(PreferenceSettingsGroupRepository Function() create) { - return ProviderOverride( - origin: this, - override: PreferenceSettingsGroupRepositoryProvider._internal( - () => create() - ..partition = partition - ..groupName = groupName, - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - partition: partition, - groupName: groupName, - ), - ); - } - - @override - AutoDisposeStreamNotifierProviderElement< - PreferenceSettingsGroupRepository, - PreferenceSettingGroup - > - createElement() { - return _PreferenceSettingsGroupRepositoryProviderElement(this); - } - - @override - bool operator ==(Object other) { - return other is PreferenceSettingsGroupRepositoryProvider && - other.partition == partition && - other.groupName == groupName; - } - - @override - int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, partition.hashCode); - hash = _SystemHash.combine(hash, groupName.hashCode); - - return _SystemHash.finish(hash); + void runBuild() { + final created = build(_$args.$1, _$args.$2); + final ref = + this.ref + as $Ref, PreferenceSettingGroup>; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier< + AsyncValue, + PreferenceSettingGroup + >, + AsyncValue, + Object?, + Object? + >; + element.handleValue(ref, created); } } - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin PreferenceSettingsGroupRepositoryRef - on AutoDisposeStreamNotifierProviderRef { - /// The parameter `partition` of this provider. - PreferencePartition get partition; - - /// The parameter `groupName` of this provider. - String get groupName; -} - -class _PreferenceSettingsGroupRepositoryProviderElement - extends - AutoDisposeStreamNotifierProviderElement< - PreferenceSettingsGroupRepository, - PreferenceSettingGroup - > - with PreferenceSettingsGroupRepositoryRef { - _PreferenceSettingsGroupRepositoryProviderElement(super.provider); - - @override - PreferencePartition get partition => - (origin as PreferenceSettingsGroupRepositoryProvider).partition; - @override - String get groupName => - (origin as PreferenceSettingsGroupRepositoryProvider).groupName; -} - -// 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 diff --git a/app/lib/features/geckoview/features/readerview/domain/providers/readerable.g.dart b/app/lib/features/geckoview/features/readerview/domain/providers/readerable.g.dart index 3bc02107..9ae5d51c 100644 --- a/app/lib/features/geckoview/features/readerview/domain/providers/readerable.g.dart +++ b/app/lib/features/geckoview/features/readerview/domain/providers/readerable.g.dart @@ -6,41 +6,87 @@ part of 'readerable.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(readerableService) +const readerableServiceProvider = ReaderableServiceProvider._(); + +final class ReaderableServiceProvider + extends + $FunctionalProvider< + GeckoReaderableService, + GeckoReaderableService, + GeckoReaderableService + > + with $Provider { + const ReaderableServiceProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'readerableServiceProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$readerableServiceHash(); + + @$internal + @override + $ProviderElement $createElement( + $ProviderPointer pointer, + ) => $ProviderElement(pointer); + + @override + GeckoReaderableService create(Ref ref) { + return readerableService(ref); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(GeckoReaderableService value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + String _$readerableServiceHash() => r'03182c8afc41f5184322a3206473cbfa96df5819'; -/// See also [readerableService]. -@ProviderFor(readerableService) -final readerableServiceProvider = Provider.internal( - readerableService, - name: r'readerableServiceProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$readerableServiceHash, - dependencies: null, - allTransitiveDependencies: null, -); +@ProviderFor(appearanceButtonVisibility) +const appearanceButtonVisibilityProvider = + AppearanceButtonVisibilityProvider._(); + +final class AppearanceButtonVisibilityProvider + extends $FunctionalProvider, bool, Stream> + with $FutureModifier, $StreamProvider { + const AppearanceButtonVisibilityProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'appearanceButtonVisibilityProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$appearanceButtonVisibilityHash(); + + @$internal + @override + $StreamProviderElement $createElement($ProviderPointer pointer) => + $StreamProviderElement(pointer); + + @override + Stream create(Ref ref) { + return appearanceButtonVisibility(ref); + } +} -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef ReaderableServiceRef = ProviderRef; String _$appearanceButtonVisibilityHash() => r'e7102b63113937dd5d17028a5ec8dac428c38bbb'; - -/// See also [appearanceButtonVisibility]. -@ProviderFor(appearanceButtonVisibility) -final appearanceButtonVisibilityProvider = - AutoDisposeStreamProvider.internal( - appearanceButtonVisibility, - name: r'appearanceButtonVisibilityProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$appearanceButtonVisibilityHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef AppearanceButtonVisibilityRef = AutoDisposeStreamProviderRef; -// 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 diff --git a/app/lib/features/geckoview/features/readerview/presentation/controllers/readerable.g.dart b/app/lib/features/geckoview/features/readerview/presentation/controllers/readerable.g.dart index f7cf926f..c4900cb8 100644 --- a/app/lib/features/geckoview/features/readerview/presentation/controllers/readerable.g.dart +++ b/app/lib/features/geckoview/features/readerview/presentation/controllers/readerable.g.dart @@ -6,22 +6,52 @@ part of 'readerable.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(ReaderableScreenController) +const readerableScreenControllerProvider = + ReaderableScreenControllerProvider._(); + +final class ReaderableScreenControllerProvider + extends $AsyncNotifierProvider { + const ReaderableScreenControllerProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'readerableScreenControllerProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$readerableScreenControllerHash(); + + @$internal + @override + ReaderableScreenController create() => ReaderableScreenController(); +} + String _$readerableScreenControllerHash() => r'62b2167ff8f9fe21c3cf3339e135a50aa684160c'; -/// See also [ReaderableScreenController]. -@ProviderFor(ReaderableScreenController) -final readerableScreenControllerProvider = - AsyncNotifierProvider.internal( - ReaderableScreenController.new, - name: r'readerableScreenControllerProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$readerableScreenControllerHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$ReaderableScreenController = AsyncNotifier; -// 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 +abstract class _$ReaderableScreenController extends $AsyncNotifier { + FutureOr build(); + @$mustCallSuper + @override + void runBuild() { + build(); + final ref = this.ref as $Ref, void>; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, void>, + AsyncValue, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} diff --git a/app/lib/features/geckoview/features/readerview/presentation/widgets/reader_appearance_button.dart b/app/lib/features/geckoview/features/readerview/presentation/widgets/reader_appearance_button.dart index 0c0ee4ff..6cc6113e 100644 --- a/app/lib/features/geckoview/features/readerview/presentation/widgets/reader_appearance_button.dart +++ b/app/lib/features/geckoview/features/readerview/presentation/widgets/reader_appearance_button.dart @@ -29,7 +29,7 @@ class ReaderAppearanceButton extends HookConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { final buttonVisible = ref.watch( appearanceButtonVisibilityProvider.select( - (value) => value.valueOrNull ?? false, + (value) => value.value ?? false, ), ); diff --git a/app/lib/features/geckoview/features/search/domain/providers/engine_suggestions.g.dart b/app/lib/features/geckoview/features/search/domain/providers/engine_suggestions.g.dart index 7fdc5ff0..1b241aa3 100644 --- a/app/lib/features/geckoview/features/search/domain/providers/engine_suggestions.g.dart +++ b/app/lib/features/geckoview/features/search/domain/providers/engine_suggestions.g.dart @@ -6,44 +6,106 @@ part of 'engine_suggestions.dart'; // RiverpodGenerator // ************************************************************************** -String _$engineHistorySuggestionsHash() => - r'7e6c17e6a2df98098ca1a683a438d1c261ccabdf'; +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning -/// See also [engineHistorySuggestions]. -@ProviderFor(engineHistorySuggestions) -final engineHistorySuggestionsProvider = - AutoDisposeProvider>>.internal( - engineHistorySuggestions, - name: r'engineHistorySuggestionsProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$engineHistorySuggestionsHash, - dependencies: null, - allTransitiveDependencies: null, - ); +@ProviderFor(EngineSuggestions) +const engineSuggestionsProvider = EngineSuggestionsProvider._(); + +final class EngineSuggestionsProvider + extends $StreamNotifierProvider> { + const EngineSuggestionsProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'engineSuggestionsProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$engineSuggestionsHash(); + + @$internal + @override + EngineSuggestions create() => EngineSuggestions(); +} -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef EngineHistorySuggestionsRef = - AutoDisposeProviderRef>>; String _$engineSuggestionsHash() => r'ba2c2d7f0a5e99fd9e639acd020b8cf3016c6126'; -/// See also [EngineSuggestions]. -@ProviderFor(EngineSuggestions) -final engineSuggestionsProvider = - AutoDisposeStreamNotifierProvider< - EngineSuggestions, - List - >.internal( - EngineSuggestions.new, - name: r'engineSuggestionsProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$engineSuggestionsHash, - dependencies: null, - allTransitiveDependencies: null, - ); +abstract class _$EngineSuggestions + extends $StreamNotifier> { + Stream> build(); + @$mustCallSuper + @override + void runBuild() { + final created = build(); + final ref = + this.ref + as $Ref>, List>; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier< + AsyncValue>, + List + >, + AsyncValue>, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} -typedef _$EngineSuggestions = AutoDisposeStreamNotifier>; -// 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 +@ProviderFor(engineHistorySuggestions) +const engineHistorySuggestionsProvider = EngineHistorySuggestionsProvider._(); + +final class EngineHistorySuggestionsProvider + extends + $FunctionalProvider< + AsyncValue>, + AsyncValue>, + AsyncValue> + > + with $Provider>> { + const EngineHistorySuggestionsProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'engineHistorySuggestionsProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$engineHistorySuggestionsHash(); + + @$internal + @override + $ProviderElement>> $createElement( + $ProviderPointer pointer, + ) => $ProviderElement(pointer); + + @override + AsyncValue> create(Ref ref) { + return engineHistorySuggestions(ref); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(AsyncValue> value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider>>( + value, + ), + ); + } +} + +String _$engineHistorySuggestionsHash() => + r'7e6c17e6a2df98098ca1a683a438d1c261ccabdf'; diff --git a/app/lib/features/geckoview/features/search/domain/providers/search_suggestions.g.dart b/app/lib/features/geckoview/features/search/domain/providers/search_suggestions.g.dart index 69a4e068..4b35462b 100644 --- a/app/lib/features/geckoview/features/search/domain/providers/search_suggestions.g.dart +++ b/app/lib/features/geckoview/features/search/domain/providers/search_suggestions.g.dart @@ -6,187 +6,144 @@ part of 'search_suggestions.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(defaultSearchSuggestions) +const defaultSearchSuggestionsProvider = DefaultSearchSuggestionsProvider._(); + +final class DefaultSearchSuggestionsProvider + extends + $FunctionalProvider< + ISearchSuggestionProvider, + ISearchSuggestionProvider, + ISearchSuggestionProvider + > + with $Provider { + const DefaultSearchSuggestionsProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'defaultSearchSuggestionsProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$defaultSearchSuggestionsHash(); + + @$internal + @override + $ProviderElement $createElement( + $ProviderPointer pointer, + ) => $ProviderElement(pointer); + + @override + ISearchSuggestionProvider create(Ref ref) { + return defaultSearchSuggestions(ref); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(ISearchSuggestionProvider value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + String _$defaultSearchSuggestionsHash() => r'6d7a387c7daeb790a4c9a5cdc105d2a2bdbacd2b'; -/// See also [defaultSearchSuggestions]. -@ProviderFor(defaultSearchSuggestions) -final defaultSearchSuggestionsProvider = - Provider.internal( - defaultSearchSuggestions, - name: r'defaultSearchSuggestionsProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$defaultSearchSuggestionsHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef DefaultSearchSuggestionsRef = ProviderRef; -String _$searchSuggestionsHash() => r'8d1fb72cab374491a53f7a814f87af6a26356f42'; - -/// Copied from Dart SDK -class _SystemHash { - _SystemHash._(); - - static int combine(int hash, int value) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + value); - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10)); - return hash ^ (hash >> 6); - } - - static int finish(int hash) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); - // ignore: parameter_assignments - hash = hash ^ (hash >> 11); - return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); - } -} - -abstract class _$SearchSuggestions - extends BuildlessAutoDisposeStreamNotifier> { - late final ISearchSuggestionProvider? suggestionsProvider; - - Stream> build({ISearchSuggestionProvider? suggestionsProvider}); -} - -/// See also [SearchSuggestions]. @ProviderFor(SearchSuggestions) -const searchSuggestionsProvider = SearchSuggestionsFamily(); +const searchSuggestionsProvider = SearchSuggestionsFamily._(); -/// See also [SearchSuggestions]. -class SearchSuggestionsFamily extends Family>> { - /// See also [SearchSuggestions]. - const SearchSuggestionsFamily(); +final class SearchSuggestionsProvider + extends $StreamNotifierProvider> { + const SearchSuggestionsProvider._({ + required SearchSuggestionsFamily super.from, + required ISearchSuggestionProvider? super.argument, + }) : super( + retry: null, + name: r'searchSuggestionsProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); - /// See also [SearchSuggestions]. - SearchSuggestionsProvider call({ - ISearchSuggestionProvider? suggestionsProvider, - }) { - return SearchSuggestionsProvider(suggestionsProvider: suggestionsProvider); + @override + String debugGetCreateSourceHash() => _$searchSuggestionsHash(); + + @override + String toString() { + return r'searchSuggestionsProvider' + '' + '($argument)'; } + @$internal @override - SearchSuggestionsProvider getProviderOverride( - covariant SearchSuggestionsProvider provider, - ) { - return call(suggestionsProvider: provider.suggestionsProvider); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'searchSuggestionsProvider'; -} - -/// See also [SearchSuggestions]. -class SearchSuggestionsProvider - extends - AutoDisposeStreamNotifierProviderImpl> { - /// See also [SearchSuggestions]. - SearchSuggestionsProvider({ISearchSuggestionProvider? suggestionsProvider}) - : this._internal( - () => SearchSuggestions()..suggestionsProvider = suggestionsProvider, - from: searchSuggestionsProvider, - name: r'searchSuggestionsProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$searchSuggestionsHash, - dependencies: SearchSuggestionsFamily._dependencies, - allTransitiveDependencies: - SearchSuggestionsFamily._allTransitiveDependencies, - suggestionsProvider: suggestionsProvider, - ); - - SearchSuggestionsProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.suggestionsProvider, - }) : super.internal(); - - final ISearchSuggestionProvider? suggestionsProvider; - - @override - Stream> runNotifierBuild(covariant SearchSuggestions notifier) { - return notifier.build(suggestionsProvider: suggestionsProvider); - } - - @override - Override overrideWith(SearchSuggestions Function() create) { - return ProviderOverride( - origin: this, - override: SearchSuggestionsProvider._internal( - () => create()..suggestionsProvider = suggestionsProvider, - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - suggestionsProvider: suggestionsProvider, - ), - ); - } - - @override - AutoDisposeStreamNotifierProviderElement> - createElement() { - return _SearchSuggestionsProviderElement(this); - } + SearchSuggestions create() => SearchSuggestions(); @override bool operator ==(Object other) { - return other is SearchSuggestionsProvider && - other.suggestionsProvider == suggestionsProvider; + return other is SearchSuggestionsProvider && other.argument == argument; } @override int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, suggestionsProvider.hashCode); - - return _SystemHash.finish(hash); + return argument.hashCode; } } -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin SearchSuggestionsRef - on AutoDisposeStreamNotifierProviderRef> { - /// The parameter `suggestionsProvider` of this provider. - ISearchSuggestionProvider? get suggestionsProvider; -} +String _$searchSuggestionsHash() => r'8d1fb72cab374491a53f7a814f87af6a26356f42'; -class _SearchSuggestionsProviderElement - extends - AutoDisposeStreamNotifierProviderElement< +final class SearchSuggestionsFamily extends $Family + with + $ClassFamilyOverride< SearchSuggestions, - List - > - with SearchSuggestionsRef { - _SearchSuggestionsProviderElement(super.provider); + AsyncValue>, + List, + Stream>, + ISearchSuggestionProvider? + > { + const SearchSuggestionsFamily._() + : super( + retry: null, + name: r'searchSuggestionsProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, + ); + + SearchSuggestionsProvider call({ + ISearchSuggestionProvider? suggestionsProvider, + }) => SearchSuggestionsProvider._(argument: suggestionsProvider, from: this); @override - ISearchSuggestionProvider? get suggestionsProvider => - (origin as SearchSuggestionsProvider).suggestionsProvider; + String toString() => r'searchSuggestionsProvider'; } -// 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 +abstract class _$SearchSuggestions extends $StreamNotifier> { + late final _$args = ref.$arg as ISearchSuggestionProvider?; + ISearchSuggestionProvider? get suggestionsProvider => _$args; + + Stream> build({ISearchSuggestionProvider? suggestionsProvider}); + @$mustCallSuper + @override + void runBuild() { + final created = build(suggestionsProvider: _$args); + final ref = this.ref as $Ref>, List>; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier>, List>, + AsyncValue>, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} diff --git a/app/lib/features/geckoview/features/search/domain/repositories/search_suggestions.g.dart b/app/lib/features/geckoview/features/search/domain/repositories/search_suggestions.g.dart index e8c9c0e4..b4f3881f 100644 --- a/app/lib/features/geckoview/features/search/domain/repositories/search_suggestions.g.dart +++ b/app/lib/features/geckoview/features/search/domain/repositories/search_suggestions.g.dart @@ -6,183 +6,118 @@ part of 'search_suggestions.dart'; // RiverpodGenerator // ************************************************************************** -String _$searchSuggestionsRepositoryHash() => - r'be75d075c3479c3d5e462211dec8bbd21b106820'; +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning -/// Copied from Dart SDK -class _SystemHash { - _SystemHash._(); - - static int combine(int hash, int value) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + value); - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10)); - return hash ^ (hash >> 6); - } - - static int finish(int hash) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); - // ignore: parameter_assignments - hash = hash ^ (hash >> 11); - return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); - } -} - -abstract class _$SearchSuggestionsRepository - extends BuildlessNotifier>>> { - late final ISearchSuggestionProvider suggestionsProvider; - - Raw>> build( - ISearchSuggestionProvider suggestionsProvider, - ); -} - -/// See also [SearchSuggestionsRepository]. @ProviderFor(SearchSuggestionsRepository) -const searchSuggestionsRepositoryProvider = SearchSuggestionsRepositoryFamily(); +const searchSuggestionsRepositoryProvider = + SearchSuggestionsRepositoryFamily._(); -/// See also [SearchSuggestionsRepository]. -class SearchSuggestionsRepositoryFamily - extends Family>>> { - /// See also [SearchSuggestionsRepository]. - const SearchSuggestionsRepositoryFamily(); - - /// See also [SearchSuggestionsRepository]. - SearchSuggestionsRepositoryProvider call( - ISearchSuggestionProvider suggestionsProvider, - ) { - return SearchSuggestionsRepositoryProvider(suggestionsProvider); - } - - @override - SearchSuggestionsRepositoryProvider getProviderOverride( - covariant SearchSuggestionsRepositoryProvider provider, - ) { - return call(provider.suggestionsProvider); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'searchSuggestionsRepositoryProvider'; -} - -/// See also [SearchSuggestionsRepository]. -class SearchSuggestionsRepositoryProvider +final class SearchSuggestionsRepositoryProvider extends - NotifierProviderImpl< + $NotifierProvider< SearchSuggestionsRepository, Raw>> > { - /// See also [SearchSuggestionsRepository]. - SearchSuggestionsRepositoryProvider( - ISearchSuggestionProvider suggestionsProvider, - ) : this._internal( - () => - SearchSuggestionsRepository() - ..suggestionsProvider = suggestionsProvider, - from: searchSuggestionsRepositoryProvider, - name: r'searchSuggestionsRepositoryProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$searchSuggestionsRepositoryHash, - dependencies: SearchSuggestionsRepositoryFamily._dependencies, - allTransitiveDependencies: - SearchSuggestionsRepositoryFamily._allTransitiveDependencies, - suggestionsProvider: suggestionsProvider, - ); - - SearchSuggestionsRepositoryProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.suggestionsProvider, - }) : super.internal(); - - final ISearchSuggestionProvider suggestionsProvider; + const SearchSuggestionsRepositoryProvider._({ + required SearchSuggestionsRepositoryFamily super.from, + required ISearchSuggestionProvider super.argument, + }) : super( + retry: null, + name: r'searchSuggestionsRepositoryProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); @override - Raw>> runNotifierBuild( - covariant SearchSuggestionsRepository notifier, - ) { - return notifier.build(suggestionsProvider); + String debugGetCreateSourceHash() => _$searchSuggestionsRepositoryHash(); + + @override + String toString() { + return r'searchSuggestionsRepositoryProvider' + '' + '($argument)'; } + @$internal @override - Override overrideWith(SearchSuggestionsRepository Function() create) { - return ProviderOverride( + SearchSuggestionsRepository create() => SearchSuggestionsRepository(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(Raw>> value) { + return $ProviderOverride( origin: this, - override: SearchSuggestionsRepositoryProvider._internal( - () => create()..suggestionsProvider = suggestionsProvider, - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - suggestionsProvider: suggestionsProvider, - ), + providerOverride: $SyncValueProvider>>>(value), ); } - @override - NotifierProviderElement< - SearchSuggestionsRepository, - Raw>> - > - createElement() { - return _SearchSuggestionsRepositoryProviderElement(this); - } - @override bool operator ==(Object other) { return other is SearchSuggestionsRepositoryProvider && - other.suggestionsProvider == suggestionsProvider; + other.argument == argument; } @override int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, suggestionsProvider.hashCode); - - return _SystemHash.finish(hash); + return argument.hashCode; } } -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin SearchSuggestionsRepositoryRef - on NotifierProviderRef>>> { - /// The parameter `suggestionsProvider` of this provider. - ISearchSuggestionProvider get suggestionsProvider; -} +String _$searchSuggestionsRepositoryHash() => + r'be75d075c3479c3d5e462211dec8bbd21b106820'; -class _SearchSuggestionsRepositoryProviderElement - extends - NotifierProviderElement< +final class SearchSuggestionsRepositoryFamily extends $Family + with + $ClassFamilyOverride< SearchSuggestionsRepository, - Raw>> - > - with SearchSuggestionsRepositoryRef { - _SearchSuggestionsRepositoryProviderElement(super.provider); + Raw>>, + Raw>>, + Raw>>, + ISearchSuggestionProvider + > { + const SearchSuggestionsRepositoryFamily._() + : super( + retry: null, + name: r'searchSuggestionsRepositoryProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: false, + ); + + SearchSuggestionsRepositoryProvider call( + ISearchSuggestionProvider suggestionsProvider, + ) => SearchSuggestionsRepositoryProvider._( + argument: suggestionsProvider, + from: this, + ); @override - ISearchSuggestionProvider get suggestionsProvider => - (origin as SearchSuggestionsRepositoryProvider).suggestionsProvider; + String toString() => r'searchSuggestionsRepositoryProvider'; } -// 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 +abstract class _$SearchSuggestionsRepository + extends $Notifier>>> { + late final _$args = ref.$arg as ISearchSuggestionProvider; + ISearchSuggestionProvider get suggestionsProvider => _$args; + + Raw>> build( + ISearchSuggestionProvider suggestionsProvider, + ); + @$mustCallSuper + @override + void runBuild() { + final created = build(_$args); + final ref = + this.ref as $Ref>>, Raw>>>; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier>>, Raw>>>, + Raw>>, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} diff --git a/app/lib/features/geckoview/features/search/presentation/screens/search.dart b/app/lib/features/geckoview/features/search/presentation/screens/search.dart index 0029a228..5b2fc782 100644 --- a/app/lib/features/geckoview/features/search/presentation/screens/search.dart +++ b/app/lib/features/geckoview/features/search/presentation/screens/search.dart @@ -81,7 +81,7 @@ class SearchScreen extends HookConsumerWidget { final searchFocusNode = useFocusNode(); final defaultSearchBang = ref.watch( - defaultSearchBangDataProvider.select((value) => value.valueOrNull), + defaultSearchBangDataProvider.select((value) => value.value), ); final selectedBang = useState(null); diff --git a/app/lib/features/geckoview/features/search/presentation/widgets/search_modules/feed_search.dart b/app/lib/features/geckoview/features/search/presentation/widgets/search_modules/feed_search.dart index 6300fed0..9826c719 100644 --- a/app/lib/features/geckoview/features/search/presentation/widgets/search_modules/feed_search.dart +++ b/app/lib/features/geckoview/features/search/presentation/widgets/search_modules/feed_search.dart @@ -62,7 +62,7 @@ class FeedSearch extends HookConsumerWidget { ); }); - if (articlesAsync.hasValue && (articlesAsync.valueOrNull.isEmpty)) { + if (articlesAsync.hasValue && (articlesAsync.value.isEmpty)) { return const SliverToBoxAdapter(child: SizedBox.shrink()); } @@ -190,7 +190,7 @@ class FeedSearch extends HookConsumerWidget { ); }, loading: () => SliverList.builder( - itemCount: articlesAsync.valueOrNull?.length ?? 3, + itemCount: articlesAsync.value?.length ?? 3, itemBuilder: (context, index) { return const ListTile(title: Bone.text()); }, diff --git a/app/lib/features/geckoview/features/search/presentation/widgets/search_modules/fixed_search_suggestions.dart b/app/lib/features/geckoview/features/search/presentation/widgets/search_modules/fixed_search_suggestions.dart index 67d2a9af..fa8a8de9 100644 --- a/app/lib/features/geckoview/features/search/presentation/widgets/search_modules/fixed_search_suggestions.dart +++ b/app/lib/features/geckoview/features/search/presentation/widgets/search_modules/fixed_search_suggestions.dart @@ -69,8 +69,8 @@ class FixedSearchTermSuggestions extends HookConsumerWidget { final prioritizedSuggestions = isSuggestableText ? [ searchTextController.text, - if (searchSuggestions.valueOrNull != null) - ...searchSuggestions.valueOrNull! + if (searchSuggestions.value != null) + ...searchSuggestions.value! .whereNot( (suggestion) => suggestion == searchTextController.text, ) diff --git a/app/lib/features/geckoview/features/search/presentation/widgets/search_modules/full_search_suggestions.dart b/app/lib/features/geckoview/features/search/presentation/widgets/search_modules/full_search_suggestions.dart index cfa6e607..d4917b3c 100644 --- a/app/lib/features/geckoview/features/search/presentation/widgets/search_modules/full_search_suggestions.dart +++ b/app/lib/features/geckoview/features/search/presentation/widgets/search_modules/full_search_suggestions.dart @@ -94,8 +94,8 @@ class FullSearchTermSuggestions extends HookConsumerWidget { } else { final prioritizedSuggestions = [ if (searchTextIsNotEmpty) searchTextController.text, - if (searchSuggestions.valueOrNull != null) - ...searchSuggestions.valueOrNull!.whereNot( + if (searchSuggestions.value != null) + ...searchSuggestions.value!.whereNot( (suggestion) => suggestion == searchTextController.text, ), ]; diff --git a/app/lib/features/geckoview/features/search/presentation/widgets/search_modules/history_suggestions.dart b/app/lib/features/geckoview/features/search/presentation/widgets/search_modules/history_suggestions.dart index b4dbdd9d..66d99e41 100644 --- a/app/lib/features/geckoview/features/search/presentation/widgets/search_modules/history_suggestions.dart +++ b/app/lib/features/geckoview/features/search/presentation/widgets/search_modules/history_suggestions.dart @@ -55,7 +55,7 @@ class HistorySuggestions extends HookConsumerWidget { }); if (historySuggestionsAsync.hasValue && - (historySuggestionsAsync.valueOrNull.isEmpty)) { + (historySuggestionsAsync.value.isEmpty)) { return const SliverToBoxAdapter(child: SizedBox.shrink()); } @@ -147,7 +147,7 @@ class HistorySuggestions extends HookConsumerWidget { ); }, loading: () => SliverList.builder( - itemCount: historySuggestionsAsync.valueOrNull?.length ?? 3, + itemCount: historySuggestionsAsync.value?.length ?? 3, itemBuilder: (context, index) { return const ListTile(title: Bone.text()); }, diff --git a/app/lib/features/geckoview/features/search/presentation/widgets/search_modules/tab_search.dart b/app/lib/features/geckoview/features/search/presentation/widgets/search_modules/tab_search.dart index 999cae50..a5d5936f 100644 --- a/app/lib/features/geckoview/features/search/presentation/widgets/search_modules/tab_search.dart +++ b/app/lib/features/geckoview/features/search/presentation/widgets/search_modules/tab_search.dart @@ -49,9 +49,7 @@ class TabSearch extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final selectedContainer = useState( - ref.read( - selectedContainerDataProvider.select((value) => value.valueOrNull), - ), + ref.read(selectedContainerDataProvider.select((value) => value.value)), ); final tabs = ref diff --git a/app/lib/features/geckoview/features/tabs/data/database/daos/container.dart b/app/lib/features/geckoview/features/tabs/data/database/daos/container.dart index f5b4d34c..23b1fc2e 100644 --- a/app/lib/features/geckoview/features/tabs/data/database/daos/container.dart +++ b/app/lib/features/geckoview/features/tabs/data/database/daos/container.dart @@ -20,14 +20,14 @@ import 'dart:ui'; import 'package:drift/drift.dart'; +import 'package:weblibre/features/geckoview/features/tabs/data/database/daos/container.drift.dart'; import 'package:weblibre/features/geckoview/features/tabs/data/database/database.dart'; +import 'package:weblibre/features/geckoview/features/tabs/data/database/definitions.drift.dart'; import 'package:weblibre/features/geckoview/features/tabs/data/models/container_data.dart'; -part 'container.g.dart'; - @DriftAccessor() class ContainerDao extends DatabaseAccessor - with _$ContainerDaoMixin { + with $ContainerDaoMixin { ContainerDao(super.db); Future addContainer(ContainerData container) { @@ -99,27 +99,39 @@ class ContainerDao extends DatabaseAccessor String? containerId, { int bucket = 0, }) { - return db.leadingOrderKey(bucket: bucket, containerId: containerId); + return db.definitionsDrift.leadingOrderKey( + bucket: bucket, + containerId: containerId, + ); } SingleSelectable generateTrailingOrderKey( String? containerId, { int bucket = 0, }) { - return db.trailingOrderKey(bucket: bucket, containerId: containerId); + return db.definitionsDrift.trailingOrderKey( + bucket: bucket, + containerId: containerId, + ); } SingleSelectable generateOrderKeyAfterTabId( String? containerId, String tabId, ) { - return db.orderKeyAfterTab(containerId: containerId, tabId: tabId); + return db.definitionsDrift.orderKeyAfterTab( + containerId: containerId, + tabId: tabId, + ); } SingleSelectable generateOrderKeyBeforeTabId( String? containerId, String tabId, ) { - return db.orderKeyBeforeTab(containerId: containerId, tabId: tabId); + return db.definitionsDrift.orderKeyBeforeTab( + containerId: containerId, + tabId: tabId, + ); } } diff --git a/app/lib/features/geckoview/features/tabs/data/database/daos/container.drift.dart b/app/lib/features/geckoview/features/tabs/data/database/daos/container.drift.dart new file mode 100644 index 00000000..67d1f2fa --- /dev/null +++ b/app/lib/features/geckoview/features/tabs/data/database/daos/container.drift.dart @@ -0,0 +1,7 @@ +// dart format width=80 +// ignore_for_file: type=lint +import 'package:drift/drift.dart' as i0; +import 'package:weblibre/features/geckoview/features/tabs/data/database/database.dart' + as i1; + +mixin $ContainerDaoMixin on i0.DatabaseAccessor {} diff --git a/app/lib/features/geckoview/features/tabs/data/database/daos/container.g.dart b/app/lib/features/geckoview/features/tabs/data/database/daos/container.g.dart deleted file mode 100644 index 55df7c87..00000000 --- a/app/lib/features/geckoview/features/tabs/data/database/daos/container.g.dart +++ /dev/null @@ -1,6 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'container.dart'; - -// ignore_for_file: type=lint -mixin _$ContainerDaoMixin on DatabaseAccessor {} diff --git a/app/lib/features/geckoview/features/tabs/data/database/daos/tab.dart b/app/lib/features/geckoview/features/tabs/data/database/daos/tab.dart index befe7a8d..ea63f2e7 100644 --- a/app/lib/features/geckoview/features/tabs/data/database/daos/tab.dart +++ b/app/lib/features/geckoview/features/tabs/data/database/daos/tab.dart @@ -23,13 +23,13 @@ import 'package:drift/drift.dart'; import 'package:lexo_rank/lexo_rank.dart'; import 'package:nullability/nullability.dart'; import 'package:weblibre/features/geckoview/domain/entities/states/tab.dart'; +import 'package:weblibre/features/geckoview/features/tabs/data/database/daos/tab.drift.dart'; import 'package:weblibre/features/geckoview/features/tabs/data/database/database.dart'; +import 'package:weblibre/features/geckoview/features/tabs/data/database/definitions.drift.dart'; import 'package:weblibre/features/geckoview/features/tabs/data/models/tab_query_result.dart'; -part 'tab.g.dart'; - @DriftAccessor() -class TabDao extends DatabaseAccessor with _$TabDaoMixin { +class TabDao extends DatabaseAccessor with $TabDaoMixin { final _undoHistory = {}; Timer? _clearHistoryTimer; @@ -258,7 +258,7 @@ class TabDao extends DatabaseAccessor with _$TabDaoMixin { final ftsQuery = db.buildFtsQuery(searchString); if (ftsQuery.isNotEmpty) { - return db.queryTabsFullContent( + return db.definitionsDrift.queryTabsFullContent( query: ftsQuery, snippetLength: snippetLength, beforeMatch: matchPrefix, @@ -266,7 +266,9 @@ class TabDao extends DatabaseAccessor with _$TabDaoMixin { ellipsis: ellipsis, ); } else { - return db.queryTabsBasic(query: db.buildLikeQuery(searchString)); + return db.definitionsDrift.queryTabsBasic( + query: db.buildLikeQuery(searchString), + ); } } } diff --git a/app/lib/features/geckoview/features/tabs/data/database/daos/tab.drift.dart b/app/lib/features/geckoview/features/tabs/data/database/daos/tab.drift.dart new file mode 100644 index 00000000..5452d53a --- /dev/null +++ b/app/lib/features/geckoview/features/tabs/data/database/daos/tab.drift.dart @@ -0,0 +1,7 @@ +// dart format width=80 +// ignore_for_file: type=lint +import 'package:drift/drift.dart' as i0; +import 'package:weblibre/features/geckoview/features/tabs/data/database/database.dart' + as i1; + +mixin $TabDaoMixin on i0.DatabaseAccessor {} diff --git a/app/lib/features/geckoview/features/tabs/data/database/daos/tab.g.dart b/app/lib/features/geckoview/features/tabs/data/database/daos/tab.g.dart deleted file mode 100644 index 3da23453..00000000 --- a/app/lib/features/geckoview/features/tabs/data/database/daos/tab.g.dart +++ /dev/null @@ -1,6 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'tab.dart'; - -// ignore_for_file: type=lint -mixin _$TabDaoMixin on DatabaseAccessor {} diff --git a/app/lib/features/geckoview/features/tabs/data/database/database.dart b/app/lib/features/geckoview/features/tabs/data/database/database.dart index 741f62c4..e43aecc5 100644 --- a/app/lib/features/geckoview/features/tabs/data/database/database.dart +++ b/app/lib/features/geckoview/features/tabs/data/database/database.dart @@ -18,20 +18,13 @@ * along with this program. If not, see . */ import 'package:drift/drift.dart'; -import 'package:flutter/widgets.dart' show Color; -import 'package:weblibre/data/database/converters/color.dart'; -import 'package:weblibre/data/database/converters/uri.dart'; -import 'package:weblibre/features/geckoview/features/tabs/data/database/converters/container_metadata_converter.dart'; import 'package:weblibre/features/geckoview/features/tabs/data/database/daos/container.dart'; import 'package:weblibre/features/geckoview/features/tabs/data/database/daos/tab.dart'; -import 'package:weblibre/features/geckoview/features/tabs/data/models/container_data.dart'; -import 'package:weblibre/features/geckoview/features/tabs/data/models/tab_query_result.dart'; +import 'package:weblibre/features/geckoview/features/tabs/data/database/database.drift.dart'; import 'package:weblibre/features/search/domain/fts_tokenizer.dart'; -part 'database.g.dart'; - -@DriftDatabase(include: {'database.drift'}, daos: [ContainerDao, TabDao]) -class TabDatabase extends _$TabDatabase with TrigramQueryBuilderMixin { +@DriftDatabase(include: {'definitions.drift'}, daos: [ContainerDao, TabDao]) +class TabDatabase extends $TabDatabase with TrigramQueryBuilderMixin { @override final int schemaVersion = 2; @@ -44,7 +37,7 @@ class TabDatabase extends _$TabDatabase with TrigramQueryBuilderMixin { MigrationStrategy get migration => MigrationStrategy( beforeOpen: (details) async { await customStatement('PRAGMA foreign_keys = ON;'); - await optimizeFtsIndex(); + await definitionsDrift.optimizeFtsIndex(); }, ); diff --git a/app/lib/features/geckoview/features/tabs/data/database/database.drift.dart b/app/lib/features/geckoview/features/tabs/data/database/database.drift.dart new file mode 100644 index 00000000..ae254ae7 --- /dev/null +++ b/app/lib/features/geckoview/features/tabs/data/database/database.drift.dart @@ -0,0 +1,135 @@ +// dart format width=80 +// ignore_for_file: type=lint +import 'package:drift/drift.dart' as i0; +import 'package:weblibre/features/geckoview/features/tabs/data/database/definitions.drift.dart' + as i1; +import 'package:weblibre/features/geckoview/features/tabs/data/database/daos/container.dart' + as i2; +import 'package:weblibre/features/geckoview/features/tabs/data/database/database.dart' + as i3; +import 'package:weblibre/features/geckoview/features/tabs/data/database/daos/tab.dart' + as i4; +import 'package:drift/internal/modular.dart' as i5; +import 'package:sqlite3/common.dart' as i6; + +abstract class $TabDatabase extends i0.GeneratedDatabase { + $TabDatabase(i0.QueryExecutor e) : super(e); + $TabDatabaseManager get managers => $TabDatabaseManager(this); + late final i1.Container container = i1.Container(this); + late final i1.Tab tab = i1.Tab(this); + late final i1.TabFts tabFts = i1.TabFts(this); + late final i2.ContainerDao containerDao = i2.ContainerDao( + this as i3.TabDatabase, + ); + late final i4.TabDao tabDao = i4.TabDao(this as i3.TabDatabase); + i1.DefinitionsDrift get definitionsDrift => i5.ReadDatabaseContainer( + this, + ).accessor(i1.DefinitionsDrift.new); + @override + Iterable> get allTables => + allSchemaEntities.whereType>(); + @override + List get allSchemaEntities => [ + container, + tab, + tabFts, + i1.tabMaintainParentChainOnDelete, + i1.tabAfterInsert, + i1.tabAfterDelete, + i1.tabAfterUpdate, + ]; + @override + i0.StreamQueryUpdateRules get streamUpdateRules => + const i0.StreamQueryUpdateRules([ + i0.WritePropagation( + on: i0.TableUpdateQuery.onTableName( + 'container', + limitUpdateKind: i0.UpdateKind.delete, + ), + result: [i0.TableUpdate('tab', kind: i0.UpdateKind.delete)], + ), + i0.WritePropagation( + on: i0.TableUpdateQuery.onTableName( + 'tab', + limitUpdateKind: i0.UpdateKind.delete, + ), + result: [i0.TableUpdate('tab', kind: i0.UpdateKind.update)], + ), + i0.WritePropagation( + on: i0.TableUpdateQuery.onTableName( + 'tab', + limitUpdateKind: i0.UpdateKind.insert, + ), + result: [i0.TableUpdate('tab_fts', kind: i0.UpdateKind.insert)], + ), + i0.WritePropagation( + on: i0.TableUpdateQuery.onTableName( + 'tab', + limitUpdateKind: i0.UpdateKind.delete, + ), + result: [i0.TableUpdate('tab_fts', kind: i0.UpdateKind.insert)], + ), + i0.WritePropagation( + on: i0.TableUpdateQuery.onTableName( + 'tab', + limitUpdateKind: i0.UpdateKind.update, + ), + result: [i0.TableUpdate('tab_fts', kind: i0.UpdateKind.insert)], + ), + ]); +} + +class $TabDatabaseManager { + final $TabDatabase _db; + $TabDatabaseManager(this._db); + i1.$ContainerTableManager get container => + i1.$ContainerTableManager(_db, _db.container); + i1.$TabTableManager get tab => i1.$TabTableManager(_db, _db.tab); + i1.$TabFtsTableManager get tabFts => i1.$TabFtsTableManager(_db, _db.tabFts); +} + +extension DefineFunctions on i6.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 i6.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 i6.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 i6.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 i6.AllowedArgumentCount(2), + function: (args) { + final arg0 = args[0] as String?; + final arg1 = args[1] as String?; + return lexoRankReorderBefore(arg0, arg1); + }, + ); + } +} diff --git a/app/lib/features/geckoview/features/tabs/data/database/database.drift b/app/lib/features/geckoview/features/tabs/data/database/definitions.drift similarity index 100% rename from app/lib/features/geckoview/features/tabs/data/database/database.drift rename to app/lib/features/geckoview/features/tabs/data/database/definitions.drift diff --git a/app/lib/features/geckoview/features/tabs/data/database/database.g.dart b/app/lib/features/geckoview/features/tabs/data/database/definitions.drift.dart similarity index 52% rename from app/lib/features/geckoview/features/tabs/data/database/database.g.dart rename to app/lib/features/geckoview/features/tabs/data/database/definitions.drift.dart index c8284aa8..a9e36e16 100644 --- a/app/lib/features/geckoview/features/tabs/data/database/database.g.dart +++ b/app/lib/features/geckoview/features/tabs/data/database/definitions.drift.dart @@ -1,77 +1,1055 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'database.dart'; - +// dart format width=80 // ignore_for_file: type=lint -class Container extends Table with TableInfo { +import 'package:drift/drift.dart' as i0; +import 'package:weblibre/features/geckoview/features/tabs/data/models/container_data.dart' + as i1; +import 'dart:ui' as i2; +import 'package:weblibre/features/geckoview/features/tabs/data/database/definitions.drift.dart' + as i3; +import 'package:weblibre/data/database/converters/color.dart' as i4; +import 'package:weblibre/features/geckoview/features/tabs/data/database/converters/container_metadata_converter.dart' + as i5; +import 'package:weblibre/data/database/converters/uri.dart' as i6; +import 'package:drift/internal/modular.dart' as i7; +import 'package:weblibre/features/geckoview/features/tabs/data/models/tab_query_result.dart' + as i8; + +typedef $ContainerCreateCompanionBuilder = + i3.ContainerCompanion Function({ + required String id, + i0.Value name, + required i2.Color color, + i0.Value metadata, + i0.Value rowid, + }); +typedef $ContainerUpdateCompanionBuilder = + i3.ContainerCompanion Function({ + i0.Value id, + i0.Value name, + i0.Value color, + i0.Value metadata, + i0.Value rowid, + }); + +final class $ContainerReferences + extends + i0.BaseReferences< + i0.GeneratedDatabase, + i3.Container, + i1.ContainerData + > { + $ContainerReferences(super.$_db, super.$_table, super.$_typedResult); + + static i0.MultiTypedResultKey> _tabRefsTable( + i0.GeneratedDatabase db, + ) => i0.MultiTypedResultKey.fromTable( + i7.ReadDatabaseContainer(db).resultSet('tab'), + aliasName: i0.$_aliasNameGenerator( + i7.ReadDatabaseContainer(db).resultSet('container').id, + i7.ReadDatabaseContainer(db).resultSet('tab').containerId, + ), + ); + + i3.$TabProcessedTableManager get tabRefs { + final manager = i3 + .$TabTableManager( + $_db, + i7.ReadDatabaseContainer($_db).resultSet('tab'), + ) + .filter((f) => f.containerId.id.sqlEquals($_itemColumn('id')!)); + + final cache = $_typedResult.readTableOrNull(_tabRefsTable($_db)); + return i0.ProcessedTableManager( + manager.$state.copyWith(prefetchedData: cache), + ); + } +} + +class $ContainerFilterComposer + extends i0.Composer { + $ContainerFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.ColumnFilters get id => $composableBuilder( + column: $table.id, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get name => $composableBuilder( + column: $table.name, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnWithTypeConverterFilters get color => + $composableBuilder( + column: $table.color, + builder: (column) => i0.ColumnWithTypeConverterFilters(column), + ); + + i0.ColumnWithTypeConverterFilters< + i1.ContainerMetadata?, + i1.ContainerMetadata, + String + > + get metadata => $composableBuilder( + column: $table.metadata, + builder: (column) => i0.ColumnWithTypeConverterFilters(column), + ); + + i0.Expression tabRefs( + i0.Expression Function(i3.$TabFilterComposer f) f, + ) { + final i3.$TabFilterComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: i7.ReadDatabaseContainer($db).resultSet('tab'), + getReferencedColumn: (t) => t.containerId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => i3.$TabFilterComposer( + $db: $db, + $table: i7.ReadDatabaseContainer($db).resultSet('tab'), + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); + return f(composer); + } +} + +class $ContainerOrderingComposer + extends i0.Composer { + $ContainerOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.ColumnOrderings get id => $composableBuilder( + column: $table.id, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get name => $composableBuilder( + column: $table.name, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get color => $composableBuilder( + column: $table.color, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get metadata => $composableBuilder( + column: $table.metadata, + builder: (column) => i0.ColumnOrderings(column), + ); +} + +class $ContainerAnnotationComposer + extends i0.Composer { + $ContainerAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.GeneratedColumn get id => + $composableBuilder(column: $table.id, builder: (column) => column); + + i0.GeneratedColumn get name => + $composableBuilder(column: $table.name, builder: (column) => column); + + i0.GeneratedColumnWithTypeConverter get color => + $composableBuilder(column: $table.color, builder: (column) => column); + + i0.GeneratedColumnWithTypeConverter + get metadata => + $composableBuilder(column: $table.metadata, builder: (column) => column); + + i0.Expression tabRefs( + i0.Expression Function(i3.$TabAnnotationComposer a) f, + ) { + final i3.$TabAnnotationComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: i7.ReadDatabaseContainer($db).resultSet('tab'), + getReferencedColumn: (t) => t.containerId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => i3.$TabAnnotationComposer( + $db: $db, + $table: i7.ReadDatabaseContainer($db).resultSet('tab'), + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); + return f(composer); + } +} + +class $ContainerTableManager + extends + i0.RootTableManager< + i0.GeneratedDatabase, + i3.Container, + i1.ContainerData, + i3.$ContainerFilterComposer, + i3.$ContainerOrderingComposer, + i3.$ContainerAnnotationComposer, + $ContainerCreateCompanionBuilder, + $ContainerUpdateCompanionBuilder, + (i1.ContainerData, i3.$ContainerReferences), + i1.ContainerData, + i0.PrefetchHooks Function({bool tabRefs}) + > { + $ContainerTableManager(i0.GeneratedDatabase db, i3.Container table) + : super( + i0.TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + i3.$ContainerFilterComposer($db: db, $table: table), + createOrderingComposer: () => + i3.$ContainerOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + i3.$ContainerAnnotationComposer($db: db, $table: table), + updateCompanionCallback: + ({ + i0.Value id = const i0.Value.absent(), + i0.Value name = const i0.Value.absent(), + i0.Value color = const i0.Value.absent(), + i0.Value metadata = + const i0.Value.absent(), + i0.Value rowid = const i0.Value.absent(), + }) => i3.ContainerCompanion( + id: id, + name: name, + color: color, + metadata: metadata, + rowid: rowid, + ), + createCompanionCallback: + ({ + required String id, + i0.Value name = const i0.Value.absent(), + required i2.Color color, + i0.Value metadata = + const i0.Value.absent(), + i0.Value rowid = const i0.Value.absent(), + }) => i3.ContainerCompanion.insert( + id: id, + name: name, + color: color, + metadata: metadata, + rowid: rowid, + ), + withReferenceMapper: (p0) => p0 + .map( + (e) => + (e.readTable(table), i3.$ContainerReferences(db, table, e)), + ) + .toList(), + prefetchHooksCallback: ({tabRefs = false}) { + return i0.PrefetchHooks( + db: db, + explicitlyWatchedTables: [ + if (tabRefs) + i7.ReadDatabaseContainer(db).resultSet('tab'), + ], + addJoins: null, + getPrefetchedDataCallback: (items) async { + return [ + if (tabRefs) + await i0.$_getPrefetchedData< + i1.ContainerData, + i3.Container, + i3.TabData + >( + currentTable: table, + referencedTable: i3.$ContainerReferences._tabRefsTable( + db, + ), + managerFromTypedResult: (p0) => + i3.$ContainerReferences(db, table, p0).tabRefs, + referencedItemsForCurrentItem: (item, referencedItems) => + referencedItems.where( + (e) => e.containerId == item.id, + ), + typedResults: items, + ), + ]; + }, + ); + }, + ), + ); +} + +typedef $ContainerProcessedTableManager = + i0.ProcessedTableManager< + i0.GeneratedDatabase, + i3.Container, + i1.ContainerData, + i3.$ContainerFilterComposer, + i3.$ContainerOrderingComposer, + i3.$ContainerAnnotationComposer, + $ContainerCreateCompanionBuilder, + $ContainerUpdateCompanionBuilder, + (i1.ContainerData, i3.$ContainerReferences), + i1.ContainerData, + i0.PrefetchHooks Function({bool tabRefs}) + >; +typedef $TabCreateCompanionBuilder = + i3.TabCompanion Function({ + required String id, + i0.Value parentId, + i0.Value containerId, + required String orderKey, + i0.Value url, + i0.Value title, + i0.Value isProbablyReaderable, + i0.Value extractedContentMarkdown, + i0.Value extractedContentPlain, + i0.Value fullContentMarkdown, + i0.Value fullContentPlain, + required DateTime timestamp, + i0.Value rowid, + }); +typedef $TabUpdateCompanionBuilder = + i3.TabCompanion Function({ + i0.Value id, + i0.Value parentId, + i0.Value containerId, + i0.Value orderKey, + i0.Value url, + i0.Value title, + i0.Value isProbablyReaderable, + i0.Value extractedContentMarkdown, + i0.Value extractedContentPlain, + i0.Value fullContentMarkdown, + i0.Value fullContentPlain, + i0.Value timestamp, + i0.Value rowid, + }); + +final class $TabReferences + extends i0.BaseReferences { + $TabReferences(super.$_db, super.$_table, super.$_typedResult); + + static i3.Container _containerIdTable(i0.GeneratedDatabase db) => + i7.ReadDatabaseContainer(db) + .resultSet('container') + .createAlias( + i0.$_aliasNameGenerator( + i7.ReadDatabaseContainer(db).resultSet('tab').containerId, + i7.ReadDatabaseContainer( + db, + ).resultSet('container').id, + ), + ); + + i3.$ContainerProcessedTableManager? get containerId { + final $_column = $_itemColumn('container_id'); + if ($_column == null) return null; + final manager = i3 + .$ContainerTableManager( + $_db, + i7.ReadDatabaseContainer($_db).resultSet('container'), + ) + .filter((f) => f.id.sqlEquals($_column)); + final item = $_typedResult.readTableOrNull(_containerIdTable($_db)); + if (item == null) return manager; + return i0.ProcessedTableManager( + manager.$state.copyWith(prefetchedData: [item]), + ); + } +} + +class $TabFilterComposer extends i0.Composer { + $TabFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.ColumnFilters get id => $composableBuilder( + column: $table.id, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get parentId => $composableBuilder( + column: $table.parentId, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get orderKey => $composableBuilder( + column: $table.orderKey, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnWithTypeConverterFilters get url => + $composableBuilder( + column: $table.url, + builder: (column) => i0.ColumnWithTypeConverterFilters(column), + ); + + i0.ColumnFilters get title => $composableBuilder( + column: $table.title, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get isProbablyReaderable => $composableBuilder( + column: $table.isProbablyReaderable, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get extractedContentMarkdown => $composableBuilder( + column: $table.extractedContentMarkdown, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get extractedContentPlain => $composableBuilder( + column: $table.extractedContentPlain, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get fullContentMarkdown => $composableBuilder( + column: $table.fullContentMarkdown, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get fullContentPlain => $composableBuilder( + column: $table.fullContentPlain, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get timestamp => $composableBuilder( + column: $table.timestamp, + builder: (column) => i0.ColumnFilters(column), + ); + + i3.$ContainerFilterComposer get containerId { + final i3.$ContainerFilterComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.containerId, + referencedTable: i7.ReadDatabaseContainer( + $db, + ).resultSet('container'), + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => i3.$ContainerFilterComposer( + $db: $db, + $table: i7.ReadDatabaseContainer( + $db, + ).resultSet('container'), + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); + return composer; + } +} + +class $TabOrderingComposer extends i0.Composer { + $TabOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.ColumnOrderings get id => $composableBuilder( + column: $table.id, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get parentId => $composableBuilder( + column: $table.parentId, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get orderKey => $composableBuilder( + column: $table.orderKey, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get url => $composableBuilder( + column: $table.url, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get title => $composableBuilder( + column: $table.title, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get isProbablyReaderable => $composableBuilder( + column: $table.isProbablyReaderable, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get extractedContentMarkdown => $composableBuilder( + column: $table.extractedContentMarkdown, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get extractedContentPlain => $composableBuilder( + column: $table.extractedContentPlain, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get fullContentMarkdown => $composableBuilder( + column: $table.fullContentMarkdown, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get fullContentPlain => $composableBuilder( + column: $table.fullContentPlain, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get timestamp => $composableBuilder( + column: $table.timestamp, + builder: (column) => i0.ColumnOrderings(column), + ); + + i3.$ContainerOrderingComposer get containerId { + final i3.$ContainerOrderingComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.containerId, + referencedTable: i7.ReadDatabaseContainer( + $db, + ).resultSet('container'), + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => i3.$ContainerOrderingComposer( + $db: $db, + $table: i7.ReadDatabaseContainer( + $db, + ).resultSet('container'), + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); + return composer; + } +} + +class $TabAnnotationComposer extends i0.Composer { + $TabAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.GeneratedColumn get id => + $composableBuilder(column: $table.id, builder: (column) => column); + + i0.GeneratedColumn get parentId => + $composableBuilder(column: $table.parentId, builder: (column) => column); + + i0.GeneratedColumn get orderKey => + $composableBuilder(column: $table.orderKey, builder: (column) => column); + + i0.GeneratedColumnWithTypeConverter get url => + $composableBuilder(column: $table.url, builder: (column) => column); + + i0.GeneratedColumn get title => + $composableBuilder(column: $table.title, builder: (column) => column); + + i0.GeneratedColumn get isProbablyReaderable => $composableBuilder( + column: $table.isProbablyReaderable, + builder: (column) => column, + ); + + i0.GeneratedColumn get extractedContentMarkdown => $composableBuilder( + column: $table.extractedContentMarkdown, + builder: (column) => column, + ); + + i0.GeneratedColumn get extractedContentPlain => $composableBuilder( + column: $table.extractedContentPlain, + builder: (column) => column, + ); + + i0.GeneratedColumn get fullContentMarkdown => $composableBuilder( + column: $table.fullContentMarkdown, + builder: (column) => column, + ); + + i0.GeneratedColumn get fullContentPlain => $composableBuilder( + column: $table.fullContentPlain, + builder: (column) => column, + ); + + i0.GeneratedColumn get timestamp => + $composableBuilder(column: $table.timestamp, builder: (column) => column); + + i3.$ContainerAnnotationComposer get containerId { + final i3.$ContainerAnnotationComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.containerId, + referencedTable: i7.ReadDatabaseContainer( + $db, + ).resultSet('container'), + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => i3.$ContainerAnnotationComposer( + $db: $db, + $table: i7.ReadDatabaseContainer( + $db, + ).resultSet('container'), + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); + return composer; + } +} + +class $TabTableManager + extends + i0.RootTableManager< + i0.GeneratedDatabase, + i3.Tab, + i3.TabData, + i3.$TabFilterComposer, + i3.$TabOrderingComposer, + i3.$TabAnnotationComposer, + $TabCreateCompanionBuilder, + $TabUpdateCompanionBuilder, + (i3.TabData, i3.$TabReferences), + i3.TabData, + i0.PrefetchHooks Function({bool containerId}) + > { + $TabTableManager(i0.GeneratedDatabase db, i3.Tab table) + : super( + i0.TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + i3.$TabFilterComposer($db: db, $table: table), + createOrderingComposer: () => + i3.$TabOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + i3.$TabAnnotationComposer($db: db, $table: table), + updateCompanionCallback: + ({ + i0.Value id = const i0.Value.absent(), + i0.Value parentId = const i0.Value.absent(), + i0.Value containerId = const i0.Value.absent(), + i0.Value orderKey = const i0.Value.absent(), + i0.Value url = const i0.Value.absent(), + i0.Value title = const i0.Value.absent(), + i0.Value isProbablyReaderable = const i0.Value.absent(), + i0.Value extractedContentMarkdown = + const i0.Value.absent(), + i0.Value extractedContentPlain = + const i0.Value.absent(), + i0.Value fullContentMarkdown = const i0.Value.absent(), + i0.Value fullContentPlain = const i0.Value.absent(), + i0.Value timestamp = const i0.Value.absent(), + i0.Value rowid = const i0.Value.absent(), + }) => i3.TabCompanion( + id: id, + parentId: parentId, + containerId: containerId, + orderKey: orderKey, + url: url, + title: title, + isProbablyReaderable: isProbablyReaderable, + extractedContentMarkdown: extractedContentMarkdown, + extractedContentPlain: extractedContentPlain, + fullContentMarkdown: fullContentMarkdown, + fullContentPlain: fullContentPlain, + timestamp: timestamp, + rowid: rowid, + ), + createCompanionCallback: + ({ + required String id, + i0.Value parentId = const i0.Value.absent(), + i0.Value containerId = const i0.Value.absent(), + required String orderKey, + i0.Value url = const i0.Value.absent(), + i0.Value title = const i0.Value.absent(), + i0.Value isProbablyReaderable = const i0.Value.absent(), + i0.Value extractedContentMarkdown = + const i0.Value.absent(), + i0.Value extractedContentPlain = + const i0.Value.absent(), + i0.Value fullContentMarkdown = const i0.Value.absent(), + i0.Value fullContentPlain = const i0.Value.absent(), + required DateTime timestamp, + i0.Value rowid = const i0.Value.absent(), + }) => i3.TabCompanion.insert( + id: id, + parentId: parentId, + containerId: containerId, + orderKey: orderKey, + url: url, + title: title, + isProbablyReaderable: isProbablyReaderable, + extractedContentMarkdown: extractedContentMarkdown, + extractedContentPlain: extractedContentPlain, + fullContentMarkdown: fullContentMarkdown, + fullContentPlain: fullContentPlain, + timestamp: timestamp, + rowid: rowid, + ), + withReferenceMapper: (p0) => p0 + .map((e) => (e.readTable(table), i3.$TabReferences(db, table, e))) + .toList(), + prefetchHooksCallback: ({containerId = false}) { + return i0.PrefetchHooks( + db: db, + explicitlyWatchedTables: [], + addJoins: + < + T extends i0.TableManagerState< + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic + > + >(state) { + if (containerId) { + state = + state.withJoin( + currentTable: table, + currentColumn: table.containerId, + referencedTable: i3.$TabReferences + ._containerIdTable(db), + referencedColumn: i3.$TabReferences + ._containerIdTable(db) + .id, + ) + as T; + } + + return state; + }, + getPrefetchedDataCallback: (items) async { + return []; + }, + ); + }, + ), + ); +} + +typedef $TabProcessedTableManager = + i0.ProcessedTableManager< + i0.GeneratedDatabase, + i3.Tab, + i3.TabData, + i3.$TabFilterComposer, + i3.$TabOrderingComposer, + i3.$TabAnnotationComposer, + $TabCreateCompanionBuilder, + $TabUpdateCompanionBuilder, + (i3.TabData, i3.$TabReferences), + i3.TabData, + i0.PrefetchHooks Function({bool containerId}) + >; +typedef $TabFtsCreateCompanionBuilder = + i3.TabFtsCompanion Function({ + required String title, + required String url, + required String extractedContentPlain, + required String fullContentPlain, + i0.Value rowid, + }); +typedef $TabFtsUpdateCompanionBuilder = + i3.TabFtsCompanion Function({ + i0.Value title, + i0.Value url, + i0.Value extractedContentPlain, + i0.Value fullContentPlain, + i0.Value rowid, + }); + +class $TabFtsFilterComposer + extends i0.Composer { + $TabFtsFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.ColumnFilters get title => $composableBuilder( + column: $table.title, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get url => $composableBuilder( + column: $table.url, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get extractedContentPlain => $composableBuilder( + column: $table.extractedContentPlain, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get fullContentPlain => $composableBuilder( + column: $table.fullContentPlain, + builder: (column) => i0.ColumnFilters(column), + ); +} + +class $TabFtsOrderingComposer + extends i0.Composer { + $TabFtsOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.ColumnOrderings get title => $composableBuilder( + column: $table.title, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get url => $composableBuilder( + column: $table.url, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get extractedContentPlain => $composableBuilder( + column: $table.extractedContentPlain, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get fullContentPlain => $composableBuilder( + column: $table.fullContentPlain, + builder: (column) => i0.ColumnOrderings(column), + ); +} + +class $TabFtsAnnotationComposer + extends i0.Composer { + $TabFtsAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.GeneratedColumn get title => + $composableBuilder(column: $table.title, builder: (column) => column); + + i0.GeneratedColumn get url => + $composableBuilder(column: $table.url, builder: (column) => column); + + i0.GeneratedColumn get extractedContentPlain => $composableBuilder( + column: $table.extractedContentPlain, + builder: (column) => column, + ); + + i0.GeneratedColumn get fullContentPlain => $composableBuilder( + column: $table.fullContentPlain, + builder: (column) => column, + ); +} + +class $TabFtsTableManager + extends + i0.RootTableManager< + i0.GeneratedDatabase, + i3.TabFts, + i3.TabFt, + i3.$TabFtsFilterComposer, + i3.$TabFtsOrderingComposer, + i3.$TabFtsAnnotationComposer, + $TabFtsCreateCompanionBuilder, + $TabFtsUpdateCompanionBuilder, + ( + i3.TabFt, + i0.BaseReferences, + ), + i3.TabFt, + i0.PrefetchHooks Function() + > { + $TabFtsTableManager(i0.GeneratedDatabase db, i3.TabFts table) + : super( + i0.TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + i3.$TabFtsFilterComposer($db: db, $table: table), + createOrderingComposer: () => + i3.$TabFtsOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + i3.$TabFtsAnnotationComposer($db: db, $table: table), + updateCompanionCallback: + ({ + i0.Value title = const i0.Value.absent(), + i0.Value url = const i0.Value.absent(), + i0.Value extractedContentPlain = + const i0.Value.absent(), + i0.Value fullContentPlain = const i0.Value.absent(), + i0.Value rowid = const i0.Value.absent(), + }) => i3.TabFtsCompanion( + title: title, + url: url, + extractedContentPlain: extractedContentPlain, + fullContentPlain: fullContentPlain, + rowid: rowid, + ), + createCompanionCallback: + ({ + required String title, + required String url, + required String extractedContentPlain, + required String fullContentPlain, + i0.Value rowid = const i0.Value.absent(), + }) => i3.TabFtsCompanion.insert( + title: title, + url: url, + extractedContentPlain: extractedContentPlain, + fullContentPlain: fullContentPlain, + rowid: rowid, + ), + withReferenceMapper: (p0) => p0 + .map((e) => (e.readTable(table), i0.BaseReferences(db, table, e))) + .toList(), + prefetchHooksCallback: null, + ), + ); +} + +typedef $TabFtsProcessedTableManager = + i0.ProcessedTableManager< + i0.GeneratedDatabase, + i3.TabFts, + i3.TabFt, + i3.$TabFtsFilterComposer, + i3.$TabFtsOrderingComposer, + i3.$TabFtsAnnotationComposer, + $TabFtsCreateCompanionBuilder, + $TabFtsUpdateCompanionBuilder, + (i3.TabFt, i0.BaseReferences), + i3.TabFt, + i0.PrefetchHooks Function() + >; + +class Container extends i0.Table + with i0.TableInfo { @override - final GeneratedDatabase attachedDatabase; + final i0.GeneratedDatabase attachedDatabase; final String? _alias; Container(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( + late final i0.GeneratedColumn id = i0.GeneratedColumn( 'id', aliasedName, false, - type: DriftSqlType.string, + type: i0.DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'PRIMARY KEY NOT NULL', ); - late final GeneratedColumn name = GeneratedColumn( + late final i0.GeneratedColumn name = i0.GeneratedColumn( 'name', aliasedName, true, - type: DriftSqlType.string, + type: i0.DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); - late final GeneratedColumnWithTypeConverter color = - GeneratedColumn( + late final i0.GeneratedColumnWithTypeConverter color = + i0.GeneratedColumn( 'color', aliasedName, false, - type: DriftSqlType.int, + type: i0.DriftSqlType.int, requiredDuringInsert: true, $customConstraints: 'NOT NULL', - ).withConverter(Container.$convertercolor); - late final GeneratedColumnWithTypeConverter - metadata = GeneratedColumn( + ).withConverter(i3.Container.$convertercolor); + late final i0.GeneratedColumnWithTypeConverter + metadata = i0.GeneratedColumn( 'metadata', aliasedName, true, - type: DriftSqlType.string, + type: i0.DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', - ).withConverter(Container.$convertermetadatan); + ).withConverter(i3.Container.$convertermetadatan); @override - List get $columns => [id, name, color, metadata]; + List get $columns => [id, name, color, metadata]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'container'; @override - Set get $primaryKey => {id}; + Set get $primaryKey => {id}; @override - ContainerData map(Map data, {String? tablePrefix}) { + i1.ContainerData map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return ContainerData( + return i1.ContainerData( id: attachedDatabase.typeMapping.read( - DriftSqlType.string, + i0.DriftSqlType.string, data['${effectivePrefix}id'], )!, name: attachedDatabase.typeMapping.read( - DriftSqlType.string, + i0.DriftSqlType.string, data['${effectivePrefix}name'], ), - color: Container.$convertercolor.fromSql( + color: i3.Container.$convertercolor.fromSql( attachedDatabase.typeMapping.read( - DriftSqlType.int, + i0.DriftSqlType.int, data['${effectivePrefix}color'], )!, ), - metadata: Container.$convertermetadatan.fromSql( + metadata: i3.Container.$convertermetadatan.fromSql( attachedDatabase.typeMapping.read( - DriftSqlType.string, + i0.DriftSqlType.string, data['${effectivePrefix}metadata'], ), ), @@ -83,44 +1061,45 @@ class Container extends Table with TableInfo { return Container(attachedDatabase, alias); } - static TypeConverter $convertercolor = const ColorConverter(); - static TypeConverter $convertermetadata = - const ContainerMetadataConverter(); - static TypeConverter $convertermetadatan = - NullAwareTypeConverter.wrap($convertermetadata); + static i0.TypeConverter $convertercolor = + const i4.ColorConverter(); + static i0.TypeConverter $convertermetadata = + const i5.ContainerMetadataConverter(); + static i0.TypeConverter $convertermetadatan = + i0.NullAwareTypeConverter.wrap($convertermetadata); @override bool get dontWriteConstraints => true; } -class ContainerCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value color; - final Value metadata; - final Value rowid; +class ContainerCompanion extends i0.UpdateCompanion { + final i0.Value id; + final i0.Value name; + final i0.Value color; + final i0.Value metadata; + final i0.Value rowid; const ContainerCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.color = const Value.absent(), - this.metadata = const Value.absent(), - this.rowid = const Value.absent(), + this.id = const i0.Value.absent(), + this.name = const i0.Value.absent(), + this.color = const i0.Value.absent(), + this.metadata = const i0.Value.absent(), + this.rowid = const i0.Value.absent(), }); ContainerCompanion.insert({ required String id, - this.name = const Value.absent(), - required Color color, - this.metadata = const Value.absent(), - this.rowid = const Value.absent(), - }) : id = Value(id), - color = Value(color); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? color, - Expression? metadata, - Expression? rowid, + this.name = const i0.Value.absent(), + required i2.Color color, + this.metadata = const i0.Value.absent(), + this.rowid = const i0.Value.absent(), + }) : id = i0.Value(id), + color = i0.Value(color); + static i0.Insertable custom({ + i0.Expression? id, + i0.Expression? name, + i0.Expression? color, + i0.Expression? metadata, + i0.Expression? rowid, }) { - return RawValuesInsertable({ + return i0.RawValuesInsertable({ if (id != null) 'id': id, if (name != null) 'name': name, if (color != null) 'color': color, @@ -129,14 +1108,14 @@ class ContainerCompanion extends UpdateCompanion { }); } - ContainerCompanion copyWith({ - Value? id, - Value? name, - Value? color, - Value? metadata, - Value? rowid, + i3.ContainerCompanion copyWith({ + i0.Value? id, + i0.Value? name, + i0.Value? color, + i0.Value? metadata, + i0.Value? rowid, }) { - return ContainerCompanion( + return i3.ContainerCompanion( id: id ?? this.id, name: name ?? this.name, color: color ?? this.color, @@ -146,26 +1125,26 @@ class ContainerCompanion extends UpdateCompanion { } @override - Map toColumns(bool nullToAbsent) { - final map = {}; + Map toColumns(bool nullToAbsent) { + final map = {}; if (id.present) { - map['id'] = Variable(id.value); + map['id'] = i0.Variable(id.value); } if (name.present) { - map['name'] = Variable(name.value); + map['name'] = i0.Variable(name.value); } if (color.present) { - map['color'] = Variable( - Container.$convertercolor.toSql(color.value), + map['color'] = i0.Variable( + i3.Container.$convertercolor.toSql(color.value), ); } if (metadata.present) { - map['metadata'] = Variable( - Container.$convertermetadatan.toSql(metadata.value), + map['metadata'] = i0.Variable( + i3.Container.$convertermetadatan.toSql(metadata.value), ); } if (rowid.present) { - map['rowid'] = Variable(rowid.value); + map['rowid'] = i0.Variable(rowid.value); } return map; } @@ -183,113 +1162,117 @@ class ContainerCompanion extends UpdateCompanion { } } -class Tab extends Table with TableInfo { +class Tab extends i0.Table with i0.TableInfo { @override - final GeneratedDatabase attachedDatabase; + final i0.GeneratedDatabase attachedDatabase; final String? _alias; Tab(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( + late final i0.GeneratedColumn id = i0.GeneratedColumn( 'id', aliasedName, false, - type: DriftSqlType.string, + type: i0.DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'PRIMARY KEY NOT NULL', ); - late final GeneratedColumn parentId = GeneratedColumn( + late final i0.GeneratedColumn parentId = i0.GeneratedColumn( 'parent_id', aliasedName, true, - type: DriftSqlType.string, + type: i0.DriftSqlType.string, requiredDuringInsert: false, $customConstraints: 'REFERENCES tab(id)ON DELETE SET NULL', ); - late final GeneratedColumn containerId = GeneratedColumn( - 'container_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: 'REFERENCES container(id)ON DELETE CASCADE', - ); - late final GeneratedColumn orderKey = GeneratedColumn( + late final i0.GeneratedColumn containerId = + i0.GeneratedColumn( + 'container_id', + aliasedName, + true, + type: i0.DriftSqlType.string, + requiredDuringInsert: false, + $customConstraints: 'REFERENCES container(id)ON DELETE CASCADE', + ); + late final i0.GeneratedColumn orderKey = i0.GeneratedColumn( 'order_key', aliasedName, false, - type: DriftSqlType.string, + type: i0.DriftSqlType.string, requiredDuringInsert: true, $customConstraints: 'NOT NULL', ); - late final GeneratedColumnWithTypeConverter url = - GeneratedColumn( + late final i0.GeneratedColumnWithTypeConverter url = + i0.GeneratedColumn( 'url', aliasedName, true, - type: DriftSqlType.string, + type: i0.DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', - ).withConverter(Tab.$converterurl); - late final GeneratedColumn title = GeneratedColumn( + ).withConverter(i3.Tab.$converterurl); + late final i0.GeneratedColumn title = i0.GeneratedColumn( 'title', aliasedName, true, - type: DriftSqlType.string, + type: i0.DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); - late final GeneratedColumn isProbablyReaderable = GeneratedColumn( - 'is_probably_readerable', - aliasedName, - true, - type: DriftSqlType.bool, - requiredDuringInsert: false, - $customConstraints: '', - ); - late final GeneratedColumn extractedContentMarkdown = - GeneratedColumn( + late final i0.GeneratedColumn isProbablyReaderable = + i0.GeneratedColumn( + 'is_probably_readerable', + aliasedName, + true, + type: i0.DriftSqlType.bool, + requiredDuringInsert: false, + $customConstraints: '', + ); + late final i0.GeneratedColumn extractedContentMarkdown = + i0.GeneratedColumn( 'extracted_content_markdown', aliasedName, true, - type: DriftSqlType.string, + type: i0.DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); - late final GeneratedColumn extractedContentPlain = - GeneratedColumn( + late final i0.GeneratedColumn extractedContentPlain = + i0.GeneratedColumn( 'extracted_content_plain', aliasedName, true, - type: DriftSqlType.string, + type: i0.DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); - late final GeneratedColumn fullContentMarkdown = - GeneratedColumn( + late final i0.GeneratedColumn fullContentMarkdown = + i0.GeneratedColumn( 'full_content_markdown', aliasedName, true, - type: DriftSqlType.string, + type: i0.DriftSqlType.string, requiredDuringInsert: false, $customConstraints: '', ); - late final GeneratedColumn fullContentPlain = GeneratedColumn( - 'full_content_plain', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: '', - ); - late final GeneratedColumn timestamp = GeneratedColumn( - 'timestamp', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); + late final i0.GeneratedColumn fullContentPlain = + i0.GeneratedColumn( + 'full_content_plain', + aliasedName, + true, + type: i0.DriftSqlType.string, + requiredDuringInsert: false, + $customConstraints: '', + ); + late final i0.GeneratedColumn timestamp = + i0.GeneratedColumn( + 'timestamp', + aliasedName, + false, + type: i0.DriftSqlType.dateTime, + requiredDuringInsert: true, + $customConstraints: 'NOT NULL', + ); @override - List get $columns => [ + List get $columns => [ id, parentId, containerId, @@ -309,59 +1292,59 @@ class Tab extends Table with TableInfo { String get actualTableName => $name; static const String $name = 'tab'; @override - Set get $primaryKey => {id}; + Set get $primaryKey => {id}; @override - TabData map(Map data, {String? tablePrefix}) { + i3.TabData map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return TabData( + return i3.TabData( id: attachedDatabase.typeMapping.read( - DriftSqlType.string, + i0.DriftSqlType.string, data['${effectivePrefix}id'], )!, parentId: attachedDatabase.typeMapping.read( - DriftSqlType.string, + i0.DriftSqlType.string, data['${effectivePrefix}parent_id'], ), containerId: attachedDatabase.typeMapping.read( - DriftSqlType.string, + i0.DriftSqlType.string, data['${effectivePrefix}container_id'], ), orderKey: attachedDatabase.typeMapping.read( - DriftSqlType.string, + i0.DriftSqlType.string, data['${effectivePrefix}order_key'], )!, - url: Tab.$converterurl.fromSql( + url: i3.Tab.$converterurl.fromSql( attachedDatabase.typeMapping.read( - DriftSqlType.string, + i0.DriftSqlType.string, data['${effectivePrefix}url'], ), ), title: attachedDatabase.typeMapping.read( - DriftSqlType.string, + i0.DriftSqlType.string, data['${effectivePrefix}title'], ), isProbablyReaderable: attachedDatabase.typeMapping.read( - DriftSqlType.bool, + i0.DriftSqlType.bool, data['${effectivePrefix}is_probably_readerable'], ), extractedContentMarkdown: attachedDatabase.typeMapping.read( - DriftSqlType.string, + i0.DriftSqlType.string, data['${effectivePrefix}extracted_content_markdown'], ), extractedContentPlain: attachedDatabase.typeMapping.read( - DriftSqlType.string, + i0.DriftSqlType.string, data['${effectivePrefix}extracted_content_plain'], ), fullContentMarkdown: attachedDatabase.typeMapping.read( - DriftSqlType.string, + i0.DriftSqlType.string, data['${effectivePrefix}full_content_markdown'], ), fullContentPlain: attachedDatabase.typeMapping.read( - DriftSqlType.string, + i0.DriftSqlType.string, data['${effectivePrefix}full_content_plain'], ), timestamp: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, + i0.DriftSqlType.dateTime, data['${effectivePrefix}timestamp'], )!, ); @@ -372,13 +1355,13 @@ class Tab extends Table with TableInfo { return Tab(attachedDatabase, alias); } - static TypeConverter $converterurl = - const UriConverterNullable(); + static i0.TypeConverter $converterurl = + const i6.UriConverterNullable(); @override bool get dontWriteConstraints => true; } -class TabData extends DataClass implements Insertable { +class TabData extends i0.DataClass implements i0.Insertable { final String id; final String? parentId; final String? containerId; @@ -406,48 +1389,50 @@ class TabData extends DataClass implements Insertable { required this.timestamp, }); @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); + Map toColumns(bool nullToAbsent) { + final map = {}; + map['id'] = i0.Variable(id); if (!nullToAbsent || parentId != null) { - map['parent_id'] = Variable(parentId); + map['parent_id'] = i0.Variable(parentId); } if (!nullToAbsent || containerId != null) { - map['container_id'] = Variable(containerId); + map['container_id'] = i0.Variable(containerId); } - map['order_key'] = Variable(orderKey); + map['order_key'] = i0.Variable(orderKey); if (!nullToAbsent || url != null) { - map['url'] = Variable(Tab.$converterurl.toSql(url)); + map['url'] = i0.Variable(i3.Tab.$converterurl.toSql(url)); } if (!nullToAbsent || title != null) { - map['title'] = Variable(title); + map['title'] = i0.Variable(title); } if (!nullToAbsent || isProbablyReaderable != null) { - map['is_probably_readerable'] = Variable(isProbablyReaderable); + map['is_probably_readerable'] = i0.Variable(isProbablyReaderable); } if (!nullToAbsent || extractedContentMarkdown != null) { - map['extracted_content_markdown'] = Variable( + map['extracted_content_markdown'] = i0.Variable( extractedContentMarkdown, ); } if (!nullToAbsent || extractedContentPlain != null) { - map['extracted_content_plain'] = Variable(extractedContentPlain); + map['extracted_content_plain'] = i0.Variable( + extractedContentPlain, + ); } if (!nullToAbsent || fullContentMarkdown != null) { - map['full_content_markdown'] = Variable(fullContentMarkdown); + map['full_content_markdown'] = i0.Variable(fullContentMarkdown); } if (!nullToAbsent || fullContentPlain != null) { - map['full_content_plain'] = Variable(fullContentPlain); + map['full_content_plain'] = i0.Variable(fullContentPlain); } - map['timestamp'] = Variable(timestamp); + map['timestamp'] = i0.Variable(timestamp); return map; } factory TabData.fromJson( Map json, { - ValueSerializer? serializer, + i0.ValueSerializer? serializer, }) { - serializer ??= driftRuntimeOptions.defaultSerializer; + serializer ??= i0.driftRuntimeOptions.defaultSerializer; return TabData( id: serializer.fromJson(json['id']), parentId: serializer.fromJson(json['parent_id']), @@ -474,8 +1459,8 @@ class TabData extends DataClass implements Insertable { ); } @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; + Map toJson({i0.ValueSerializer? serializer}) { + serializer ??= i0.driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'parent_id': serializer.toJson(parentId), @@ -496,20 +1481,20 @@ class TabData extends DataClass implements Insertable { }; } - TabData copyWith({ + i3.TabData copyWith({ String? id, - Value parentId = const Value.absent(), - Value containerId = const Value.absent(), + i0.Value parentId = const i0.Value.absent(), + i0.Value containerId = const i0.Value.absent(), String? orderKey, - Value url = const Value.absent(), - Value title = const Value.absent(), - Value isProbablyReaderable = const Value.absent(), - Value extractedContentMarkdown = const Value.absent(), - Value extractedContentPlain = const Value.absent(), - Value fullContentMarkdown = const Value.absent(), - Value fullContentPlain = const Value.absent(), + i0.Value url = const i0.Value.absent(), + i0.Value title = const i0.Value.absent(), + i0.Value isProbablyReaderable = const i0.Value.absent(), + i0.Value extractedContentMarkdown = const i0.Value.absent(), + i0.Value extractedContentPlain = const i0.Value.absent(), + i0.Value fullContentMarkdown = const i0.Value.absent(), + i0.Value fullContentPlain = const i0.Value.absent(), DateTime? timestamp, - }) => TabData( + }) => i3.TabData( id: id ?? this.id, parentId: parentId.present ? parentId.value : this.parentId, containerId: containerId.present ? containerId.value : this.containerId, @@ -533,7 +1518,7 @@ class TabData extends DataClass implements Insertable { : this.fullContentPlain, timestamp: timestamp ?? this.timestamp, ); - TabData copyWithCompanion(TabCompanion data) { + TabData copyWithCompanion(i3.TabCompanion data) { return TabData( id: data.id.present ? data.id.value : this.id, parentId: data.parentId.present ? data.parentId.value : this.parentId, @@ -599,7 +1584,7 @@ class TabData extends DataClass implements Insertable { @override bool operator ==(Object other) => identical(this, other) || - (other is TabData && + (other is i3.TabData && other.id == this.id && other.parentId == this.parentId && other.containerId == this.containerId && @@ -614,68 +1599,68 @@ class TabData extends DataClass implements Insertable { other.timestamp == this.timestamp); } -class TabCompanion extends UpdateCompanion { - final Value id; - final Value parentId; - final Value containerId; - final Value orderKey; - final Value url; - final Value title; - final Value isProbablyReaderable; - final Value extractedContentMarkdown; - final Value extractedContentPlain; - final Value fullContentMarkdown; - final Value fullContentPlain; - final Value timestamp; - final Value rowid; +class TabCompanion extends i0.UpdateCompanion { + final i0.Value id; + final i0.Value parentId; + final i0.Value containerId; + final i0.Value orderKey; + final i0.Value url; + final i0.Value title; + final i0.Value isProbablyReaderable; + final i0.Value extractedContentMarkdown; + final i0.Value extractedContentPlain; + final i0.Value fullContentMarkdown; + final i0.Value fullContentPlain; + final i0.Value timestamp; + final i0.Value rowid; const TabCompanion({ - this.id = const Value.absent(), - this.parentId = const Value.absent(), - this.containerId = const Value.absent(), - this.orderKey = const Value.absent(), - this.url = const Value.absent(), - this.title = const Value.absent(), - this.isProbablyReaderable = const Value.absent(), - this.extractedContentMarkdown = const Value.absent(), - this.extractedContentPlain = const Value.absent(), - this.fullContentMarkdown = const Value.absent(), - this.fullContentPlain = const Value.absent(), - this.timestamp = const Value.absent(), - this.rowid = const Value.absent(), + this.id = const i0.Value.absent(), + this.parentId = const i0.Value.absent(), + this.containerId = const i0.Value.absent(), + this.orderKey = const i0.Value.absent(), + this.url = const i0.Value.absent(), + this.title = const i0.Value.absent(), + this.isProbablyReaderable = const i0.Value.absent(), + this.extractedContentMarkdown = const i0.Value.absent(), + this.extractedContentPlain = const i0.Value.absent(), + this.fullContentMarkdown = const i0.Value.absent(), + this.fullContentPlain = const i0.Value.absent(), + this.timestamp = const i0.Value.absent(), + this.rowid = const i0.Value.absent(), }); TabCompanion.insert({ required String id, - this.parentId = const Value.absent(), - this.containerId = const Value.absent(), + this.parentId = const i0.Value.absent(), + this.containerId = const i0.Value.absent(), required String orderKey, - this.url = const Value.absent(), - this.title = const Value.absent(), - this.isProbablyReaderable = const Value.absent(), - this.extractedContentMarkdown = const Value.absent(), - this.extractedContentPlain = const Value.absent(), - this.fullContentMarkdown = const Value.absent(), - this.fullContentPlain = const Value.absent(), + this.url = const i0.Value.absent(), + this.title = const i0.Value.absent(), + this.isProbablyReaderable = const i0.Value.absent(), + this.extractedContentMarkdown = const i0.Value.absent(), + this.extractedContentPlain = const i0.Value.absent(), + this.fullContentMarkdown = const i0.Value.absent(), + this.fullContentPlain = const i0.Value.absent(), required DateTime timestamp, - this.rowid = const Value.absent(), - }) : id = Value(id), - orderKey = Value(orderKey), - timestamp = Value(timestamp); - static Insertable custom({ - Expression? id, - Expression? parentId, - Expression? containerId, - Expression? orderKey, - Expression? url, - Expression? title, - Expression? isProbablyReaderable, - Expression? extractedContentMarkdown, - Expression? extractedContentPlain, - Expression? fullContentMarkdown, - Expression? fullContentPlain, - Expression? timestamp, - Expression? rowid, + this.rowid = const i0.Value.absent(), + }) : id = i0.Value(id), + orderKey = i0.Value(orderKey), + timestamp = i0.Value(timestamp); + static i0.Insertable custom({ + i0.Expression? id, + i0.Expression? parentId, + i0.Expression? containerId, + i0.Expression? orderKey, + i0.Expression? url, + i0.Expression? title, + i0.Expression? isProbablyReaderable, + i0.Expression? extractedContentMarkdown, + i0.Expression? extractedContentPlain, + i0.Expression? fullContentMarkdown, + i0.Expression? fullContentPlain, + i0.Expression? timestamp, + i0.Expression? rowid, }) { - return RawValuesInsertable({ + return i0.RawValuesInsertable({ if (id != null) 'id': id, if (parentId != null) 'parent_id': parentId, if (containerId != null) 'container_id': containerId, @@ -696,22 +1681,22 @@ class TabCompanion extends UpdateCompanion { }); } - TabCompanion copyWith({ - Value? id, - Value? parentId, - Value? containerId, - Value? orderKey, - Value? url, - Value? title, - Value? isProbablyReaderable, - Value? extractedContentMarkdown, - Value? extractedContentPlain, - Value? fullContentMarkdown, - Value? fullContentPlain, - Value? timestamp, - Value? rowid, + i3.TabCompanion copyWith({ + i0.Value? id, + i0.Value? parentId, + i0.Value? containerId, + i0.Value? orderKey, + i0.Value? url, + i0.Value? title, + i0.Value? isProbablyReaderable, + i0.Value? extractedContentMarkdown, + i0.Value? extractedContentPlain, + i0.Value? fullContentMarkdown, + i0.Value? fullContentPlain, + i0.Value? timestamp, + i0.Value? rowid, }) { - return TabCompanion( + return i3.TabCompanion( id: id ?? this.id, parentId: parentId ?? this.parentId, containerId: containerId ?? this.containerId, @@ -731,54 +1716,54 @@ class TabCompanion extends UpdateCompanion { } @override - Map toColumns(bool nullToAbsent) { - final map = {}; + Map toColumns(bool nullToAbsent) { + final map = {}; if (id.present) { - map['id'] = Variable(id.value); + map['id'] = i0.Variable(id.value); } if (parentId.present) { - map['parent_id'] = Variable(parentId.value); + map['parent_id'] = i0.Variable(parentId.value); } if (containerId.present) { - map['container_id'] = Variable(containerId.value); + map['container_id'] = i0.Variable(containerId.value); } if (orderKey.present) { - map['order_key'] = Variable(orderKey.value); + map['order_key'] = i0.Variable(orderKey.value); } if (url.present) { - map['url'] = Variable(Tab.$converterurl.toSql(url.value)); + map['url'] = i0.Variable(i3.Tab.$converterurl.toSql(url.value)); } if (title.present) { - map['title'] = Variable(title.value); + map['title'] = i0.Variable(title.value); } if (isProbablyReaderable.present) { - map['is_probably_readerable'] = Variable( + map['is_probably_readerable'] = i0.Variable( isProbablyReaderable.value, ); } if (extractedContentMarkdown.present) { - map['extracted_content_markdown'] = Variable( + map['extracted_content_markdown'] = i0.Variable( extractedContentMarkdown.value, ); } if (extractedContentPlain.present) { - map['extracted_content_plain'] = Variable( + map['extracted_content_plain'] = i0.Variable( extractedContentPlain.value, ); } if (fullContentMarkdown.present) { - map['full_content_markdown'] = Variable( + map['full_content_markdown'] = i0.Variable( fullContentMarkdown.value, ); } if (fullContentPlain.present) { - map['full_content_plain'] = Variable(fullContentPlain.value); + map['full_content_plain'] = i0.Variable(fullContentPlain.value); } if (timestamp.present) { - map['timestamp'] = Variable(timestamp.value); + map['timestamp'] = i0.Variable(timestamp.value); } if (rowid.present) { - map['rowid'] = Variable(rowid.value); + map['rowid'] = i0.Variable(rowid.value); } return map; } @@ -804,47 +1789,48 @@ class TabCompanion extends UpdateCompanion { } } -class TabFts extends Table - with TableInfo, VirtualTableInfo { +class TabFts extends i0.Table + with i0.TableInfo, i0.VirtualTableInfo { @override - final GeneratedDatabase attachedDatabase; + final i0.GeneratedDatabase attachedDatabase; final String? _alias; TabFts(this.attachedDatabase, [this._alias]); - late final GeneratedColumn title = GeneratedColumn( + late final i0.GeneratedColumn title = i0.GeneratedColumn( 'title', aliasedName, false, - type: DriftSqlType.string, + type: i0.DriftSqlType.string, requiredDuringInsert: true, $customConstraints: '', ); - late final GeneratedColumn url = GeneratedColumn( + late final i0.GeneratedColumn url = i0.GeneratedColumn( 'url', aliasedName, false, - type: DriftSqlType.string, + type: i0.DriftSqlType.string, requiredDuringInsert: true, $customConstraints: '', ); - late final GeneratedColumn extractedContentPlain = - GeneratedColumn( + late final i0.GeneratedColumn extractedContentPlain = + i0.GeneratedColumn( 'extracted_content_plain', aliasedName, false, - type: DriftSqlType.string, + type: i0.DriftSqlType.string, + requiredDuringInsert: true, + $customConstraints: '', + ); + late final i0.GeneratedColumn fullContentPlain = + i0.GeneratedColumn( + 'full_content_plain', + aliasedName, + false, + type: i0.DriftSqlType.string, requiredDuringInsert: true, $customConstraints: '', ); - late final GeneratedColumn fullContentPlain = GeneratedColumn( - 'full_content_plain', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: '', - ); @override - List get $columns => [ + List get $columns => [ title, url, extractedContentPlain, @@ -856,25 +1842,25 @@ class TabFts extends Table String get actualTableName => $name; static const String $name = 'tab_fts'; @override - Set get $primaryKey => const {}; + Set get $primaryKey => const {}; @override - TabFt map(Map data, {String? tablePrefix}) { + i3.TabFt map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return TabFt( + return i3.TabFt( title: attachedDatabase.typeMapping.read( - DriftSqlType.string, + i0.DriftSqlType.string, data['${effectivePrefix}title'], )!, url: attachedDatabase.typeMapping.read( - DriftSqlType.string, + i0.DriftSqlType.string, data['${effectivePrefix}url'], )!, extractedContentPlain: attachedDatabase.typeMapping.read( - DriftSqlType.string, + i0.DriftSqlType.string, data['${effectivePrefix}extracted_content_plain'], )!, fullContentPlain: attachedDatabase.typeMapping.read( - DriftSqlType.string, + i0.DriftSqlType.string, data['${effectivePrefix}full_content_plain'], )!, ); @@ -892,7 +1878,7 @@ class TabFts extends Table 'fts5(title, url, extracted_content_plain, full_content_plain, content=tab, tokenize="trigram")'; } -class TabFt extends DataClass implements Insertable { +class TabFt extends i0.DataClass implements i0.Insertable { final String title; final String url; final String extractedContentPlain; @@ -904,20 +1890,20 @@ class TabFt extends DataClass implements Insertable { required this.fullContentPlain, }); @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['title'] = Variable(title); - map['url'] = Variable(url); - map['extracted_content_plain'] = Variable(extractedContentPlain); - map['full_content_plain'] = Variable(fullContentPlain); + Map toColumns(bool nullToAbsent) { + final map = {}; + map['title'] = i0.Variable(title); + map['url'] = i0.Variable(url); + map['extracted_content_plain'] = i0.Variable(extractedContentPlain); + map['full_content_plain'] = i0.Variable(fullContentPlain); return map; } factory TabFt.fromJson( Map json, { - ValueSerializer? serializer, + i0.ValueSerializer? serializer, }) { - serializer ??= driftRuntimeOptions.defaultSerializer; + serializer ??= i0.driftRuntimeOptions.defaultSerializer; return TabFt( title: serializer.fromJson(json['title']), url: serializer.fromJson(json['url']), @@ -928,8 +1914,8 @@ class TabFt extends DataClass implements Insertable { ); } @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; + Map toJson({i0.ValueSerializer? serializer}) { + serializer ??= i0.driftRuntimeOptions.defaultSerializer; return { 'title': serializer.toJson(title), 'url': serializer.toJson(url), @@ -940,18 +1926,18 @@ class TabFt extends DataClass implements Insertable { }; } - TabFt copyWith({ + i3.TabFt copyWith({ String? title, String? url, String? extractedContentPlain, String? fullContentPlain, - }) => TabFt( + }) => i3.TabFt( title: title ?? this.title, url: url ?? this.url, extractedContentPlain: extractedContentPlain ?? this.extractedContentPlain, fullContentPlain: fullContentPlain ?? this.fullContentPlain, ); - TabFt copyWithCompanion(TabFtsCompanion data) { + TabFt copyWithCompanion(i3.TabFtsCompanion data) { return TabFt( title: data.title.present ? data.title.value : this.title, url: data.url.present ? data.url.value : this.url, @@ -981,44 +1967,44 @@ class TabFt extends DataClass implements Insertable { @override bool operator ==(Object other) => identical(this, other) || - (other is TabFt && + (other is i3.TabFt && other.title == this.title && other.url == this.url && other.extractedContentPlain == this.extractedContentPlain && other.fullContentPlain == this.fullContentPlain); } -class TabFtsCompanion extends UpdateCompanion { - final Value title; - final Value url; - final Value extractedContentPlain; - final Value fullContentPlain; - final Value rowid; +class TabFtsCompanion extends i0.UpdateCompanion { + final i0.Value title; + final i0.Value url; + final i0.Value extractedContentPlain; + final i0.Value fullContentPlain; + final i0.Value rowid; const TabFtsCompanion({ - this.title = const Value.absent(), - this.url = const Value.absent(), - this.extractedContentPlain = const Value.absent(), - this.fullContentPlain = const Value.absent(), - this.rowid = const Value.absent(), + this.title = const i0.Value.absent(), + this.url = const i0.Value.absent(), + this.extractedContentPlain = const i0.Value.absent(), + this.fullContentPlain = const i0.Value.absent(), + this.rowid = const i0.Value.absent(), }); TabFtsCompanion.insert({ required String title, required String url, required String extractedContentPlain, required String fullContentPlain, - this.rowid = const Value.absent(), - }) : title = Value(title), - url = Value(url), - extractedContentPlain = Value(extractedContentPlain), - fullContentPlain = Value(fullContentPlain); - static Insertable custom({ - Expression? title, - Expression? url, - Expression? extractedContentPlain, - Expression? fullContentPlain, - Expression? rowid, + this.rowid = const i0.Value.absent(), + }) : title = i0.Value(title), + url = i0.Value(url), + extractedContentPlain = i0.Value(extractedContentPlain), + fullContentPlain = i0.Value(fullContentPlain); + static i0.Insertable custom({ + i0.Expression? title, + i0.Expression? url, + i0.Expression? extractedContentPlain, + i0.Expression? fullContentPlain, + i0.Expression? rowid, }) { - return RawValuesInsertable({ + return i0.RawValuesInsertable({ if (title != null) 'title': title, if (url != null) 'url': url, if (extractedContentPlain != null) @@ -1028,14 +2014,14 @@ class TabFtsCompanion extends UpdateCompanion { }); } - TabFtsCompanion copyWith({ - Value? title, - Value? url, - Value? extractedContentPlain, - Value? fullContentPlain, - Value? rowid, + i3.TabFtsCompanion copyWith({ + i0.Value? title, + i0.Value? url, + i0.Value? extractedContentPlain, + i0.Value? fullContentPlain, + i0.Value? rowid, }) { - return TabFtsCompanion( + return i3.TabFtsCompanion( title: title ?? this.title, url: url ?? this.url, extractedContentPlain: @@ -1046,24 +2032,24 @@ class TabFtsCompanion extends UpdateCompanion { } @override - Map toColumns(bool nullToAbsent) { - final map = {}; + Map toColumns(bool nullToAbsent) { + final map = {}; if (title.present) { - map['title'] = Variable(title.value); + map['title'] = i0.Variable(title.value); } if (url.present) { - map['url'] = Variable(url.value); + map['url'] = i0.Variable(url.value); } if (extractedContentPlain.present) { - map['extracted_content_plain'] = Variable( + map['extracted_content_plain'] = i0.Variable( extractedContentPlain.value, ); } if (fullContentPlain.present) { - map['full_content_plain'] = Variable(fullContentPlain.value); + map['full_content_plain'] = i0.Variable(fullContentPlain.value); } if (rowid.present) { - map['rowid'] = Variable(rowid.value); + map['rowid'] = i0.Variable(rowid.value); } return map; } @@ -1081,30 +2067,25 @@ class TabFtsCompanion extends UpdateCompanion { } } -abstract class _$TabDatabase extends GeneratedDatabase { - _$TabDatabase(QueryExecutor e) : super(e); - $TabDatabaseManager get managers => $TabDatabaseManager(this); - late final Container container = Container(this); - late final Tab tab = Tab(this); - late final TabFts tabFts = TabFts(this); - late final Trigger tabMaintainParentChainOnDelete = Trigger( - 'CREATE TRIGGER tab_maintain_parent_chain_on_delete BEFORE DELETE ON tab BEGIN UPDATE tab SET parent_id = OLD.parent_id WHERE parent_id = OLD.id;END', - 'tab_maintain_parent_chain_on_delete', - ); - late final Trigger tabAfterInsert = Trigger( - 'CREATE TRIGGER tab_after_insert AFTER INSERT ON tab BEGIN INSERT INTO tab_fts ("rowid", title, url, extracted_content_plain, full_content_plain) VALUES (new."rowid", new.title, new.url, new.extracted_content_plain, new.full_content_plain);END', - 'tab_after_insert', - ); - late final Trigger tabAfterDelete = Trigger( - 'CREATE TRIGGER tab_after_delete AFTER DELETE ON tab BEGIN INSERT INTO tab_fts (tab_fts, "rowid", title, url, extracted_content_plain, full_content_plain) VALUES (\'delete\', old."rowid", old.title, old.url, old.extracted_content_plain, old.full_content_plain);END', - 'tab_after_delete', - ); - late final Trigger tabAfterUpdate = Trigger( - 'CREATE TRIGGER tab_after_update AFTER UPDATE ON tab BEGIN INSERT INTO tab_fts (tab_fts, "rowid", title, url, extracted_content_plain, full_content_plain) VALUES (\'delete\', old."rowid", old.title, old.url, old.extracted_content_plain, old.full_content_plain);INSERT INTO tab_fts ("rowid", title, url, extracted_content_plain, full_content_plain) VALUES (new."rowid", new.title, new.url, new.extracted_content_plain, new.full_content_plain);END', - 'tab_after_update', - ); - late final ContainerDao containerDao = ContainerDao(this as TabDatabase); - late final TabDao tabDao = TabDao(this as TabDatabase); +i0.Trigger get tabMaintainParentChainOnDelete => i0.Trigger( + 'CREATE TRIGGER tab_maintain_parent_chain_on_delete BEFORE DELETE ON tab BEGIN UPDATE tab SET parent_id = OLD.parent_id WHERE parent_id = OLD.id;END', + 'tab_maintain_parent_chain_on_delete', +); +i0.Trigger get tabAfterInsert => i0.Trigger( + 'CREATE TRIGGER tab_after_insert AFTER INSERT ON tab BEGIN INSERT INTO tab_fts ("rowid", title, url, extracted_content_plain, full_content_plain) VALUES (new."rowid", new.title, new.url, new.extracted_content_plain, new.full_content_plain);END', + 'tab_after_insert', +); +i0.Trigger get tabAfterDelete => i0.Trigger( + 'CREATE TRIGGER tab_after_delete AFTER DELETE ON tab BEGIN INSERT INTO tab_fts (tab_fts, "rowid", title, url, extracted_content_plain, full_content_plain) VALUES (\'delete\', old."rowid", old.title, old.url, old.extracted_content_plain, old.full_content_plain);END', + 'tab_after_delete', +); +i0.Trigger get tabAfterUpdate => i0.Trigger( + 'CREATE TRIGGER tab_after_update AFTER UPDATE ON tab BEGIN INSERT INTO tab_fts (tab_fts, "rowid", title, url, extracted_content_plain, full_content_plain) VALUES (\'delete\', old."rowid", old.title, old.url, old.extracted_content_plain, old.full_content_plain);INSERT INTO tab_fts ("rowid", title, url, extracted_content_plain, full_content_plain) VALUES (new."rowid", new.title, new.url, new.extracted_content_plain, new.full_content_plain);END', + 'tab_after_update', +); + +class DefinitionsDrift extends i7.ModularAccessor { + DefinitionsDrift(i0.GeneratedDatabase db) : super(db); Future optimizeFtsIndex() { return customInsert( 'INSERT INTO tab_fts (tab_fts) VALUES (\'optimize\')', @@ -1113,18 +2094,18 @@ abstract class _$TabDatabase extends GeneratedDatabase { ); } - Selectable containersWithCount() { + i0.Selectable containersWithCount() { return customSelect( 'SELECT container.*, tab_agg.tab_count FROM container LEFT JOIN (SELECT container_id, COUNT(*) AS tab_count, MAX(timestamp) AS last_updated FROM tab GROUP BY container_id) AS tab_agg ON container.id = tab_agg.container_id ORDER BY tab_agg.last_updated DESC NULLS LAST', variables: [], readsFrom: {container, tab}, ).map( - (QueryRow row) => ContainerDataWithCount( + (i0.QueryRow row) => i1.ContainerDataWithCount( id: row.read('id'), name: row.readNullable('name'), - color: Container.$convertercolor.fromSql(row.read('color')), - metadata: NullAwareTypeConverter.wrapFromSql( - Container.$convertermetadata, + color: i3.Container.$convertercolor.fromSql(row.read('color')), + metadata: i0.NullAwareTypeConverter.wrapFromSql( + i3.Container.$convertermetadata, row.readNullable('metadata'), ), tabCount: row.readNullable('tab_count'), @@ -1132,61 +2113,61 @@ abstract class _$TabDatabase extends GeneratedDatabase { ); } - Selectable leadingOrderKey({ + i0.Selectable leadingOrderKey({ required int bucket, String? containerId, }) { return customSelect( 'SELECT lexo_rank_previous(?1, (SELECT order_key FROM tab WHERE container_id IS ?2 ORDER BY order_key LIMIT 1)) AS _c0', - variables: [Variable(bucket), Variable(containerId)], + variables: [i0.Variable(bucket), i0.Variable(containerId)], readsFrom: {tab}, - ).map((QueryRow row) => row.read('_c0')); + ).map((i0.QueryRow row) => row.read('_c0')); } - Selectable trailingOrderKey({ + i0.Selectable trailingOrderKey({ required int bucket, String? containerId, }) { return customSelect( 'SELECT lexo_rank_next(?1, (SELECT order_key FROM tab WHERE container_id IS ?2 ORDER BY order_key DESC LIMIT 1)) AS _c0', - variables: [Variable(bucket), Variable(containerId)], + variables: [i0.Variable(bucket), i0.Variable(containerId)], readsFrom: {tab}, - ).map((QueryRow row) => row.read('_c0')); + ).map((i0.QueryRow row) => row.read('_c0')); } - Selectable orderKeyAfterTab({ + i0.Selectable orderKeyAfterTab({ String? containerId, required String tabId, }) { return customSelect( 'WITH ordered_table AS (SELECT id, order_key, LEAD(order_key)OVER (ORDER BY order_key RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE NO OTHERS) AS next_order_key FROM tab WHERE container_id IS ?1) SELECT lexo_rank_reorder_after(order_key, next_order_key) AS _c0 FROM ordered_table WHERE id = ?2', - variables: [Variable(containerId), Variable(tabId)], + variables: [i0.Variable(containerId), i0.Variable(tabId)], readsFrom: {tab}, - ).map((QueryRow row) => row.read('_c0')); + ).map((i0.QueryRow row) => row.read('_c0')); } - Selectable orderKeyBeforeTab({ + i0.Selectable orderKeyBeforeTab({ String? containerId, required String tabId, }) { return customSelect( 'WITH ordered_table AS (SELECT id, order_key, LAG(order_key)OVER (ORDER BY order_key RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE NO OTHERS) AS prev_order_key FROM tab WHERE container_id IS ?1) SELECT lexo_rank_reorder_before(order_key, prev_order_key) AS _c0 FROM ordered_table WHERE id = ?2', - variables: [Variable(containerId), Variable(tabId)], + variables: [i0.Variable(containerId), i0.Variable(tabId)], readsFrom: {tab}, - ).map((QueryRow row) => row.read('_c0')); + ).map((i0.QueryRow row) => row.read('_c0')); } - Selectable queryTabsBasic({required String query}) { + i0.Selectable queryTabsBasic({required String query}) { return customSelect( 'WITH weights AS (SELECT 10.0 AS title_weight, 5.0 AS url_weight) SELECT t.id, t.title, CAST(t.url AS TEXT) AS url, t.url AS clean_url, bm25(tab_fts, weights.title_weight, weights.url_weight) AS weighted_rank FROM tab_fts AS fts INNER JOIN tab AS t ON t."rowid" = fts."rowid" CROSS JOIN weights WHERE fts.title LIKE ?1 OR fts.url LIKE ?1 ORDER BY weighted_rank ASC, t.timestamp DESC', - variables: [Variable(query)], + variables: [i0.Variable(query)], readsFrom: {tab, tabFts}, ).map( - (QueryRow row) => TabQueryResult( + (i0.QueryRow row) => i8.TabQueryResult( id: row.read('id'), title: row.readNullable('title'), url: row.readNullable('url'), - cleanUrl: Tab.$converterurl.fromSql( + cleanUrl: i3.Tab.$converterurl.fromSql( row.readNullable('clean_url'), ), weightedRank: row.read('weighted_rank'), @@ -1194,7 +2175,7 @@ abstract class _$TabDatabase extends GeneratedDatabase { ); } - Selectable queryTabsFullContent({ + i0.Selectable queryTabsFullContent({ required String beforeMatch, required String afterMatch, required String ellipsis, @@ -1204,19 +2185,19 @@ abstract class _$TabDatabase extends GeneratedDatabase { return customSelect( 'WITH weights AS (SELECT 10.0 AS title_weight, 5.0 AS url_weight, 3.0 AS extracted_weight, 1.0 AS full_weight) SELECT t.id, highlight(tab_fts, 0, ?1, ?2) AS title, highlight(tab_fts, 1, ?1, ?2) AS url, snippet(tab_fts, 2, ?1, ?2, ?3, ?4) AS extracted_content, snippet(tab_fts, 3, ?1, ?2, ?3, ?4) AS full_content, t.url AS clean_url,(bm25(tab_fts, weights.title_weight, weights.url_weight, weights.extracted_weight, weights.full_weight))AS weighted_rank FROM tab_fts(?5)AS fts INNER JOIN tab AS t ON t."rowid" = fts."rowid" CROSS JOIN weights ORDER BY weighted_rank ASC, t.timestamp DESC', variables: [ - Variable(beforeMatch), - Variable(afterMatch), - Variable(ellipsis), - Variable(snippetLength), - Variable(query), + i0.Variable(beforeMatch), + i0.Variable(afterMatch), + i0.Variable(ellipsis), + i0.Variable(snippetLength), + i0.Variable(query), ], readsFrom: {tab, tabFts}, ).map( - (QueryRow row) => TabQueryResult( + (i0.QueryRow row) => i8.TabQueryResult( id: row.read('id'), title: row.readNullable('title'), url: row.readNullable('url'), - cleanUrl: Tab.$converterurl.fromSql( + cleanUrl: i3.Tab.$converterurl.fromSql( row.readNullable('clean_url'), ), extractedContent: row.readNullable('extracted_content'), @@ -1226,13 +2207,13 @@ abstract class _$TabDatabase extends GeneratedDatabase { ); } - Selectable tabTrees() { + i0.Selectable tabTrees() { return customSelect( 'WITH RECURSIVE descendants AS (SELECT id, parent_id, timestamp, id AS root_id FROM tab WHERE parent_id IS NULL UNION ALL SELECT t.id, t.parent_id, t.timestamp, d.root_id FROM tab AS t JOIN descendants AS d ON t.parent_id = d.id), root_stats AS (SELECT root_id, MAX(timestamp) AS max_timestamp, COUNT(*) AS total_children FROM descendants GROUP BY root_id) SELECT d.root_id AS root_tab_id, d.id AS latest_tab_id, d.timestamp AS latest_timestamp, rs.total_children AS total_tabs FROM descendants AS d JOIN root_stats AS rs ON d.root_id = rs.root_id AND d.timestamp = rs.max_timestamp ORDER BY d.timestamp DESC', variables: [], readsFrom: {tab}, ).map( - (QueryRow row) => TabTreesResult( + (i0.QueryRow row) => TabTreesResult( rootTabId: row.read('root_tab_id'), latestTabId: row.read('latest_tab_id'), latestTimestamp: row.read('latest_timestamp'), @@ -1241,1008 +2222,53 @@ abstract class _$TabDatabase extends GeneratedDatabase { ); } - Selectable unorderedTabDescendants({ + i0.Selectable unorderedTabDescendants({ required String tabId, }) { return customSelect( 'WITH RECURSIVE descendants AS (SELECT id, parent_id FROM tab WHERE id = ?1 UNION ALL SELECT t.id, t.parent_id FROM tab AS t JOIN descendants AS d ON t.parent_id = d.id) SELECT id, parent_id FROM descendants', - variables: [Variable(tabId)], + variables: [i0.Variable(tabId)], readsFrom: {tab}, ).map( - (QueryRow row) => UnorderedTabDescendantsResult( + (i0.QueryRow row) => UnorderedTabDescendantsResult( id: row.read('id'), parentId: row.readNullable('parent_id'), ), ); } - Selectable previousTabByTimestamp({required String tabId}) { + i0.Selectable previousTabByTimestamp({required String tabId}) { return customSelect( 'WITH ranked_tabs AS (SELECT id, timestamp, LAG(id)OVER (ORDER BY timestamp RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE NO OTHERS) AS prev_tab_id FROM tab) SELECT prev_tab_id FROM ranked_tabs WHERE id = ?1', - variables: [Variable(tabId)], + variables: [i0.Variable(tabId)], readsFrom: {tab}, - ).map((QueryRow row) => row.readNullable('prev_tab_id')); + ).map((i0.QueryRow row) => row.readNullable('prev_tab_id')); } - Selectable previousTabByOrderKey({required String tabId}) { + i0.Selectable previousTabByOrderKey({required String tabId}) { return customSelect( 'WITH ranked_tabs AS (SELECT id, order_key, LAG(id)OVER (ORDER BY order_key RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE NO OTHERS) AS prev_tab_id FROM tab) SELECT prev_tab_id FROM ranked_tabs WHERE id = ?1', - variables: [Variable(tabId)], + variables: [i0.Variable(tabId)], readsFrom: {tab}, - ).map((QueryRow row) => row.readNullable('prev_tab_id')); + ).map((i0.QueryRow row) => row.readNullable('prev_tab_id')); } - Selectable nextTabByOrderKey({required String tabId}) { + i0.Selectable nextTabByOrderKey({required String tabId}) { return customSelect( 'WITH ranked_tabs AS (SELECT id, order_key, LEAD(id)OVER (ORDER BY order_key RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE NO OTHERS) AS next_tab_id FROM tab) SELECT next_tab_id FROM ranked_tabs WHERE id = ?1', - variables: [Variable(tabId)], + variables: [i0.Variable(tabId)], readsFrom: {tab}, - ).map((QueryRow row) => row.readNullable('next_tab_id')); + ).map((i0.QueryRow row) => row.readNullable('next_tab_id')); } - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - container, - tab, - tabFts, - tabMaintainParentChainOnDelete, - tabAfterInsert, - tabAfterDelete, - tabAfterUpdate, - ]; - @override - StreamQueryUpdateRules get streamUpdateRules => const StreamQueryUpdateRules([ - WritePropagation( - on: TableUpdateQuery.onTableName( - 'container', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('tab', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'tab', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('tab', kind: UpdateKind.update)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'tab', - limitUpdateKind: UpdateKind.insert, - ), - result: [TableUpdate('tab_fts', kind: UpdateKind.insert)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'tab', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('tab_fts', kind: UpdateKind.insert)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'tab', - limitUpdateKind: UpdateKind.update, - ), - result: [TableUpdate('tab_fts', kind: UpdateKind.insert)], - ), - ]); -} - -typedef $ContainerCreateCompanionBuilder = - ContainerCompanion Function({ - required String id, - Value name, - required Color color, - Value metadata, - Value rowid, - }); -typedef $ContainerUpdateCompanionBuilder = - ContainerCompanion Function({ - Value id, - Value name, - Value color, - Value metadata, - Value rowid, - }); - -final class $ContainerReferences - extends BaseReferences<_$TabDatabase, Container, ContainerData> { - $ContainerReferences(super.$_db, super.$_table, super.$_typedResult); - - static MultiTypedResultKey> _tabRefsTable( - _$TabDatabase db, - ) => MultiTypedResultKey.fromTable( - db.tab, - aliasName: $_aliasNameGenerator(db.container.id, db.tab.containerId), - ); - - $TabProcessedTableManager get tabRefs { - final manager = $TabTableManager( - $_db, - $_db.tab, - ).filter((f) => f.containerId.id.sqlEquals($_itemColumn('id')!)); - - final cache = $_typedResult.readTableOrNull(_tabRefsTable($_db)); - return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: cache), - ); - } -} - -class $ContainerFilterComposer extends Composer<_$TabDatabase, Container> { - $ContainerFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnFilters get id => $composableBuilder( - column: $table.id, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get name => $composableBuilder( - column: $table.name, - builder: (column) => ColumnFilters(column), - ); - - ColumnWithTypeConverterFilters get color => - $composableBuilder( - column: $table.color, - builder: (column) => ColumnWithTypeConverterFilters(column), - ); - - ColumnWithTypeConverterFilters - get metadata => $composableBuilder( - column: $table.metadata, - builder: (column) => ColumnWithTypeConverterFilters(column), - ); - - Expression tabRefs(Expression Function($TabFilterComposer f) f) { - final $TabFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.tab, - getReferencedColumn: (t) => t.containerId, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $TabFilterComposer( - $db: $db, - $table: $db.tab, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return f(composer); - } -} - -class $ContainerOrderingComposer extends Composer<_$TabDatabase, Container> { - $ContainerOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnOrderings get id => $composableBuilder( - column: $table.id, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get name => $composableBuilder( - column: $table.name, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get color => $composableBuilder( - column: $table.color, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get metadata => $composableBuilder( - column: $table.metadata, - builder: (column) => ColumnOrderings(column), - ); -} - -class $ContainerAnnotationComposer extends Composer<_$TabDatabase, Container> { - $ContainerAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); - - GeneratedColumn get name => - $composableBuilder(column: $table.name, builder: (column) => column); - - GeneratedColumnWithTypeConverter get color => - $composableBuilder(column: $table.color, builder: (column) => column); - - GeneratedColumnWithTypeConverter get metadata => - $composableBuilder(column: $table.metadata, builder: (column) => column); - - Expression tabRefs( - Expression Function($TabAnnotationComposer a) f, - ) { - final $TabAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.tab, - getReferencedColumn: (t) => t.containerId, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $TabAnnotationComposer( - $db: $db, - $table: $db.tab, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return f(composer); - } -} - -class $ContainerTableManager - extends - RootTableManager< - _$TabDatabase, - Container, - ContainerData, - $ContainerFilterComposer, - $ContainerOrderingComposer, - $ContainerAnnotationComposer, - $ContainerCreateCompanionBuilder, - $ContainerUpdateCompanionBuilder, - (ContainerData, $ContainerReferences), - ContainerData, - PrefetchHooks Function({bool tabRefs}) - > { - $ContainerTableManager(_$TabDatabase db, Container table) - : super( - TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - $ContainerFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $ContainerOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $ContainerAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - Value id = const Value.absent(), - Value name = const Value.absent(), - Value color = const Value.absent(), - Value metadata = const Value.absent(), - Value rowid = const Value.absent(), - }) => ContainerCompanion( - id: id, - name: name, - color: color, - metadata: metadata, - rowid: rowid, - ), - createCompanionCallback: - ({ - required String id, - Value name = const Value.absent(), - required Color color, - Value metadata = const Value.absent(), - Value rowid = const Value.absent(), - }) => ContainerCompanion.insert( - id: id, - name: name, - color: color, - metadata: metadata, - rowid: rowid, - ), - withReferenceMapper: (p0) => p0 - .map( - (e) => (e.readTable(table), $ContainerReferences(db, table, e)), - ) - .toList(), - prefetchHooksCallback: ({tabRefs = false}) { - return PrefetchHooks( - db: db, - explicitlyWatchedTables: [if (tabRefs) db.tab], - addJoins: null, - getPrefetchedDataCallback: (items) async { - return [ - if (tabRefs) - await $_getPrefetchedData< - ContainerData, - Container, - TabData - >( - currentTable: table, - referencedTable: $ContainerReferences._tabRefsTable(db), - managerFromTypedResult: (p0) => - $ContainerReferences(db, table, p0).tabRefs, - referencedItemsForCurrentItem: (item, referencedItems) => - referencedItems.where( - (e) => e.containerId == item.id, - ), - typedResults: items, - ), - ]; - }, - ); - }, - ), - ); -} - -typedef $ContainerProcessedTableManager = - ProcessedTableManager< - _$TabDatabase, - Container, - ContainerData, - $ContainerFilterComposer, - $ContainerOrderingComposer, - $ContainerAnnotationComposer, - $ContainerCreateCompanionBuilder, - $ContainerUpdateCompanionBuilder, - (ContainerData, $ContainerReferences), - ContainerData, - PrefetchHooks Function({bool tabRefs}) - >; -typedef $TabCreateCompanionBuilder = - TabCompanion Function({ - required String id, - Value parentId, - Value containerId, - required String orderKey, - Value url, - Value title, - Value isProbablyReaderable, - Value extractedContentMarkdown, - Value extractedContentPlain, - Value fullContentMarkdown, - Value fullContentPlain, - required DateTime timestamp, - Value rowid, - }); -typedef $TabUpdateCompanionBuilder = - TabCompanion Function({ - Value id, - Value parentId, - Value containerId, - Value orderKey, - Value url, - Value title, - Value isProbablyReaderable, - Value extractedContentMarkdown, - Value extractedContentPlain, - Value fullContentMarkdown, - Value fullContentPlain, - Value timestamp, - Value rowid, - }); - -final class $TabReferences extends BaseReferences<_$TabDatabase, Tab, TabData> { - $TabReferences(super.$_db, super.$_table, super.$_typedResult); - - static Container _containerIdTable(_$TabDatabase db) => db.container - .createAlias($_aliasNameGenerator(db.tab.containerId, db.container.id)); - - $ContainerProcessedTableManager? get containerId { - final $_column = $_itemColumn('container_id'); - if ($_column == null) return null; - final manager = $ContainerTableManager( - $_db, - $_db.container, - ).filter((f) => f.id.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_containerIdTable($_db)); - if (item == null) return manager; - return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } -} - -class $TabFilterComposer extends Composer<_$TabDatabase, Tab> { - $TabFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnFilters get id => $composableBuilder( - column: $table.id, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get parentId => $composableBuilder( - column: $table.parentId, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get orderKey => $composableBuilder( - column: $table.orderKey, - builder: (column) => ColumnFilters(column), - ); - - ColumnWithTypeConverterFilters get url => - $composableBuilder( - column: $table.url, - builder: (column) => ColumnWithTypeConverterFilters(column), - ); - - ColumnFilters get title => $composableBuilder( - column: $table.title, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get isProbablyReaderable => $composableBuilder( - column: $table.isProbablyReaderable, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get extractedContentMarkdown => $composableBuilder( - column: $table.extractedContentMarkdown, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get extractedContentPlain => $composableBuilder( - column: $table.extractedContentPlain, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get fullContentMarkdown => $composableBuilder( - column: $table.fullContentMarkdown, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get fullContentPlain => $composableBuilder( - column: $table.fullContentPlain, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get timestamp => $composableBuilder( - column: $table.timestamp, - builder: (column) => ColumnFilters(column), - ); - - $ContainerFilterComposer get containerId { - final $ContainerFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.containerId, - referencedTable: $db.container, - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $ContainerFilterComposer( - $db: $db, - $table: $db.container, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $TabOrderingComposer extends Composer<_$TabDatabase, Tab> { - $TabOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnOrderings get id => $composableBuilder( - column: $table.id, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get parentId => $composableBuilder( - column: $table.parentId, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get orderKey => $composableBuilder( - column: $table.orderKey, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get url => $composableBuilder( - column: $table.url, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get title => $composableBuilder( - column: $table.title, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get isProbablyReaderable => $composableBuilder( - column: $table.isProbablyReaderable, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get extractedContentMarkdown => $composableBuilder( - column: $table.extractedContentMarkdown, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get extractedContentPlain => $composableBuilder( - column: $table.extractedContentPlain, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get fullContentMarkdown => $composableBuilder( - column: $table.fullContentMarkdown, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get fullContentPlain => $composableBuilder( - column: $table.fullContentPlain, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get timestamp => $composableBuilder( - column: $table.timestamp, - builder: (column) => ColumnOrderings(column), - ); - - $ContainerOrderingComposer get containerId { - final $ContainerOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.containerId, - referencedTable: $db.container, - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $ContainerOrderingComposer( - $db: $db, - $table: $db.container, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $TabAnnotationComposer extends Composer<_$TabDatabase, Tab> { - $TabAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); - - GeneratedColumn get parentId => - $composableBuilder(column: $table.parentId, builder: (column) => column); - - GeneratedColumn get orderKey => - $composableBuilder(column: $table.orderKey, builder: (column) => column); - - GeneratedColumnWithTypeConverter get url => - $composableBuilder(column: $table.url, builder: (column) => column); - - GeneratedColumn get title => - $composableBuilder(column: $table.title, builder: (column) => column); - - GeneratedColumn get isProbablyReaderable => $composableBuilder( - column: $table.isProbablyReaderable, - builder: (column) => column, - ); - - GeneratedColumn get extractedContentMarkdown => $composableBuilder( - column: $table.extractedContentMarkdown, - builder: (column) => column, - ); - - GeneratedColumn get extractedContentPlain => $composableBuilder( - column: $table.extractedContentPlain, - builder: (column) => column, - ); - - GeneratedColumn get fullContentMarkdown => $composableBuilder( - column: $table.fullContentMarkdown, - builder: (column) => column, - ); - - GeneratedColumn get fullContentPlain => $composableBuilder( - column: $table.fullContentPlain, - builder: (column) => column, - ); - - GeneratedColumn get timestamp => - $composableBuilder(column: $table.timestamp, builder: (column) => column); - - $ContainerAnnotationComposer get containerId { - final $ContainerAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.containerId, - referencedTable: $db.container, - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $ContainerAnnotationComposer( - $db: $db, - $table: $db.container, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $TabTableManager - extends - RootTableManager< - _$TabDatabase, - Tab, - TabData, - $TabFilterComposer, - $TabOrderingComposer, - $TabAnnotationComposer, - $TabCreateCompanionBuilder, - $TabUpdateCompanionBuilder, - (TabData, $TabReferences), - TabData, - PrefetchHooks Function({bool containerId}) - > { - $TabTableManager(_$TabDatabase db, Tab table) - : super( - TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - $TabFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $TabOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $TabAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - Value id = const Value.absent(), - Value parentId = const Value.absent(), - Value containerId = const Value.absent(), - Value orderKey = const Value.absent(), - Value url = const Value.absent(), - Value title = const Value.absent(), - Value isProbablyReaderable = const Value.absent(), - Value extractedContentMarkdown = const Value.absent(), - Value extractedContentPlain = const Value.absent(), - Value fullContentMarkdown = const Value.absent(), - Value fullContentPlain = const Value.absent(), - Value timestamp = const Value.absent(), - Value rowid = const Value.absent(), - }) => TabCompanion( - id: id, - parentId: parentId, - containerId: containerId, - orderKey: orderKey, - url: url, - title: title, - isProbablyReaderable: isProbablyReaderable, - extractedContentMarkdown: extractedContentMarkdown, - extractedContentPlain: extractedContentPlain, - fullContentMarkdown: fullContentMarkdown, - fullContentPlain: fullContentPlain, - timestamp: timestamp, - rowid: rowid, - ), - createCompanionCallback: - ({ - required String id, - Value parentId = const Value.absent(), - Value containerId = const Value.absent(), - required String orderKey, - Value url = const Value.absent(), - Value title = const Value.absent(), - Value isProbablyReaderable = const Value.absent(), - Value extractedContentMarkdown = const Value.absent(), - Value extractedContentPlain = const Value.absent(), - Value fullContentMarkdown = const Value.absent(), - Value fullContentPlain = const Value.absent(), - required DateTime timestamp, - Value rowid = const Value.absent(), - }) => TabCompanion.insert( - id: id, - parentId: parentId, - containerId: containerId, - orderKey: orderKey, - url: url, - title: title, - isProbablyReaderable: isProbablyReaderable, - extractedContentMarkdown: extractedContentMarkdown, - extractedContentPlain: extractedContentPlain, - fullContentMarkdown: fullContentMarkdown, - fullContentPlain: fullContentPlain, - timestamp: timestamp, - rowid: rowid, - ), - withReferenceMapper: (p0) => p0 - .map((e) => (e.readTable(table), $TabReferences(db, table, e))) - .toList(), - prefetchHooksCallback: ({containerId = false}) { - return PrefetchHooks( - db: db, - explicitlyWatchedTables: [], - addJoins: - < - T extends TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic - > - >(state) { - if (containerId) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.containerId, - referencedTable: $TabReferences - ._containerIdTable(db), - referencedColumn: $TabReferences - ._containerIdTable(db) - .id, - ) - as T; - } - - return state; - }, - getPrefetchedDataCallback: (items) async { - return []; - }, - ); - }, - ), - ); -} - -typedef $TabProcessedTableManager = - ProcessedTableManager< - _$TabDatabase, - Tab, - TabData, - $TabFilterComposer, - $TabOrderingComposer, - $TabAnnotationComposer, - $TabCreateCompanionBuilder, - $TabUpdateCompanionBuilder, - (TabData, $TabReferences), - TabData, - PrefetchHooks Function({bool containerId}) - >; -typedef $TabFtsCreateCompanionBuilder = - TabFtsCompanion Function({ - required String title, - required String url, - required String extractedContentPlain, - required String fullContentPlain, - Value rowid, - }); -typedef $TabFtsUpdateCompanionBuilder = - TabFtsCompanion Function({ - Value title, - Value url, - Value extractedContentPlain, - Value fullContentPlain, - Value rowid, - }); - -class $TabFtsFilterComposer extends Composer<_$TabDatabase, TabFts> { - $TabFtsFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnFilters get title => $composableBuilder( - column: $table.title, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get url => $composableBuilder( - column: $table.url, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get extractedContentPlain => $composableBuilder( - column: $table.extractedContentPlain, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get fullContentPlain => $composableBuilder( - column: $table.fullContentPlain, - builder: (column) => ColumnFilters(column), - ); -} - -class $TabFtsOrderingComposer extends Composer<_$TabDatabase, TabFts> { - $TabFtsOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnOrderings get title => $composableBuilder( - column: $table.title, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get url => $composableBuilder( - column: $table.url, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get extractedContentPlain => $composableBuilder( - column: $table.extractedContentPlain, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get fullContentPlain => $composableBuilder( - column: $table.fullContentPlain, - builder: (column) => ColumnOrderings(column), - ); -} - -class $TabFtsAnnotationComposer extends Composer<_$TabDatabase, TabFts> { - $TabFtsAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - GeneratedColumn get title => - $composableBuilder(column: $table.title, builder: (column) => column); - - GeneratedColumn get url => - $composableBuilder(column: $table.url, builder: (column) => column); - - GeneratedColumn get extractedContentPlain => $composableBuilder( - column: $table.extractedContentPlain, - builder: (column) => column, - ); - - GeneratedColumn get fullContentPlain => $composableBuilder( - column: $table.fullContentPlain, - builder: (column) => column, - ); -} - -class $TabFtsTableManager - extends - RootTableManager< - _$TabDatabase, - TabFts, - TabFt, - $TabFtsFilterComposer, - $TabFtsOrderingComposer, - $TabFtsAnnotationComposer, - $TabFtsCreateCompanionBuilder, - $TabFtsUpdateCompanionBuilder, - (TabFt, BaseReferences<_$TabDatabase, TabFts, TabFt>), - TabFt, - PrefetchHooks Function() - > { - $TabFtsTableManager(_$TabDatabase db, TabFts table) - : super( - TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - $TabFtsFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $TabFtsOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $TabFtsAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - Value title = const Value.absent(), - Value url = const Value.absent(), - Value extractedContentPlain = const Value.absent(), - Value fullContentPlain = const Value.absent(), - Value rowid = const Value.absent(), - }) => TabFtsCompanion( - title: title, - url: url, - extractedContentPlain: extractedContentPlain, - fullContentPlain: fullContentPlain, - rowid: rowid, - ), - createCompanionCallback: - ({ - required String title, - required String url, - required String extractedContentPlain, - required String fullContentPlain, - Value rowid = const Value.absent(), - }) => TabFtsCompanion.insert( - title: title, - url: url, - extractedContentPlain: extractedContentPlain, - fullContentPlain: fullContentPlain, - rowid: rowid, - ), - withReferenceMapper: (p0) => p0 - .map((e) => (e.readTable(table), BaseReferences(db, table, e))) - .toList(), - prefetchHooksCallback: null, - ), - ); -} - -typedef $TabFtsProcessedTableManager = - ProcessedTableManager< - _$TabDatabase, - TabFts, - TabFt, - $TabFtsFilterComposer, - $TabFtsOrderingComposer, - $TabFtsAnnotationComposer, - $TabFtsCreateCompanionBuilder, - $TabFtsUpdateCompanionBuilder, - (TabFt, BaseReferences<_$TabDatabase, TabFts, TabFt>), - TabFt, - PrefetchHooks Function() - >; - -class $TabDatabaseManager { - final _$TabDatabase _db; - $TabDatabaseManager(this._db); - $ContainerTableManager get container => - $ContainerTableManager(_db, _db.container); - $TabTableManager get tab => $TabTableManager(_db, _db.tab); - $TabFtsTableManager get tabFts => $TabFtsTableManager(_db, _db.tabFts); + i3.TabFts get tabFts => i7.ReadDatabaseContainer( + attachedDatabase, + ).resultSet('tab_fts'); + i3.Container get container => i7.ReadDatabaseContainer( + attachedDatabase, + ).resultSet('container'); + i3.Tab get tab => + i7.ReadDatabaseContainer(attachedDatabase).resultSet('tab'); } class TabTreesResult { diff --git a/app/lib/features/geckoview/features/tabs/data/models/container_data.g.dart b/app/lib/features/geckoview/features/tabs/data/models/container_data.g.dart index deffca1e..796334f4 100644 --- a/app/lib/features/geckoview/features/tabs/data/models/container_data.g.dart +++ b/app/lib/features/geckoview/features/tabs/data/models/container_data.g.dart @@ -13,12 +13,13 @@ abstract class _$ContainerAuthSettingsCWProxy { ContainerAuthSettings lockTimeout(Duration? lockTimeout); - /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ContainerAuthSettings(...).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 `ContainerAuthSettings(...).copyWith.fieldName(value)`. /// - /// Usage + /// Example: /// ```dart /// ContainerAuthSettings(...).copyWith(id: 12, name: "My name") - /// ```` + /// ``` ContainerAuthSettings call({ bool authenticationRequired, bool lockOnAppBackground, @@ -26,7 +27,8 @@ abstract class _$ContainerAuthSettingsCWProxy { }); } -/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfContainerAuthSettings.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfContainerAuthSettings.copyWith.fieldName(...)` +/// Callable proxy for `copyWith` functionality. +/// Use as `instanceOfContainerAuthSettings.copyWith(...)` or call `instanceOfContainerAuthSettings.copyWith.fieldName(value)` for a single field. class _$ContainerAuthSettingsCWProxyImpl implements _$ContainerAuthSettingsCWProxy { const _$ContainerAuthSettingsCWProxyImpl(this._value); @@ -35,23 +37,24 @@ class _$ContainerAuthSettingsCWProxyImpl @override ContainerAuthSettings authenticationRequired(bool authenticationRequired) => - this(authenticationRequired: authenticationRequired); + call(authenticationRequired: authenticationRequired); @override ContainerAuthSettings lockOnAppBackground(bool lockOnAppBackground) => - this(lockOnAppBackground: lockOnAppBackground); + call(lockOnAppBackground: lockOnAppBackground); @override ContainerAuthSettings lockTimeout(Duration? lockTimeout) => - this(lockTimeout: lockTimeout); + call(lockTimeout: lockTimeout); @override - /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ContainerAuthSettings(...).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 `ContainerAuthSettings(...).copyWith.fieldName(value)`. /// - /// Usage + /// Example: /// ```dart /// ContainerAuthSettings(...).copyWith(id: 12, name: "My name") - /// ```` + /// ``` ContainerAuthSettings call({ Object? authenticationRequired = const $CopyWithPlaceholder(), Object? lockOnAppBackground = const $CopyWithPlaceholder(), @@ -59,11 +62,14 @@ class _$ContainerAuthSettingsCWProxyImpl }) { return ContainerAuthSettings( authenticationRequired: - authenticationRequired == const $CopyWithPlaceholder() + authenticationRequired == const $CopyWithPlaceholder() || + authenticationRequired == null ? _value.authenticationRequired // ignore: cast_nullable_to_non_nullable : authenticationRequired as bool, - lockOnAppBackground: lockOnAppBackground == const $CopyWithPlaceholder() + lockOnAppBackground: + lockOnAppBackground == const $CopyWithPlaceholder() || + lockOnAppBackground == null ? _value.lockOnAppBackground // ignore: cast_nullable_to_non_nullable : lockOnAppBackground as bool, @@ -76,7 +82,8 @@ class _$ContainerAuthSettingsCWProxyImpl } extension $ContainerAuthSettingsCopyWith on ContainerAuthSettings { - /// Returns a callable class that can be used as follows: `instanceOfContainerAuthSettings.copyWith(...)` or like so:`instanceOfContainerAuthSettings.copyWith.fieldName(...)`. + /// Returns a callable class used to build a new instance with modified fields. + /// Example: `instanceOfContainerAuthSettings.copyWith(...)` or `instanceOfContainerAuthSettings.copyWith.fieldName(...)`. // ignore: library_private_types_in_public_api _$ContainerAuthSettingsCWProxy get copyWith => _$ContainerAuthSettingsCWProxyImpl(this); @@ -91,12 +98,13 @@ abstract class _$ContainerMetadataCWProxy { ContainerMetadata useProxy(bool useProxy); - /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ContainerMetadata(...).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 `ContainerMetadata(...).copyWith.fieldName(value)`. /// - /// Usage + /// Example: /// ```dart /// ContainerMetadata(...).copyWith(id: 12, name: "My name") - /// ```` + /// ``` ContainerMetadata call({ IconData? iconData, String? contextualIdentity, @@ -105,33 +113,35 @@ abstract class _$ContainerMetadataCWProxy { }); } -/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfContainerMetadata.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfContainerMetadata.copyWith.fieldName(...)` +/// Callable proxy for `copyWith` functionality. +/// Use as `instanceOfContainerMetadata.copyWith(...)` or call `instanceOfContainerMetadata.copyWith.fieldName(value)` for a single field. class _$ContainerMetadataCWProxyImpl implements _$ContainerMetadataCWProxy { const _$ContainerMetadataCWProxyImpl(this._value); final ContainerMetadata _value; @override - ContainerMetadata iconData(IconData? iconData) => this(iconData: iconData); + ContainerMetadata iconData(IconData? iconData) => call(iconData: iconData); @override ContainerMetadata contextualIdentity(String? contextualIdentity) => - this(contextualIdentity: contextualIdentity); + call(contextualIdentity: contextualIdentity); @override ContainerMetadata authSettings(ContainerAuthSettings authSettings) => - this(authSettings: authSettings); + call(authSettings: authSettings); @override - ContainerMetadata useProxy(bool useProxy) => this(useProxy: useProxy); + ContainerMetadata useProxy(bool useProxy) => call(useProxy: useProxy); @override - /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ContainerMetadata(...).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 `ContainerMetadata(...).copyWith.fieldName(value)`. /// - /// Usage + /// Example: /// ```dart /// ContainerMetadata(...).copyWith(id: 12, name: "My name") - /// ```` + /// ``` ContainerMetadata call({ Object? iconData = const $CopyWithPlaceholder(), Object? contextualIdentity = const $CopyWithPlaceholder(), @@ -147,11 +157,12 @@ class _$ContainerMetadataCWProxyImpl implements _$ContainerMetadataCWProxy { ? _value.contextualIdentity // ignore: cast_nullable_to_non_nullable : contextualIdentity as String?, - authSettings: authSettings == const $CopyWithPlaceholder() + authSettings: + authSettings == const $CopyWithPlaceholder() || authSettings == null ? _value.authSettings // ignore: cast_nullable_to_non_nullable : authSettings as ContainerAuthSettings, - useProxy: useProxy == const $CopyWithPlaceholder() + useProxy: useProxy == const $CopyWithPlaceholder() || useProxy == null ? _value.useProxy // ignore: cast_nullable_to_non_nullable : useProxy as bool, @@ -160,7 +171,8 @@ class _$ContainerMetadataCWProxyImpl implements _$ContainerMetadataCWProxy { } extension $ContainerMetadataCopyWith on ContainerMetadata { - /// Returns a callable class that can be used as follows: `instanceOfContainerMetadata.copyWith(...)` or like so:`instanceOfContainerMetadata.copyWith.fieldName(...)`. + /// Returns a callable class used to build a new instance with modified fields. + /// Example: `instanceOfContainerMetadata.copyWith(...)` or `instanceOfContainerMetadata.copyWith.fieldName(...)`. // ignore: library_private_types_in_public_api _$ContainerMetadataCWProxy get copyWith => _$ContainerMetadataCWProxyImpl(this); @@ -175,12 +187,13 @@ abstract class _$ContainerDataCWProxy { ContainerData metadata(ContainerMetadata? metadata); - /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ContainerData(...).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 `ContainerData(...).copyWith.fieldName(value)`. /// - /// Usage + /// Example: /// ```dart /// ContainerData(...).copyWith(id: 12, name: "My name") - /// ```` + /// ``` ContainerData call({ String id, String? name, @@ -189,32 +202,34 @@ abstract class _$ContainerDataCWProxy { }); } -/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfContainerData.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfContainerData.copyWith.fieldName(...)` +/// Callable proxy for `copyWith` functionality. +/// Use as `instanceOfContainerData.copyWith(...)` or call `instanceOfContainerData.copyWith.fieldName(value)` for a single field. class _$ContainerDataCWProxyImpl implements _$ContainerDataCWProxy { const _$ContainerDataCWProxyImpl(this._value); final ContainerData _value; @override - ContainerData id(String id) => this(id: id); + ContainerData id(String id) => call(id: id); @override - ContainerData name(String? name) => this(name: name); + ContainerData name(String? name) => call(name: name); @override - ContainerData color(Color color) => this(color: color); + ContainerData color(Color color) => call(color: color); @override ContainerData metadata(ContainerMetadata? metadata) => - this(metadata: metadata); + call(metadata: metadata); @override - /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ContainerData(...).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 `ContainerData(...).copyWith.fieldName(value)`. /// - /// Usage + /// Example: /// ```dart /// ContainerData(...).copyWith(id: 12, name: "My name") - /// ```` + /// ``` ContainerData call({ Object? id = const $CopyWithPlaceholder(), Object? name = const $CopyWithPlaceholder(), @@ -222,7 +237,7 @@ class _$ContainerDataCWProxyImpl implements _$ContainerDataCWProxy { Object? metadata = const $CopyWithPlaceholder(), }) { return ContainerData( - id: id == const $CopyWithPlaceholder() + id: id == const $CopyWithPlaceholder() || id == null ? _value.id // ignore: cast_nullable_to_non_nullable : id as String, @@ -230,7 +245,7 @@ class _$ContainerDataCWProxyImpl implements _$ContainerDataCWProxy { ? _value.name // ignore: cast_nullable_to_non_nullable : name as String?, - color: color == const $CopyWithPlaceholder() + color: color == const $CopyWithPlaceholder() || color == null ? _value.color // ignore: cast_nullable_to_non_nullable : color as Color, @@ -243,7 +258,8 @@ class _$ContainerDataCWProxyImpl implements _$ContainerDataCWProxy { } extension $ContainerDataCopyWith on ContainerData { - /// Returns a callable class that can be used as follows: `instanceOfContainerData.copyWith(...)` or like so:`instanceOfContainerData.copyWith.fieldName(...)`. + /// Returns a callable class used to build a new instance with modified fields. + /// Example: `instanceOfContainerData.copyWith(...)` or `instanceOfContainerData.copyWith.fieldName(...)`. // ignore: library_private_types_in_public_api _$ContainerDataCWProxy get copyWith => _$ContainerDataCWProxyImpl(this); } diff --git a/app/lib/features/geckoview/features/tabs/data/providers.g.dart b/app/lib/features/geckoview/features/tabs/data/providers.g.dart index 332ce76f..30c0c1d3 100644 --- a/app/lib/features/geckoview/features/tabs/data/providers.g.dart +++ b/app/lib/features/geckoview/features/tabs/data/providers.g.dart @@ -6,22 +6,46 @@ part of 'providers.dart'; // RiverpodGenerator // ************************************************************************** -String _$tabDatabaseHash() => r'422bd4789296dc271fabbd5906f2e2ab16bccaa3'; +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning -/// See also [tabDatabase]. @ProviderFor(tabDatabase) -final tabDatabaseProvider = Provider.internal( - tabDatabase, - name: r'tabDatabaseProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$tabDatabaseHash, - dependencies: null, - allTransitiveDependencies: null, -); +const tabDatabaseProvider = TabDatabaseProvider._(); -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef TabDatabaseRef = ProviderRef; -// 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 TabDatabaseProvider + extends $FunctionalProvider + with $Provider { + const TabDatabaseProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'tabDatabaseProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$tabDatabaseHash(); + + @$internal + @override + $ProviderElement $createElement($ProviderPointer pointer) => + $ProviderElement(pointer); + + @override + TabDatabase create(Ref ref) { + return tabDatabase(ref); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(TabDatabase value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + +String _$tabDatabaseHash() => r'422bd4789296dc271fabbd5906f2e2ab16bccaa3'; diff --git a/app/lib/features/geckoview/features/tabs/domain/providers.dart b/app/lib/features/geckoview/features/tabs/domain/providers.dart index b9d0c2a9..787951e5 100644 --- a/app/lib/features/geckoview/features/tabs/domain/providers.dart +++ b/app/lib/features/geckoview/features/tabs/domain/providers.dart @@ -20,7 +20,7 @@ import 'package:nullability/nullability.dart'; import 'package:riverpod/riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; -import 'package:weblibre/features/geckoview/features/tabs/data/database/database.dart'; +import 'package:weblibre/features/geckoview/features/tabs/data/database/definitions.drift.dart'; import 'package:weblibre/features/geckoview/features/tabs/data/entities/container_filter.dart'; import 'package:weblibre/features/geckoview/features/tabs/data/models/container_data.dart'; import 'package:weblibre/features/geckoview/features/tabs/data/providers.dart'; @@ -31,7 +31,7 @@ part 'providers.g.dart'; @Riverpod() Stream> containersWithCount(Ref ref) { final db = ref.watch(tabDatabaseProvider); - return db.containersWithCount().watch(); + return db.definitionsDrift.containersWithCount().watch(); } @Riverpod() @@ -78,13 +78,15 @@ Future containerTabCount(Ref ref, ContainerFilter containerFilter) { @Riverpod() Stream> tabTrees(Ref ref) { final db = ref.watch(tabDatabaseProvider); - return db.tabTrees().watch(); + return db.definitionsDrift.tabTrees().watch(); } @Riverpod() Stream> tabDescendants(Ref ref, String tabId) { final db = ref.watch(tabDatabaseProvider); - return db.unorderedTabDescendants(tabId: tabId).watch().map((results) { + return db.definitionsDrift.unorderedTabDescendants(tabId: tabId).watch().map(( + results, + ) { return Map.fromEntries( results.map((pair) => MapEntry(pair.id, pair.parentId)), ); diff --git a/app/lib/features/geckoview/features/tabs/domain/providers.g.dart b/app/lib/features/geckoview/features/tabs/domain/providers.g.dart index 233d82be..eb82bf54 100644 --- a/app/lib/features/geckoview/features/tabs/domain/providers.g.dart +++ b/app/lib/features/geckoview/features/tabs/domain/providers.g.dart @@ -6,927 +6,623 @@ part of 'providers.dart'; // RiverpodGenerator // ************************************************************************** -String _$containersWithCountHash() => - r'ee0734e4b71472b79636816616a158f54fa6bc23'; +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning -/// See also [containersWithCount]. @ProviderFor(containersWithCount) -final containersWithCountProvider = - AutoDisposeStreamProvider>.internal( - containersWithCount, - name: r'containersWithCountProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$containersWithCountHash, - dependencies: null, - allTransitiveDependencies: null, - ); +const containersWithCountProvider = ContainersWithCountProvider._(); -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef ContainersWithCountRef = - AutoDisposeStreamProviderRef>; -String _$matchSortedContainersWithCountHash() => - r'bc2077602c3c1d86c5b916e4ad920053310993e4'; - -/// Copied from Dart SDK -class _SystemHash { - _SystemHash._(); - - static int combine(int hash, int value) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + value); - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10)); - return hash ^ (hash >> 6); - } - - static int finish(int hash) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); - // ignore: parameter_assignments - hash = hash ^ (hash >> 11); - return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); - } -} - -/// See also [matchSortedContainersWithCount]. -@ProviderFor(matchSortedContainersWithCount) -const matchSortedContainersWithCountProvider = - MatchSortedContainersWithCountFamily(); - -/// See also [matchSortedContainersWithCount]. -class MatchSortedContainersWithCountFamily - extends Family>> { - /// See also [matchSortedContainersWithCount]. - const MatchSortedContainersWithCountFamily(); - - /// See also [matchSortedContainersWithCount]. - MatchSortedContainersWithCountProvider call(String? searchText) { - return MatchSortedContainersWithCountProvider(searchText); - } - - @override - MatchSortedContainersWithCountProvider getProviderOverride( - covariant MatchSortedContainersWithCountProvider provider, - ) { - return call(provider.searchText); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'matchSortedContainersWithCountProvider'; -} - -/// See also [matchSortedContainersWithCount]. -class MatchSortedContainersWithCountProvider - extends AutoDisposeProvider>> { - /// See also [matchSortedContainersWithCount]. - MatchSortedContainersWithCountProvider(String? searchText) - : this._internal( - (ref) => matchSortedContainersWithCount( - ref as MatchSortedContainersWithCountRef, - searchText, - ), - from: matchSortedContainersWithCountProvider, - name: r'matchSortedContainersWithCountProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$matchSortedContainersWithCountHash, - dependencies: MatchSortedContainersWithCountFamily._dependencies, - allTransitiveDependencies: - MatchSortedContainersWithCountFamily._allTransitiveDependencies, - searchText: searchText, +final class ContainersWithCountProvider + extends + $FunctionalProvider< + AsyncValue>, + List, + Stream> + > + with + $FutureModifier>, + $StreamProvider> { + const ContainersWithCountProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'containersWithCountProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, ); - MatchSortedContainersWithCountProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.searchText, - }) : super.internal(); + @override + String debugGetCreateSourceHash() => _$containersWithCountHash(); - final String? searchText; + @$internal + @override + $StreamProviderElement> $createElement( + $ProviderPointer pointer, + ) => $StreamProviderElement(pointer); @override - Override overrideWith( - AsyncValue> Function( - MatchSortedContainersWithCountRef provider, - ) - create, - ) { - return ProviderOverride( - origin: this, - override: MatchSortedContainersWithCountProvider._internal( - (ref) => create(ref as MatchSortedContainersWithCountRef), - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - searchText: searchText, - ), - ); + Stream> create(Ref ref) { + return containersWithCount(ref); + } +} + +String _$containersWithCountHash() => + r'd08294ef0def19b3401552fa9d533c9a780fa3dd'; + +@ProviderFor(matchSortedContainersWithCount) +const matchSortedContainersWithCountProvider = + MatchSortedContainersWithCountFamily._(); + +final class MatchSortedContainersWithCountProvider + extends + $FunctionalProvider< + AsyncValue>, + AsyncValue>, + AsyncValue> + > + with $Provider>> { + const MatchSortedContainersWithCountProvider._({ + required MatchSortedContainersWithCountFamily super.from, + required String? super.argument, + }) : super( + retry: null, + name: r'matchSortedContainersWithCountProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$matchSortedContainersWithCountHash(); + + @override + String toString() { + return r'matchSortedContainersWithCountProvider' + '' + '($argument)'; } + @$internal @override - AutoDisposeProviderElement>> - createElement() { - return _MatchSortedContainersWithCountProviderElement(this); + $ProviderElement>> $createElement( + $ProviderPointer pointer, + ) => $ProviderElement(pointer); + + @override + AsyncValue> create(Ref ref) { + final argument = this.argument as String?; + return matchSortedContainersWithCount(ref, argument); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(AsyncValue> value) { + return $ProviderOverride( + origin: this, + providerOverride: + $SyncValueProvider>>(value), + ); } @override bool operator ==(Object other) { return other is MatchSortedContainersWithCountProvider && - other.searchText == searchText; + other.argument == argument; } @override int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, searchText.hashCode); - - return _SystemHash.finish(hash); + return argument.hashCode; } } -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin MatchSortedContainersWithCountRef - on AutoDisposeProviderRef>> { - /// The parameter `searchText` of this provider. - String? get searchText; -} +String _$matchSortedContainersWithCountHash() => + r'bc2077602c3c1d86c5b916e4ad920053310993e4'; -class _MatchSortedContainersWithCountProviderElement - extends AutoDisposeProviderElement>> - with MatchSortedContainersWithCountRef { - _MatchSortedContainersWithCountProviderElement(super.provider); +final class MatchSortedContainersWithCountFamily extends $Family + with + $FunctionalFamilyOverride< + AsyncValue>, + String? + > { + const MatchSortedContainersWithCountFamily._() + : super( + retry: null, + name: r'matchSortedContainersWithCountProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, + ); + + MatchSortedContainersWithCountProvider call(String? searchText) => + MatchSortedContainersWithCountProvider._( + argument: searchText, + from: this, + ); @override - String? get searchText => - (origin as MatchSortedContainersWithCountProvider).searchText; + String toString() => r'matchSortedContainersWithCountProvider'; +} + +@ProviderFor(containerTabIds) +const containerTabIdsProvider = ContainerTabIdsFamily._(); + +final class ContainerTabIdsProvider + extends + $FunctionalProvider< + AsyncValue>, + List, + Stream> + > + with $FutureModifier>, $StreamProvider> { + const ContainerTabIdsProvider._({ + required ContainerTabIdsFamily super.from, + required ContainerFilter super.argument, + }) : super( + retry: null, + name: r'containerTabIdsProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$containerTabIdsHash(); + + @override + String toString() { + return r'containerTabIdsProvider' + '' + '($argument)'; + } + + @$internal + @override + $StreamProviderElement> $createElement( + $ProviderPointer pointer, + ) => $StreamProviderElement(pointer); + + @override + Stream> create(Ref ref) { + final argument = this.argument as ContainerFilter; + return containerTabIds(ref, argument); + } + + @override + bool operator ==(Object other) { + return other is ContainerTabIdsProvider && other.argument == argument; + } + + @override + int get hashCode { + return argument.hashCode; + } } String _$containerTabIdsHash() => r'61716a2ae74ffa590c1498d259382e69e24ad7f1'; -/// See also [containerTabIds]. -@ProviderFor(containerTabIds) -const containerTabIdsProvider = ContainerTabIdsFamily(); - -/// See also [containerTabIds]. -class ContainerTabIdsFamily extends Family>> { - /// See also [containerTabIds]. - const ContainerTabIdsFamily(); - - /// See also [containerTabIds]. - ContainerTabIdsProvider call(ContainerFilter containerFilter) { - return ContainerTabIdsProvider(containerFilter); - } - - @override - ContainerTabIdsProvider getProviderOverride( - covariant ContainerTabIdsProvider provider, - ) { - return call(provider.containerFilter); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'containerTabIdsProvider'; -} - -/// See also [containerTabIds]. -class ContainerTabIdsProvider extends AutoDisposeStreamProvider> { - /// See also [containerTabIds]. - ContainerTabIdsProvider(ContainerFilter containerFilter) - : this._internal( - (ref) => containerTabIds(ref as ContainerTabIdsRef, containerFilter), - from: containerTabIdsProvider, +final class ContainerTabIdsFamily extends $Family + with $FunctionalFamilyOverride>, ContainerFilter> { + const ContainerTabIdsFamily._() + : super( + retry: null, name: r'containerTabIdsProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$containerTabIdsHash, - dependencies: ContainerTabIdsFamily._dependencies, - allTransitiveDependencies: - ContainerTabIdsFamily._allTransitiveDependencies, - containerFilter: containerFilter, + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, ); - ContainerTabIdsProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.containerFilter, - }) : super.internal(); - - final ContainerFilter containerFilter; + ContainerTabIdsProvider call(ContainerFilter containerFilter) => + ContainerTabIdsProvider._(argument: containerFilter, from: this); @override - Override overrideWith( - Stream> Function(ContainerTabIdsRef provider) create, - ) { - return ProviderOverride( - origin: this, - override: ContainerTabIdsProvider._internal( - (ref) => create(ref as ContainerTabIdsRef), - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - containerFilter: containerFilter, - ), - ); + String toString() => r'containerTabIdsProvider'; +} + +@ProviderFor(containerTabCount) +const containerTabCountProvider = ContainerTabCountFamily._(); + +final class ContainerTabCountProvider + extends $FunctionalProvider, int, FutureOr> + with $FutureModifier, $FutureProvider { + const ContainerTabCountProvider._({ + required ContainerTabCountFamily super.from, + required ContainerFilter super.argument, + }) : super( + retry: null, + name: r'containerTabCountProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$containerTabCountHash(); + + @override + String toString() { + return r'containerTabCountProvider' + '' + '($argument)'; } + @$internal @override - AutoDisposeStreamProviderElement> createElement() { - return _ContainerTabIdsProviderElement(this); + $FutureProviderElement $createElement($ProviderPointer pointer) => + $FutureProviderElement(pointer); + + @override + FutureOr create(Ref ref) { + final argument = this.argument as ContainerFilter; + return containerTabCount(ref, argument); } @override bool operator ==(Object other) { - return other is ContainerTabIdsProvider && - other.containerFilter == containerFilter; + return other is ContainerTabCountProvider && other.argument == argument; } @override int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, containerFilter.hashCode); - - return _SystemHash.finish(hash); + return argument.hashCode; } } -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin ContainerTabIdsRef on AutoDisposeStreamProviderRef> { - /// The parameter `containerFilter` of this provider. - ContainerFilter get containerFilter; -} - -class _ContainerTabIdsProviderElement - extends AutoDisposeStreamProviderElement> - with ContainerTabIdsRef { - _ContainerTabIdsProviderElement(super.provider); - - @override - ContainerFilter get containerFilter => - (origin as ContainerTabIdsProvider).containerFilter; -} - String _$containerTabCountHash() => r'586e83429b527b546d43232a58453635ab860d69'; -/// See also [containerTabCount]. -@ProviderFor(containerTabCount) -const containerTabCountProvider = ContainerTabCountFamily(); - -/// See also [containerTabCount]. -class ContainerTabCountFamily extends Family> { - /// See also [containerTabCount]. - const ContainerTabCountFamily(); - - /// See also [containerTabCount]. - ContainerTabCountProvider call(ContainerFilter containerFilter) { - return ContainerTabCountProvider(containerFilter); - } - - @override - ContainerTabCountProvider getProviderOverride( - covariant ContainerTabCountProvider provider, - ) { - return call(provider.containerFilter); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'containerTabCountProvider'; -} - -/// See also [containerTabCount]. -class ContainerTabCountProvider extends AutoDisposeFutureProvider { - /// See also [containerTabCount]. - ContainerTabCountProvider(ContainerFilter containerFilter) - : this._internal( - (ref) => - containerTabCount(ref as ContainerTabCountRef, containerFilter), - from: containerTabCountProvider, +final class ContainerTabCountFamily extends $Family + with $FunctionalFamilyOverride, ContainerFilter> { + const ContainerTabCountFamily._() + : super( + retry: null, name: r'containerTabCountProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$containerTabCountHash, - dependencies: ContainerTabCountFamily._dependencies, - allTransitiveDependencies: - ContainerTabCountFamily._allTransitiveDependencies, - containerFilter: containerFilter, + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, ); - ContainerTabCountProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.containerFilter, - }) : super.internal(); - - final ContainerFilter containerFilter; + ContainerTabCountProvider call(ContainerFilter containerFilter) => + ContainerTabCountProvider._(argument: containerFilter, from: this); @override - Override overrideWith( - FutureOr Function(ContainerTabCountRef provider) create, - ) { - return ProviderOverride( - origin: this, - override: ContainerTabCountProvider._internal( - (ref) => create(ref as ContainerTabCountRef), - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - containerFilter: containerFilter, - ), - ); - } - - @override - AutoDisposeFutureProviderElement createElement() { - return _ContainerTabCountProviderElement(this); - } - - @override - bool operator ==(Object other) { - return other is ContainerTabCountProvider && - other.containerFilter == containerFilter; - } - - @override - int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, containerFilter.hashCode); - - return _SystemHash.finish(hash); - } + String toString() => r'containerTabCountProvider'; } -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin ContainerTabCountRef on AutoDisposeFutureProviderRef { - /// The parameter `containerFilter` of this provider. - ContainerFilter get containerFilter; -} - -class _ContainerTabCountProviderElement - extends AutoDisposeFutureProviderElement - with ContainerTabCountRef { - _ContainerTabCountProviderElement(super.provider); - - @override - ContainerFilter get containerFilter => - (origin as ContainerTabCountProvider).containerFilter; -} - -String _$tabTreesHash() => r'b7b7f7136827207dd01a7894a915be3d17b1ae63'; - -/// See also [tabTrees]. @ProviderFor(tabTrees) -final tabTreesProvider = - AutoDisposeStreamProvider>.internal( - tabTrees, - name: r'tabTreesProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$tabTreesHash, - dependencies: null, - allTransitiveDependencies: null, - ); +const tabTreesProvider = TabTreesProvider._(); -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef TabTreesRef = AutoDisposeStreamProviderRef>; -String _$tabDescendantsHash() => r'93e19df9896e4876dc911370c02bf10f1ee9a9e6'; - -/// See also [tabDescendants]. -@ProviderFor(tabDescendants) -const tabDescendantsProvider = TabDescendantsFamily(); - -/// See also [tabDescendants]. -class TabDescendantsFamily extends Family>> { - /// See also [tabDescendants]. - const TabDescendantsFamily(); - - /// See also [tabDescendants]. - TabDescendantsProvider call(String tabId) { - return TabDescendantsProvider(tabId); - } - - @override - TabDescendantsProvider getProviderOverride( - covariant TabDescendantsProvider provider, - ) { - return call(provider.tabId); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'tabDescendantsProvider'; -} - -/// See also [tabDescendants]. -class TabDescendantsProvider - extends AutoDisposeStreamProvider> { - /// See also [tabDescendants]. - TabDescendantsProvider(String tabId) - : this._internal( - (ref) => tabDescendants(ref as TabDescendantsRef, tabId), - from: tabDescendantsProvider, - name: r'tabDescendantsProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$tabDescendantsHash, - dependencies: TabDescendantsFamily._dependencies, - allTransitiveDependencies: - TabDescendantsFamily._allTransitiveDependencies, - tabId: tabId, +final class TabTreesProvider + extends + $FunctionalProvider< + AsyncValue>, + List, + Stream> + > + with + $FutureModifier>, + $StreamProvider> { + const TabTreesProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'tabTreesProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, ); - TabDescendantsProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.tabId, - }) : super.internal(); + @override + String debugGetCreateSourceHash() => _$tabTreesHash(); - final String tabId; + @$internal + @override + $StreamProviderElement> $createElement( + $ProviderPointer pointer, + ) => $StreamProviderElement(pointer); @override - Override overrideWith( - Stream> Function(TabDescendantsRef provider) create, - ) { - return ProviderOverride( - origin: this, - override: TabDescendantsProvider._internal( - (ref) => create(ref as TabDescendantsRef), - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - tabId: tabId, - ), - ); + Stream> create(Ref ref) { + return tabTrees(ref); + } +} + +String _$tabTreesHash() => r'd9256293a97d5451c2ab881a30ae99c9e2178999'; + +@ProviderFor(tabDescendants) +const tabDescendantsProvider = TabDescendantsFamily._(); + +final class TabDescendantsProvider + extends + $FunctionalProvider< + AsyncValue>, + Map, + Stream> + > + with + $FutureModifier>, + $StreamProvider> { + const TabDescendantsProvider._({ + required TabDescendantsFamily super.from, + required String super.argument, + }) : super( + retry: null, + name: r'tabDescendantsProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$tabDescendantsHash(); + + @override + String toString() { + return r'tabDescendantsProvider' + '' + '($argument)'; } + @$internal @override - AutoDisposeStreamProviderElement> createElement() { - return _TabDescendantsProviderElement(this); + $StreamProviderElement> $createElement( + $ProviderPointer pointer, + ) => $StreamProviderElement(pointer); + + @override + Stream> create(Ref ref) { + final argument = this.argument as String; + return tabDescendants(ref, argument); } @override bool operator ==(Object other) { - return other is TabDescendantsProvider && other.tabId == tabId; + return other is TabDescendantsProvider && other.argument == argument; } @override int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, tabId.hashCode); - - return _SystemHash.finish(hash); + return argument.hashCode; } } -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin TabDescendantsRef on AutoDisposeStreamProviderRef> { - /// The parameter `tabId` of this provider. - String get tabId; -} +String _$tabDescendantsHash() => r'c2c3fe18e9b47c64df9ae6c1cfde683f3231d53c'; -class _TabDescendantsProviderElement - extends AutoDisposeStreamProviderElement> - with TabDescendantsRef { - _TabDescendantsProviderElement(super.provider); +final class TabDescendantsFamily extends $Family + with $FunctionalFamilyOverride>, String> { + const TabDescendantsFamily._() + : super( + retry: null, + name: r'tabDescendantsProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, + ); + + TabDescendantsProvider call(String tabId) => + TabDescendantsProvider._(argument: tabId, from: this); @override - String get tabId => (origin as TabDescendantsProvider).tabId; + String toString() => r'tabDescendantsProvider'; +} + +@ProviderFor(containerTabsData) +const containerTabsDataProvider = ContainerTabsDataFamily._(); + +final class ContainerTabsDataProvider + extends + $FunctionalProvider< + AsyncValue>, + List, + Stream> + > + with $FutureModifier>, $StreamProvider> { + const ContainerTabsDataProvider._({ + required ContainerTabsDataFamily super.from, + required String? super.argument, + }) : super( + retry: null, + name: r'containerTabsDataProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$containerTabsDataHash(); + + @override + String toString() { + return r'containerTabsDataProvider' + '' + '($argument)'; + } + + @$internal + @override + $StreamProviderElement> $createElement( + $ProviderPointer pointer, + ) => $StreamProviderElement(pointer); + + @override + Stream> create(Ref ref) { + final argument = this.argument as String?; + return containerTabsData(ref, argument); + } + + @override + bool operator ==(Object other) { + return other is ContainerTabsDataProvider && other.argument == argument; + } + + @override + int get hashCode { + return argument.hashCode; + } } String _$containerTabsDataHash() => r'2961c89fc9e16c8e6005342356ecf677fb2ff63c'; -/// See also [containerTabsData]. -@ProviderFor(containerTabsData) -const containerTabsDataProvider = ContainerTabsDataFamily(); - -/// See also [containerTabsData]. -class ContainerTabsDataFamily extends Family>> { - /// See also [containerTabsData]. - const ContainerTabsDataFamily(); - - /// See also [containerTabsData]. - ContainerTabsDataProvider call(String? containerId) { - return ContainerTabsDataProvider(containerId); - } - - @override - ContainerTabsDataProvider getProviderOverride( - covariant ContainerTabsDataProvider provider, - ) { - return call(provider.containerId); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'containerTabsDataProvider'; -} - -/// See also [containerTabsData]. -class ContainerTabsDataProvider - extends AutoDisposeStreamProvider> { - /// See also [containerTabsData]. - ContainerTabsDataProvider(String? containerId) - : this._internal( - (ref) => containerTabsData(ref as ContainerTabsDataRef, containerId), - from: containerTabsDataProvider, +final class ContainerTabsDataFamily extends $Family + with $FunctionalFamilyOverride>, String?> { + const ContainerTabsDataFamily._() + : super( + retry: null, name: r'containerTabsDataProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$containerTabsDataHash, - dependencies: ContainerTabsDataFamily._dependencies, - allTransitiveDependencies: - ContainerTabsDataFamily._allTransitiveDependencies, - containerId: containerId, + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, ); - ContainerTabsDataProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.containerId, - }) : super.internal(); - - final String? containerId; + ContainerTabsDataProvider call(String? containerId) => + ContainerTabsDataProvider._(argument: containerId, from: this); @override - Override overrideWith( - Stream> Function(ContainerTabsDataRef provider) create, - ) { - return ProviderOverride( - origin: this, - override: ContainerTabsDataProvider._internal( - (ref) => create(ref as ContainerTabsDataRef), - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - containerId: containerId, - ), - ); + String toString() => r'containerTabsDataProvider'; +} + +@ProviderFor(containerData) +const containerDataProvider = ContainerDataFamily._(); + +final class ContainerDataProvider + extends + $FunctionalProvider< + AsyncValue, + ContainerData?, + Stream + > + with $FutureModifier, $StreamProvider { + const ContainerDataProvider._({ + required ContainerDataFamily super.from, + required String super.argument, + }) : super( + retry: null, + name: r'containerDataProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$containerDataHash(); + + @override + String toString() { + return r'containerDataProvider' + '' + '($argument)'; } + @$internal @override - AutoDisposeStreamProviderElement> createElement() { - return _ContainerTabsDataProviderElement(this); + $StreamProviderElement $createElement( + $ProviderPointer pointer, + ) => $StreamProviderElement(pointer); + + @override + Stream create(Ref ref) { + final argument = this.argument as String; + return containerData(ref, argument); } @override bool operator ==(Object other) { - return other is ContainerTabsDataProvider && - other.containerId == containerId; + return other is ContainerDataProvider && other.argument == argument; } @override int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, containerId.hashCode); - - return _SystemHash.finish(hash); + return argument.hashCode; } } -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin ContainerTabsDataRef on AutoDisposeStreamProviderRef> { - /// The parameter `containerId` of this provider. - String? get containerId; -} - -class _ContainerTabsDataProviderElement - extends AutoDisposeStreamProviderElement> - with ContainerTabsDataRef { - _ContainerTabsDataProviderElement(super.provider); - - @override - String? get containerId => (origin as ContainerTabsDataProvider).containerId; -} - String _$containerDataHash() => r'6adbec128876069189954832af35109b0779148c'; -/// See also [containerData]. -@ProviderFor(containerData) -const containerDataProvider = ContainerDataFamily(); - -/// See also [containerData]. -class ContainerDataFamily extends Family> { - /// See also [containerData]. - const ContainerDataFamily(); - - /// See also [containerData]. - ContainerDataProvider call(String containerId) { - return ContainerDataProvider(containerId); - } - - @override - ContainerDataProvider getProviderOverride( - covariant ContainerDataProvider provider, - ) { - return call(provider.containerId); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'containerDataProvider'; -} - -/// See also [containerData]. -class ContainerDataProvider extends AutoDisposeStreamProvider { - /// See also [containerData]. - ContainerDataProvider(String containerId) - : this._internal( - (ref) => containerData(ref as ContainerDataRef, containerId), - from: containerDataProvider, +final class ContainerDataFamily extends $Family + with $FunctionalFamilyOverride, String> { + const ContainerDataFamily._() + : super( + retry: null, name: r'containerDataProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$containerDataHash, - dependencies: ContainerDataFamily._dependencies, - allTransitiveDependencies: - ContainerDataFamily._allTransitiveDependencies, - containerId: containerId, + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, ); - ContainerDataProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.containerId, - }) : super.internal(); - - final String containerId; + ContainerDataProvider call(String containerId) => + ContainerDataProvider._(argument: containerId, from: this); @override - Override overrideWith( - Stream Function(ContainerDataRef provider) create, - ) { - return ProviderOverride( - origin: this, - override: ContainerDataProvider._internal( - (ref) => create(ref as ContainerDataRef), - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - containerId: containerId, - ), - ); + String toString() => r'containerDataProvider'; +} + +@ProviderFor(watchContainerTabId) +const watchContainerTabIdProvider = WatchContainerTabIdFamily._(); + +final class WatchContainerTabIdProvider + extends $FunctionalProvider, String?, Stream> + with $FutureModifier, $StreamProvider { + const WatchContainerTabIdProvider._({ + required WatchContainerTabIdFamily super.from, + required String super.argument, + }) : super( + retry: null, + name: r'watchContainerTabIdProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$watchContainerTabIdHash(); + + @override + String toString() { + return r'watchContainerTabIdProvider' + '' + '($argument)'; } + @$internal @override - AutoDisposeStreamProviderElement createElement() { - return _ContainerDataProviderElement(this); + $StreamProviderElement $createElement($ProviderPointer pointer) => + $StreamProviderElement(pointer); + + @override + Stream create(Ref ref) { + final argument = this.argument as String; + return watchContainerTabId(ref, argument); } @override bool operator ==(Object other) { - return other is ContainerDataProvider && other.containerId == containerId; + return other is WatchContainerTabIdProvider && other.argument == argument; } @override int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, containerId.hashCode); - - return _SystemHash.finish(hash); + return argument.hashCode; } } -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin ContainerDataRef on AutoDisposeStreamProviderRef { - /// The parameter `containerId` of this provider. - String get containerId; -} - -class _ContainerDataProviderElement - extends AutoDisposeStreamProviderElement - with ContainerDataRef { - _ContainerDataProviderElement(super.provider); - - @override - String get containerId => (origin as ContainerDataProvider).containerId; -} - String _$watchContainerTabIdHash() => r'b8f107e462f417b128221240242167a0754f040f'; -/// See also [watchContainerTabId]. -@ProviderFor(watchContainerTabId) -const watchContainerTabIdProvider = WatchContainerTabIdFamily(); - -/// See also [watchContainerTabId]. -class WatchContainerTabIdFamily extends Family> { - /// See also [watchContainerTabId]. - const WatchContainerTabIdFamily(); - - /// See also [watchContainerTabId]. - WatchContainerTabIdProvider call(String tabId) { - return WatchContainerTabIdProvider(tabId); - } - - @override - WatchContainerTabIdProvider getProviderOverride( - covariant WatchContainerTabIdProvider provider, - ) { - return call(provider.tabId); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'watchContainerTabIdProvider'; -} - -/// See also [watchContainerTabId]. -class WatchContainerTabIdProvider extends AutoDisposeStreamProvider { - /// See also [watchContainerTabId]. - WatchContainerTabIdProvider(String tabId) - : this._internal( - (ref) => watchContainerTabId(ref as WatchContainerTabIdRef, tabId), - from: watchContainerTabIdProvider, +final class WatchContainerTabIdFamily extends $Family + with $FunctionalFamilyOverride, String> { + const WatchContainerTabIdFamily._() + : super( + retry: null, name: r'watchContainerTabIdProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$watchContainerTabIdHash, - dependencies: WatchContainerTabIdFamily._dependencies, - allTransitiveDependencies: - WatchContainerTabIdFamily._allTransitiveDependencies, - tabId: tabId, + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, ); - WatchContainerTabIdProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.tabId, - }) : super.internal(); - - final String tabId; + WatchContainerTabIdProvider call(String tabId) => + WatchContainerTabIdProvider._(argument: tabId, from: this); @override - Override overrideWith( - Stream Function(WatchContainerTabIdRef provider) create, - ) { - return ProviderOverride( - origin: this, - override: WatchContainerTabIdProvider._internal( - (ref) => create(ref as WatchContainerTabIdRef), - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - tabId: tabId, - ), - ); - } - - @override - AutoDisposeStreamProviderElement createElement() { - return _WatchContainerTabIdProviderElement(this); - } - - @override - bool operator ==(Object other) { - return other is WatchContainerTabIdProvider && other.tabId == tabId; - } - - @override - int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, tabId.hashCode); - - return _SystemHash.finish(hash); - } + String toString() => r'watchContainerTabIdProvider'; } - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin WatchContainerTabIdRef on AutoDisposeStreamProviderRef { - /// The parameter `tabId` of this provider. - String get tabId; -} - -class _WatchContainerTabIdProviderElement - extends AutoDisposeStreamProviderElement - with WatchContainerTabIdRef { - _WatchContainerTabIdProviderElement(super.provider); - - @override - String get tabId => (origin as WatchContainerTabIdProvider).tabId; -} - -// 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 diff --git a/app/lib/features/geckoview/features/tabs/domain/providers/selected_container.dart b/app/lib/features/geckoview/features/tabs/domain/providers/selected_container.dart index 5f68b1e5..4aca84d1 100644 --- a/app/lib/features/geckoview/features/tabs/domain/providers/selected_container.dart +++ b/app/lib/features/geckoview/features/tabs/domain/providers/selected_container.dart @@ -99,7 +99,7 @@ class SelectedContainer extends _$SelectedContainer { fireImmediately: true, containersWithCountProvider, (previous, next) { - if (stateOrNull != null && next.valueOrNull != null) { + if (stateOrNull != null && next.value != null) { if (!next.value!.any((container) => container.id == state)) { clearContainer(); } diff --git a/app/lib/features/geckoview/features/tabs/domain/providers/selected_container.g.dart b/app/lib/features/geckoview/features/tabs/domain/providers/selected_container.g.dart index f95f1709..b23f8182 100644 --- a/app/lib/features/geckoview/features/tabs/domain/providers/selected_container.g.dart +++ b/app/lib/features/geckoview/features/tabs/domain/providers/selected_container.g.dart @@ -6,59 +6,141 @@ part of 'selected_container.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(SelectedContainer) +const selectedContainerProvider = SelectedContainerProvider._(); + +final class SelectedContainerProvider + extends $NotifierProvider { + const SelectedContainerProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'selectedContainerProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$selectedContainerHash(); + + @$internal + @override + SelectedContainer create() => SelectedContainer(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(String? value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + +String _$selectedContainerHash() => r'9e9a9b5e3c91ff1fbf8544e329524f8e064587fe'; + +abstract class _$SelectedContainer extends $Notifier { + String? build(); + @$mustCallSuper + @override + void runBuild() { + final created = build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + String?, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} + +@ProviderFor(selectedContainerData) +const selectedContainerDataProvider = SelectedContainerDataProvider._(); + +final class SelectedContainerDataProvider + extends + $FunctionalProvider< + AsyncValue, + ContainerData?, + Stream + > + with $FutureModifier, $StreamProvider { + const SelectedContainerDataProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'selectedContainerDataProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$selectedContainerDataHash(); + + @$internal + @override + $StreamProviderElement $createElement( + $ProviderPointer pointer, + ) => $StreamProviderElement(pointer); + + @override + Stream create(Ref ref) { + return selectedContainerData(ref); + } +} + String _$selectedContainerDataHash() => r'1ec86a82e1fc4823a867285f05036c903633a165'; -/// See also [selectedContainerData]. -@ProviderFor(selectedContainerData) -final selectedContainerDataProvider = - AutoDisposeStreamProvider.internal( - selectedContainerData, - name: r'selectedContainerDataProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$selectedContainerDataHash, - dependencies: null, - allTransitiveDependencies: null, - ); +@ProviderFor(selectedContainerTabCount) +const selectedContainerTabCountProvider = SelectedContainerTabCountProvider._(); + +final class SelectedContainerTabCountProvider + extends + $FunctionalProvider, AsyncValue, AsyncValue> + with $Provider> { + const SelectedContainerTabCountProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'selectedContainerTabCountProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$selectedContainerTabCountHash(); + + @$internal + @override + $ProviderElement> $createElement($ProviderPointer pointer) => + $ProviderElement(pointer); + + @override + AsyncValue create(Ref ref) { + return selectedContainerTabCount(ref); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(AsyncValue value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider>(value), + ); + } +} -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef SelectedContainerDataRef = AutoDisposeStreamProviderRef; String _$selectedContainerTabCountHash() => r'0fd457793f7870050f81c54d2fbcc81aca60f394'; - -/// See also [selectedContainerTabCount]. -@ProviderFor(selectedContainerTabCount) -final selectedContainerTabCountProvider = - AutoDisposeProvider>.internal( - selectedContainerTabCount, - name: r'selectedContainerTabCountProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$selectedContainerTabCountHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef SelectedContainerTabCountRef = AutoDisposeProviderRef>; -String _$selectedContainerHash() => r'0441c56a22fd8cab71fec4906d3c22f40553b327'; - -/// See also [SelectedContainer]. -@ProviderFor(SelectedContainer) -final selectedContainerProvider = - NotifierProvider.internal( - SelectedContainer.new, - name: r'selectedContainerProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$selectedContainerHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$SelectedContainer = Notifier; -// 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 diff --git a/app/lib/features/geckoview/features/tabs/domain/repositories/container.dart b/app/lib/features/geckoview/features/tabs/domain/repositories/container.dart index fd07faab..1633b255 100644 --- a/app/lib/features/geckoview/features/tabs/domain/repositories/container.dart +++ b/app/lib/features/geckoview/features/tabs/domain/repositories/container.dart @@ -35,7 +35,11 @@ class ContainerRepository extends _$ContainerRepository { } Future> getAllContainersWithCount() { - return ref.read(tabDatabaseProvider).containersWithCount().get(); + return ref + .read(tabDatabaseProvider) + .definitionsDrift + .containersWithCount() + .get(); } Future replaceContainer(ContainerData container) { diff --git a/app/lib/features/geckoview/features/tabs/domain/repositories/container.g.dart b/app/lib/features/geckoview/features/tabs/domain/repositories/container.g.dart index 8f75b964..541af910 100644 --- a/app/lib/features/geckoview/features/tabs/domain/repositories/container.g.dart +++ b/app/lib/features/geckoview/features/tabs/domain/repositories/container.g.dart @@ -6,22 +6,59 @@ part of 'container.dart'; // RiverpodGenerator // ************************************************************************** -String _$containerRepositoryHash() => - r'af4ccf6cc12eebae2313df6c8f9ca63db842ffe5'; +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning -/// See also [ContainerRepository]. @ProviderFor(ContainerRepository) -final containerRepositoryProvider = - NotifierProvider.internal( - ContainerRepository.new, - name: r'containerRepositoryProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$containerRepositoryHash, - dependencies: null, - allTransitiveDependencies: null, - ); +const containerRepositoryProvider = ContainerRepositoryProvider._(); -typedef _$ContainerRepository = Notifier; -// 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 ContainerRepositoryProvider + extends $NotifierProvider { + const ContainerRepositoryProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'containerRepositoryProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$containerRepositoryHash(); + + @$internal + @override + ContainerRepository create() => ContainerRepository(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(void value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + +String _$containerRepositoryHash() => + r'6d84d672e24ac3d2cb376e93cbbe61fc223d89b3'; + +abstract class _$ContainerRepository extends $Notifier { + void build(); + @$mustCallSuper + @override + void runBuild() { + build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + void, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} diff --git a/app/lib/features/geckoview/features/tabs/domain/repositories/gecko_inference.g.dart b/app/lib/features/geckoview/features/tabs/domain/repositories/gecko_inference.g.dart index aea1ca37..6e3f7f2d 100644 --- a/app/lib/features/geckoview/features/tabs/domain/repositories/gecko_inference.g.dart +++ b/app/lib/features/geckoview/features/tabs/domain/repositories/gecko_inference.g.dart @@ -6,291 +6,205 @@ part of 'gecko_inference.dart'; // RiverpodGenerator // ************************************************************************** -String _$containerTopicHash() => r'b680381eab3dded9ca6f174fbcc5da5c59d7e9f0'; +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning -/// Copied from Dart SDK -class _SystemHash { - _SystemHash._(); +@ProviderFor(GeckoInferenceRepository) +const geckoInferenceRepositoryProvider = GeckoInferenceRepositoryProvider._(); - static int combine(int hash, int value) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + value); - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10)); - return hash ^ (hash >> 6); - } - - static int finish(int hash) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); - // ignore: parameter_assignments - hash = hash ^ (hash >> 11); - return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); - } -} - -/// See also [containerTopic]. -@ProviderFor(containerTopic) -const containerTopicProvider = ContainerTopicFamily(); - -/// See also [containerTopic]. -class ContainerTopicFamily extends Family> { - /// See also [containerTopic]. - const ContainerTopicFamily(); - - /// See also [containerTopic]. - ContainerTopicProvider call(String containerId) { - return ContainerTopicProvider(containerId); - } - - @override - ContainerTopicProvider getProviderOverride( - covariant ContainerTopicProvider provider, - ) { - return call(provider.containerId); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'containerTopicProvider'; -} - -/// See also [containerTopic]. -class ContainerTopicProvider extends FutureProvider { - /// See also [containerTopic]. - ContainerTopicProvider(String containerId) - : this._internal( - (ref) => containerTopic(ref as ContainerTopicRef, containerId), - from: containerTopicProvider, - name: r'containerTopicProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$containerTopicHash, - dependencies: ContainerTopicFamily._dependencies, - allTransitiveDependencies: - ContainerTopicFamily._allTransitiveDependencies, - containerId: containerId, +final class GeckoInferenceRepositoryProvider + extends $NotifierProvider { + const GeckoInferenceRepositoryProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'geckoInferenceRepositoryProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, ); - ContainerTopicProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.containerId, - }) : super.internal(); - - final String containerId; - @override - Override overrideWith( - FutureOr Function(ContainerTopicRef provider) create, - ) { - return ProviderOverride( + String debugGetCreateSourceHash() => _$geckoInferenceRepositoryHash(); + + @$internal + @override + GeckoInferenceRepository create() => GeckoInferenceRepository(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(void value) { + return $ProviderOverride( origin: this, - override: ContainerTopicProvider._internal( - (ref) => create(ref as ContainerTopicRef), - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - containerId: containerId, - ), + providerOverride: $SyncValueProvider(value), ); } - - @override - FutureProviderElement createElement() { - return _ContainerTopicProviderElement(this); - } - - @override - bool operator ==(Object other) { - return other is ContainerTopicProvider && other.containerId == containerId; - } - - @override - int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, containerId.hashCode); - - return _SystemHash.finish(hash); - } -} - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin ContainerTopicRef on FutureProviderRef { - /// The parameter `containerId` of this provider. - String get containerId; -} - -class _ContainerTopicProviderElement extends FutureProviderElement - with ContainerTopicRef { - _ContainerTopicProviderElement(super.provider); - - @override - String get containerId => (origin as ContainerTopicProvider).containerId; -} - -String _$containerTabSuggestionsHash() => - r'ab8e596f0c7e8562bf998c701145e48eb1e520d5'; - -/// See also [containerTabSuggestions]. -@ProviderFor(containerTabSuggestions) -const containerTabSuggestionsProvider = ContainerTabSuggestionsFamily(); - -/// See also [containerTabSuggestions]. -class ContainerTabSuggestionsFamily extends Family?>> { - /// See also [containerTabSuggestions]. - const ContainerTabSuggestionsFamily(); - - /// See also [containerTabSuggestions]. - ContainerTabSuggestionsProvider call(String? containerId) { - return ContainerTabSuggestionsProvider(containerId); - } - - @override - ContainerTabSuggestionsProvider getProviderOverride( - covariant ContainerTabSuggestionsProvider provider, - ) { - return call(provider.containerId); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'containerTabSuggestionsProvider'; -} - -/// See also [containerTabSuggestions]. -class ContainerTabSuggestionsProvider - extends AutoDisposeFutureProvider?> { - /// See also [containerTabSuggestions]. - ContainerTabSuggestionsProvider(String? containerId) - : this._internal( - (ref) => containerTabSuggestions( - ref as ContainerTabSuggestionsRef, - containerId, - ), - from: containerTabSuggestionsProvider, - name: r'containerTabSuggestionsProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$containerTabSuggestionsHash, - dependencies: ContainerTabSuggestionsFamily._dependencies, - allTransitiveDependencies: - ContainerTabSuggestionsFamily._allTransitiveDependencies, - containerId: containerId, - ); - - ContainerTabSuggestionsProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.containerId, - }) : super.internal(); - - final String? containerId; - - @override - Override overrideWith( - FutureOr?> Function(ContainerTabSuggestionsRef provider) - create, - ) { - return ProviderOverride( - origin: this, - override: ContainerTabSuggestionsProvider._internal( - (ref) => create(ref as ContainerTabSuggestionsRef), - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - containerId: containerId, - ), - ); - } - - @override - AutoDisposeFutureProviderElement?> createElement() { - return _ContainerTabSuggestionsProviderElement(this); - } - - @override - bool operator ==(Object other) { - return other is ContainerTabSuggestionsProvider && - other.containerId == containerId; - } - - @override - int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, containerId.hashCode); - - return _SystemHash.finish(hash); - } -} - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin ContainerTabSuggestionsRef - on AutoDisposeFutureProviderRef?> { - /// The parameter `containerId` of this provider. - String? get containerId; -} - -class _ContainerTabSuggestionsProviderElement - extends AutoDisposeFutureProviderElement?> - with ContainerTabSuggestionsRef { - _ContainerTabSuggestionsProviderElement(super.provider); - - @override - String? get containerId => - (origin as ContainerTabSuggestionsProvider).containerId; } String _$geckoInferenceRepositoryHash() => r'6099998a3f49fc4faf650878ab4afd6268c593e2'; -/// See also [GeckoInferenceRepository]. -@ProviderFor(GeckoInferenceRepository) -final geckoInferenceRepositoryProvider = - NotifierProvider.internal( - GeckoInferenceRepository.new, - name: r'geckoInferenceRepositoryProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$geckoInferenceRepositoryHash, - dependencies: null, - allTransitiveDependencies: null, - ); +abstract class _$GeckoInferenceRepository extends $Notifier { + void build(); + @$mustCallSuper + @override + void runBuild() { + build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + void, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} -typedef _$GeckoInferenceRepository = Notifier; -// 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 +@ProviderFor(containerTopic) +const containerTopicProvider = ContainerTopicFamily._(); + +final class ContainerTopicProvider + extends $FunctionalProvider, String?, FutureOr> + with $FutureModifier, $FutureProvider { + const ContainerTopicProvider._({ + required ContainerTopicFamily super.from, + required String super.argument, + }) : super( + retry: null, + name: r'containerTopicProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$containerTopicHash(); + + @override + String toString() { + return r'containerTopicProvider' + '' + '($argument)'; + } + + @$internal + @override + $FutureProviderElement $createElement($ProviderPointer pointer) => + $FutureProviderElement(pointer); + + @override + FutureOr create(Ref ref) { + final argument = this.argument as String; + return containerTopic(ref, argument); + } + + @override + bool operator ==(Object other) { + return other is ContainerTopicProvider && other.argument == argument; + } + + @override + int get hashCode { + return argument.hashCode; + } +} + +String _$containerTopicHash() => r'b680381eab3dded9ca6f174fbcc5da5c59d7e9f0'; + +final class ContainerTopicFamily extends $Family + with $FunctionalFamilyOverride, String> { + const ContainerTopicFamily._() + : super( + retry: null, + name: r'containerTopicProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: false, + ); + + ContainerTopicProvider call(String containerId) => + ContainerTopicProvider._(argument: containerId, from: this); + + @override + String toString() => r'containerTopicProvider'; +} + +@ProviderFor(containerTabSuggestions) +const containerTabSuggestionsProvider = ContainerTabSuggestionsFamily._(); + +final class ContainerTabSuggestionsProvider + extends + $FunctionalProvider< + AsyncValue?>, + List?, + FutureOr?> + > + with $FutureModifier?>, $FutureProvider?> { + const ContainerTabSuggestionsProvider._({ + required ContainerTabSuggestionsFamily super.from, + required String? super.argument, + }) : super( + retry: null, + name: r'containerTabSuggestionsProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$containerTabSuggestionsHash(); + + @override + String toString() { + return r'containerTabSuggestionsProvider' + '' + '($argument)'; + } + + @$internal + @override + $FutureProviderElement?> $createElement( + $ProviderPointer pointer, + ) => $FutureProviderElement(pointer); + + @override + FutureOr?> create(Ref ref) { + final argument = this.argument as String?; + return containerTabSuggestions(ref, argument); + } + + @override + bool operator ==(Object other) { + return other is ContainerTabSuggestionsProvider && + other.argument == argument; + } + + @override + int get hashCode { + return argument.hashCode; + } +} + +String _$containerTabSuggestionsHash() => + r'ab8e596f0c7e8562bf998c701145e48eb1e520d5'; + +final class ContainerTabSuggestionsFamily extends $Family + with $FunctionalFamilyOverride?>, String?> { + const ContainerTabSuggestionsFamily._() + : super( + retry: null, + name: r'containerTabSuggestionsProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, + ); + + ContainerTabSuggestionsProvider call(String? containerId) => + ContainerTabSuggestionsProvider._(argument: containerId, from: this); + + @override + String toString() => r'containerTabSuggestionsProvider'; +} diff --git a/app/lib/features/geckoview/features/tabs/domain/repositories/tab.g.dart b/app/lib/features/geckoview/features/tabs/domain/repositories/tab.g.dart index 7b521975..9851229c 100644 --- a/app/lib/features/geckoview/features/tabs/domain/repositories/tab.g.dart +++ b/app/lib/features/geckoview/features/tabs/domain/repositories/tab.g.dart @@ -6,21 +6,58 @@ part of 'tab.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(TabDataRepository) +const tabDataRepositoryProvider = TabDataRepositoryProvider._(); + +final class TabDataRepositoryProvider + extends $NotifierProvider { + const TabDataRepositoryProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'tabDataRepositoryProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$tabDataRepositoryHash(); + + @$internal + @override + TabDataRepository create() => TabDataRepository(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(void value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + String _$tabDataRepositoryHash() => r'295c1718ecf41202709517fb2c5b31527e885dfa'; -/// See also [TabDataRepository]. -@ProviderFor(TabDataRepository) -final tabDataRepositoryProvider = - NotifierProvider.internal( - TabDataRepository.new, - name: r'tabDataRepositoryProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$tabDataRepositoryHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$TabDataRepository = Notifier; -// 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 +abstract class _$TabDataRepository extends $Notifier { + void build(); + @$mustCallSuper + @override + void runBuild() { + build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + void, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} diff --git a/app/lib/features/geckoview/features/tabs/domain/repositories/tab_search.g.dart b/app/lib/features/geckoview/features/tabs/domain/repositories/tab_search.g.dart index a2dde486..3152a511 100644 --- a/app/lib/features/geckoview/features/tabs/domain/repositories/tab_search.g.dart +++ b/app/lib/features/geckoview/features/tabs/domain/repositories/tab_search.g.dart @@ -6,184 +6,111 @@ part of 'tab_search.dart'; // RiverpodGenerator // ************************************************************************** -String _$tabSearchRepositoryHash() => - r'ac2381c692b9caf93f26f302d15e0160c098917a'; +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning -/// Copied from Dart SDK -class _SystemHash { - _SystemHash._(); - - static int combine(int hash, int value) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + value); - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10)); - return hash ^ (hash >> 6); - } - - static int finish(int hash) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); - // ignore: parameter_assignments - hash = hash ^ (hash >> 11); - return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); - } -} - -abstract class _$TabSearchRepository - extends - BuildlessAutoDisposeAsyncNotifier< - ({String query, List results})? - > { - late final TabSearchPartition partition; - - FutureOr<({String query, List results})?> build( - TabSearchPartition partition, - ); -} - -/// See also [TabSearchRepository]. @ProviderFor(TabSearchRepository) -const tabSearchRepositoryProvider = TabSearchRepositoryFamily(); +const tabSearchRepositoryProvider = TabSearchRepositoryFamily._(); -/// See also [TabSearchRepository]. -class TabSearchRepositoryFamily +final class TabSearchRepositoryProvider extends - Family results})?>> { - /// See also [TabSearchRepository]. - const TabSearchRepositoryFamily(); - - /// See also [TabSearchRepository]. - TabSearchRepositoryProvider call(TabSearchPartition partition) { - return TabSearchRepositoryProvider(partition); - } - - @override - TabSearchRepositoryProvider getProviderOverride( - covariant TabSearchRepositoryProvider provider, - ) { - return call(provider.partition); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'tabSearchRepositoryProvider'; -} - -/// See also [TabSearchRepository]. -class TabSearchRepositoryProvider - extends - AutoDisposeAsyncNotifierProviderImpl< + $AsyncNotifierProvider< TabSearchRepository, ({String query, List results})? > { - /// See also [TabSearchRepository]. - TabSearchRepositoryProvider(TabSearchPartition partition) - : this._internal( - () => TabSearchRepository()..partition = partition, - from: tabSearchRepositoryProvider, - name: r'tabSearchRepositoryProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$tabSearchRepositoryHash, - dependencies: TabSearchRepositoryFamily._dependencies, - allTransitiveDependencies: - TabSearchRepositoryFamily._allTransitiveDependencies, - partition: partition, - ); - - TabSearchRepositoryProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.partition, - }) : super.internal(); - - final TabSearchPartition partition; + const TabSearchRepositoryProvider._({ + required TabSearchRepositoryFamily super.from, + required TabSearchPartition super.argument, + }) : super( + retry: null, + name: r'tabSearchRepositoryProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); @override - FutureOr<({String query, List results})?> runNotifierBuild( - covariant TabSearchRepository notifier, - ) { - return notifier.build(partition); - } + String debugGetCreateSourceHash() => _$tabSearchRepositoryHash(); @override - Override overrideWith(TabSearchRepository Function() create) { - return ProviderOverride( - origin: this, - override: TabSearchRepositoryProvider._internal( - () => create()..partition = partition, - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - partition: partition, - ), - ); + String toString() { + return r'tabSearchRepositoryProvider' + '' + '($argument)'; } + @$internal @override - AutoDisposeAsyncNotifierProviderElement< - TabSearchRepository, - ({String query, List results})? - > - createElement() { - return _TabSearchRepositoryProviderElement(this); - } + TabSearchRepository create() => TabSearchRepository(); @override bool operator ==(Object other) { - return other is TabSearchRepositoryProvider && other.partition == partition; + return other is TabSearchRepositoryProvider && other.argument == argument; } @override int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, partition.hashCode); - - return _SystemHash.finish(hash); + return argument.hashCode; } } -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin TabSearchRepositoryRef - on - AutoDisposeAsyncNotifierProviderRef< - ({String query, List results})? - > { - /// The parameter `partition` of this provider. - TabSearchPartition get partition; -} +String _$tabSearchRepositoryHash() => + r'ac2381c692b9caf93f26f302d15e0160c098917a'; -class _TabSearchRepositoryProviderElement - extends - AutoDisposeAsyncNotifierProviderElement< +final class TabSearchRepositoryFamily extends $Family + with + $ClassFamilyOverride< TabSearchRepository, - ({String query, List results})? - > - with TabSearchRepositoryRef { - _TabSearchRepositoryProviderElement(super.provider); + AsyncValue<({String query, List results})?>, + ({String query, List results})?, + FutureOr<({String query, List results})?>, + TabSearchPartition + > { + const TabSearchRepositoryFamily._() + : super( + retry: null, + name: r'tabSearchRepositoryProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, + ); + + TabSearchRepositoryProvider call(TabSearchPartition partition) => + TabSearchRepositoryProvider._(argument: partition, from: this); @override - TabSearchPartition get partition => - (origin as TabSearchRepositoryProvider).partition; + String toString() => r'tabSearchRepositoryProvider'; } -// 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 +abstract class _$TabSearchRepository + extends $AsyncNotifier<({String query, List results})?> { + late final _$args = ref.$arg as TabSearchPartition; + TabSearchPartition get partition => _$args; + + FutureOr<({String query, List results})?> build( + TabSearchPartition partition, + ); + @$mustCallSuper + @override + void runBuild() { + final created = build(_$args); + final ref = + this.ref + as $Ref< + AsyncValue<({String query, List results})?>, + ({String query, List results})? + >; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier< + AsyncValue<({String query, List results})?>, + ({String query, List results})? + >, + AsyncValue<({String query, List results})?>, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} diff --git a/app/lib/features/geckoview/features/tabs/presentation/controllers/container_topic.dart b/app/lib/features/geckoview/features/tabs/presentation/controllers/container_topic.dart index 122c97a3..551bf274 100644 --- a/app/lib/features/geckoview/features/tabs/presentation/controllers/container_topic.dart +++ b/app/lib/features/geckoview/features/tabs/presentation/controllers/container_topic.dart @@ -32,7 +32,7 @@ class ContainerTopicController extends _$ContainerTopicController { }); state = result; - return result.valueOrNull; + return result.value; } @override diff --git a/app/lib/features/geckoview/features/tabs/presentation/controllers/container_topic.g.dart b/app/lib/features/geckoview/features/tabs/presentation/controllers/container_topic.g.dart index bcea1e61..0d08d69e 100644 --- a/app/lib/features/geckoview/features/tabs/presentation/controllers/container_topic.g.dart +++ b/app/lib/features/geckoview/features/tabs/presentation/controllers/container_topic.g.dart @@ -6,25 +6,59 @@ part of 'container_topic.dart'; // RiverpodGenerator // ************************************************************************** -String _$containerTopicControllerHash() => - r'fa38ebd3c1352b471e58444b04d1cb0528aae1dd'; +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning -/// See also [ContainerTopicController]. @ProviderFor(ContainerTopicController) -final containerTopicControllerProvider = - AutoDisposeNotifierProvider< - ContainerTopicController, - AsyncValue - >.internal( - ContainerTopicController.new, - name: r'containerTopicControllerProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$containerTopicControllerHash, - dependencies: null, - allTransitiveDependencies: null, - ); +const containerTopicControllerProvider = ContainerTopicControllerProvider._(); -typedef _$ContainerTopicController = AutoDisposeNotifier>; -// 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 ContainerTopicControllerProvider + extends $NotifierProvider> { + const ContainerTopicControllerProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'containerTopicControllerProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$containerTopicControllerHash(); + + @$internal + @override + ContainerTopicController create() => ContainerTopicController(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(AsyncValue value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider>(value), + ); + } +} + +String _$containerTopicControllerHash() => + r'e89fbdaaa9106f163ff00a829eb40752dd4af63a'; + +abstract class _$ContainerTopicController extends $Notifier> { + AsyncValue build(); + @$mustCallSuper + @override + void runBuild() { + final created = build(); + final ref = this.ref as $Ref, AsyncValue>; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, AsyncValue>, + AsyncValue, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} diff --git a/app/lib/features/geckoview/features/tabs/presentation/widgets/container_chips.dart b/app/lib/features/geckoview/features/tabs/presentation/widgets/container_chips.dart index 1f5030a0..b3f65e14 100644 --- a/app/lib/features/geckoview/features/tabs/presentation/widgets/container_chips.dart +++ b/app/lib/features/geckoview/features/tabs/presentation/widgets/container_chips.dart @@ -110,7 +110,7 @@ class ContainerChips extends HookConsumerWidget { containerTabCountProvider( // ignore: provider_parameters ContainerFilterById(containerId: null), - ).select((value) => value.valueOrNull ?? 0), + ).select((value) => value.value ?? 0), ); return FilterChip( diff --git a/app/lib/features/geckoview/features/tabs/presentation/widgets/container_title.dart b/app/lib/features/geckoview/features/tabs/presentation/widgets/container_title.dart index 3fb9dd00..f1a1fbb8 100644 --- a/app/lib/features/geckoview/features/tabs/presentation/widgets/container_title.dart +++ b/app/lib/features/geckoview/features/tabs/presentation/widgets/container_title.dart @@ -44,7 +44,7 @@ class ContainerTitle extends HookConsumerWidget { containerTabCountProvider( // ignore: provider_parameters ContainerFilterById(containerId: container.id), - ).select((value) => (value.valueOrNull ?? 0) > 0), + ).select((value) => (value.value ?? 0) > 0), ); return topicAsync.when( @@ -73,8 +73,7 @@ class ContainerTitle extends HookConsumerWidget { return const Text('Untitled'); }, - loading: () => - Skeletonizer(child: Text(topicAsync.valueOrNull ?? 'container')), + loading: () => Skeletonizer(child: Text(topicAsync.value ?? 'container')), ); } } diff --git a/app/lib/features/onboarding/presentation/pages/default_search.dart b/app/lib/features/onboarding/presentation/pages/default_search.dart index 521fa205..1e9e03ee 100644 --- a/app/lib/features/onboarding/presentation/pages/default_search.dart +++ b/app/lib/features/onboarding/presentation/pages/default_search.dart @@ -42,7 +42,7 @@ class DefaultSearchPage extends HookConsumerWidget { final bangs = ref.watch(bangListProvider(triggers: defaultBangs)); final activeBang = ref.watch( - defaultSearchBangDataProvider.select((value) => value.valueOrNull), + defaultSearchBangDataProvider.select((value) => value.value), ); final activeAutosuggest = ref.watch( generalSettingsWithDefaultsProvider.select( diff --git a/app/lib/features/search/domain/autosuggest/brave.g.dart b/app/lib/features/search/domain/autosuggest/brave.g.dart index 070f8b8a..22428a22 100644 --- a/app/lib/features/search/domain/autosuggest/brave.g.dart +++ b/app/lib/features/search/domain/autosuggest/brave.g.dart @@ -6,22 +6,59 @@ part of 'brave.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(BraveAutosuggestService) +const braveAutosuggestServiceProvider = BraveAutosuggestServiceProvider._(); + +final class BraveAutosuggestServiceProvider + extends $NotifierProvider { + const BraveAutosuggestServiceProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'braveAutosuggestServiceProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$braveAutosuggestServiceHash(); + + @$internal + @override + BraveAutosuggestService create() => BraveAutosuggestService(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(void value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + String _$braveAutosuggestServiceHash() => r'3b2f465dcf4b44b0450975d3909fc7066d171bf2'; -/// See also [BraveAutosuggestService]. -@ProviderFor(BraveAutosuggestService) -final braveAutosuggestServiceProvider = - NotifierProvider.internal( - BraveAutosuggestService.new, - name: r'braveAutosuggestServiceProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$braveAutosuggestServiceHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$BraveAutosuggestService = Notifier; -// 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 +abstract class _$BraveAutosuggestService extends $Notifier { + void build(); + @$mustCallSuper + @override + void runBuild() { + build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + void, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} diff --git a/app/lib/features/search/domain/autosuggest/duckduckgo.g.dart b/app/lib/features/search/domain/autosuggest/duckduckgo.g.dart index 45f09844..0f630d41 100644 --- a/app/lib/features/search/domain/autosuggest/duckduckgo.g.dart +++ b/app/lib/features/search/domain/autosuggest/duckduckgo.g.dart @@ -6,22 +6,60 @@ part of 'duckduckgo.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(DuckDuckGoAutosuggestService) +const duckDuckGoAutosuggestServiceProvider = + DuckDuckGoAutosuggestServiceProvider._(); + +final class DuckDuckGoAutosuggestServiceProvider + extends $NotifierProvider { + const DuckDuckGoAutosuggestServiceProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'duckDuckGoAutosuggestServiceProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$duckDuckGoAutosuggestServiceHash(); + + @$internal + @override + DuckDuckGoAutosuggestService create() => DuckDuckGoAutosuggestService(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(void value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + String _$duckDuckGoAutosuggestServiceHash() => r'd9f30a577b276049b252be890bc73eb18aa118f2'; -/// See also [DuckDuckGoAutosuggestService]. -@ProviderFor(DuckDuckGoAutosuggestService) -final duckDuckGoAutosuggestServiceProvider = - NotifierProvider.internal( - DuckDuckGoAutosuggestService.new, - name: r'duckDuckGoAutosuggestServiceProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$duckDuckGoAutosuggestServiceHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$DuckDuckGoAutosuggestService = Notifier; -// 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 +abstract class _$DuckDuckGoAutosuggestService extends $Notifier { + void build(); + @$mustCallSuper + @override + void runBuild() { + build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + void, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} diff --git a/app/lib/features/search/domain/autosuggest/empty.g.dart b/app/lib/features/search/domain/autosuggest/empty.g.dart index 8aee4d5c..1db826f5 100644 --- a/app/lib/features/search/domain/autosuggest/empty.g.dart +++ b/app/lib/features/search/domain/autosuggest/empty.g.dart @@ -6,22 +6,59 @@ part of 'empty.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(EmptyAutosuggestService) +const emptyAutosuggestServiceProvider = EmptyAutosuggestServiceProvider._(); + +final class EmptyAutosuggestServiceProvider + extends $NotifierProvider { + const EmptyAutosuggestServiceProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'emptyAutosuggestServiceProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$emptyAutosuggestServiceHash(); + + @$internal + @override + EmptyAutosuggestService create() => EmptyAutosuggestService(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(void value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + String _$emptyAutosuggestServiceHash() => r'7fbe81807baf379cf621ef46fba00e46778978f8'; -/// See also [EmptyAutosuggestService]. -@ProviderFor(EmptyAutosuggestService) -final emptyAutosuggestServiceProvider = - NotifierProvider.internal( - EmptyAutosuggestService.new, - name: r'emptyAutosuggestServiceProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$emptyAutosuggestServiceHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$EmptyAutosuggestService = Notifier; -// 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 +abstract class _$EmptyAutosuggestService extends $Notifier { + void build(); + @$mustCallSuper + @override + void runBuild() { + build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + void, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} diff --git a/app/lib/features/search/domain/autosuggest/kagi.g.dart b/app/lib/features/search/domain/autosuggest/kagi.g.dart index 4d3cfb10..b68b2e00 100644 --- a/app/lib/features/search/domain/autosuggest/kagi.g.dart +++ b/app/lib/features/search/domain/autosuggest/kagi.g.dart @@ -6,22 +6,59 @@ part of 'kagi.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(KagiAutosuggestService) +const kagiAutosuggestServiceProvider = KagiAutosuggestServiceProvider._(); + +final class KagiAutosuggestServiceProvider + extends $NotifierProvider { + const KagiAutosuggestServiceProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'kagiAutosuggestServiceProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$kagiAutosuggestServiceHash(); + + @$internal + @override + KagiAutosuggestService create() => KagiAutosuggestService(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(void value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + String _$kagiAutosuggestServiceHash() => r'039fe84dd480316eab38c80b41e16d16d6c14a7c'; -/// See also [KagiAutosuggestService]. -@ProviderFor(KagiAutosuggestService) -final kagiAutosuggestServiceProvider = - NotifierProvider.internal( - KagiAutosuggestService.new, - name: r'kagiAutosuggestServiceProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$kagiAutosuggestServiceHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$KagiAutosuggestService = Notifier; -// 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 +abstract class _$KagiAutosuggestService extends $Notifier { + void build(); + @$mustCallSuper + @override + void runBuild() { + build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + void, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} diff --git a/app/lib/features/search/domain/autosuggest/qwant.g.dart b/app/lib/features/search/domain/autosuggest/qwant.g.dart index c81c1bac..74355e62 100644 --- a/app/lib/features/search/domain/autosuggest/qwant.g.dart +++ b/app/lib/features/search/domain/autosuggest/qwant.g.dart @@ -6,22 +6,59 @@ part of 'qwant.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(QwantAutosuggestService) +const qwantAutosuggestServiceProvider = QwantAutosuggestServiceProvider._(); + +final class QwantAutosuggestServiceProvider + extends $NotifierProvider { + const QwantAutosuggestServiceProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'qwantAutosuggestServiceProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$qwantAutosuggestServiceHash(); + + @$internal + @override + QwantAutosuggestService create() => QwantAutosuggestService(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(void value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + String _$qwantAutosuggestServiceHash() => r'a942cd073289d20d43647de5c0f43fb08790045f'; -/// See also [QwantAutosuggestService]. -@ProviderFor(QwantAutosuggestService) -final qwantAutosuggestServiceProvider = - NotifierProvider.internal( - QwantAutosuggestService.new, - name: r'qwantAutosuggestServiceProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$qwantAutosuggestServiceHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$QwantAutosuggestService = Notifier; -// 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 +abstract class _$QwantAutosuggestService extends $Notifier { + void build(); + @$mustCallSuper + @override + void runBuild() { + build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + void, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} diff --git a/app/lib/features/settings/presentation/controllers/save_settings.g.dart b/app/lib/features/settings/presentation/controllers/save_settings.g.dart index b4eb8750..dac32e82 100644 --- a/app/lib/features/settings/presentation/controllers/save_settings.g.dart +++ b/app/lib/features/settings/presentation/controllers/save_settings.g.dart @@ -6,56 +6,145 @@ part of 'save_settings.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(SaveGeneralSettingsController) +const saveGeneralSettingsControllerProvider = + SaveGeneralSettingsControllerProvider._(); + +final class SaveGeneralSettingsControllerProvider + extends $AsyncNotifierProvider { + const SaveGeneralSettingsControllerProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'saveGeneralSettingsControllerProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$saveGeneralSettingsControllerHash(); + + @$internal + @override + SaveGeneralSettingsController create() => SaveGeneralSettingsController(); +} + String _$saveGeneralSettingsControllerHash() => r'b75c9c52452a9cb687f69dad1523f1ed5205847e'; -/// See also [SaveGeneralSettingsController]. -@ProviderFor(SaveGeneralSettingsController) -final saveGeneralSettingsControllerProvider = - AsyncNotifierProvider.internal( - SaveGeneralSettingsController.new, - name: r'saveGeneralSettingsControllerProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$saveGeneralSettingsControllerHash, - dependencies: null, - allTransitiveDependencies: null, - ); +abstract class _$SaveGeneralSettingsController extends $AsyncNotifier { + FutureOr build(); + @$mustCallSuper + @override + void runBuild() { + build(); + final ref = this.ref as $Ref, void>; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, void>, + AsyncValue, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} + +@ProviderFor(SaveEngineSettingsController) +const saveEngineSettingsControllerProvider = + SaveEngineSettingsControllerProvider._(); + +final class SaveEngineSettingsControllerProvider + extends $AsyncNotifierProvider { + const SaveEngineSettingsControllerProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'saveEngineSettingsControllerProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$saveEngineSettingsControllerHash(); + + @$internal + @override + SaveEngineSettingsController create() => SaveEngineSettingsController(); +} -typedef _$SaveGeneralSettingsController = AsyncNotifier; String _$saveEngineSettingsControllerHash() => r'd3d74a6aadc89532b1d81c424d92efbfa43002d5'; -/// See also [SaveEngineSettingsController]. -@ProviderFor(SaveEngineSettingsController) -final saveEngineSettingsControllerProvider = - AsyncNotifierProvider.internal( - SaveEngineSettingsController.new, - name: r'saveEngineSettingsControllerProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$saveEngineSettingsControllerHash, - dependencies: null, - allTransitiveDependencies: null, - ); +abstract class _$SaveEngineSettingsController extends $AsyncNotifier { + FutureOr build(); + @$mustCallSuper + @override + void runBuild() { + build(); + final ref = this.ref as $Ref, void>; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, void>, + AsyncValue, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} + +@ProviderFor(SaveTorSettingsController) +const saveTorSettingsControllerProvider = SaveTorSettingsControllerProvider._(); + +final class SaveTorSettingsControllerProvider + extends $AsyncNotifierProvider { + const SaveTorSettingsControllerProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'saveTorSettingsControllerProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$saveTorSettingsControllerHash(); + + @$internal + @override + SaveTorSettingsController create() => SaveTorSettingsController(); +} -typedef _$SaveEngineSettingsController = AsyncNotifier; String _$saveTorSettingsControllerHash() => r'd8aa04d7ae60c97bdad6c072f894189509dd35d3'; -/// See also [SaveTorSettingsController]. -@ProviderFor(SaveTorSettingsController) -final saveTorSettingsControllerProvider = - AsyncNotifierProvider.internal( - SaveTorSettingsController.new, - name: r'saveTorSettingsControllerProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$saveTorSettingsControllerHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$SaveTorSettingsController = AsyncNotifier; -// 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 +abstract class _$SaveTorSettingsController extends $AsyncNotifier { + FutureOr build(); + @$mustCallSuper + @override + void runBuild() { + build(); + final ref = this.ref as $Ref, void>; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, void>, + AsyncValue, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} diff --git a/app/lib/features/settings/presentation/screens/general_settings.dart b/app/lib/features/settings/presentation/screens/general_settings.dart index 831248d0..5ecfafeb 100644 --- a/app/lib/features/settings/presentation/screens/general_settings.dart +++ b/app/lib/features/settings/presentation/screens/general_settings.dart @@ -457,7 +457,7 @@ class GeneralSettingsScreen extends HookConsumerWidget { builder: (context, ref, child) { final size = ref.watch( iconCacheSizeMegabytesProvider.select( - (value) => value.valueOrNull, + (value) => value.value, ), ); diff --git a/app/lib/features/settings/presentation/screens/web_engine_hardening.dart b/app/lib/features/settings/presentation/screens/web_engine_hardening.dart index baba5cda..75d7dbcf 100644 --- a/app/lib/features/settings/presentation/screens/web_engine_hardening.dart +++ b/app/lib/features/settings/presentation/screens/web_engine_hardening.dart @@ -39,11 +39,11 @@ class WebEngineHardeningScreen extends HookConsumerWidget { final allGroupsActive = useMemoized( () => - preferenceGroups.valueOrNull?.values.every( + preferenceGroups.value?.values.every( (element) => element.isActiveOrOptional, ) ?? false, - [EquatableValue(preferenceGroups.valueOrNull)], + [EquatableValue(preferenceGroups.value)], ); final theme = Theme.of(context); diff --git a/app/lib/features/settings/presentation/widgets/bang_group_list_tile.dart b/app/lib/features/settings/presentation/widgets/bang_group_list_tile.dart index 3c5a8fa9..0accd2ca 100644 --- a/app/lib/features/settings/presentation/widgets/bang_group_list_tile.dart +++ b/app/lib/features/settings/presentation/widgets/bang_group_list_tile.dart @@ -41,11 +41,11 @@ class BangGroupListTile extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final lastSync = ref.watch( - lastSyncOfGroupProvider(group).select((value) => value.valueOrNull), + lastSyncOfGroupProvider(group).select((value) => value.value), ); final count = ref.watch( - bangCountOfGroupProvider(group).select((value) => value.valueOrNull), + bangCountOfGroupProvider(group).select((value) => value.value), ); return CustomListTile( diff --git a/app/lib/features/settings/presentation/widgets/bang_icon.dart b/app/lib/features/settings/presentation/widgets/bang_icon.dart index 0d745eba..8693adf7 100644 --- a/app/lib/features/settings/presentation/widgets/bang_icon.dart +++ b/app/lib/features/settings/presentation/widgets/bang_icon.dart @@ -31,7 +31,7 @@ class BangIcon extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final bang = ref.watch( - bangDataProvider(trigger).select((value) => value.valueOrNull), + bangDataProvider(trigger).select((value) => value.value), ); return UrlIcon([ diff --git a/app/lib/features/settings/presentation/widgets/default_search_selector.dart b/app/lib/features/settings/presentation/widgets/default_search_selector.dart index 3160ddda..219582c1 100644 --- a/app/lib/features/settings/presentation/widgets/default_search_selector.dart +++ b/app/lib/features/settings/presentation/widgets/default_search_selector.dart @@ -32,7 +32,7 @@ class DefaultSearchSelector extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final activeBang = ref.watch( - defaultSearchBangDataProvider.select((value) => value.valueOrNull), + defaultSearchBangDataProvider.select((value) => value.value), ); final availableBangs = ref.watch(frequentBangListProvider); diff --git a/app/lib/features/share_intent/domain/services/sharing_intent.g.dart b/app/lib/features/share_intent/domain/services/sharing_intent.g.dart index 014c317f..a1087197 100644 --- a/app/lib/features/share_intent/domain/services/sharing_intent.g.dart +++ b/app/lib/features/share_intent/domain/services/sharing_intent.g.dart @@ -6,25 +6,54 @@ part of 'sharing_intent.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(sharingIntentStream) +const sharingIntentStreamProvider = SharingIntentStreamProvider._(); + +final class SharingIntentStreamProvider + extends + $FunctionalProvider< + Raw>, + Raw>, + Raw> + > + with $Provider>> { + const SharingIntentStreamProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'sharingIntentStreamProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$sharingIntentStreamHash(); + + @$internal + @override + $ProviderElement>> $createElement( + $ProviderPointer pointer, + ) => $ProviderElement(pointer); + + @override + Raw> create(Ref ref) { + return sharingIntentStream(ref); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(Raw> value) { + return $ProviderOverride( + origin: this, + providerOverride: + $SyncValueProvider>>(value), + ); + } +} + String _$sharingIntentStreamHash() => r'486f994fc0e01a2cffdb19d93f0a332f96a9850c'; - -/// See also [sharingIntentStream]. -@ProviderFor(sharingIntentStream) -final sharingIntentStreamProvider = - Provider>>.internal( - sharingIntentStream, - name: r'sharingIntentStreamProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$sharingIntentStreamHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef SharingIntentStreamRef = - ProviderRef>>; -// 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 diff --git a/app/lib/features/tor/data/services/builtin_bridges.g.dart b/app/lib/features/tor/data/services/builtin_bridges.g.dart index 40782e6b..4b6d3d73 100644 --- a/app/lib/features/tor/data/services/builtin_bridges.g.dart +++ b/app/lib/features/tor/data/services/builtin_bridges.g.dart @@ -6,22 +6,59 @@ part of 'builtin_bridges.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(BuiltinBridgesService) +const builtinBridgesServiceProvider = BuiltinBridgesServiceProvider._(); + +final class BuiltinBridgesServiceProvider + extends $NotifierProvider { + const BuiltinBridgesServiceProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'builtinBridgesServiceProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$builtinBridgesServiceHash(); + + @$internal + @override + BuiltinBridgesService create() => BuiltinBridgesService(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(void value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + String _$builtinBridgesServiceHash() => r'beacb3c9d8c5a7179c7c9cad8024d128b09241f5'; -/// See also [BuiltinBridgesService]. -@ProviderFor(BuiltinBridgesService) -final builtinBridgesServiceProvider = - NotifierProvider.internal( - BuiltinBridgesService.new, - name: r'builtinBridgesServiceProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$builtinBridgesServiceHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$BuiltinBridgesService = Notifier; -// 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 +abstract class _$BuiltinBridgesService extends $Notifier { + void build(); + @$mustCallSuper + @override + void runBuild() { + build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + void, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} diff --git a/app/lib/features/tor/domain/repositories/builtin_bridges.g.dart b/app/lib/features/tor/domain/repositories/builtin_bridges.g.dart index 1ee4a8c7..9a00316d 100644 --- a/app/lib/features/tor/domain/repositories/builtin_bridges.g.dart +++ b/app/lib/features/tor/domain/repositories/builtin_bridges.g.dart @@ -6,161 +6,105 @@ part of 'builtin_bridges.dart'; // RiverpodGenerator // ************************************************************************** -String _$builtinBridgesRepositoryHash() => - r'05fc40a7742fc266aeb76b4e3f1d9bdfdb8d448f'; +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning -/// Copied from Dart SDK -class _SystemHash { - _SystemHash._(); - - static int combine(int hash, int value) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + value); - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10)); - return hash ^ (hash >> 6); - } - - static int finish(int hash) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); - // ignore: parameter_assignments - hash = hash ^ (hash >> 11); - return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); - } -} - -abstract class _$BuiltinBridgesRepository - extends BuildlessAutoDisposeNotifier { - late final MoatService service; - - void build(MoatService service); -} - -/// See also [BuiltinBridgesRepository]. @ProviderFor(BuiltinBridgesRepository) -const builtinBridgesRepositoryProvider = BuiltinBridgesRepositoryFamily(); +const builtinBridgesRepositoryProvider = BuiltinBridgesRepositoryFamily._(); -/// See also [BuiltinBridgesRepository]. -class BuiltinBridgesRepositoryFamily extends Family { - /// See also [BuiltinBridgesRepository]. - const BuiltinBridgesRepositoryFamily(); +final class BuiltinBridgesRepositoryProvider + extends $NotifierProvider { + const BuiltinBridgesRepositoryProvider._({ + required BuiltinBridgesRepositoryFamily super.from, + required MoatService super.argument, + }) : super( + retry: null, + name: r'builtinBridgesRepositoryProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); - /// See also [BuiltinBridgesRepository]. - BuiltinBridgesRepositoryProvider call(MoatService service) { - return BuiltinBridgesRepositoryProvider(service); + @override + String debugGetCreateSourceHash() => _$builtinBridgesRepositoryHash(); + + @override + String toString() { + return r'builtinBridgesRepositoryProvider' + '' + '($argument)'; } + @$internal @override - BuiltinBridgesRepositoryProvider getProviderOverride( - covariant BuiltinBridgesRepositoryProvider provider, - ) { - return call(provider.service); - } + BuiltinBridgesRepository create() => BuiltinBridgesRepository(); - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'builtinBridgesRepositoryProvider'; -} - -/// See also [BuiltinBridgesRepository]. -class BuiltinBridgesRepositoryProvider - extends AutoDisposeNotifierProviderImpl { - /// See also [BuiltinBridgesRepository]. - BuiltinBridgesRepositoryProvider(MoatService service) - : this._internal( - () => BuiltinBridgesRepository()..service = service, - from: builtinBridgesRepositoryProvider, - name: r'builtinBridgesRepositoryProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$builtinBridgesRepositoryHash, - dependencies: BuiltinBridgesRepositoryFamily._dependencies, - allTransitiveDependencies: - BuiltinBridgesRepositoryFamily._allTransitiveDependencies, - service: service, - ); - - BuiltinBridgesRepositoryProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.service, - }) : super.internal(); - - final MoatService service; - - @override - void runNotifierBuild(covariant BuiltinBridgesRepository notifier) { - return notifier.build(service); - } - - @override - Override overrideWith(BuiltinBridgesRepository Function() create) { - return ProviderOverride( + /// {@macro riverpod.override_with_value} + Override overrideWithValue(void value) { + return $ProviderOverride( origin: this, - override: BuiltinBridgesRepositoryProvider._internal( - () => create()..service = service, - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - service: service, - ), + providerOverride: $SyncValueProvider(value), ); } - @override - AutoDisposeNotifierProviderElement - createElement() { - return _BuiltinBridgesRepositoryProviderElement(this); - } - @override bool operator ==(Object other) { return other is BuiltinBridgesRepositoryProvider && - other.service == service; + other.argument == argument; } @override int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, service.hashCode); - - return _SystemHash.finish(hash); + return argument.hashCode; } } -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin BuiltinBridgesRepositoryRef on AutoDisposeNotifierProviderRef { - /// The parameter `service` of this provider. - MoatService get service; -} +String _$builtinBridgesRepositoryHash() => + r'05fc40a7742fc266aeb76b4e3f1d9bdfdb8d448f'; -class _BuiltinBridgesRepositoryProviderElement - extends AutoDisposeNotifierProviderElement - with BuiltinBridgesRepositoryRef { - _BuiltinBridgesRepositoryProviderElement(super.provider); +final class BuiltinBridgesRepositoryFamily extends $Family + with + $ClassFamilyOverride< + BuiltinBridgesRepository, + void, + void, + void, + MoatService + > { + const BuiltinBridgesRepositoryFamily._() + : super( + retry: null, + name: r'builtinBridgesRepositoryProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, + ); + + BuiltinBridgesRepositoryProvider call(MoatService service) => + BuiltinBridgesRepositoryProvider._(argument: service, from: this); @override - MoatService get service => - (origin as BuiltinBridgesRepositoryProvider).service; + String toString() => r'builtinBridgesRepositoryProvider'; } -// 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 +abstract class _$BuiltinBridgesRepository extends $Notifier { + late final _$args = ref.$arg as MoatService; + MoatService get service => _$args; + + void build(MoatService service); + @$mustCallSuper + @override + void runBuild() { + build(_$args); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + void, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} diff --git a/app/lib/features/tor/domain/services/tor_proxy.g.dart b/app/lib/features/tor/domain/services/tor_proxy.g.dart index cd139a39..4f288da4 100644 --- a/app/lib/features/tor/domain/services/tor_proxy.g.dart +++ b/app/lib/features/tor/domain/services/tor_proxy.g.dart @@ -6,21 +6,50 @@ part of 'tor_proxy.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(TorProxyService) +const torProxyServiceProvider = TorProxyServiceProvider._(); + +final class TorProxyServiceProvider + extends $AsyncNotifierProvider { + const TorProxyServiceProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'torProxyServiceProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$torProxyServiceHash(); + + @$internal + @override + TorProxyService create() => TorProxyService(); +} + String _$torProxyServiceHash() => r'82b4964ddf14d02893ebbea3b25d91216359ba10'; -/// See also [TorProxyService]. -@ProviderFor(TorProxyService) -final torProxyServiceProvider = - AsyncNotifierProvider.internal( - TorProxyService.new, - name: r'torProxyServiceProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$torProxyServiceHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$TorProxyService = AsyncNotifier; -// 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 +abstract class _$TorProxyService extends $AsyncNotifier { + FutureOr build(); + @$mustCallSuper + @override + void runBuild() { + final created = build(); + final ref = this.ref as $Ref, int?>; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, int?>, + AsyncValue, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} diff --git a/app/lib/features/tor/presentation/controllers/start_tor_proxy.g.dart b/app/lib/features/tor/presentation/controllers/start_tor_proxy.g.dart index 1f9caad7..12f10939 100644 --- a/app/lib/features/tor/presentation/controllers/start_tor_proxy.g.dart +++ b/app/lib/features/tor/presentation/controllers/start_tor_proxy.g.dart @@ -6,22 +6,59 @@ part of 'start_tor_proxy.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(StartProxyController) +const startProxyControllerProvider = StartProxyControllerProvider._(); + +final class StartProxyControllerProvider + extends $NotifierProvider { + const StartProxyControllerProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'startProxyControllerProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$startProxyControllerHash(); + + @$internal + @override + StartProxyController create() => StartProxyController(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(void value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + String _$startProxyControllerHash() => r'8840d5ffe9346c3f8b0aa0b3e034605b606c5e34'; -/// See also [StartProxyController]. -@ProviderFor(StartProxyController) -final startProxyControllerProvider = - AutoDisposeNotifierProvider.internal( - StartProxyController.new, - name: r'startProxyControllerProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$startProxyControllerHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$StartProxyController = AutoDisposeNotifier; -// 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 +abstract class _$StartProxyController extends $Notifier { + void build(); + @$mustCallSuper + @override + void runBuild() { + build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + void, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} diff --git a/app/lib/features/tor/presentation/screens/tor_proxy.dart b/app/lib/features/tor/presentation/screens/tor_proxy.dart index 2bdcd8d4..b4fc319f 100644 --- a/app/lib/features/tor/presentation/screens/tor_proxy.dart +++ b/app/lib/features/tor/presentation/screens/tor_proxy.dart @@ -90,7 +90,7 @@ class TorProxyScreen extends HookConsumerWidget { } return null; // Use the default color. }), - value: torProxyPort.valueOrNull != null, + value: torProxyPort.value != null, title: const Text('Torâ„¢ Proxy'), secondary: const Icon(MdiIcons.power), onChanged: torProxyPort.isLoading @@ -370,7 +370,7 @@ class TorProxyScreen extends HookConsumerWidget { ), ], ), - if (torProxyPort.valueOrNull != null) + if (torProxyPort.value != null) Padding( padding: const EdgeInsets.only(top: 24.0), child: Row( diff --git a/app/lib/features/user/data/database/daos/cache.dart b/app/lib/features/user/data/database/daos/cache.dart index bf01978e..65daa194 100644 --- a/app/lib/features/user/data/database/daos/cache.dart +++ b/app/lib/features/user/data/database/daos/cache.dart @@ -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 with _$CacheDaoMixin { +class CacheDao extends DatabaseAccessor with $CacheDaoMixin { CacheDao(super.attachedDatabase); SingleSelectable getIconCacheSize() { diff --git a/app/lib/features/user/data/database/daos/cache.drift.dart b/app/lib/features/user/data/database/daos/cache.drift.dart new file mode 100644 index 00000000..76ca91c6 --- /dev/null +++ b/app/lib/features/user/data/database/daos/cache.drift.dart @@ -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 {} diff --git a/app/lib/features/user/data/database/daos/cache.g.dart b/app/lib/features/user/data/database/daos/cache.g.dart deleted file mode 100644 index 5b292224..00000000 --- a/app/lib/features/user/data/database/daos/cache.g.dart +++ /dev/null @@ -1,6 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'cache.dart'; - -// ignore_for_file: type=lint -mixin _$CacheDaoMixin on DatabaseAccessor {} diff --git a/app/lib/features/user/data/database/daos/onboarding.dart b/app/lib/features/user/data/database/daos/onboarding.dart index ef7a1be0..0b67da40 100644 --- a/app/lib/features/user/data/database/daos/onboarding.dart +++ b/app/lib/features/user/data/database/daos/onboarding.dart @@ -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 - with _$OnboardingDaoMixin { +class OnboardingDao extends DatabaseAccessor { OnboardingDao(super.attachedDatabase); SingleOrNullSelectable getLastRevision() { diff --git a/app/lib/features/user/data/database/daos/onboarding.drift.dart b/app/lib/features/user/data/database/daos/onboarding.drift.dart new file mode 100644 index 00000000..bbbc4767 --- /dev/null +++ b/app/lib/features/user/data/database/daos/onboarding.drift.dart @@ -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 {} diff --git a/app/lib/features/user/data/database/daos/onboarding.g.dart b/app/lib/features/user/data/database/daos/onboarding.g.dart deleted file mode 100644 index 17352560..00000000 --- a/app/lib/features/user/data/database/daos/onboarding.g.dart +++ /dev/null @@ -1,6 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'onboarding.dart'; - -// ignore_for_file: type=lint -mixin _$OnboardingDaoMixin on DatabaseAccessor {} diff --git a/app/lib/features/user/data/database/daos/setting.dart b/app/lib/features/user/data/database/daos/setting.dart index a2df40ae..3401f25e 100644 --- a/app/lib/features/user/data/database/daos/setting.dart +++ b/app/lib/features/user/data/database/daos/setting.dart @@ -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 with _$SettingDaoMixin { +class SettingDao extends DatabaseAccessor with $SettingDaoMixin { SettingDao(super.attachedDatabase); Future updateSetting(String key, String? partitionKey, Object? value) { diff --git a/app/lib/features/user/data/database/daos/setting.drift.dart b/app/lib/features/user/data/database/daos/setting.drift.dart new file mode 100644 index 00000000..6d66502f --- /dev/null +++ b/app/lib/features/user/data/database/daos/setting.drift.dart @@ -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 {} diff --git a/app/lib/features/user/data/database/daos/setting.g.dart b/app/lib/features/user/data/database/daos/setting.g.dart deleted file mode 100644 index a031d6ce..00000000 --- a/app/lib/features/user/data/database/daos/setting.g.dart +++ /dev/null @@ -1,6 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'setting.dart'; - -// ignore_for_file: type=lint -mixin _$SettingDaoMixin on DatabaseAccessor {} diff --git a/app/lib/features/user/data/database/database.dart b/app/lib/features/user/data/database/database.dart index 734a2f12..4819e9a3 100644 --- a/app/lib/features/user/data/database/database.dart +++ b/app/lib/features/user/data/database/database.dart @@ -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; diff --git a/app/lib/features/user/data/database/database.drift.dart b/app/lib/features/user/data/database/database.drift.dart new file mode 100644 index 00000000..c50931d8 --- /dev/null +++ b/app/lib/features/user/data/database/database.drift.dart @@ -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.new); + @override + Iterable> get allTables => + allSchemaEntities.whereType>(); + @override + List 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); + }, + ); + } +} diff --git a/app/lib/features/user/data/database/database.g.dart b/app/lib/features/user/data/database/database.g.dart deleted file mode 100644 index 44a3e5ad..00000000 --- a/app/lib/features/user/data/database/database.g.dart +++ /dev/null @@ -1,1125 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'database.dart'; - -// ignore_for_file: type=lint -class Setting extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - Setting(this.attachedDatabase, [this._alias]); - late final GeneratedColumn key = GeneratedColumn( - 'key', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'PRIMARY KEY NOT NULL', - ); - late final GeneratedColumn partitionKey = GeneratedColumn( - 'partition_key', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: '', - ); - late final GeneratedColumn value = GeneratedColumn( - 'value', - aliasedName, - true, - type: DriftSqlType.any, - requiredDuringInsert: false, - $customConstraints: '', - ); - @override - List get $columns => [key, partitionKey, value]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'setting'; - @override - Set get $primaryKey => {key}; - @override - SettingData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return SettingData( - key: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}key'], - )!, - partitionKey: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}partition_key'], - ), - value: attachedDatabase.typeMapping.read( - DriftSqlType.any, - data['${effectivePrefix}value'], - ), - ); - } - - @override - Setting createAlias(String alias) { - return Setting(attachedDatabase, alias); - } - - @override - bool get isStrict => true; - @override - bool get dontWriteConstraints => true; -} - -class SettingData extends DataClass implements Insertable { - final String key; - final String? partitionKey; - final DriftAny? value; - const SettingData({required this.key, this.partitionKey, this.value}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['key'] = Variable(key); - if (!nullToAbsent || partitionKey != null) { - map['partition_key'] = Variable(partitionKey); - } - if (!nullToAbsent || value != null) { - map['value'] = Variable(value); - } - return map; - } - - factory SettingData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return SettingData( - key: serializer.fromJson(json['key']), - partitionKey: serializer.fromJson(json['partition_key']), - value: serializer.fromJson(json['value']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'key': serializer.toJson(key), - 'partition_key': serializer.toJson(partitionKey), - 'value': serializer.toJson(value), - }; - } - - SettingData copyWith({ - String? key, - Value partitionKey = const Value.absent(), - Value value = const Value.absent(), - }) => SettingData( - key: key ?? this.key, - partitionKey: partitionKey.present ? partitionKey.value : this.partitionKey, - value: value.present ? value.value : this.value, - ); - SettingData copyWithCompanion(SettingCompanion data) { - return SettingData( - key: data.key.present ? data.key.value : this.key, - partitionKey: data.partitionKey.present - ? data.partitionKey.value - : this.partitionKey, - value: data.value.present ? data.value.value : this.value, - ); - } - - @override - String toString() { - return (StringBuffer('SettingData(') - ..write('key: $key, ') - ..write('partitionKey: $partitionKey, ') - ..write('value: $value') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(key, partitionKey, value); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is SettingData && - other.key == this.key && - other.partitionKey == this.partitionKey && - other.value == this.value); -} - -class SettingCompanion extends UpdateCompanion { - final Value key; - final Value partitionKey; - final Value value; - final Value rowid; - const SettingCompanion({ - this.key = const Value.absent(), - this.partitionKey = const Value.absent(), - this.value = const Value.absent(), - this.rowid = const Value.absent(), - }); - SettingCompanion.insert({ - required String key, - this.partitionKey = const Value.absent(), - this.value = const Value.absent(), - this.rowid = const Value.absent(), - }) : key = Value(key); - static Insertable custom({ - Expression? key, - Expression? partitionKey, - Expression? value, - Expression? rowid, - }) { - return RawValuesInsertable({ - if (key != null) 'key': key, - if (partitionKey != null) 'partition_key': partitionKey, - if (value != null) 'value': value, - if (rowid != null) 'rowid': rowid, - }); - } - - SettingCompanion copyWith({ - Value? key, - Value? partitionKey, - Value? value, - Value? rowid, - }) { - return SettingCompanion( - key: key ?? this.key, - partitionKey: partitionKey ?? this.partitionKey, - value: value ?? this.value, - rowid: rowid ?? this.rowid, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (key.present) { - map['key'] = Variable(key.value); - } - if (partitionKey.present) { - map['partition_key'] = Variable(partitionKey.value); - } - if (value.present) { - map['value'] = Variable(value.value); - } - if (rowid.present) { - map['rowid'] = Variable(rowid.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('SettingCompanion(') - ..write('key: $key, ') - ..write('partitionKey: $partitionKey, ') - ..write('value: $value, ') - ..write('rowid: $rowid') - ..write(')')) - .toString(); - } -} - -class IconCache extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - IconCache(this.attachedDatabase, [this._alias]); - late final GeneratedColumn origin = GeneratedColumn( - 'origin', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'PRIMARY KEY NOT NULL', - ); - late final GeneratedColumn iconData = GeneratedColumn( - 'icon_data', - aliasedName, - false, - type: DriftSqlType.blob, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn fetchDate = GeneratedColumn( - 'fetch_date', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [origin, iconData, fetchDate]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'icon_cache'; - @override - Set get $primaryKey => {origin}; - @override - IconCacheData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return IconCacheData( - origin: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}origin'], - )!, - iconData: attachedDatabase.typeMapping.read( - DriftSqlType.blob, - data['${effectivePrefix}icon_data'], - )!, - fetchDate: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}fetch_date'], - )!, - ); - } - - @override - IconCache createAlias(String alias) { - return IconCache(attachedDatabase, alias); - } - - @override - bool get dontWriteConstraints => true; -} - -class IconCacheData extends DataClass implements Insertable { - final String origin; - final Uint8List iconData; - final DateTime fetchDate; - const IconCacheData({ - required this.origin, - required this.iconData, - required this.fetchDate, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['origin'] = Variable(origin); - map['icon_data'] = Variable(iconData); - map['fetch_date'] = Variable(fetchDate); - return map; - } - - factory IconCacheData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return IconCacheData( - origin: serializer.fromJson(json['origin']), - iconData: serializer.fromJson(json['icon_data']), - fetchDate: serializer.fromJson(json['fetch_date']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'origin': serializer.toJson(origin), - 'icon_data': serializer.toJson(iconData), - 'fetch_date': serializer.toJson(fetchDate), - }; - } - - IconCacheData copyWith({ - String? origin, - Uint8List? iconData, - DateTime? fetchDate, - }) => IconCacheData( - origin: origin ?? this.origin, - iconData: iconData ?? this.iconData, - fetchDate: fetchDate ?? this.fetchDate, - ); - IconCacheData copyWithCompanion(IconCacheCompanion data) { - return IconCacheData( - origin: data.origin.present ? data.origin.value : this.origin, - iconData: data.iconData.present ? data.iconData.value : this.iconData, - fetchDate: data.fetchDate.present ? data.fetchDate.value : this.fetchDate, - ); - } - - @override - String toString() { - return (StringBuffer('IconCacheData(') - ..write('origin: $origin, ') - ..write('iconData: $iconData, ') - ..write('fetchDate: $fetchDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(origin, $driftBlobEquality.hash(iconData), fetchDate); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is IconCacheData && - other.origin == this.origin && - $driftBlobEquality.equals(other.iconData, this.iconData) && - other.fetchDate == this.fetchDate); -} - -class IconCacheCompanion extends UpdateCompanion { - final Value origin; - final Value iconData; - final Value fetchDate; - final Value rowid; - const IconCacheCompanion({ - this.origin = const Value.absent(), - this.iconData = const Value.absent(), - this.fetchDate = const Value.absent(), - this.rowid = const Value.absent(), - }); - IconCacheCompanion.insert({ - required String origin, - required Uint8List iconData, - required DateTime fetchDate, - this.rowid = const Value.absent(), - }) : origin = Value(origin), - iconData = Value(iconData), - fetchDate = Value(fetchDate); - static Insertable custom({ - Expression? origin, - Expression? iconData, - Expression? fetchDate, - Expression? rowid, - }) { - return RawValuesInsertable({ - if (origin != null) 'origin': origin, - if (iconData != null) 'icon_data': iconData, - if (fetchDate != null) 'fetch_date': fetchDate, - if (rowid != null) 'rowid': rowid, - }); - } - - IconCacheCompanion copyWith({ - Value? origin, - Value? iconData, - Value? fetchDate, - Value? rowid, - }) { - return IconCacheCompanion( - origin: origin ?? this.origin, - iconData: iconData ?? this.iconData, - fetchDate: fetchDate ?? this.fetchDate, - rowid: rowid ?? this.rowid, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (origin.present) { - map['origin'] = Variable(origin.value); - } - if (iconData.present) { - map['icon_data'] = Variable(iconData.value); - } - if (fetchDate.present) { - map['fetch_date'] = Variable(fetchDate.value); - } - if (rowid.present) { - map['rowid'] = Variable(rowid.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('IconCacheCompanion(') - ..write('origin: $origin, ') - ..write('iconData: $iconData, ') - ..write('fetchDate: $fetchDate, ') - ..write('rowid: $rowid') - ..write(')')) - .toString(); - } -} - -class Onboarding extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - Onboarding(this.attachedDatabase, [this._alias]); - late final GeneratedColumn revision = GeneratedColumn( - 'revision', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn completionDate = - GeneratedColumn( - 'completion_date', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - @override - List get $columns => [revision, completionDate]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'onboarding'; - @override - Set get $primaryKey => const {}; - @override - OnboardingData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return OnboardingData( - revision: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}revision'], - )!, - completionDate: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}completion_date'], - )!, - ); - } - - @override - Onboarding createAlias(String alias) { - return Onboarding(attachedDatabase, alias); - } - - @override - bool get dontWriteConstraints => true; -} - -class OnboardingData extends DataClass implements Insertable { - final int revision; - final DateTime completionDate; - const OnboardingData({required this.revision, required this.completionDate}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['revision'] = Variable(revision); - map['completion_date'] = Variable(completionDate); - return map; - } - - factory OnboardingData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return OnboardingData( - revision: serializer.fromJson(json['revision']), - completionDate: serializer.fromJson(json['completion_date']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'revision': serializer.toJson(revision), - 'completion_date': serializer.toJson(completionDate), - }; - } - - OnboardingData copyWith({int? revision, DateTime? completionDate}) => - OnboardingData( - revision: revision ?? this.revision, - completionDate: completionDate ?? this.completionDate, - ); - OnboardingData copyWithCompanion(OnboardingCompanion data) { - return OnboardingData( - revision: data.revision.present ? data.revision.value : this.revision, - completionDate: data.completionDate.present - ? data.completionDate.value - : this.completionDate, - ); - } - - @override - String toString() { - return (StringBuffer('OnboardingData(') - ..write('revision: $revision, ') - ..write('completionDate: $completionDate') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(revision, completionDate); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is OnboardingData && - other.revision == this.revision && - other.completionDate == this.completionDate); -} - -class OnboardingCompanion extends UpdateCompanion { - final Value revision; - final Value completionDate; - final Value rowid; - const OnboardingCompanion({ - this.revision = const Value.absent(), - this.completionDate = const Value.absent(), - this.rowid = const Value.absent(), - }); - OnboardingCompanion.insert({ - required int revision, - required DateTime completionDate, - this.rowid = const Value.absent(), - }) : revision = Value(revision), - completionDate = Value(completionDate); - static Insertable custom({ - Expression? revision, - Expression? completionDate, - Expression? rowid, - }) { - return RawValuesInsertable({ - if (revision != null) 'revision': revision, - if (completionDate != null) 'completion_date': completionDate, - if (rowid != null) 'rowid': rowid, - }); - } - - OnboardingCompanion copyWith({ - Value? revision, - Value? completionDate, - Value? rowid, - }) { - return OnboardingCompanion( - revision: revision ?? this.revision, - completionDate: completionDate ?? this.completionDate, - rowid: rowid ?? this.rowid, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (revision.present) { - map['revision'] = Variable(revision.value); - } - if (completionDate.present) { - map['completion_date'] = Variable(completionDate.value); - } - if (rowid.present) { - map['rowid'] = Variable(rowid.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('OnboardingCompanion(') - ..write('revision: $revision, ') - ..write('completionDate: $completionDate, ') - ..write('rowid: $rowid') - ..write(')')) - .toString(); - } -} - -abstract class _$UserDatabase extends GeneratedDatabase { - _$UserDatabase(QueryExecutor e) : super(e); - $UserDatabaseManager get managers => $UserDatabaseManager(this); - late final Setting setting = Setting(this); - late final IconCache iconCache = IconCache(this); - late final Onboarding onboarding = Onboarding(this); - late final SettingDao settingDao = SettingDao(this as UserDatabase); - late final CacheDao cacheDao = CacheDao(this as UserDatabase); - late final OnboardingDao onboardingDao = OnboardingDao(this as UserDatabase); - Future evictCacheEntries({required int limit}) { - return customUpdate( - 'DELETE FROM icon_cache WHERE "rowid" IN (SELECT "rowid" FROM icon_cache ORDER BY fetch_date DESC LIMIT -1 OFFSET ?1)', - variables: [Variable(limit)], - updates: {iconCache}, - updateKind: UpdateKind.delete, - ); - } - - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - setting, - iconCache, - onboarding, - ]; -} - -typedef $SettingCreateCompanionBuilder = - SettingCompanion Function({ - required String key, - Value partitionKey, - Value value, - Value rowid, - }); -typedef $SettingUpdateCompanionBuilder = - SettingCompanion Function({ - Value key, - Value partitionKey, - Value value, - Value rowid, - }); - -class $SettingFilterComposer extends Composer<_$UserDatabase, Setting> { - $SettingFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnFilters get key => $composableBuilder( - column: $table.key, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get partitionKey => $composableBuilder( - column: $table.partitionKey, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get value => $composableBuilder( - column: $table.value, - builder: (column) => ColumnFilters(column), - ); -} - -class $SettingOrderingComposer extends Composer<_$UserDatabase, Setting> { - $SettingOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnOrderings get key => $composableBuilder( - column: $table.key, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get partitionKey => $composableBuilder( - column: $table.partitionKey, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get value => $composableBuilder( - column: $table.value, - builder: (column) => ColumnOrderings(column), - ); -} - -class $SettingAnnotationComposer extends Composer<_$UserDatabase, Setting> { - $SettingAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - GeneratedColumn get key => - $composableBuilder(column: $table.key, builder: (column) => column); - - GeneratedColumn get partitionKey => $composableBuilder( - column: $table.partitionKey, - builder: (column) => column, - ); - - GeneratedColumn get value => - $composableBuilder(column: $table.value, builder: (column) => column); -} - -class $SettingTableManager - extends - RootTableManager< - _$UserDatabase, - Setting, - SettingData, - $SettingFilterComposer, - $SettingOrderingComposer, - $SettingAnnotationComposer, - $SettingCreateCompanionBuilder, - $SettingUpdateCompanionBuilder, - (SettingData, BaseReferences<_$UserDatabase, Setting, SettingData>), - SettingData, - PrefetchHooks Function() - > { - $SettingTableManager(_$UserDatabase db, Setting table) - : super( - TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - $SettingFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $SettingOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $SettingAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - Value key = const Value.absent(), - Value partitionKey = const Value.absent(), - Value value = const Value.absent(), - Value rowid = const Value.absent(), - }) => SettingCompanion( - key: key, - partitionKey: partitionKey, - value: value, - rowid: rowid, - ), - createCompanionCallback: - ({ - required String key, - Value partitionKey = const Value.absent(), - Value value = const Value.absent(), - Value rowid = const Value.absent(), - }) => SettingCompanion.insert( - key: key, - partitionKey: partitionKey, - value: value, - rowid: rowid, - ), - withReferenceMapper: (p0) => p0 - .map((e) => (e.readTable(table), BaseReferences(db, table, e))) - .toList(), - prefetchHooksCallback: null, - ), - ); -} - -typedef $SettingProcessedTableManager = - ProcessedTableManager< - _$UserDatabase, - Setting, - SettingData, - $SettingFilterComposer, - $SettingOrderingComposer, - $SettingAnnotationComposer, - $SettingCreateCompanionBuilder, - $SettingUpdateCompanionBuilder, - (SettingData, BaseReferences<_$UserDatabase, Setting, SettingData>), - SettingData, - PrefetchHooks Function() - >; -typedef $IconCacheCreateCompanionBuilder = - IconCacheCompanion Function({ - required String origin, - required Uint8List iconData, - required DateTime fetchDate, - Value rowid, - }); -typedef $IconCacheUpdateCompanionBuilder = - IconCacheCompanion Function({ - Value origin, - Value iconData, - Value fetchDate, - Value rowid, - }); - -class $IconCacheFilterComposer extends Composer<_$UserDatabase, IconCache> { - $IconCacheFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnFilters get origin => $composableBuilder( - column: $table.origin, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get iconData => $composableBuilder( - column: $table.iconData, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get fetchDate => $composableBuilder( - column: $table.fetchDate, - builder: (column) => ColumnFilters(column), - ); -} - -class $IconCacheOrderingComposer extends Composer<_$UserDatabase, IconCache> { - $IconCacheOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnOrderings get origin => $composableBuilder( - column: $table.origin, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get iconData => $composableBuilder( - column: $table.iconData, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get fetchDate => $composableBuilder( - column: $table.fetchDate, - builder: (column) => ColumnOrderings(column), - ); -} - -class $IconCacheAnnotationComposer extends Composer<_$UserDatabase, IconCache> { - $IconCacheAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - GeneratedColumn get origin => - $composableBuilder(column: $table.origin, builder: (column) => column); - - GeneratedColumn get iconData => - $composableBuilder(column: $table.iconData, builder: (column) => column); - - GeneratedColumn get fetchDate => - $composableBuilder(column: $table.fetchDate, builder: (column) => column); -} - -class $IconCacheTableManager - extends - RootTableManager< - _$UserDatabase, - IconCache, - IconCacheData, - $IconCacheFilterComposer, - $IconCacheOrderingComposer, - $IconCacheAnnotationComposer, - $IconCacheCreateCompanionBuilder, - $IconCacheUpdateCompanionBuilder, - ( - IconCacheData, - BaseReferences<_$UserDatabase, IconCache, IconCacheData>, - ), - IconCacheData, - PrefetchHooks Function() - > { - $IconCacheTableManager(_$UserDatabase db, IconCache table) - : super( - TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - $IconCacheFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $IconCacheOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $IconCacheAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - Value origin = const Value.absent(), - Value iconData = const Value.absent(), - Value fetchDate = const Value.absent(), - Value rowid = const Value.absent(), - }) => IconCacheCompanion( - origin: origin, - iconData: iconData, - fetchDate: fetchDate, - rowid: rowid, - ), - createCompanionCallback: - ({ - required String origin, - required Uint8List iconData, - required DateTime fetchDate, - Value rowid = const Value.absent(), - }) => IconCacheCompanion.insert( - origin: origin, - iconData: iconData, - fetchDate: fetchDate, - rowid: rowid, - ), - withReferenceMapper: (p0) => p0 - .map((e) => (e.readTable(table), BaseReferences(db, table, e))) - .toList(), - prefetchHooksCallback: null, - ), - ); -} - -typedef $IconCacheProcessedTableManager = - ProcessedTableManager< - _$UserDatabase, - IconCache, - IconCacheData, - $IconCacheFilterComposer, - $IconCacheOrderingComposer, - $IconCacheAnnotationComposer, - $IconCacheCreateCompanionBuilder, - $IconCacheUpdateCompanionBuilder, - (IconCacheData, BaseReferences<_$UserDatabase, IconCache, IconCacheData>), - IconCacheData, - PrefetchHooks Function() - >; -typedef $OnboardingCreateCompanionBuilder = - OnboardingCompanion Function({ - required int revision, - required DateTime completionDate, - Value rowid, - }); -typedef $OnboardingUpdateCompanionBuilder = - OnboardingCompanion Function({ - Value revision, - Value completionDate, - Value rowid, - }); - -class $OnboardingFilterComposer extends Composer<_$UserDatabase, Onboarding> { - $OnboardingFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnFilters get revision => $composableBuilder( - column: $table.revision, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get completionDate => $composableBuilder( - column: $table.completionDate, - builder: (column) => ColumnFilters(column), - ); -} - -class $OnboardingOrderingComposer extends Composer<_$UserDatabase, Onboarding> { - $OnboardingOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnOrderings get revision => $composableBuilder( - column: $table.revision, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get completionDate => $composableBuilder( - column: $table.completionDate, - builder: (column) => ColumnOrderings(column), - ); -} - -class $OnboardingAnnotationComposer - extends Composer<_$UserDatabase, Onboarding> { - $OnboardingAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - GeneratedColumn get revision => - $composableBuilder(column: $table.revision, builder: (column) => column); - - GeneratedColumn get completionDate => $composableBuilder( - column: $table.completionDate, - builder: (column) => column, - ); -} - -class $OnboardingTableManager - extends - RootTableManager< - _$UserDatabase, - Onboarding, - OnboardingData, - $OnboardingFilterComposer, - $OnboardingOrderingComposer, - $OnboardingAnnotationComposer, - $OnboardingCreateCompanionBuilder, - $OnboardingUpdateCompanionBuilder, - ( - OnboardingData, - BaseReferences<_$UserDatabase, Onboarding, OnboardingData>, - ), - OnboardingData, - PrefetchHooks Function() - > { - $OnboardingTableManager(_$UserDatabase db, Onboarding table) - : super( - TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - $OnboardingFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $OnboardingOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $OnboardingAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - Value revision = const Value.absent(), - Value completionDate = const Value.absent(), - Value rowid = const Value.absent(), - }) => OnboardingCompanion( - revision: revision, - completionDate: completionDate, - rowid: rowid, - ), - createCompanionCallback: - ({ - required int revision, - required DateTime completionDate, - Value rowid = const Value.absent(), - }) => OnboardingCompanion.insert( - revision: revision, - completionDate: completionDate, - rowid: rowid, - ), - withReferenceMapper: (p0) => p0 - .map((e) => (e.readTable(table), BaseReferences(db, table, e))) - .toList(), - prefetchHooksCallback: null, - ), - ); -} - -typedef $OnboardingProcessedTableManager = - ProcessedTableManager< - _$UserDatabase, - Onboarding, - OnboardingData, - $OnboardingFilterComposer, - $OnboardingOrderingComposer, - $OnboardingAnnotationComposer, - $OnboardingCreateCompanionBuilder, - $OnboardingUpdateCompanionBuilder, - ( - OnboardingData, - BaseReferences<_$UserDatabase, Onboarding, OnboardingData>, - ), - OnboardingData, - PrefetchHooks Function() - >; - -class $UserDatabaseManager { - final _$UserDatabase _db; - $UserDatabaseManager(this._db); - $SettingTableManager get setting => $SettingTableManager(_db, _db.setting); - $IconCacheTableManager get iconCache => - $IconCacheTableManager(_db, _db.iconCache); - $OnboardingTableManager get onboarding => - $OnboardingTableManager(_db, _db.onboarding); -} diff --git a/app/lib/features/user/data/database/database.drift b/app/lib/features/user/data/database/definitions.drift similarity index 100% rename from app/lib/features/user/data/database/database.drift rename to app/lib/features/user/data/database/definitions.drift diff --git a/app/lib/features/user/data/database/definitions.drift.dart b/app/lib/features/user/data/database/definitions.drift.dart new file mode 100644 index 00000000..669ae043 --- /dev/null +++ b/app/lib/features/user/data/database/definitions.drift.dart @@ -0,0 +1,1143 @@ +// 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 'dart:typed_data' as i2; +import 'package:drift/internal/modular.dart' as i3; + +typedef $SettingCreateCompanionBuilder = + i1.SettingCompanion Function({ + required String key, + i0.Value partitionKey, + i0.Value value, + i0.Value rowid, + }); +typedef $SettingUpdateCompanionBuilder = + i1.SettingCompanion Function({ + i0.Value key, + i0.Value partitionKey, + i0.Value value, + i0.Value rowid, + }); + +class $SettingFilterComposer + extends i0.Composer { + $SettingFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.ColumnFilters get key => $composableBuilder( + column: $table.key, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get partitionKey => $composableBuilder( + column: $table.partitionKey, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get value => $composableBuilder( + column: $table.value, + builder: (column) => i0.ColumnFilters(column), + ); +} + +class $SettingOrderingComposer + extends i0.Composer { + $SettingOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.ColumnOrderings get key => $composableBuilder( + column: $table.key, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get partitionKey => $composableBuilder( + column: $table.partitionKey, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get value => $composableBuilder( + column: $table.value, + builder: (column) => i0.ColumnOrderings(column), + ); +} + +class $SettingAnnotationComposer + extends i0.Composer { + $SettingAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.GeneratedColumn get key => + $composableBuilder(column: $table.key, builder: (column) => column); + + i0.GeneratedColumn get partitionKey => $composableBuilder( + column: $table.partitionKey, + builder: (column) => column, + ); + + i0.GeneratedColumn get value => + $composableBuilder(column: $table.value, builder: (column) => column); +} + +class $SettingTableManager + extends + i0.RootTableManager< + i0.GeneratedDatabase, + i1.Setting, + i1.SettingData, + i1.$SettingFilterComposer, + i1.$SettingOrderingComposer, + i1.$SettingAnnotationComposer, + $SettingCreateCompanionBuilder, + $SettingUpdateCompanionBuilder, + ( + i1.SettingData, + i0.BaseReferences, + ), + i1.SettingData, + i0.PrefetchHooks Function() + > { + $SettingTableManager(i0.GeneratedDatabase db, i1.Setting table) + : super( + i0.TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + i1.$SettingFilterComposer($db: db, $table: table), + createOrderingComposer: () => + i1.$SettingOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + i1.$SettingAnnotationComposer($db: db, $table: table), + updateCompanionCallback: + ({ + i0.Value key = const i0.Value.absent(), + i0.Value partitionKey = const i0.Value.absent(), + i0.Value value = const i0.Value.absent(), + i0.Value rowid = const i0.Value.absent(), + }) => i1.SettingCompanion( + key: key, + partitionKey: partitionKey, + value: value, + rowid: rowid, + ), + createCompanionCallback: + ({ + required String key, + i0.Value partitionKey = const i0.Value.absent(), + i0.Value value = const i0.Value.absent(), + i0.Value rowid = const i0.Value.absent(), + }) => i1.SettingCompanion.insert( + key: key, + partitionKey: partitionKey, + value: value, + rowid: rowid, + ), + withReferenceMapper: (p0) => p0 + .map((e) => (e.readTable(table), i0.BaseReferences(db, table, e))) + .toList(), + prefetchHooksCallback: null, + ), + ); +} + +typedef $SettingProcessedTableManager = + i0.ProcessedTableManager< + i0.GeneratedDatabase, + i1.Setting, + i1.SettingData, + i1.$SettingFilterComposer, + i1.$SettingOrderingComposer, + i1.$SettingAnnotationComposer, + $SettingCreateCompanionBuilder, + $SettingUpdateCompanionBuilder, + ( + i1.SettingData, + i0.BaseReferences, + ), + i1.SettingData, + i0.PrefetchHooks Function() + >; +typedef $IconCacheCreateCompanionBuilder = + i1.IconCacheCompanion Function({ + required String origin, + required i2.Uint8List iconData, + required DateTime fetchDate, + i0.Value rowid, + }); +typedef $IconCacheUpdateCompanionBuilder = + i1.IconCacheCompanion Function({ + i0.Value origin, + i0.Value iconData, + i0.Value fetchDate, + i0.Value rowid, + }); + +class $IconCacheFilterComposer + extends i0.Composer { + $IconCacheFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.ColumnFilters get origin => $composableBuilder( + column: $table.origin, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get iconData => $composableBuilder( + column: $table.iconData, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get fetchDate => $composableBuilder( + column: $table.fetchDate, + builder: (column) => i0.ColumnFilters(column), + ); +} + +class $IconCacheOrderingComposer + extends i0.Composer { + $IconCacheOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.ColumnOrderings get origin => $composableBuilder( + column: $table.origin, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get iconData => $composableBuilder( + column: $table.iconData, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get fetchDate => $composableBuilder( + column: $table.fetchDate, + builder: (column) => i0.ColumnOrderings(column), + ); +} + +class $IconCacheAnnotationComposer + extends i0.Composer { + $IconCacheAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.GeneratedColumn get origin => + $composableBuilder(column: $table.origin, builder: (column) => column); + + i0.GeneratedColumn get iconData => + $composableBuilder(column: $table.iconData, builder: (column) => column); + + i0.GeneratedColumn get fetchDate => + $composableBuilder(column: $table.fetchDate, builder: (column) => column); +} + +class $IconCacheTableManager + extends + i0.RootTableManager< + i0.GeneratedDatabase, + i1.IconCache, + i1.IconCacheData, + i1.$IconCacheFilterComposer, + i1.$IconCacheOrderingComposer, + i1.$IconCacheAnnotationComposer, + $IconCacheCreateCompanionBuilder, + $IconCacheUpdateCompanionBuilder, + ( + i1.IconCacheData, + i0.BaseReferences< + i0.GeneratedDatabase, + i1.IconCache, + i1.IconCacheData + >, + ), + i1.IconCacheData, + i0.PrefetchHooks Function() + > { + $IconCacheTableManager(i0.GeneratedDatabase db, i1.IconCache table) + : super( + i0.TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + i1.$IconCacheFilterComposer($db: db, $table: table), + createOrderingComposer: () => + i1.$IconCacheOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + i1.$IconCacheAnnotationComposer($db: db, $table: table), + updateCompanionCallback: + ({ + i0.Value origin = const i0.Value.absent(), + i0.Value iconData = const i0.Value.absent(), + i0.Value fetchDate = const i0.Value.absent(), + i0.Value rowid = const i0.Value.absent(), + }) => i1.IconCacheCompanion( + origin: origin, + iconData: iconData, + fetchDate: fetchDate, + rowid: rowid, + ), + createCompanionCallback: + ({ + required String origin, + required i2.Uint8List iconData, + required DateTime fetchDate, + i0.Value rowid = const i0.Value.absent(), + }) => i1.IconCacheCompanion.insert( + origin: origin, + iconData: iconData, + fetchDate: fetchDate, + rowid: rowid, + ), + withReferenceMapper: (p0) => p0 + .map((e) => (e.readTable(table), i0.BaseReferences(db, table, e))) + .toList(), + prefetchHooksCallback: null, + ), + ); +} + +typedef $IconCacheProcessedTableManager = + i0.ProcessedTableManager< + i0.GeneratedDatabase, + i1.IconCache, + i1.IconCacheData, + i1.$IconCacheFilterComposer, + i1.$IconCacheOrderingComposer, + i1.$IconCacheAnnotationComposer, + $IconCacheCreateCompanionBuilder, + $IconCacheUpdateCompanionBuilder, + ( + i1.IconCacheData, + i0.BaseReferences, + ), + i1.IconCacheData, + i0.PrefetchHooks Function() + >; +typedef $OnboardingCreateCompanionBuilder = + i1.OnboardingCompanion Function({ + required int revision, + required DateTime completionDate, + i0.Value rowid, + }); +typedef $OnboardingUpdateCompanionBuilder = + i1.OnboardingCompanion Function({ + i0.Value revision, + i0.Value completionDate, + i0.Value rowid, + }); + +class $OnboardingFilterComposer + extends i0.Composer { + $OnboardingFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.ColumnFilters get revision => $composableBuilder( + column: $table.revision, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get completionDate => $composableBuilder( + column: $table.completionDate, + builder: (column) => i0.ColumnFilters(column), + ); +} + +class $OnboardingOrderingComposer + extends i0.Composer { + $OnboardingOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.ColumnOrderings get revision => $composableBuilder( + column: $table.revision, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get completionDate => $composableBuilder( + column: $table.completionDate, + builder: (column) => i0.ColumnOrderings(column), + ); +} + +class $OnboardingAnnotationComposer + extends i0.Composer { + $OnboardingAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.GeneratedColumn get revision => + $composableBuilder(column: $table.revision, builder: (column) => column); + + i0.GeneratedColumn get completionDate => $composableBuilder( + column: $table.completionDate, + builder: (column) => column, + ); +} + +class $OnboardingTableManager + extends + i0.RootTableManager< + i0.GeneratedDatabase, + i1.Onboarding, + i1.OnboardingData, + i1.$OnboardingFilterComposer, + i1.$OnboardingOrderingComposer, + i1.$OnboardingAnnotationComposer, + $OnboardingCreateCompanionBuilder, + $OnboardingUpdateCompanionBuilder, + ( + i1.OnboardingData, + i0.BaseReferences< + i0.GeneratedDatabase, + i1.Onboarding, + i1.OnboardingData + >, + ), + i1.OnboardingData, + i0.PrefetchHooks Function() + > { + $OnboardingTableManager(i0.GeneratedDatabase db, i1.Onboarding table) + : super( + i0.TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + i1.$OnboardingFilterComposer($db: db, $table: table), + createOrderingComposer: () => + i1.$OnboardingOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + i1.$OnboardingAnnotationComposer($db: db, $table: table), + updateCompanionCallback: + ({ + i0.Value revision = const i0.Value.absent(), + i0.Value completionDate = const i0.Value.absent(), + i0.Value rowid = const i0.Value.absent(), + }) => i1.OnboardingCompanion( + revision: revision, + completionDate: completionDate, + rowid: rowid, + ), + createCompanionCallback: + ({ + required int revision, + required DateTime completionDate, + i0.Value rowid = const i0.Value.absent(), + }) => i1.OnboardingCompanion.insert( + revision: revision, + completionDate: completionDate, + rowid: rowid, + ), + withReferenceMapper: (p0) => p0 + .map((e) => (e.readTable(table), i0.BaseReferences(db, table, e))) + .toList(), + prefetchHooksCallback: null, + ), + ); +} + +typedef $OnboardingProcessedTableManager = + i0.ProcessedTableManager< + i0.GeneratedDatabase, + i1.Onboarding, + i1.OnboardingData, + i1.$OnboardingFilterComposer, + i1.$OnboardingOrderingComposer, + i1.$OnboardingAnnotationComposer, + $OnboardingCreateCompanionBuilder, + $OnboardingUpdateCompanionBuilder, + ( + i1.OnboardingData, + i0.BaseReferences< + i0.GeneratedDatabase, + i1.Onboarding, + i1.OnboardingData + >, + ), + i1.OnboardingData, + i0.PrefetchHooks Function() + >; + +class Setting extends i0.Table with i0.TableInfo { + @override + final i0.GeneratedDatabase attachedDatabase; + final String? _alias; + Setting(this.attachedDatabase, [this._alias]); + late final i0.GeneratedColumn key = i0.GeneratedColumn( + 'key', + aliasedName, + false, + type: i0.DriftSqlType.string, + requiredDuringInsert: true, + $customConstraints: 'PRIMARY KEY NOT NULL', + ); + late final i0.GeneratedColumn partitionKey = + i0.GeneratedColumn( + 'partition_key', + aliasedName, + true, + type: i0.DriftSqlType.string, + requiredDuringInsert: false, + $customConstraints: '', + ); + late final i0.GeneratedColumn value = + i0.GeneratedColumn( + 'value', + aliasedName, + true, + type: i0.DriftSqlType.any, + requiredDuringInsert: false, + $customConstraints: '', + ); + @override + List get $columns => [key, partitionKey, value]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'setting'; + @override + Set get $primaryKey => {key}; + @override + i1.SettingData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return i1.SettingData( + key: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}key'], + )!, + partitionKey: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}partition_key'], + ), + value: attachedDatabase.typeMapping.read( + i0.DriftSqlType.any, + data['${effectivePrefix}value'], + ), + ); + } + + @override + Setting createAlias(String alias) { + return Setting(attachedDatabase, alias); + } + + @override + bool get isStrict => true; + @override + bool get dontWriteConstraints => true; +} + +class SettingData extends i0.DataClass + implements i0.Insertable { + final String key; + final String? partitionKey; + final i0.DriftAny? value; + const SettingData({required this.key, this.partitionKey, this.value}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['key'] = i0.Variable(key); + if (!nullToAbsent || partitionKey != null) { + map['partition_key'] = i0.Variable(partitionKey); + } + if (!nullToAbsent || value != null) { + map['value'] = i0.Variable(value); + } + return map; + } + + factory SettingData.fromJson( + Map json, { + i0.ValueSerializer? serializer, + }) { + serializer ??= i0.driftRuntimeOptions.defaultSerializer; + return SettingData( + key: serializer.fromJson(json['key']), + partitionKey: serializer.fromJson(json['partition_key']), + value: serializer.fromJson(json['value']), + ); + } + @override + Map toJson({i0.ValueSerializer? serializer}) { + serializer ??= i0.driftRuntimeOptions.defaultSerializer; + return { + 'key': serializer.toJson(key), + 'partition_key': serializer.toJson(partitionKey), + 'value': serializer.toJson(value), + }; + } + + i1.SettingData copyWith({ + String? key, + i0.Value partitionKey = const i0.Value.absent(), + i0.Value value = const i0.Value.absent(), + }) => i1.SettingData( + key: key ?? this.key, + partitionKey: partitionKey.present ? partitionKey.value : this.partitionKey, + value: value.present ? value.value : this.value, + ); + SettingData copyWithCompanion(i1.SettingCompanion data) { + return SettingData( + key: data.key.present ? data.key.value : this.key, + partitionKey: data.partitionKey.present + ? data.partitionKey.value + : this.partitionKey, + value: data.value.present ? data.value.value : this.value, + ); + } + + @override + String toString() { + return (StringBuffer('SettingData(') + ..write('key: $key, ') + ..write('partitionKey: $partitionKey, ') + ..write('value: $value') + ..write(')')) + .toString(); + } + + @override + int get hashCode => Object.hash(key, partitionKey, value); + @override + bool operator ==(Object other) => + identical(this, other) || + (other is i1.SettingData && + other.key == this.key && + other.partitionKey == this.partitionKey && + other.value == this.value); +} + +class SettingCompanion extends i0.UpdateCompanion { + final i0.Value key; + final i0.Value partitionKey; + final i0.Value value; + final i0.Value rowid; + const SettingCompanion({ + this.key = const i0.Value.absent(), + this.partitionKey = const i0.Value.absent(), + this.value = const i0.Value.absent(), + this.rowid = const i0.Value.absent(), + }); + SettingCompanion.insert({ + required String key, + this.partitionKey = const i0.Value.absent(), + this.value = const i0.Value.absent(), + this.rowid = const i0.Value.absent(), + }) : key = i0.Value(key); + static i0.Insertable custom({ + i0.Expression? key, + i0.Expression? partitionKey, + i0.Expression? value, + i0.Expression? rowid, + }) { + return i0.RawValuesInsertable({ + if (key != null) 'key': key, + if (partitionKey != null) 'partition_key': partitionKey, + if (value != null) 'value': value, + if (rowid != null) 'rowid': rowid, + }); + } + + i1.SettingCompanion copyWith({ + i0.Value? key, + i0.Value? partitionKey, + i0.Value? value, + i0.Value? rowid, + }) { + return i1.SettingCompanion( + key: key ?? this.key, + partitionKey: partitionKey ?? this.partitionKey, + value: value ?? this.value, + rowid: rowid ?? this.rowid, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (key.present) { + map['key'] = i0.Variable(key.value); + } + if (partitionKey.present) { + map['partition_key'] = i0.Variable(partitionKey.value); + } + if (value.present) { + map['value'] = i0.Variable(value.value); + } + if (rowid.present) { + map['rowid'] = i0.Variable(rowid.value); + } + return map; + } + + @override + String toString() { + return (StringBuffer('SettingCompanion(') + ..write('key: $key, ') + ..write('partitionKey: $partitionKey, ') + ..write('value: $value, ') + ..write('rowid: $rowid') + ..write(')')) + .toString(); + } +} + +class IconCache extends i0.Table + with i0.TableInfo { + @override + final i0.GeneratedDatabase attachedDatabase; + final String? _alias; + IconCache(this.attachedDatabase, [this._alias]); + late final i0.GeneratedColumn origin = i0.GeneratedColumn( + 'origin', + aliasedName, + false, + type: i0.DriftSqlType.string, + requiredDuringInsert: true, + $customConstraints: 'PRIMARY KEY NOT NULL', + ); + late final i0.GeneratedColumn iconData = + i0.GeneratedColumn( + 'icon_data', + aliasedName, + false, + type: i0.DriftSqlType.blob, + requiredDuringInsert: true, + $customConstraints: 'NOT NULL', + ); + late final i0.GeneratedColumn fetchDate = + i0.GeneratedColumn( + 'fetch_date', + aliasedName, + false, + type: i0.DriftSqlType.dateTime, + requiredDuringInsert: true, + $customConstraints: 'NOT NULL', + ); + @override + List get $columns => [origin, iconData, fetchDate]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'icon_cache'; + @override + Set get $primaryKey => {origin}; + @override + i1.IconCacheData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return i1.IconCacheData( + origin: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}origin'], + )!, + iconData: attachedDatabase.typeMapping.read( + i0.DriftSqlType.blob, + data['${effectivePrefix}icon_data'], + )!, + fetchDate: attachedDatabase.typeMapping.read( + i0.DriftSqlType.dateTime, + data['${effectivePrefix}fetch_date'], + )!, + ); + } + + @override + IconCache createAlias(String alias) { + return IconCache(attachedDatabase, alias); + } + + @override + bool get dontWriteConstraints => true; +} + +class IconCacheData extends i0.DataClass + implements i0.Insertable { + final String origin; + final i2.Uint8List iconData; + final DateTime fetchDate; + const IconCacheData({ + required this.origin, + required this.iconData, + required this.fetchDate, + }); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['origin'] = i0.Variable(origin); + map['icon_data'] = i0.Variable(iconData); + map['fetch_date'] = i0.Variable(fetchDate); + return map; + } + + factory IconCacheData.fromJson( + Map json, { + i0.ValueSerializer? serializer, + }) { + serializer ??= i0.driftRuntimeOptions.defaultSerializer; + return IconCacheData( + origin: serializer.fromJson(json['origin']), + iconData: serializer.fromJson(json['icon_data']), + fetchDate: serializer.fromJson(json['fetch_date']), + ); + } + @override + Map toJson({i0.ValueSerializer? serializer}) { + serializer ??= i0.driftRuntimeOptions.defaultSerializer; + return { + 'origin': serializer.toJson(origin), + 'icon_data': serializer.toJson(iconData), + 'fetch_date': serializer.toJson(fetchDate), + }; + } + + i1.IconCacheData copyWith({ + String? origin, + i2.Uint8List? iconData, + DateTime? fetchDate, + }) => i1.IconCacheData( + origin: origin ?? this.origin, + iconData: iconData ?? this.iconData, + fetchDate: fetchDate ?? this.fetchDate, + ); + IconCacheData copyWithCompanion(i1.IconCacheCompanion data) { + return IconCacheData( + origin: data.origin.present ? data.origin.value : this.origin, + iconData: data.iconData.present ? data.iconData.value : this.iconData, + fetchDate: data.fetchDate.present ? data.fetchDate.value : this.fetchDate, + ); + } + + @override + String toString() { + return (StringBuffer('IconCacheData(') + ..write('origin: $origin, ') + ..write('iconData: $iconData, ') + ..write('fetchDate: $fetchDate') + ..write(')')) + .toString(); + } + + @override + int get hashCode => + Object.hash(origin, i0.$driftBlobEquality.hash(iconData), fetchDate); + @override + bool operator ==(Object other) => + identical(this, other) || + (other is i1.IconCacheData && + other.origin == this.origin && + i0.$driftBlobEquality.equals(other.iconData, this.iconData) && + other.fetchDate == this.fetchDate); +} + +class IconCacheCompanion extends i0.UpdateCompanion { + final i0.Value origin; + final i0.Value iconData; + final i0.Value fetchDate; + final i0.Value rowid; + const IconCacheCompanion({ + this.origin = const i0.Value.absent(), + this.iconData = const i0.Value.absent(), + this.fetchDate = const i0.Value.absent(), + this.rowid = const i0.Value.absent(), + }); + IconCacheCompanion.insert({ + required String origin, + required i2.Uint8List iconData, + required DateTime fetchDate, + this.rowid = const i0.Value.absent(), + }) : origin = i0.Value(origin), + iconData = i0.Value(iconData), + fetchDate = i0.Value(fetchDate); + static i0.Insertable custom({ + i0.Expression? origin, + i0.Expression? iconData, + i0.Expression? fetchDate, + i0.Expression? rowid, + }) { + return i0.RawValuesInsertable({ + if (origin != null) 'origin': origin, + if (iconData != null) 'icon_data': iconData, + if (fetchDate != null) 'fetch_date': fetchDate, + if (rowid != null) 'rowid': rowid, + }); + } + + i1.IconCacheCompanion copyWith({ + i0.Value? origin, + i0.Value? iconData, + i0.Value? fetchDate, + i0.Value? rowid, + }) { + return i1.IconCacheCompanion( + origin: origin ?? this.origin, + iconData: iconData ?? this.iconData, + fetchDate: fetchDate ?? this.fetchDate, + rowid: rowid ?? this.rowid, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (origin.present) { + map['origin'] = i0.Variable(origin.value); + } + if (iconData.present) { + map['icon_data'] = i0.Variable(iconData.value); + } + if (fetchDate.present) { + map['fetch_date'] = i0.Variable(fetchDate.value); + } + if (rowid.present) { + map['rowid'] = i0.Variable(rowid.value); + } + return map; + } + + @override + String toString() { + return (StringBuffer('IconCacheCompanion(') + ..write('origin: $origin, ') + ..write('iconData: $iconData, ') + ..write('fetchDate: $fetchDate, ') + ..write('rowid: $rowid') + ..write(')')) + .toString(); + } +} + +class Onboarding extends i0.Table + with i0.TableInfo { + @override + final i0.GeneratedDatabase attachedDatabase; + final String? _alias; + Onboarding(this.attachedDatabase, [this._alias]); + late final i0.GeneratedColumn revision = i0.GeneratedColumn( + 'revision', + aliasedName, + false, + type: i0.DriftSqlType.int, + requiredDuringInsert: true, + $customConstraints: 'NOT NULL', + ); + late final i0.GeneratedColumn completionDate = + i0.GeneratedColumn( + 'completion_date', + aliasedName, + false, + type: i0.DriftSqlType.dateTime, + requiredDuringInsert: true, + $customConstraints: 'NOT NULL', + ); + @override + List get $columns => [revision, completionDate]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'onboarding'; + @override + Set get $primaryKey => const {}; + @override + i1.OnboardingData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return i1.OnboardingData( + revision: attachedDatabase.typeMapping.read( + i0.DriftSqlType.int, + data['${effectivePrefix}revision'], + )!, + completionDate: attachedDatabase.typeMapping.read( + i0.DriftSqlType.dateTime, + data['${effectivePrefix}completion_date'], + )!, + ); + } + + @override + Onboarding createAlias(String alias) { + return Onboarding(attachedDatabase, alias); + } + + @override + bool get dontWriteConstraints => true; +} + +class OnboardingData extends i0.DataClass + implements i0.Insertable { + final int revision; + final DateTime completionDate; + const OnboardingData({required this.revision, required this.completionDate}); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['revision'] = i0.Variable(revision); + map['completion_date'] = i0.Variable(completionDate); + return map; + } + + factory OnboardingData.fromJson( + Map json, { + i0.ValueSerializer? serializer, + }) { + serializer ??= i0.driftRuntimeOptions.defaultSerializer; + return OnboardingData( + revision: serializer.fromJson(json['revision']), + completionDate: serializer.fromJson(json['completion_date']), + ); + } + @override + Map toJson({i0.ValueSerializer? serializer}) { + serializer ??= i0.driftRuntimeOptions.defaultSerializer; + return { + 'revision': serializer.toJson(revision), + 'completion_date': serializer.toJson(completionDate), + }; + } + + i1.OnboardingData copyWith({int? revision, DateTime? completionDate}) => + i1.OnboardingData( + revision: revision ?? this.revision, + completionDate: completionDate ?? this.completionDate, + ); + OnboardingData copyWithCompanion(i1.OnboardingCompanion data) { + return OnboardingData( + revision: data.revision.present ? data.revision.value : this.revision, + completionDate: data.completionDate.present + ? data.completionDate.value + : this.completionDate, + ); + } + + @override + String toString() { + return (StringBuffer('OnboardingData(') + ..write('revision: $revision, ') + ..write('completionDate: $completionDate') + ..write(')')) + .toString(); + } + + @override + int get hashCode => Object.hash(revision, completionDate); + @override + bool operator ==(Object other) => + identical(this, other) || + (other is i1.OnboardingData && + other.revision == this.revision && + other.completionDate == this.completionDate); +} + +class OnboardingCompanion extends i0.UpdateCompanion { + final i0.Value revision; + final i0.Value completionDate; + final i0.Value rowid; + const OnboardingCompanion({ + this.revision = const i0.Value.absent(), + this.completionDate = const i0.Value.absent(), + this.rowid = const i0.Value.absent(), + }); + OnboardingCompanion.insert({ + required int revision, + required DateTime completionDate, + this.rowid = const i0.Value.absent(), + }) : revision = i0.Value(revision), + completionDate = i0.Value(completionDate); + static i0.Insertable custom({ + i0.Expression? revision, + i0.Expression? completionDate, + i0.Expression? rowid, + }) { + return i0.RawValuesInsertable({ + if (revision != null) 'revision': revision, + if (completionDate != null) 'completion_date': completionDate, + if (rowid != null) 'rowid': rowid, + }); + } + + i1.OnboardingCompanion copyWith({ + i0.Value? revision, + i0.Value? completionDate, + i0.Value? rowid, + }) { + return i1.OnboardingCompanion( + revision: revision ?? this.revision, + completionDate: completionDate ?? this.completionDate, + rowid: rowid ?? this.rowid, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (revision.present) { + map['revision'] = i0.Variable(revision.value); + } + if (completionDate.present) { + map['completion_date'] = i0.Variable(completionDate.value); + } + if (rowid.present) { + map['rowid'] = i0.Variable(rowid.value); + } + return map; + } + + @override + String toString() { + return (StringBuffer('OnboardingCompanion(') + ..write('revision: $revision, ') + ..write('completionDate: $completionDate, ') + ..write('rowid: $rowid') + ..write(')')) + .toString(); + } +} + +class DefinitionsDrift extends i3.ModularAccessor { + DefinitionsDrift(i0.GeneratedDatabase db) : super(db); + Future evictCacheEntries({required int limit}) { + return customUpdate( + 'DELETE FROM icon_cache WHERE "rowid" IN (SELECT "rowid" FROM icon_cache ORDER BY fetch_date DESC LIMIT -1 OFFSET ?1)', + variables: [i0.Variable(limit)], + updates: {iconCache}, + updateKind: i0.UpdateKind.delete, + ); + } + + i1.IconCache get iconCache => i3.ReadDatabaseContainer( + attachedDatabase, + ).resultSet('icon_cache'); +} diff --git a/app/lib/features/user/data/models/engine_settings.g.dart b/app/lib/features/user/data/models/engine_settings.g.dart index 3e11fa19..05f353fc 100644 --- a/app/lib/features/user/data/models/engine_settings.g.dart +++ b/app/lib/features/user/data/models/engine_settings.g.dart @@ -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); } diff --git a/app/lib/features/user/data/models/general_settings.g.dart b/app/lib/features/user/data/models/general_settings.g.dart index bff6fae5..54e93c42 100644 --- a/app/lib/features/user/data/models/general_settings.g.dart +++ b/app/lib/features/user/data/models/general_settings.g.dart @@ -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? 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?, 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); } diff --git a/app/lib/features/user/data/models/tor_settings.g.dart b/app/lib/features/user/data/models/tor_settings.g.dart index cd6b7159..9101086a 100644 --- a/app/lib/features/user/data/models/tor_settings.g.dart +++ b/app/lib/features/user/data/models/tor_settings.g.dart @@ -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); } diff --git a/app/lib/features/user/data/providers.g.dart b/app/lib/features/user/data/providers.g.dart index 592fd910..96b3418c 100644 --- a/app/lib/features/user/data/providers.g.dart +++ b/app/lib/features/user/data/providers.g.dart @@ -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.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; -// 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 + with $Provider { + 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 $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(value), + ); + } +} + +String _$userDatabaseHash() => r'b925780435806f0241d7ddb635e301e9fc8baf6e'; diff --git a/app/lib/features/user/domain/providers.g.dart b/app/lib/features/user/domain/providers.g.dart index a99d1fea..871e9156 100644 --- a/app/lib/features/user/domain/providers.g.dart +++ b/app/lib/features/user/domain/providers.g.dart @@ -6,59 +6,114 @@ part of 'providers.dart'; // RiverpodGenerator // ************************************************************************** -String _$storedAuthDataHash() => r'5f7e3ef6233a2036f7ce3728131901a46b1e548e'; +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning -/// See also [_storedAuthData]. @ProviderFor(_storedAuthData) -final _storedAuthDataProvider = AutoDisposeFutureProvider.internal( - _storedAuthData, - name: r'_storedAuthDataProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$storedAuthDataHash, - dependencies: null, - allTransitiveDependencies: null, -); +const _storedAuthDataProvider = _StoredAuthDataProvider._(); + +final class _StoredAuthDataProvider + extends $FunctionalProvider, String?, FutureOr> + with $FutureModifier, $FutureProvider { + const _StoredAuthDataProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'_storedAuthDataProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$_storedAuthDataHash(); + + @$internal + @override + $FutureProviderElement $createElement($ProviderPointer pointer) => + $FutureProviderElement(pointer); + + @override + FutureOr create(Ref ref) { + return _storedAuthData(ref); + } +} + +String _$_storedAuthDataHash() => r'5f7e3ef6233a2036f7ce3728131901a46b1e548e'; + +@ProviderFor(iconCacheSizeMegabytes) +const iconCacheSizeMegabytesProvider = IconCacheSizeMegabytesProvider._(); + +final class IconCacheSizeMegabytesProvider + extends $FunctionalProvider, double, Stream> + with $FutureModifier, $StreamProvider { + const IconCacheSizeMegabytesProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'iconCacheSizeMegabytesProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$iconCacheSizeMegabytesHash(); + + @$internal + @override + $StreamProviderElement $createElement($ProviderPointer pointer) => + $StreamProviderElement(pointer); + + @override + Stream create(Ref ref) { + return iconCacheSizeMegabytes(ref); + } +} -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef _StoredAuthDataRef = AutoDisposeFutureProviderRef; String _$iconCacheSizeMegabytesHash() => r'5d7f5f6485060b08ce4fd8fa634f07bf8bfdbd2d'; -/// See also [iconCacheSizeMegabytes]. -@ProviderFor(iconCacheSizeMegabytes) -final iconCacheSizeMegabytesProvider = - AutoDisposeStreamProvider.internal( - iconCacheSizeMegabytes, - name: r'iconCacheSizeMegabytesProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$iconCacheSizeMegabytesHash, - dependencies: null, - allTransitiveDependencies: null, - ); +@ProviderFor(incognitoModeEnabled) +const incognitoModeEnabledProvider = IncognitoModeEnabledProvider._(); + +final class IncognitoModeEnabledProvider + extends $FunctionalProvider + with $Provider { + const IncognitoModeEnabledProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'incognitoModeEnabledProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$incognitoModeEnabledHash(); + + @$internal + @override + $ProviderElement $createElement($ProviderPointer pointer) => + $ProviderElement(pointer); + + @override + bool create(Ref ref) { + return incognitoModeEnabled(ref); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(bool value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef IconCacheSizeMegabytesRef = AutoDisposeStreamProviderRef; String _$incognitoModeEnabledHash() => r'36957b70a5261f9d3ad228e07cc8dd5c8f616082'; - -/// See also [incognitoModeEnabled]. -@ProviderFor(incognitoModeEnabled) -final incognitoModeEnabledProvider = AutoDisposeProvider.internal( - incognitoModeEnabled, - name: r'incognitoModeEnabledProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$incognitoModeEnabledHash, - dependencies: null, - allTransitiveDependencies: null, -); - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef IncognitoModeEnabledRef = AutoDisposeProviderRef; -// 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 diff --git a/app/lib/features/user/domain/repositories/cache.g.dart b/app/lib/features/user/domain/repositories/cache.g.dart index f793320b..070bacae 100644 --- a/app/lib/features/user/domain/repositories/cache.g.dart +++ b/app/lib/features/user/domain/repositories/cache.g.dart @@ -6,21 +6,58 @@ part of 'cache.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(CacheRepository) +const cacheRepositoryProvider = CacheRepositoryProvider._(); + +final class CacheRepositoryProvider + extends $NotifierProvider { + const CacheRepositoryProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'cacheRepositoryProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$cacheRepositoryHash(); + + @$internal + @override + CacheRepository create() => CacheRepository(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(void value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + String _$cacheRepositoryHash() => r'548b7cba9a23c21bba39f0918d7d90acaaf8d8e9'; -/// See also [CacheRepository]. -@ProviderFor(CacheRepository) -final cacheRepositoryProvider = - NotifierProvider.internal( - CacheRepository.new, - name: r'cacheRepositoryProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$cacheRepositoryHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$CacheRepository = Notifier; -// 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 +abstract class _$CacheRepository extends $Notifier { + void build(); + @$mustCallSuper + @override + void runBuild() { + build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + void, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} diff --git a/app/lib/features/user/domain/repositories/engine_settings.dart b/app/lib/features/user/domain/repositories/engine_settings.dart index d19ecb0a..84a2a6c0 100644 --- a/app/lib/features/user/domain/repositories/engine_settings.dart +++ b/app/lib/features/user/domain/repositories/engine_settings.dart @@ -143,7 +143,7 @@ class EngineSettingsRepository extends _$EngineSettingsRepository { EngineSettings engineSettingsWithDefaults(Ref ref) { return ref.watch( engineSettingsRepositoryProvider.select( - (value) => value.valueOrNull ?? EngineSettings.withDefaults(), + (value) => value.value ?? EngineSettings.withDefaults(), ), ); } diff --git a/app/lib/features/user/domain/repositories/engine_settings.g.dart b/app/lib/features/user/domain/repositories/engine_settings.g.dart index 921f2c2b..fdaefe4f 100644 --- a/app/lib/features/user/domain/repositories/engine_settings.g.dart +++ b/app/lib/features/user/domain/repositories/engine_settings.g.dart @@ -6,41 +6,95 @@ part of 'engine_settings.dart'; // RiverpodGenerator // ************************************************************************** -String _$engineSettingsWithDefaultsHash() => - r'018e37f31f893e203b86038e84b0ddf5e72454d4'; +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning -/// See also [engineSettingsWithDefaults]. -@ProviderFor(engineSettingsWithDefaults) -final engineSettingsWithDefaultsProvider = - AutoDisposeProvider.internal( - engineSettingsWithDefaults, - name: r'engineSettingsWithDefaultsProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$engineSettingsWithDefaultsHash, - dependencies: null, - allTransitiveDependencies: null, - ); +@ProviderFor(EngineSettingsRepository) +const engineSettingsRepositoryProvider = EngineSettingsRepositoryProvider._(); + +final class EngineSettingsRepositoryProvider + extends $StreamNotifierProvider { + const EngineSettingsRepositoryProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'engineSettingsRepositoryProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$engineSettingsRepositoryHash(); + + @$internal + @override + EngineSettingsRepository create() => EngineSettingsRepository(); +} -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef EngineSettingsWithDefaultsRef = AutoDisposeProviderRef; String _$engineSettingsRepositoryHash() => r'd0c2fbe060b5eaee7189f6cb0dd58c97cf5987b5'; -/// See also [EngineSettingsRepository]. -@ProviderFor(EngineSettingsRepository) -final engineSettingsRepositoryProvider = - StreamNotifierProvider.internal( - EngineSettingsRepository.new, - name: r'engineSettingsRepositoryProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$engineSettingsRepositoryHash, - dependencies: null, - allTransitiveDependencies: null, - ); +abstract class _$EngineSettingsRepository + extends $StreamNotifier { + Stream build(); + @$mustCallSuper + @override + void runBuild() { + final created = build(); + final ref = this.ref as $Ref, EngineSettings>; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, EngineSettings>, + AsyncValue, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} -typedef _$EngineSettingsRepository = StreamNotifier; -// 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 +@ProviderFor(engineSettingsWithDefaults) +const engineSettingsWithDefaultsProvider = + EngineSettingsWithDefaultsProvider._(); + +final class EngineSettingsWithDefaultsProvider + extends $FunctionalProvider + with $Provider { + const EngineSettingsWithDefaultsProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'engineSettingsWithDefaultsProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$engineSettingsWithDefaultsHash(); + + @$internal + @override + $ProviderElement $createElement($ProviderPointer pointer) => + $ProviderElement(pointer); + + @override + EngineSettings create(Ref ref) { + return engineSettingsWithDefaults(ref); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(EngineSettings value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + +String _$engineSettingsWithDefaultsHash() => + r'd47fa79c0ad87a2357de58133585b4f6b097b068'; diff --git a/app/lib/features/user/domain/repositories/general_settings.dart b/app/lib/features/user/domain/repositories/general_settings.dart index 3760fc87..900e1907 100644 --- a/app/lib/features/user/domain/repositories/general_settings.dart +++ b/app/lib/features/user/domain/repositories/general_settings.dart @@ -149,7 +149,7 @@ class GeneralSettingsRepository extends _$GeneralSettingsRepository { GeneralSettings generalSettingsWithDefaults(Ref ref) { return ref.watch( generalSettingsRepositoryProvider.select( - (value) => value.valueOrNull ?? GeneralSettings.withDefaults(), + (value) => value.value ?? GeneralSettings.withDefaults(), ), ); } diff --git a/app/lib/features/user/domain/repositories/general_settings.g.dart b/app/lib/features/user/domain/repositories/general_settings.g.dart index 17df857e..ba689e40 100644 --- a/app/lib/features/user/domain/repositories/general_settings.g.dart +++ b/app/lib/features/user/domain/repositories/general_settings.g.dart @@ -6,42 +6,97 @@ part of 'general_settings.dart'; // RiverpodGenerator // ************************************************************************** -String _$generalSettingsWithDefaultsHash() => - r'd2a20cb527f8bf5a16e273933cf7ccc9d0851dc4'; +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning -/// See also [generalSettingsWithDefaults]. -@ProviderFor(generalSettingsWithDefaults) -final generalSettingsWithDefaultsProvider = - AutoDisposeProvider.internal( - generalSettingsWithDefaults, - name: r'generalSettingsWithDefaultsProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$generalSettingsWithDefaultsHash, - dependencies: null, - allTransitiveDependencies: null, - ); +@ProviderFor(GeneralSettingsRepository) +const generalSettingsRepositoryProvider = GeneralSettingsRepositoryProvider._(); + +final class GeneralSettingsRepositoryProvider + extends + $StreamNotifierProvider { + const GeneralSettingsRepositoryProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'generalSettingsRepositoryProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$generalSettingsRepositoryHash(); + + @$internal + @override + GeneralSettingsRepository create() => GeneralSettingsRepository(); +} -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef GeneralSettingsWithDefaultsRef = - AutoDisposeProviderRef; String _$generalSettingsRepositoryHash() => r'3e2a07b8956094cd9376a254d9aedaa80a3c45c4'; -/// See also [GeneralSettingsRepository]. -@ProviderFor(GeneralSettingsRepository) -final generalSettingsRepositoryProvider = - StreamNotifierProvider.internal( - GeneralSettingsRepository.new, - name: r'generalSettingsRepositoryProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$generalSettingsRepositoryHash, - dependencies: null, - allTransitiveDependencies: null, - ); +abstract class _$GeneralSettingsRepository + extends $StreamNotifier { + Stream build(); + @$mustCallSuper + @override + void runBuild() { + final created = build(); + final ref = this.ref as $Ref, GeneralSettings>; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, GeneralSettings>, + AsyncValue, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} -typedef _$GeneralSettingsRepository = StreamNotifier; -// 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 +@ProviderFor(generalSettingsWithDefaults) +const generalSettingsWithDefaultsProvider = + GeneralSettingsWithDefaultsProvider._(); + +final class GeneralSettingsWithDefaultsProvider + extends + $FunctionalProvider + with $Provider { + const GeneralSettingsWithDefaultsProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'generalSettingsWithDefaultsProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$generalSettingsWithDefaultsHash(); + + @$internal + @override + $ProviderElement $createElement($ProviderPointer pointer) => + $ProviderElement(pointer); + + @override + GeneralSettings create(Ref ref) { + return generalSettingsWithDefaults(ref); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(GeneralSettings value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + +String _$generalSettingsWithDefaultsHash() => + r'4b8ccd2d9ce6a07fd342a0a663d822f8c658655d'; diff --git a/app/lib/features/user/domain/repositories/onboarding.g.dart b/app/lib/features/user/domain/repositories/onboarding.g.dart index 1467476d..4ab1ac6b 100644 --- a/app/lib/features/user/domain/repositories/onboarding.g.dart +++ b/app/lib/features/user/domain/repositories/onboarding.g.dart @@ -6,22 +6,59 @@ part of 'onboarding.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(OnboardingRepository) +const onboardingRepositoryProvider = OnboardingRepositoryProvider._(); + +final class OnboardingRepositoryProvider + extends $NotifierProvider { + const OnboardingRepositoryProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'onboardingRepositoryProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$onboardingRepositoryHash(); + + @$internal + @override + OnboardingRepository create() => OnboardingRepository(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(void value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + String _$onboardingRepositoryHash() => r'937a5fe08c09cc0475270d3707bfb6f087bcf123'; -/// See also [OnboardingRepository]. -@ProviderFor(OnboardingRepository) -final onboardingRepositoryProvider = - NotifierProvider.internal( - OnboardingRepository.new, - name: r'onboardingRepositoryProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$onboardingRepositoryHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$OnboardingRepository = Notifier; -// 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 +abstract class _$OnboardingRepository extends $Notifier { + void build(); + @$mustCallSuper + @override + void runBuild() { + build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + void, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} diff --git a/app/lib/features/user/domain/repositories/tor_settings.dart b/app/lib/features/user/domain/repositories/tor_settings.dart index 96c55313..d4aab5dd 100644 --- a/app/lib/features/user/domain/repositories/tor_settings.dart +++ b/app/lib/features/user/domain/repositories/tor_settings.dart @@ -98,7 +98,7 @@ class TorSettingsRepository extends _$TorSettingsRepository { TorSettings torSettingsWithDefaults(Ref ref) { return ref.watch( torSettingsRepositoryProvider.select( - (value) => value.valueOrNull ?? TorSettings.withDefaults(), + (value) => value.value ?? TorSettings.withDefaults(), ), ); } diff --git a/app/lib/features/user/domain/repositories/tor_settings.g.dart b/app/lib/features/user/domain/repositories/tor_settings.g.dart index 492f951f..37751364 100644 --- a/app/lib/features/user/domain/repositories/tor_settings.g.dart +++ b/app/lib/features/user/domain/repositories/tor_settings.g.dart @@ -6,41 +6,93 @@ part of 'tor_settings.dart'; // RiverpodGenerator // ************************************************************************** -String _$torSettingsWithDefaultsHash() => - r'b355678ae49e038f7e1b60f2d5da3f806349cba8'; +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning -/// See also [torSettingsWithDefaults]. -@ProviderFor(torSettingsWithDefaults) -final torSettingsWithDefaultsProvider = - AutoDisposeProvider.internal( - torSettingsWithDefaults, - name: r'torSettingsWithDefaultsProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$torSettingsWithDefaultsHash, - dependencies: null, - allTransitiveDependencies: null, - ); +@ProviderFor(TorSettingsRepository) +const torSettingsRepositoryProvider = TorSettingsRepositoryProvider._(); + +final class TorSettingsRepositoryProvider + extends $StreamNotifierProvider { + const TorSettingsRepositoryProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'torSettingsRepositoryProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$torSettingsRepositoryHash(); + + @$internal + @override + TorSettingsRepository create() => TorSettingsRepository(); +} -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef TorSettingsWithDefaultsRef = AutoDisposeProviderRef; String _$torSettingsRepositoryHash() => r'ef80d1cc6b9b72cce371c03c656b10a0924d49d0'; -/// See also [TorSettingsRepository]. -@ProviderFor(TorSettingsRepository) -final torSettingsRepositoryProvider = - StreamNotifierProvider.internal( - TorSettingsRepository.new, - name: r'torSettingsRepositoryProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$torSettingsRepositoryHash, - dependencies: null, - allTransitiveDependencies: null, - ); +abstract class _$TorSettingsRepository extends $StreamNotifier { + Stream build(); + @$mustCallSuper + @override + void runBuild() { + final created = build(); + final ref = this.ref as $Ref, TorSettings>; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, TorSettings>, + AsyncValue, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} -typedef _$TorSettingsRepository = StreamNotifier; -// 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 +@ProviderFor(torSettingsWithDefaults) +const torSettingsWithDefaultsProvider = TorSettingsWithDefaultsProvider._(); + +final class TorSettingsWithDefaultsProvider + extends $FunctionalProvider + with $Provider { + const TorSettingsWithDefaultsProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'torSettingsWithDefaultsProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$torSettingsWithDefaultsHash(); + + @$internal + @override + $ProviderElement $createElement($ProviderPointer pointer) => + $ProviderElement(pointer); + + @override + TorSettings create(Ref ref) { + return torSettingsWithDefaults(ref); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(TorSettings value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + +String _$torSettingsWithDefaultsHash() => + r'47005584ad9d3445a8dfa54ffcd0987763997003'; diff --git a/app/lib/features/user/domain/services/local_authentication.g.dart b/app/lib/features/user/domain/services/local_authentication.g.dart index 736584ba..7ef01fa9 100644 --- a/app/lib/features/user/domain/services/local_authentication.g.dart +++ b/app/lib/features/user/domain/services/local_authentication.g.dart @@ -6,22 +6,52 @@ part of 'local_authentication.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(LocalAuthenticationService) +const localAuthenticationServiceProvider = + LocalAuthenticationServiceProvider._(); + +final class LocalAuthenticationServiceProvider + extends $AsyncNotifierProvider { + const LocalAuthenticationServiceProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'localAuthenticationServiceProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$localAuthenticationServiceHash(); + + @$internal + @override + LocalAuthenticationService create() => LocalAuthenticationService(); +} + String _$localAuthenticationServiceHash() => r'4893be7a11833d77a575f7aa248a9ba65d6717da'; -/// See also [LocalAuthenticationService]. -@ProviderFor(LocalAuthenticationService) -final localAuthenticationServiceProvider = - AsyncNotifierProvider.internal( - LocalAuthenticationService.new, - name: r'localAuthenticationServiceProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$localAuthenticationServiceHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$LocalAuthenticationService = AsyncNotifier; -// 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 +abstract class _$LocalAuthenticationService extends $AsyncNotifier { + FutureOr build(); + @$mustCallSuper + @override + void runBuild() { + final created = build(); + final ref = this.ref as $Ref, bool>; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, bool>, + AsyncValue, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} diff --git a/app/lib/features/web_feed/data/database/converters/feed_data.dart b/app/lib/features/web_feed/data/database/converters/feed_data.dart index 1df26d8c..35300c1d 100644 --- a/app/lib/features/web_feed/data/database/converters/feed_data.dart +++ b/app/lib/features/web_feed/data/database/converters/feed_data.dart @@ -18,7 +18,7 @@ * along with this program. If not, see . */ import 'package:json_annotation/json_annotation.dart'; -import 'package:weblibre/features/web_feed/data/database/database.dart'; +import 'package:weblibre/features/web_feed/data/database/definitions.drift.dart'; class FeedDataConverter extends JsonConverter> { const FeedDataConverter(); diff --git a/app/lib/features/web_feed/data/database/daos/article.dart b/app/lib/features/web_feed/data/database/daos/article.dart index f2aeaf9a..8b792231 100644 --- a/app/lib/features/web_feed/data/database/daos/article.dart +++ b/app/lib/features/web_feed/data/database/daos/article.dart @@ -18,14 +18,14 @@ * along with this program. If not, see . */ import 'package:drift/drift.dart'; +import 'package:weblibre/features/web_feed/data/database/daos/article.drift.dart'; import 'package:weblibre/features/web_feed/data/database/database.dart'; +import 'package:weblibre/features/web_feed/data/database/definitions.drift.dart'; import 'package:weblibre/features/web_feed/data/models/feed_article.dart'; import 'package:weblibre/features/web_feed/data/models/feed_article_query_result.dart'; -part 'article.g.dart'; - @DriftAccessor() -class ArticleDao extends DatabaseAccessor with _$ArticleDaoMixin { +class ArticleDao extends DatabaseAccessor with $ArticleDaoMixin { ArticleDao(super.attachedDatabase); Selectable getFeedArticles(Uri? url) { @@ -152,7 +152,7 @@ class ArticleDao extends DatabaseAccessor with _$ArticleDaoMixin { final ftsQuery = db.buildFtsQuery(searchString); if (ftsQuery.isNotEmpty) { - return db.queryArticlesFullContent( + return db.definitionsDrift.queryArticlesFullContent( feedId: feedId?.toString(), query: ftsQuery, snippetLength: snippetLength, @@ -161,7 +161,7 @@ class ArticleDao extends DatabaseAccessor with _$ArticleDaoMixin { ellipsis: ellipsis, ); } else { - return db.queryArticlesBasic( + return db.definitionsDrift.queryArticlesBasic( feedId: feedId?.toString(), query: db.buildLikeQuery(searchString), ); diff --git a/app/lib/features/web_feed/data/database/daos/article.drift.dart b/app/lib/features/web_feed/data/database/daos/article.drift.dart new file mode 100644 index 00000000..6a5d43f1 --- /dev/null +++ b/app/lib/features/web_feed/data/database/daos/article.drift.dart @@ -0,0 +1,6 @@ +// dart format width=80 +// ignore_for_file: type=lint +import 'package:drift/drift.dart' as i0; +import 'package:weblibre/features/web_feed/data/database/database.dart' as i1; + +mixin $ArticleDaoMixin on i0.DatabaseAccessor {} diff --git a/app/lib/features/web_feed/data/database/daos/article.g.dart b/app/lib/features/web_feed/data/database/daos/article.g.dart deleted file mode 100644 index a2904668..00000000 --- a/app/lib/features/web_feed/data/database/daos/article.g.dart +++ /dev/null @@ -1,6 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'article.dart'; - -// ignore_for_file: type=lint -mixin _$ArticleDaoMixin on DatabaseAccessor {} diff --git a/app/lib/features/web_feed/data/database/daos/feed.dart b/app/lib/features/web_feed/data/database/daos/feed.dart index 356b2fc5..473823a4 100644 --- a/app/lib/features/web_feed/data/database/daos/feed.dart +++ b/app/lib/features/web_feed/data/database/daos/feed.dart @@ -18,12 +18,12 @@ * along with this program. If not, see . */ import 'package:drift/drift.dart'; +import 'package:weblibre/features/web_feed/data/database/daos/feed.drift.dart'; import 'package:weblibre/features/web_feed/data/database/database.dart'; - -part 'feed.g.dart'; +import 'package:weblibre/features/web_feed/data/database/definitions.drift.dart'; @DriftAccessor() -class FeedDao extends DatabaseAccessor with _$FeedDaoMixin { +class FeedDao extends DatabaseAccessor with $FeedDaoMixin { FeedDao(super.attachedDatabase); Selectable getFeeds() { diff --git a/app/lib/features/web_feed/data/database/daos/feed.drift.dart b/app/lib/features/web_feed/data/database/daos/feed.drift.dart new file mode 100644 index 00000000..336d4d9c --- /dev/null +++ b/app/lib/features/web_feed/data/database/daos/feed.drift.dart @@ -0,0 +1,6 @@ +// dart format width=80 +// ignore_for_file: type=lint +import 'package:drift/drift.dart' as i0; +import 'package:weblibre/features/web_feed/data/database/database.dart' as i1; + +mixin $FeedDaoMixin on i0.DatabaseAccessor {} diff --git a/app/lib/features/web_feed/data/database/daos/feed.g.dart b/app/lib/features/web_feed/data/database/daos/feed.g.dart deleted file mode 100644 index 95d0ecec..00000000 --- a/app/lib/features/web_feed/data/database/daos/feed.g.dart +++ /dev/null @@ -1,6 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'feed.dart'; - -// ignore_for_file: type=lint -mixin _$FeedDaoMixin on DatabaseAccessor {} diff --git a/app/lib/features/web_feed/data/database/database.dart b/app/lib/features/web_feed/data/database/database.dart index 6e8b9a48..145b16dd 100644 --- a/app/lib/features/web_feed/data/database/database.dart +++ b/app/lib/features/web_feed/data/database/database.dart @@ -18,23 +18,13 @@ * along with this program. If not, see . */ import 'package:drift/drift.dart'; -import 'package:weblibre/data/database/converters/uri.dart'; import 'package:weblibre/features/search/domain/fts_tokenizer.dart'; -import 'package:weblibre/features/web_feed/data/database/converters/feed_authors.dart'; -import 'package:weblibre/features/web_feed/data/database/converters/feed_categories.dart'; -import 'package:weblibre/features/web_feed/data/database/converters/feed_links.dart'; import 'package:weblibre/features/web_feed/data/database/daos/article.dart'; import 'package:weblibre/features/web_feed/data/database/daos/feed.dart'; -import 'package:weblibre/features/web_feed/data/models/feed_article.dart'; -import 'package:weblibre/features/web_feed/data/models/feed_article_query_result.dart'; -import 'package:weblibre/features/web_feed/data/models/feed_author.dart'; -import 'package:weblibre/features/web_feed/data/models/feed_category.dart'; -import 'package:weblibre/features/web_feed/data/models/feed_link.dart'; +import 'package:weblibre/features/web_feed/data/database/database.drift.dart'; -part 'database.g.dart'; - -@DriftDatabase(include: {'database.drift'}, daos: [ArticleDao, FeedDao]) -class FeedDatabase extends _$FeedDatabase with TrigramQueryBuilderMixin { +@DriftDatabase(include: {'definitions.drift'}, daos: [ArticleDao, FeedDao]) +class FeedDatabase extends $FeedDatabase with TrigramQueryBuilderMixin { @override final int schemaVersion = 1; @@ -47,7 +37,7 @@ class FeedDatabase extends _$FeedDatabase with TrigramQueryBuilderMixin { MigrationStrategy get migration => MigrationStrategy( beforeOpen: (details) async { await customStatement('PRAGMA foreign_keys = ON;'); - await optimizeFtsIndex(); + await definitionsDrift.optimizeFtsIndex(); }, ); diff --git a/app/lib/features/web_feed/data/database/database.drift.dart b/app/lib/features/web_feed/data/database/database.drift.dart new file mode 100644 index 00000000..1847c465 --- /dev/null +++ b/app/lib/features/web_feed/data/database/database.drift.dart @@ -0,0 +1,127 @@ +// dart format width=80 +// ignore_for_file: type=lint +import 'package:drift/drift.dart' as i0; +import 'package:weblibre/features/web_feed/data/database/definitions.drift.dart' + as i1; +import 'package:weblibre/features/web_feed/data/database/daos/article.dart' + as i2; +import 'package:weblibre/features/web_feed/data/database/database.dart' as i3; +import 'package:weblibre/features/web_feed/data/database/daos/feed.dart' as i4; +import 'package:drift/internal/modular.dart' as i5; +import 'package:sqlite3/common.dart' as i6; + +abstract class $FeedDatabase extends i0.GeneratedDatabase { + $FeedDatabase(i0.QueryExecutor e) : super(e); + $FeedDatabaseManager get managers => $FeedDatabaseManager(this); + late final i1.Feed feed = i1.Feed(this); + late final i1.Article article = i1.Article(this); + late final i1.ArticleView articleView = i1.ArticleView(this); + late final i1.ArticleFts articleFts = i1.ArticleFts(this); + late final i2.ArticleDao articleDao = i2.ArticleDao(this as i3.FeedDatabase); + late final i4.FeedDao feedDao = i4.FeedDao(this as i3.FeedDatabase); + i1.DefinitionsDrift get definitionsDrift => i5.ReadDatabaseContainer( + this, + ).accessor(i1.DefinitionsDrift.new); + @override + Iterable> get allTables => + allSchemaEntities.whereType>(); + @override + List get allSchemaEntities => [ + feed, + article, + articleView, + i1.articleFeedId, + articleFts, + i1.articleAfterInsert, + i1.articleAfterDelete, + i1.articleAfterUpdate, + ]; + @override + i0.StreamQueryUpdateRules get streamUpdateRules => + const i0.StreamQueryUpdateRules([ + i0.WritePropagation( + on: i0.TableUpdateQuery.onTableName( + 'feed', + limitUpdateKind: i0.UpdateKind.delete, + ), + result: [i0.TableUpdate('article', kind: i0.UpdateKind.delete)], + ), + i0.WritePropagation( + on: i0.TableUpdateQuery.onTableName( + 'article', + limitUpdateKind: i0.UpdateKind.insert, + ), + result: [i0.TableUpdate('article_fts', kind: i0.UpdateKind.insert)], + ), + i0.WritePropagation( + on: i0.TableUpdateQuery.onTableName( + 'article', + limitUpdateKind: i0.UpdateKind.delete, + ), + result: [i0.TableUpdate('article_fts', kind: i0.UpdateKind.insert)], + ), + i0.WritePropagation( + on: i0.TableUpdateQuery.onTableName( + 'article', + limitUpdateKind: i0.UpdateKind.update, + ), + result: [i0.TableUpdate('article_fts', kind: i0.UpdateKind.insert)], + ), + ]); +} + +class $FeedDatabaseManager { + final $FeedDatabase _db; + $FeedDatabaseManager(this._db); + i1.$FeedTableManager get feed => i1.$FeedTableManager(_db, _db.feed); + i1.$ArticleTableManager get article => + i1.$ArticleTableManager(_db, _db.article); + i1.$ArticleFtsTableManager get articleFts => + i1.$ArticleFtsTableManager(_db, _db.articleFts); +} + +extension DefineFunctions on i6.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 i6.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 i6.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 i6.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 i6.AllowedArgumentCount(2), + function: (args) { + final arg0 = args[0] as String?; + final arg1 = args[1] as String?; + return lexoRankReorderBefore(arg0, arg1); + }, + ); + } +} diff --git a/app/lib/features/web_feed/data/database/database.g.dart b/app/lib/features/web_feed/data/database/database.g.dart deleted file mode 100644 index 30c38493..00000000 --- a/app/lib/features/web_feed/data/database/database.g.dart +++ /dev/null @@ -1,2671 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'database.dart'; - -// ignore_for_file: type=lint -class Feed extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - Feed(this.attachedDatabase, [this._alias]); - late final GeneratedColumnWithTypeConverter url = - GeneratedColumn( - 'url', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'PRIMARY KEY NOT NULL', - ).withConverter(Feed.$converterurl); - late final GeneratedColumn title = GeneratedColumn( - 'title', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: '', - ); - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: '', - ); - late final GeneratedColumnWithTypeConverter icon = - GeneratedColumn( - 'icon', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: '', - ).withConverter(Feed.$convertericon); - late final GeneratedColumnWithTypeConverter siteLink = - GeneratedColumn( - 'site_link', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: '', - ).withConverter(Feed.$convertersiteLink); - late final GeneratedColumnWithTypeConverter?, String> - authors = GeneratedColumn( - 'authors', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: '', - ).withConverter?>(Feed.$converterauthorsn); - late final GeneratedColumnWithTypeConverter?, String> - tags = GeneratedColumn( - 'tags', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: '', - ).withConverter?>(Feed.$convertertagsn); - late final GeneratedColumn lastFetched = GeneratedColumn( - 'last_fetched', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - $customConstraints: '', - ); - @override - List get $columns => [ - url, - title, - description, - icon, - siteLink, - authors, - tags, - lastFetched, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'feed'; - @override - Set get $primaryKey => {url}; - @override - FeedData map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return FeedData( - url: Feed.$converterurl.fromSql( - attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}url'], - )!, - ), - title: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}title'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - icon: Feed.$convertericon.fromSql( - attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}icon'], - ), - ), - siteLink: Feed.$convertersiteLink.fromSql( - attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}site_link'], - ), - ), - authors: Feed.$converterauthorsn.fromSql( - attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}authors'], - ), - ), - tags: Feed.$convertertagsn.fromSql( - attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}tags'], - ), - ), - lastFetched: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}last_fetched'], - ), - ); - } - - @override - Feed createAlias(String alias) { - return Feed(attachedDatabase, alias); - } - - static TypeConverter $converterurl = const UriConverter(); - static TypeConverter $convertericon = - const UriConverterNullable(); - static TypeConverter $convertersiteLink = - const UriConverterNullable(); - static TypeConverter, String> $converterauthors = - const FeedAuthorsConverter(); - static TypeConverter?, String?> $converterauthorsn = - NullAwareTypeConverter.wrap($converterauthors); - static TypeConverter, String> $convertertags = - const FeedCategoriesConverter(); - static TypeConverter?, String?> $convertertagsn = - NullAwareTypeConverter.wrap($convertertags); - @override - bool get dontWriteConstraints => true; -} - -class FeedData extends DataClass implements Insertable { - final Uri url; - final String? title; - final String? description; - final Uri? icon; - final Uri? siteLink; - final List? authors; - final List? tags; - final DateTime? lastFetched; - const FeedData({ - required this.url, - this.title, - this.description, - this.icon, - this.siteLink, - this.authors, - this.tags, - this.lastFetched, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - { - map['url'] = Variable(Feed.$converterurl.toSql(url)); - } - if (!nullToAbsent || title != null) { - map['title'] = Variable(title); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || icon != null) { - map['icon'] = Variable(Feed.$convertericon.toSql(icon)); - } - if (!nullToAbsent || siteLink != null) { - map['site_link'] = Variable( - Feed.$convertersiteLink.toSql(siteLink), - ); - } - if (!nullToAbsent || authors != null) { - map['authors'] = Variable(Feed.$converterauthorsn.toSql(authors)); - } - if (!nullToAbsent || tags != null) { - map['tags'] = Variable(Feed.$convertertagsn.toSql(tags)); - } - if (!nullToAbsent || lastFetched != null) { - map['last_fetched'] = Variable(lastFetched); - } - return map; - } - - factory FeedData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return FeedData( - url: serializer.fromJson(json['url']), - title: serializer.fromJson(json['title']), - description: serializer.fromJson(json['description']), - icon: serializer.fromJson(json['icon']), - siteLink: serializer.fromJson(json['site_link']), - authors: serializer.fromJson?>(json['authors']), - tags: serializer.fromJson?>(json['tags']), - lastFetched: serializer.fromJson(json['last_fetched']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'url': serializer.toJson(url), - 'title': serializer.toJson(title), - 'description': serializer.toJson(description), - 'icon': serializer.toJson(icon), - 'site_link': serializer.toJson(siteLink), - 'authors': serializer.toJson?>(authors), - 'tags': serializer.toJson?>(tags), - 'last_fetched': serializer.toJson(lastFetched), - }; - } - - FeedData copyWith({ - Uri? url, - Value title = const Value.absent(), - Value description = const Value.absent(), - Value icon = const Value.absent(), - Value siteLink = const Value.absent(), - Value?> authors = const Value.absent(), - Value?> tags = const Value.absent(), - Value lastFetched = const Value.absent(), - }) => FeedData( - url: url ?? this.url, - title: title.present ? title.value : this.title, - description: description.present ? description.value : this.description, - icon: icon.present ? icon.value : this.icon, - siteLink: siteLink.present ? siteLink.value : this.siteLink, - authors: authors.present ? authors.value : this.authors, - tags: tags.present ? tags.value : this.tags, - lastFetched: lastFetched.present ? lastFetched.value : this.lastFetched, - ); - FeedData copyWithCompanion(FeedCompanion data) { - return FeedData( - url: data.url.present ? data.url.value : this.url, - title: data.title.present ? data.title.value : this.title, - description: data.description.present - ? data.description.value - : this.description, - icon: data.icon.present ? data.icon.value : this.icon, - siteLink: data.siteLink.present ? data.siteLink.value : this.siteLink, - authors: data.authors.present ? data.authors.value : this.authors, - tags: data.tags.present ? data.tags.value : this.tags, - lastFetched: data.lastFetched.present - ? data.lastFetched.value - : this.lastFetched, - ); - } - - @override - String toString() { - return (StringBuffer('FeedData(') - ..write('url: $url, ') - ..write('title: $title, ') - ..write('description: $description, ') - ..write('icon: $icon, ') - ..write('siteLink: $siteLink, ') - ..write('authors: $authors, ') - ..write('tags: $tags, ') - ..write('lastFetched: $lastFetched') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - url, - title, - description, - icon, - siteLink, - authors, - tags, - lastFetched, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is FeedData && - other.url == this.url && - other.title == this.title && - other.description == this.description && - other.icon == this.icon && - other.siteLink == this.siteLink && - other.authors == this.authors && - other.tags == this.tags && - other.lastFetched == this.lastFetched); -} - -class FeedCompanion extends UpdateCompanion { - final Value url; - final Value title; - final Value description; - final Value icon; - final Value siteLink; - final Value?> authors; - final Value?> tags; - final Value lastFetched; - final Value rowid; - const FeedCompanion({ - this.url = const Value.absent(), - this.title = const Value.absent(), - this.description = const Value.absent(), - this.icon = const Value.absent(), - this.siteLink = const Value.absent(), - this.authors = const Value.absent(), - this.tags = const Value.absent(), - this.lastFetched = const Value.absent(), - this.rowid = const Value.absent(), - }); - FeedCompanion.insert({ - required Uri url, - this.title = const Value.absent(), - this.description = const Value.absent(), - this.icon = const Value.absent(), - this.siteLink = const Value.absent(), - this.authors = const Value.absent(), - this.tags = const Value.absent(), - this.lastFetched = const Value.absent(), - this.rowid = const Value.absent(), - }) : url = Value(url); - static Insertable custom({ - Expression? url, - Expression? title, - Expression? description, - Expression? icon, - Expression? siteLink, - Expression? authors, - Expression? tags, - Expression? lastFetched, - Expression? rowid, - }) { - return RawValuesInsertable({ - if (url != null) 'url': url, - if (title != null) 'title': title, - if (description != null) 'description': description, - if (icon != null) 'icon': icon, - if (siteLink != null) 'site_link': siteLink, - if (authors != null) 'authors': authors, - if (tags != null) 'tags': tags, - if (lastFetched != null) 'last_fetched': lastFetched, - if (rowid != null) 'rowid': rowid, - }); - } - - FeedCompanion copyWith({ - Value? url, - Value? title, - Value? description, - Value? icon, - Value? siteLink, - Value?>? authors, - Value?>? tags, - Value? lastFetched, - Value? rowid, - }) { - return FeedCompanion( - url: url ?? this.url, - title: title ?? this.title, - description: description ?? this.description, - icon: icon ?? this.icon, - siteLink: siteLink ?? this.siteLink, - authors: authors ?? this.authors, - tags: tags ?? this.tags, - lastFetched: lastFetched ?? this.lastFetched, - rowid: rowid ?? this.rowid, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (url.present) { - map['url'] = Variable(Feed.$converterurl.toSql(url.value)); - } - if (title.present) { - map['title'] = Variable(title.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (icon.present) { - map['icon'] = Variable(Feed.$convertericon.toSql(icon.value)); - } - if (siteLink.present) { - map['site_link'] = Variable( - Feed.$convertersiteLink.toSql(siteLink.value), - ); - } - if (authors.present) { - map['authors'] = Variable( - Feed.$converterauthorsn.toSql(authors.value), - ); - } - if (tags.present) { - map['tags'] = Variable(Feed.$convertertagsn.toSql(tags.value)); - } - if (lastFetched.present) { - map['last_fetched'] = Variable(lastFetched.value); - } - if (rowid.present) { - map['rowid'] = Variable(rowid.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('FeedCompanion(') - ..write('url: $url, ') - ..write('title: $title, ') - ..write('description: $description, ') - ..write('icon: $icon, ') - ..write('siteLink: $siteLink, ') - ..write('authors: $authors, ') - ..write('tags: $tags, ') - ..write('lastFetched: $lastFetched, ') - ..write('rowid: $rowid') - ..write(')')) - .toString(); - } -} - -class Article extends Table with TableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - Article(this.attachedDatabase, [this._alias]); - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'PRIMARY KEY NOT NULL', - ); - late final GeneratedColumnWithTypeConverter feedId = - GeneratedColumn( - 'feed_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL REFERENCES feed(url)ON DELETE CASCADE', - ).withConverter(Article.$converterfeedId); - late final GeneratedColumn fetched = GeneratedColumn( - 'fetched', - aliasedName, - false, - type: DriftSqlType.dateTime, - requiredDuringInsert: true, - $customConstraints: 'NOT NULL', - ); - late final GeneratedColumn created = GeneratedColumn( - 'created', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - $customConstraints: '', - ); - late final GeneratedColumn updated = GeneratedColumn( - 'updated', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - $customConstraints: '', - ); - late final GeneratedColumn lastRead = GeneratedColumn( - 'last_read', - aliasedName, - true, - type: DriftSqlType.dateTime, - requiredDuringInsert: false, - $customConstraints: '', - ); - late final GeneratedColumn title = GeneratedColumn( - 'title', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: '', - ); - late final GeneratedColumnWithTypeConverter?, String> - authors = GeneratedColumn( - 'authors', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: '', - ).withConverter?>(Article.$converterauthorsn); - late final GeneratedColumnWithTypeConverter?, String> - tags = GeneratedColumn( - 'tags', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: '', - ).withConverter?>(Article.$convertertagsn); - late final GeneratedColumnWithTypeConverter?, String> links = - GeneratedColumn( - 'links', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: '', - ).withConverter?>(Article.$converterlinksn); - late final GeneratedColumn summaryHtml = GeneratedColumn( - 'summaryHtml', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: '', - ); - late final GeneratedColumn summaryMarkdown = GeneratedColumn( - 'summaryMarkdown', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: '', - ); - late final GeneratedColumn summaryPlain = GeneratedColumn( - 'summaryPlain', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: '', - ); - late final GeneratedColumn contentHtml = GeneratedColumn( - 'contentHtml', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: '', - ); - late final GeneratedColumn contentMarkdown = GeneratedColumn( - 'contentMarkdown', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: '', - ); - late final GeneratedColumn contentPlain = GeneratedColumn( - 'contentPlain', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - $customConstraints: '', - ); - @override - List get $columns => [ - id, - feedId, - fetched, - created, - updated, - lastRead, - title, - authors, - tags, - links, - summaryHtml, - summaryMarkdown, - summaryPlain, - contentHtml, - contentMarkdown, - contentPlain, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'article'; - @override - Set get $primaryKey => {id}; - @override - FeedArticle map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return FeedArticle( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - feedId: Article.$converterfeedId.fromSql( - attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}feed_id'], - )!, - ), - fetched: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}fetched'], - )!, - created: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created'], - ), - updated: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated'], - ), - lastRead: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}last_read'], - ), - title: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}title'], - ), - authors: Article.$converterauthorsn.fromSql( - attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}authors'], - ), - ), - tags: Article.$convertertagsn.fromSql( - attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}tags'], - ), - ), - links: Article.$converterlinksn.fromSql( - attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}links'], - ), - ), - summaryHtml: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}summaryHtml'], - ), - summaryMarkdown: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}summaryMarkdown'], - ), - summaryPlain: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}summaryPlain'], - ), - contentHtml: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}contentHtml'], - ), - contentMarkdown: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}contentMarkdown'], - ), - contentPlain: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}contentPlain'], - ), - ); - } - - @override - Article createAlias(String alias) { - return Article(attachedDatabase, alias); - } - - static TypeConverter $converterfeedId = const UriConverter(); - static TypeConverter, String> $converterauthors = - const FeedAuthorsConverter(); - static TypeConverter?, String?> $converterauthorsn = - NullAwareTypeConverter.wrap($converterauthors); - static TypeConverter, String> $convertertags = - const FeedCategoriesConverter(); - static TypeConverter?, String?> $convertertagsn = - NullAwareTypeConverter.wrap($convertertags); - static TypeConverter, String> $converterlinks = - const FeedLinksConverter(); - static TypeConverter?, String?> $converterlinksn = - NullAwareTypeConverter.wrap($converterlinks); - @override - bool get dontWriteConstraints => true; -} - -class ArticleCompanion extends UpdateCompanion { - final Value id; - final Value feedId; - final Value fetched; - final Value created; - final Value updated; - final Value lastRead; - final Value title; - final Value?> authors; - final Value?> tags; - final Value?> links; - final Value summaryHtml; - final Value summaryMarkdown; - final Value summaryPlain; - final Value contentHtml; - final Value contentMarkdown; - final Value contentPlain; - final Value rowid; - const ArticleCompanion({ - this.id = const Value.absent(), - this.feedId = const Value.absent(), - this.fetched = const Value.absent(), - this.created = const Value.absent(), - this.updated = const Value.absent(), - this.lastRead = const Value.absent(), - this.title = const Value.absent(), - this.authors = const Value.absent(), - this.tags = const Value.absent(), - this.links = const Value.absent(), - this.summaryHtml = const Value.absent(), - this.summaryMarkdown = const Value.absent(), - this.summaryPlain = const Value.absent(), - this.contentHtml = const Value.absent(), - this.contentMarkdown = const Value.absent(), - this.contentPlain = const Value.absent(), - this.rowid = const Value.absent(), - }); - ArticleCompanion.insert({ - required String id, - required Uri feedId, - required DateTime fetched, - this.created = const Value.absent(), - this.updated = const Value.absent(), - this.lastRead = const Value.absent(), - this.title = const Value.absent(), - this.authors = const Value.absent(), - this.tags = const Value.absent(), - this.links = const Value.absent(), - this.summaryHtml = const Value.absent(), - this.summaryMarkdown = const Value.absent(), - this.summaryPlain = const Value.absent(), - this.contentHtml = const Value.absent(), - this.contentMarkdown = const Value.absent(), - this.contentPlain = const Value.absent(), - this.rowid = const Value.absent(), - }) : id = Value(id), - feedId = Value(feedId), - fetched = Value(fetched); - static Insertable custom({ - Expression? id, - Expression? feedId, - Expression? fetched, - Expression? created, - Expression? updated, - Expression? lastRead, - Expression? title, - Expression? authors, - Expression? tags, - Expression? links, - Expression? summaryHtml, - Expression? summaryMarkdown, - Expression? summaryPlain, - Expression? contentHtml, - Expression? contentMarkdown, - Expression? contentPlain, - Expression? rowid, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (feedId != null) 'feed_id': feedId, - if (fetched != null) 'fetched': fetched, - if (created != null) 'created': created, - if (updated != null) 'updated': updated, - if (lastRead != null) 'last_read': lastRead, - if (title != null) 'title': title, - if (authors != null) 'authors': authors, - if (tags != null) 'tags': tags, - if (links != null) 'links': links, - if (summaryHtml != null) 'summaryHtml': summaryHtml, - if (summaryMarkdown != null) 'summaryMarkdown': summaryMarkdown, - if (summaryPlain != null) 'summaryPlain': summaryPlain, - if (contentHtml != null) 'contentHtml': contentHtml, - if (contentMarkdown != null) 'contentMarkdown': contentMarkdown, - if (contentPlain != null) 'contentPlain': contentPlain, - if (rowid != null) 'rowid': rowid, - }); - } - - ArticleCompanion copyWith({ - Value? id, - Value? feedId, - Value? fetched, - Value? created, - Value? updated, - Value? lastRead, - Value? title, - Value?>? authors, - Value?>? tags, - Value?>? links, - Value? summaryHtml, - Value? summaryMarkdown, - Value? summaryPlain, - Value? contentHtml, - Value? contentMarkdown, - Value? contentPlain, - Value? rowid, - }) { - return ArticleCompanion( - id: id ?? this.id, - feedId: feedId ?? this.feedId, - fetched: fetched ?? this.fetched, - created: created ?? this.created, - updated: updated ?? this.updated, - lastRead: lastRead ?? this.lastRead, - title: title ?? this.title, - authors: authors ?? this.authors, - tags: tags ?? this.tags, - links: links ?? this.links, - summaryHtml: summaryHtml ?? this.summaryHtml, - summaryMarkdown: summaryMarkdown ?? this.summaryMarkdown, - summaryPlain: summaryPlain ?? this.summaryPlain, - contentHtml: contentHtml ?? this.contentHtml, - contentMarkdown: contentMarkdown ?? this.contentMarkdown, - contentPlain: contentPlain ?? this.contentPlain, - rowid: rowid ?? this.rowid, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (feedId.present) { - map['feed_id'] = Variable( - Article.$converterfeedId.toSql(feedId.value), - ); - } - if (fetched.present) { - map['fetched'] = Variable(fetched.value); - } - if (created.present) { - map['created'] = Variable(created.value); - } - if (updated.present) { - map['updated'] = Variable(updated.value); - } - if (lastRead.present) { - map['last_read'] = Variable(lastRead.value); - } - if (title.present) { - map['title'] = Variable(title.value); - } - if (authors.present) { - map['authors'] = Variable( - Article.$converterauthorsn.toSql(authors.value), - ); - } - if (tags.present) { - map['tags'] = Variable(Article.$convertertagsn.toSql(tags.value)); - } - if (links.present) { - map['links'] = Variable( - Article.$converterlinksn.toSql(links.value), - ); - } - if (summaryHtml.present) { - map['summaryHtml'] = Variable(summaryHtml.value); - } - if (summaryMarkdown.present) { - map['summaryMarkdown'] = Variable(summaryMarkdown.value); - } - if (summaryPlain.present) { - map['summaryPlain'] = Variable(summaryPlain.value); - } - if (contentHtml.present) { - map['contentHtml'] = Variable(contentHtml.value); - } - if (contentMarkdown.present) { - map['contentMarkdown'] = Variable(contentMarkdown.value); - } - if (contentPlain.present) { - map['contentPlain'] = Variable(contentPlain.value); - } - if (rowid.present) { - map['rowid'] = Variable(rowid.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('ArticleCompanion(') - ..write('id: $id, ') - ..write('feedId: $feedId, ') - ..write('fetched: $fetched, ') - ..write('created: $created, ') - ..write('updated: $updated, ') - ..write('lastRead: $lastRead, ') - ..write('title: $title, ') - ..write('authors: $authors, ') - ..write('tags: $tags, ') - ..write('links: $links, ') - ..write('summaryHtml: $summaryHtml, ') - ..write('summaryMarkdown: $summaryMarkdown, ') - ..write('summaryPlain: $summaryPlain, ') - ..write('contentHtml: $contentHtml, ') - ..write('contentMarkdown: $contentMarkdown, ') - ..write('contentPlain: $contentPlain, ') - ..write('rowid: $rowid') - ..write(')')) - .toString(); - } -} - -class ArticleView extends ViewInfo - implements HasResultSet { - final String? _alias; - @override - final _$FeedDatabase attachedDatabase; - ArticleView(this.attachedDatabase, [this._alias]); - @override - List get $columns => [ - id, - feedId, - fetched, - created, - updated, - lastRead, - title, - authors, - tags, - links, - summaryHtml, - summaryMarkdown, - summaryPlain, - contentHtml, - contentMarkdown, - contentPlain, - icon, - siteLink, - ]; - @override - String get aliasedName => _alias ?? entityName; - @override - String get entityName => 'article_view'; - @override - Map get createViewStatements => { - SqlDialect.sqlite: - 'CREATE VIEW article_view AS SELECT a.*, f.icon, f.site_link FROM article AS a INNER JOIN feed AS f ON f.url = a.feed_id', - }; - @override - ArticleView get asDslTable => this; - @override - FeedArticle map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return FeedArticle( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - feedId: Article.$converterfeedId.fromSql( - attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}feed_id'], - )!, - ), - fetched: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}fetched'], - )!, - created: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}created'], - ), - updated: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}updated'], - ), - lastRead: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}last_read'], - ), - title: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}title'], - ), - authors: Article.$converterauthorsn.fromSql( - attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}authors'], - ), - ), - tags: Article.$convertertagsn.fromSql( - attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}tags'], - ), - ), - links: Article.$converterlinksn.fromSql( - attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}links'], - ), - ), - summaryHtml: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}summaryHtml'], - ), - summaryMarkdown: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}summaryMarkdown'], - ), - summaryPlain: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}summaryPlain'], - ), - contentHtml: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}contentHtml'], - ), - contentMarkdown: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}contentMarkdown'], - ), - contentPlain: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}contentPlain'], - ), - icon: Feed.$convertericon.fromSql( - attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}icon'], - ), - ), - siteLink: Feed.$convertersiteLink.fromSql( - attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}site_link'], - ), - ), - ); - } - - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - ); - late final GeneratedColumnWithTypeConverter feedId = - GeneratedColumn( - 'feed_id', - aliasedName, - false, - type: DriftSqlType.string, - ).withConverter(Article.$converterfeedId); - late final GeneratedColumn fetched = GeneratedColumn( - 'fetched', - aliasedName, - false, - type: DriftSqlType.dateTime, - ); - late final GeneratedColumn created = GeneratedColumn( - 'created', - aliasedName, - true, - type: DriftSqlType.dateTime, - ); - late final GeneratedColumn updated = GeneratedColumn( - 'updated', - aliasedName, - true, - type: DriftSqlType.dateTime, - ); - late final GeneratedColumn lastRead = GeneratedColumn( - 'last_read', - aliasedName, - true, - type: DriftSqlType.dateTime, - ); - late final GeneratedColumn title = GeneratedColumn( - 'title', - aliasedName, - true, - type: DriftSqlType.string, - ); - late final GeneratedColumnWithTypeConverter?, String> - authors = GeneratedColumn( - 'authors', - aliasedName, - true, - type: DriftSqlType.string, - ).withConverter?>(Article.$converterauthorsn); - late final GeneratedColumnWithTypeConverter?, String> - tags = GeneratedColumn( - 'tags', - aliasedName, - true, - type: DriftSqlType.string, - ).withConverter?>(Article.$convertertagsn); - late final GeneratedColumnWithTypeConverter?, String> links = - GeneratedColumn( - 'links', - aliasedName, - true, - type: DriftSqlType.string, - ).withConverter?>(Article.$converterlinksn); - late final GeneratedColumn summaryHtml = GeneratedColumn( - 'summaryHtml', - aliasedName, - true, - type: DriftSqlType.string, - ); - late final GeneratedColumn summaryMarkdown = GeneratedColumn( - 'summaryMarkdown', - aliasedName, - true, - type: DriftSqlType.string, - ); - late final GeneratedColumn summaryPlain = GeneratedColumn( - 'summaryPlain', - aliasedName, - true, - type: DriftSqlType.string, - ); - late final GeneratedColumn contentHtml = GeneratedColumn( - 'contentHtml', - aliasedName, - true, - type: DriftSqlType.string, - ); - late final GeneratedColumn contentMarkdown = GeneratedColumn( - 'contentMarkdown', - aliasedName, - true, - type: DriftSqlType.string, - ); - late final GeneratedColumn contentPlain = GeneratedColumn( - 'contentPlain', - aliasedName, - true, - type: DriftSqlType.string, - ); - late final GeneratedColumnWithTypeConverter icon = - GeneratedColumn( - 'icon', - aliasedName, - true, - type: DriftSqlType.string, - ).withConverter(Feed.$convertericon); - late final GeneratedColumnWithTypeConverter siteLink = - GeneratedColumn( - 'site_link', - aliasedName, - true, - type: DriftSqlType.string, - ).withConverter(Feed.$convertersiteLink); - @override - ArticleView createAlias(String alias) { - return ArticleView(attachedDatabase, alias); - } - - @override - Query? get query => null; - @override - Set get readTables => const {'article', 'feed'}; -} - -class ArticleFts extends Table - with - TableInfo, - VirtualTableInfo { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - ArticleFts(this.attachedDatabase, [this._alias]); - late final GeneratedColumn title = GeneratedColumn( - 'title', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: '', - ); - late final GeneratedColumn summaryPlain = GeneratedColumn( - 'summaryPlain', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: '', - ); - late final GeneratedColumn contentPlain = GeneratedColumn( - 'contentPlain', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - $customConstraints: '', - ); - @override - List get $columns => [title, summaryPlain, contentPlain]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'article_fts'; - @override - Set get $primaryKey => const {}; - @override - ArticleFt map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return ArticleFt( - title: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}title'], - )!, - summaryPlain: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}summaryPlain'], - )!, - contentPlain: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}contentPlain'], - )!, - ); - } - - @override - ArticleFts createAlias(String alias) { - return ArticleFts(attachedDatabase, alias); - } - - @override - bool get dontWriteConstraints => true; - @override - String get moduleAndArgs => - 'fts5(title, summaryPlain, contentPlain, content=article, tokenize="trigram")'; -} - -class ArticleFt extends DataClass implements Insertable { - final String title; - final String summaryPlain; - final String contentPlain; - const ArticleFt({ - required this.title, - required this.summaryPlain, - required this.contentPlain, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['title'] = Variable(title); - map['summaryPlain'] = Variable(summaryPlain); - map['contentPlain'] = Variable(contentPlain); - return map; - } - - factory ArticleFt.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return ArticleFt( - title: serializer.fromJson(json['title']), - summaryPlain: serializer.fromJson(json['summaryPlain']), - contentPlain: serializer.fromJson(json['contentPlain']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'title': serializer.toJson(title), - 'summaryPlain': serializer.toJson(summaryPlain), - 'contentPlain': serializer.toJson(contentPlain), - }; - } - - ArticleFt copyWith({ - String? title, - String? summaryPlain, - String? contentPlain, - }) => ArticleFt( - title: title ?? this.title, - summaryPlain: summaryPlain ?? this.summaryPlain, - contentPlain: contentPlain ?? this.contentPlain, - ); - ArticleFt copyWithCompanion(ArticleFtsCompanion data) { - return ArticleFt( - title: data.title.present ? data.title.value : this.title, - summaryPlain: data.summaryPlain.present - ? data.summaryPlain.value - : this.summaryPlain, - contentPlain: data.contentPlain.present - ? data.contentPlain.value - : this.contentPlain, - ); - } - - @override - String toString() { - return (StringBuffer('ArticleFt(') - ..write('title: $title, ') - ..write('summaryPlain: $summaryPlain, ') - ..write('contentPlain: $contentPlain') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(title, summaryPlain, contentPlain); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is ArticleFt && - other.title == this.title && - other.summaryPlain == this.summaryPlain && - other.contentPlain == this.contentPlain); -} - -class ArticleFtsCompanion extends UpdateCompanion { - final Value title; - final Value summaryPlain; - final Value contentPlain; - final Value rowid; - const ArticleFtsCompanion({ - this.title = const Value.absent(), - this.summaryPlain = const Value.absent(), - this.contentPlain = const Value.absent(), - this.rowid = const Value.absent(), - }); - ArticleFtsCompanion.insert({ - required String title, - required String summaryPlain, - required String contentPlain, - this.rowid = const Value.absent(), - }) : title = Value(title), - summaryPlain = Value(summaryPlain), - contentPlain = Value(contentPlain); - static Insertable custom({ - Expression? title, - Expression? summaryPlain, - Expression? contentPlain, - Expression? rowid, - }) { - return RawValuesInsertable({ - if (title != null) 'title': title, - if (summaryPlain != null) 'summaryPlain': summaryPlain, - if (contentPlain != null) 'contentPlain': contentPlain, - if (rowid != null) 'rowid': rowid, - }); - } - - ArticleFtsCompanion copyWith({ - Value? title, - Value? summaryPlain, - Value? contentPlain, - Value? rowid, - }) { - return ArticleFtsCompanion( - title: title ?? this.title, - summaryPlain: summaryPlain ?? this.summaryPlain, - contentPlain: contentPlain ?? this.contentPlain, - rowid: rowid ?? this.rowid, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (title.present) { - map['title'] = Variable(title.value); - } - if (summaryPlain.present) { - map['summaryPlain'] = Variable(summaryPlain.value); - } - if (contentPlain.present) { - map['contentPlain'] = Variable(contentPlain.value); - } - if (rowid.present) { - map['rowid'] = Variable(rowid.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('ArticleFtsCompanion(') - ..write('title: $title, ') - ..write('summaryPlain: $summaryPlain, ') - ..write('contentPlain: $contentPlain, ') - ..write('rowid: $rowid') - ..write(')')) - .toString(); - } -} - -abstract class _$FeedDatabase extends GeneratedDatabase { - _$FeedDatabase(QueryExecutor e) : super(e); - $FeedDatabaseManager get managers => $FeedDatabaseManager(this); - late final Feed feed = Feed(this); - late final Article article = Article(this); - late final ArticleView articleView = ArticleView(this); - late final Index articleFeedId = Index( - 'article_feed_id', - 'CREATE INDEX article_feed_id ON article (feed_id)', - ); - late final ArticleFts articleFts = ArticleFts(this); - late final Trigger articleAfterInsert = Trigger( - 'CREATE TRIGGER article_after_insert AFTER INSERT ON article BEGIN INSERT INTO article_fts ("rowid", title, summaryPlain, contentPlain) VALUES (new."rowid", new.title, new.summaryPlain, new.contentPlain);END', - 'article_after_insert', - ); - late final Trigger articleAfterDelete = Trigger( - 'CREATE TRIGGER article_after_delete AFTER DELETE ON article BEGIN INSERT INTO article_fts (article_fts, "rowid", title, summaryPlain, contentPlain) VALUES (\'delete\', old."rowid", old.title, old.summaryPlain, old.contentPlain);END', - 'article_after_delete', - ); - late final Trigger articleAfterUpdate = Trigger( - 'CREATE TRIGGER article_after_update AFTER UPDATE ON article BEGIN INSERT INTO article_fts (article_fts, "rowid", title, summaryPlain, contentPlain) VALUES (\'delete\', old."rowid", old.title, old.summaryPlain, old.contentPlain);INSERT INTO article_fts ("rowid", title, summaryPlain, contentPlain) VALUES (new."rowid", new.title, new.summaryPlain, new.contentPlain);END', - 'article_after_update', - ); - late final ArticleDao articleDao = ArticleDao(this as FeedDatabase); - late final FeedDao feedDao = FeedDao(this as FeedDatabase); - Future optimizeFtsIndex() { - return customInsert( - 'INSERT INTO article_fts (article_fts) VALUES (\'optimize\')', - variables: [], - updates: {articleFts}, - ); - } - - Selectable queryArticlesBasic({ - required String query, - String? feedId, - }) { - return customSelect( - 'WITH weights AS (SELECT 1.0 AS title_weight) SELECT a.*, f.icon,(bm25(article_fts, weights.title_weight))AS weighted_rank FROM article_fts AS fts INNER JOIN article AS a ON a."rowid" = fts."rowid" INNER JOIN feed AS f ON f.url = a.feed_id CROSS JOIN weights WHERE fts.title LIKE ?1 AND(?2 IS NULL OR a.feed_id = ?2)ORDER BY weighted_rank ASC, a.created DESC NULLS LAST', - variables: [Variable(query), Variable(feedId)], - readsFrom: {feed, articleFts, article}, - ).map( - (QueryRow row) => FeedArticleQueryResult( - id: row.read('id'), - feedId: Article.$converterfeedId.fromSql(row.read('feed_id')), - fetched: row.read('fetched'), - weightedRank: row.read('weighted_rank'), - created: row.readNullable('created'), - updated: row.readNullable('updated'), - lastRead: row.readNullable('last_read'), - title: row.readNullable('title'), - authors: NullAwareTypeConverter.wrapFromSql( - Article.$converterauthors, - row.readNullable('authors'), - ), - tags: NullAwareTypeConverter.wrapFromSql( - Article.$convertertags, - row.readNullable('tags'), - ), - links: NullAwareTypeConverter.wrapFromSql( - Article.$converterlinks, - row.readNullable('links'), - ), - summaryHtml: row.readNullable('summaryHtml'), - summaryMarkdown: row.readNullable('summaryMarkdown'), - summaryPlain: row.readNullable('summaryPlain'), - contentHtml: row.readNullable('contentHtml'), - contentMarkdown: row.readNullable('contentMarkdown'), - contentPlain: row.readNullable('contentPlain'), - icon: Feed.$convertericon.fromSql(row.readNullable('icon')), - ), - ); - } - - Selectable queryArticlesFullContent({ - required String beforeMatch, - required String afterMatch, - required String ellipsis, - required int snippetLength, - required String query, - String? feedId, - }) { - return customSelect( - 'WITH weights AS (SELECT 10.0 AS title_weight, 3.0 AS summary_weight, 1.0 AS content_weight) SELECT a.*, f.icon, highlight(article_fts, 0, ?1, ?2) AS title_highlight, snippet(article_fts, 1, ?1, ?2, ?3, ?4) AS summary_snippet, snippet(article_fts, 2, ?1, ?2, ?3, ?4) AS content_snippet,(bm25(article_fts, weights.title_weight, weights.summary_weight, weights.content_weight))AS weighted_rank FROM article_fts(?5)AS fts INNER JOIN article AS a ON a."rowid" = fts."rowid" INNER JOIN feed AS f ON f.url = a.feed_id CROSS JOIN weights WHERE ?6 IS NULL OR a.feed_id = ?6 ORDER BY weighted_rank ASC, a.created DESC NULLS LAST', - variables: [ - Variable(beforeMatch), - Variable(afterMatch), - Variable(ellipsis), - Variable(snippetLength), - Variable(query), - Variable(feedId), - ], - readsFrom: {feed, articleFts, article}, - ).map( - (QueryRow row) => FeedArticleQueryResult( - id: row.read('id'), - feedId: Article.$converterfeedId.fromSql(row.read('feed_id')), - fetched: row.read('fetched'), - weightedRank: row.read('weighted_rank'), - created: row.readNullable('created'), - updated: row.readNullable('updated'), - lastRead: row.readNullable('last_read'), - title: row.readNullable('title'), - authors: NullAwareTypeConverter.wrapFromSql( - Article.$converterauthors, - row.readNullable('authors'), - ), - tags: NullAwareTypeConverter.wrapFromSql( - Article.$convertertags, - row.readNullable('tags'), - ), - links: NullAwareTypeConverter.wrapFromSql( - Article.$converterlinks, - row.readNullable('links'), - ), - summaryHtml: row.readNullable('summaryHtml'), - summaryMarkdown: row.readNullable('summaryMarkdown'), - summaryPlain: row.readNullable('summaryPlain'), - contentHtml: row.readNullable('contentHtml'), - contentMarkdown: row.readNullable('contentMarkdown'), - contentPlain: row.readNullable('contentPlain'), - icon: Feed.$convertericon.fromSql(row.readNullable('icon')), - titleHighlight: row.readNullable('title_highlight'), - summarySnippet: row.readNullable('summary_snippet'), - contentSnippet: row.readNullable('content_snippet'), - ), - ); - } - - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - feed, - article, - articleView, - articleFeedId, - articleFts, - articleAfterInsert, - articleAfterDelete, - articleAfterUpdate, - ]; - @override - StreamQueryUpdateRules get streamUpdateRules => const StreamQueryUpdateRules([ - WritePropagation( - on: TableUpdateQuery.onTableName( - 'feed', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('article', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'article', - limitUpdateKind: UpdateKind.insert, - ), - result: [TableUpdate('article_fts', kind: UpdateKind.insert)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'article', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('article_fts', kind: UpdateKind.insert)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'article', - limitUpdateKind: UpdateKind.update, - ), - result: [TableUpdate('article_fts', kind: UpdateKind.insert)], - ), - ]); -} - -typedef $FeedCreateCompanionBuilder = - FeedCompanion Function({ - required Uri url, - Value title, - Value description, - Value icon, - Value siteLink, - Value?> authors, - Value?> tags, - Value lastFetched, - Value rowid, - }); -typedef $FeedUpdateCompanionBuilder = - FeedCompanion Function({ - Value url, - Value title, - Value description, - Value icon, - Value siteLink, - Value?> authors, - Value?> tags, - Value lastFetched, - Value rowid, - }); - -final class $FeedReferences - extends BaseReferences<_$FeedDatabase, Feed, FeedData> { - $FeedReferences(super.$_db, super.$_table, super.$_typedResult); - - static MultiTypedResultKey> _articleRefsTable( - _$FeedDatabase db, - ) => MultiTypedResultKey.fromTable( - db.article, - aliasName: $_aliasNameGenerator(db.feed.url, db.article.feedId), - ); - - $ArticleProcessedTableManager get articleRefs { - final manager = $ArticleTableManager( - $_db, - $_db.article, - ).filter((f) => f.feedId.url.sqlEquals($_itemColumn('url')!)); - - final cache = $_typedResult.readTableOrNull(_articleRefsTable($_db)); - return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: cache), - ); - } -} - -class $FeedFilterComposer extends Composer<_$FeedDatabase, Feed> { - $FeedFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnWithTypeConverterFilters get url => - $composableBuilder( - column: $table.url, - builder: (column) => ColumnWithTypeConverterFilters(column), - ); - - ColumnFilters get title => $composableBuilder( - column: $table.title, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get description => $composableBuilder( - column: $table.description, - builder: (column) => ColumnFilters(column), - ); - - ColumnWithTypeConverterFilters get icon => - $composableBuilder( - column: $table.icon, - builder: (column) => ColumnWithTypeConverterFilters(column), - ); - - ColumnWithTypeConverterFilters get siteLink => - $composableBuilder( - column: $table.siteLink, - builder: (column) => ColumnWithTypeConverterFilters(column), - ); - - ColumnWithTypeConverterFilters?, List, String> - get authors => $composableBuilder( - column: $table.authors, - builder: (column) => ColumnWithTypeConverterFilters(column), - ); - - ColumnWithTypeConverterFilters< - List?, - List, - String - > - get tags => $composableBuilder( - column: $table.tags, - builder: (column) => ColumnWithTypeConverterFilters(column), - ); - - ColumnFilters get lastFetched => $composableBuilder( - column: $table.lastFetched, - builder: (column) => ColumnFilters(column), - ); - - Expression articleRefs( - Expression Function($ArticleFilterComposer f) f, - ) { - final $ArticleFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.url, - referencedTable: $db.article, - getReferencedColumn: (t) => t.feedId, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $ArticleFilterComposer( - $db: $db, - $table: $db.article, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return f(composer); - } -} - -class $FeedOrderingComposer extends Composer<_$FeedDatabase, Feed> { - $FeedOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnOrderings get url => $composableBuilder( - column: $table.url, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get title => $composableBuilder( - column: $table.title, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get description => $composableBuilder( - column: $table.description, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get icon => $composableBuilder( - column: $table.icon, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get siteLink => $composableBuilder( - column: $table.siteLink, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get authors => $composableBuilder( - column: $table.authors, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get tags => $composableBuilder( - column: $table.tags, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get lastFetched => $composableBuilder( - column: $table.lastFetched, - builder: (column) => ColumnOrderings(column), - ); -} - -class $FeedAnnotationComposer extends Composer<_$FeedDatabase, Feed> { - $FeedAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - GeneratedColumnWithTypeConverter get url => - $composableBuilder(column: $table.url, builder: (column) => column); - - GeneratedColumn get title => - $composableBuilder(column: $table.title, builder: (column) => column); - - GeneratedColumn get description => $composableBuilder( - column: $table.description, - builder: (column) => column, - ); - - GeneratedColumnWithTypeConverter get icon => - $composableBuilder(column: $table.icon, builder: (column) => column); - - GeneratedColumnWithTypeConverter get siteLink => - $composableBuilder(column: $table.siteLink, builder: (column) => column); - - GeneratedColumnWithTypeConverter?, String> get authors => - $composableBuilder(column: $table.authors, builder: (column) => column); - - GeneratedColumnWithTypeConverter?, String> get tags => - $composableBuilder(column: $table.tags, builder: (column) => column); - - GeneratedColumn get lastFetched => $composableBuilder( - column: $table.lastFetched, - builder: (column) => column, - ); - - Expression articleRefs( - Expression Function($ArticleAnnotationComposer a) f, - ) { - final $ArticleAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.url, - referencedTable: $db.article, - getReferencedColumn: (t) => t.feedId, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $ArticleAnnotationComposer( - $db: $db, - $table: $db.article, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return f(composer); - } -} - -class $FeedTableManager - extends - RootTableManager< - _$FeedDatabase, - Feed, - FeedData, - $FeedFilterComposer, - $FeedOrderingComposer, - $FeedAnnotationComposer, - $FeedCreateCompanionBuilder, - $FeedUpdateCompanionBuilder, - (FeedData, $FeedReferences), - FeedData, - PrefetchHooks Function({bool articleRefs}) - > { - $FeedTableManager(_$FeedDatabase db, Feed table) - : super( - TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - $FeedFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $FeedOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $FeedAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - Value url = const Value.absent(), - Value title = const Value.absent(), - Value description = const Value.absent(), - Value icon = const Value.absent(), - Value siteLink = const Value.absent(), - Value?> authors = const Value.absent(), - Value?> tags = const Value.absent(), - Value lastFetched = const Value.absent(), - Value rowid = const Value.absent(), - }) => FeedCompanion( - url: url, - title: title, - description: description, - icon: icon, - siteLink: siteLink, - authors: authors, - tags: tags, - lastFetched: lastFetched, - rowid: rowid, - ), - createCompanionCallback: - ({ - required Uri url, - Value title = const Value.absent(), - Value description = const Value.absent(), - Value icon = const Value.absent(), - Value siteLink = const Value.absent(), - Value?> authors = const Value.absent(), - Value?> tags = const Value.absent(), - Value lastFetched = const Value.absent(), - Value rowid = const Value.absent(), - }) => FeedCompanion.insert( - url: url, - title: title, - description: description, - icon: icon, - siteLink: siteLink, - authors: authors, - tags: tags, - lastFetched: lastFetched, - rowid: rowid, - ), - withReferenceMapper: (p0) => p0 - .map((e) => (e.readTable(table), $FeedReferences(db, table, e))) - .toList(), - prefetchHooksCallback: ({articleRefs = false}) { - return PrefetchHooks( - db: db, - explicitlyWatchedTables: [if (articleRefs) db.article], - addJoins: null, - getPrefetchedDataCallback: (items) async { - return [ - if (articleRefs) - await $_getPrefetchedData( - currentTable: table, - referencedTable: $FeedReferences._articleRefsTable(db), - managerFromTypedResult: (p0) => - $FeedReferences(db, table, p0).articleRefs, - referencedItemsForCurrentItem: (item, referencedItems) => - referencedItems.where((e) => e.feedId == item.url), - typedResults: items, - ), - ]; - }, - ); - }, - ), - ); -} - -typedef $FeedProcessedTableManager = - ProcessedTableManager< - _$FeedDatabase, - Feed, - FeedData, - $FeedFilterComposer, - $FeedOrderingComposer, - $FeedAnnotationComposer, - $FeedCreateCompanionBuilder, - $FeedUpdateCompanionBuilder, - (FeedData, $FeedReferences), - FeedData, - PrefetchHooks Function({bool articleRefs}) - >; -typedef $ArticleCreateCompanionBuilder = - ArticleCompanion Function({ - required String id, - required Uri feedId, - required DateTime fetched, - Value created, - Value updated, - Value lastRead, - Value title, - Value?> authors, - Value?> tags, - Value?> links, - Value summaryHtml, - Value summaryMarkdown, - Value summaryPlain, - Value contentHtml, - Value contentMarkdown, - Value contentPlain, - Value rowid, - }); -typedef $ArticleUpdateCompanionBuilder = - ArticleCompanion Function({ - Value id, - Value feedId, - Value fetched, - Value created, - Value updated, - Value lastRead, - Value title, - Value?> authors, - Value?> tags, - Value?> links, - Value summaryHtml, - Value summaryMarkdown, - Value summaryPlain, - Value contentHtml, - Value contentMarkdown, - Value contentPlain, - Value rowid, - }); - -final class $ArticleReferences - extends BaseReferences<_$FeedDatabase, Article, FeedArticle> { - $ArticleReferences(super.$_db, super.$_table, super.$_typedResult); - - static Feed _feedIdTable(_$FeedDatabase db) => - db.feed.createAlias($_aliasNameGenerator(db.article.feedId, db.feed.url)); - - $FeedProcessedTableManager get feedId { - final $_column = $_itemColumn('feed_id')!; - - final manager = $FeedTableManager( - $_db, - $_db.feed, - ).filter((f) => f.url.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_feedIdTable($_db)); - if (item == null) return manager; - return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } -} - -class $ArticleFilterComposer extends Composer<_$FeedDatabase, Article> { - $ArticleFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnFilters get id => $composableBuilder( - column: $table.id, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get fetched => $composableBuilder( - column: $table.fetched, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get created => $composableBuilder( - column: $table.created, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get updated => $composableBuilder( - column: $table.updated, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get lastRead => $composableBuilder( - column: $table.lastRead, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get title => $composableBuilder( - column: $table.title, - builder: (column) => ColumnFilters(column), - ); - - ColumnWithTypeConverterFilters?, List, String> - get authors => $composableBuilder( - column: $table.authors, - builder: (column) => ColumnWithTypeConverterFilters(column), - ); - - ColumnWithTypeConverterFilters< - List?, - List, - String - > - get tags => $composableBuilder( - column: $table.tags, - builder: (column) => ColumnWithTypeConverterFilters(column), - ); - - ColumnWithTypeConverterFilters?, List, String> - get links => $composableBuilder( - column: $table.links, - builder: (column) => ColumnWithTypeConverterFilters(column), - ); - - ColumnFilters get summaryHtml => $composableBuilder( - column: $table.summaryHtml, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get summaryMarkdown => $composableBuilder( - column: $table.summaryMarkdown, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get summaryPlain => $composableBuilder( - column: $table.summaryPlain, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get contentHtml => $composableBuilder( - column: $table.contentHtml, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get contentMarkdown => $composableBuilder( - column: $table.contentMarkdown, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get contentPlain => $composableBuilder( - column: $table.contentPlain, - builder: (column) => ColumnFilters(column), - ); - - $FeedFilterComposer get feedId { - final $FeedFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.feedId, - referencedTable: $db.feed, - getReferencedColumn: (t) => t.url, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $FeedFilterComposer( - $db: $db, - $table: $db.feed, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $ArticleOrderingComposer extends Composer<_$FeedDatabase, Article> { - $ArticleOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnOrderings get id => $composableBuilder( - column: $table.id, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get fetched => $composableBuilder( - column: $table.fetched, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get created => $composableBuilder( - column: $table.created, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get updated => $composableBuilder( - column: $table.updated, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get lastRead => $composableBuilder( - column: $table.lastRead, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get title => $composableBuilder( - column: $table.title, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get authors => $composableBuilder( - column: $table.authors, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get tags => $composableBuilder( - column: $table.tags, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get links => $composableBuilder( - column: $table.links, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get summaryHtml => $composableBuilder( - column: $table.summaryHtml, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get summaryMarkdown => $composableBuilder( - column: $table.summaryMarkdown, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get summaryPlain => $composableBuilder( - column: $table.summaryPlain, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get contentHtml => $composableBuilder( - column: $table.contentHtml, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get contentMarkdown => $composableBuilder( - column: $table.contentMarkdown, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get contentPlain => $composableBuilder( - column: $table.contentPlain, - builder: (column) => ColumnOrderings(column), - ); - - $FeedOrderingComposer get feedId { - final $FeedOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.feedId, - referencedTable: $db.feed, - getReferencedColumn: (t) => t.url, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $FeedOrderingComposer( - $db: $db, - $table: $db.feed, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $ArticleAnnotationComposer extends Composer<_$FeedDatabase, Article> { - $ArticleAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); - - GeneratedColumn get fetched => - $composableBuilder(column: $table.fetched, builder: (column) => column); - - GeneratedColumn get created => - $composableBuilder(column: $table.created, builder: (column) => column); - - GeneratedColumn get updated => - $composableBuilder(column: $table.updated, builder: (column) => column); - - GeneratedColumn get lastRead => - $composableBuilder(column: $table.lastRead, builder: (column) => column); - - GeneratedColumn get title => - $composableBuilder(column: $table.title, builder: (column) => column); - - GeneratedColumnWithTypeConverter?, String> get authors => - $composableBuilder(column: $table.authors, builder: (column) => column); - - GeneratedColumnWithTypeConverter?, String> get tags => - $composableBuilder(column: $table.tags, builder: (column) => column); - - GeneratedColumnWithTypeConverter?, String> get links => - $composableBuilder(column: $table.links, builder: (column) => column); - - GeneratedColumn get summaryHtml => $composableBuilder( - column: $table.summaryHtml, - builder: (column) => column, - ); - - GeneratedColumn get summaryMarkdown => $composableBuilder( - column: $table.summaryMarkdown, - builder: (column) => column, - ); - - GeneratedColumn get summaryPlain => $composableBuilder( - column: $table.summaryPlain, - builder: (column) => column, - ); - - GeneratedColumn get contentHtml => $composableBuilder( - column: $table.contentHtml, - builder: (column) => column, - ); - - GeneratedColumn get contentMarkdown => $composableBuilder( - column: $table.contentMarkdown, - builder: (column) => column, - ); - - GeneratedColumn get contentPlain => $composableBuilder( - column: $table.contentPlain, - builder: (column) => column, - ); - - $FeedAnnotationComposer get feedId { - final $FeedAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.feedId, - referencedTable: $db.feed, - getReferencedColumn: (t) => t.url, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $FeedAnnotationComposer( - $db: $db, - $table: $db.feed, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $ArticleTableManager - extends - RootTableManager< - _$FeedDatabase, - Article, - FeedArticle, - $ArticleFilterComposer, - $ArticleOrderingComposer, - $ArticleAnnotationComposer, - $ArticleCreateCompanionBuilder, - $ArticleUpdateCompanionBuilder, - (FeedArticle, $ArticleReferences), - FeedArticle, - PrefetchHooks Function({bool feedId}) - > { - $ArticleTableManager(_$FeedDatabase db, Article table) - : super( - TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - $ArticleFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $ArticleOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $ArticleAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - Value id = const Value.absent(), - Value feedId = const Value.absent(), - Value fetched = const Value.absent(), - Value created = const Value.absent(), - Value updated = const Value.absent(), - Value lastRead = const Value.absent(), - Value title = const Value.absent(), - Value?> authors = const Value.absent(), - Value?> tags = const Value.absent(), - Value?> links = const Value.absent(), - Value summaryHtml = const Value.absent(), - Value summaryMarkdown = const Value.absent(), - Value summaryPlain = const Value.absent(), - Value contentHtml = const Value.absent(), - Value contentMarkdown = const Value.absent(), - Value contentPlain = const Value.absent(), - Value rowid = const Value.absent(), - }) => ArticleCompanion( - id: id, - feedId: feedId, - fetched: fetched, - created: created, - updated: updated, - lastRead: lastRead, - title: title, - authors: authors, - tags: tags, - links: links, - summaryHtml: summaryHtml, - summaryMarkdown: summaryMarkdown, - summaryPlain: summaryPlain, - contentHtml: contentHtml, - contentMarkdown: contentMarkdown, - contentPlain: contentPlain, - rowid: rowid, - ), - createCompanionCallback: - ({ - required String id, - required Uri feedId, - required DateTime fetched, - Value created = const Value.absent(), - Value updated = const Value.absent(), - Value lastRead = const Value.absent(), - Value title = const Value.absent(), - Value?> authors = const Value.absent(), - Value?> tags = const Value.absent(), - Value?> links = const Value.absent(), - Value summaryHtml = const Value.absent(), - Value summaryMarkdown = const Value.absent(), - Value summaryPlain = const Value.absent(), - Value contentHtml = const Value.absent(), - Value contentMarkdown = const Value.absent(), - Value contentPlain = const Value.absent(), - Value rowid = const Value.absent(), - }) => ArticleCompanion.insert( - id: id, - feedId: feedId, - fetched: fetched, - created: created, - updated: updated, - lastRead: lastRead, - title: title, - authors: authors, - tags: tags, - links: links, - summaryHtml: summaryHtml, - summaryMarkdown: summaryMarkdown, - summaryPlain: summaryPlain, - contentHtml: contentHtml, - contentMarkdown: contentMarkdown, - contentPlain: contentPlain, - rowid: rowid, - ), - withReferenceMapper: (p0) => p0 - .map( - (e) => (e.readTable(table), $ArticleReferences(db, table, e)), - ) - .toList(), - prefetchHooksCallback: ({feedId = false}) { - return PrefetchHooks( - db: db, - explicitlyWatchedTables: [], - addJoins: - < - T extends TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic - > - >(state) { - if (feedId) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.feedId, - referencedTable: $ArticleReferences - ._feedIdTable(db), - referencedColumn: $ArticleReferences - ._feedIdTable(db) - .url, - ) - as T; - } - - return state; - }, - getPrefetchedDataCallback: (items) async { - return []; - }, - ); - }, - ), - ); -} - -typedef $ArticleProcessedTableManager = - ProcessedTableManager< - _$FeedDatabase, - Article, - FeedArticle, - $ArticleFilterComposer, - $ArticleOrderingComposer, - $ArticleAnnotationComposer, - $ArticleCreateCompanionBuilder, - $ArticleUpdateCompanionBuilder, - (FeedArticle, $ArticleReferences), - FeedArticle, - PrefetchHooks Function({bool feedId}) - >; -typedef $ArticleFtsCreateCompanionBuilder = - ArticleFtsCompanion Function({ - required String title, - required String summaryPlain, - required String contentPlain, - Value rowid, - }); -typedef $ArticleFtsUpdateCompanionBuilder = - ArticleFtsCompanion Function({ - Value title, - Value summaryPlain, - Value contentPlain, - Value rowid, - }); - -class $ArticleFtsFilterComposer extends Composer<_$FeedDatabase, ArticleFts> { - $ArticleFtsFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnFilters get title => $composableBuilder( - column: $table.title, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get summaryPlain => $composableBuilder( - column: $table.summaryPlain, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get contentPlain => $composableBuilder( - column: $table.contentPlain, - builder: (column) => ColumnFilters(column), - ); -} - -class $ArticleFtsOrderingComposer extends Composer<_$FeedDatabase, ArticleFts> { - $ArticleFtsOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnOrderings get title => $composableBuilder( - column: $table.title, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get summaryPlain => $composableBuilder( - column: $table.summaryPlain, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get contentPlain => $composableBuilder( - column: $table.contentPlain, - builder: (column) => ColumnOrderings(column), - ); -} - -class $ArticleFtsAnnotationComposer - extends Composer<_$FeedDatabase, ArticleFts> { - $ArticleFtsAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - GeneratedColumn get title => - $composableBuilder(column: $table.title, builder: (column) => column); - - GeneratedColumn get summaryPlain => $composableBuilder( - column: $table.summaryPlain, - builder: (column) => column, - ); - - GeneratedColumn get contentPlain => $composableBuilder( - column: $table.contentPlain, - builder: (column) => column, - ); -} - -class $ArticleFtsTableManager - extends - RootTableManager< - _$FeedDatabase, - ArticleFts, - ArticleFt, - $ArticleFtsFilterComposer, - $ArticleFtsOrderingComposer, - $ArticleFtsAnnotationComposer, - $ArticleFtsCreateCompanionBuilder, - $ArticleFtsUpdateCompanionBuilder, - (ArticleFt, BaseReferences<_$FeedDatabase, ArticleFts, ArticleFt>), - ArticleFt, - PrefetchHooks Function() - > { - $ArticleFtsTableManager(_$FeedDatabase db, ArticleFts table) - : super( - TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - $ArticleFtsFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $ArticleFtsOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $ArticleFtsAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - Value title = const Value.absent(), - Value summaryPlain = const Value.absent(), - Value contentPlain = const Value.absent(), - Value rowid = const Value.absent(), - }) => ArticleFtsCompanion( - title: title, - summaryPlain: summaryPlain, - contentPlain: contentPlain, - rowid: rowid, - ), - createCompanionCallback: - ({ - required String title, - required String summaryPlain, - required String contentPlain, - Value rowid = const Value.absent(), - }) => ArticleFtsCompanion.insert( - title: title, - summaryPlain: summaryPlain, - contentPlain: contentPlain, - rowid: rowid, - ), - withReferenceMapper: (p0) => p0 - .map((e) => (e.readTable(table), BaseReferences(db, table, e))) - .toList(), - prefetchHooksCallback: null, - ), - ); -} - -typedef $ArticleFtsProcessedTableManager = - ProcessedTableManager< - _$FeedDatabase, - ArticleFts, - ArticleFt, - $ArticleFtsFilterComposer, - $ArticleFtsOrderingComposer, - $ArticleFtsAnnotationComposer, - $ArticleFtsCreateCompanionBuilder, - $ArticleFtsUpdateCompanionBuilder, - (ArticleFt, BaseReferences<_$FeedDatabase, ArticleFts, ArticleFt>), - ArticleFt, - PrefetchHooks Function() - >; - -class $FeedDatabaseManager { - final _$FeedDatabase _db; - $FeedDatabaseManager(this._db); - $FeedTableManager get feed => $FeedTableManager(_db, _db.feed); - $ArticleTableManager get article => $ArticleTableManager(_db, _db.article); - $ArticleFtsTableManager get articleFts => - $ArticleFtsTableManager(_db, _db.articleFts); -} diff --git a/app/lib/features/web_feed/data/database/database.drift b/app/lib/features/web_feed/data/database/definitions.drift similarity index 100% rename from app/lib/features/web_feed/data/database/database.drift rename to app/lib/features/web_feed/data/database/definitions.drift diff --git a/app/lib/features/web_feed/data/database/definitions.drift.dart b/app/lib/features/web_feed/data/database/definitions.drift.dart new file mode 100644 index 00000000..69b36ad0 --- /dev/null +++ b/app/lib/features/web_feed/data/database/definitions.drift.dart @@ -0,0 +1,2752 @@ +// dart format width=80 +// ignore_for_file: type=lint +import 'package:drift/drift.dart' as i0; +import 'package:weblibre/features/web_feed/data/database/definitions.drift.dart' + as i1; +import 'package:weblibre/features/web_feed/data/models/feed_author.dart' as i2; +import 'package:weblibre/features/web_feed/data/models/feed_category.dart' + as i3; +import 'package:weblibre/data/database/converters/uri.dart' as i4; +import 'package:weblibre/features/web_feed/data/database/converters/feed_authors.dart' + as i5; +import 'package:weblibre/features/web_feed/data/database/converters/feed_categories.dart' + as i6; +import 'package:weblibre/features/web_feed/data/models/feed_article.dart' as i7; +import 'package:weblibre/features/web_feed/data/models/feed_link.dart' as i8; +import 'package:weblibre/features/web_feed/data/database/converters/feed_links.dart' + as i9; +import 'package:drift/internal/modular.dart' as i10; +import 'package:weblibre/features/web_feed/data/models/feed_article_query_result.dart' + as i11; + +typedef $FeedCreateCompanionBuilder = + i1.FeedCompanion Function({ + required Uri url, + i0.Value title, + i0.Value description, + i0.Value icon, + i0.Value siteLink, + i0.Value?> authors, + i0.Value?> tags, + i0.Value lastFetched, + i0.Value rowid, + }); +typedef $FeedUpdateCompanionBuilder = + i1.FeedCompanion Function({ + i0.Value url, + i0.Value title, + i0.Value description, + i0.Value icon, + i0.Value siteLink, + i0.Value?> authors, + i0.Value?> tags, + i0.Value lastFetched, + i0.Value rowid, + }); + +final class $FeedReferences + extends i0.BaseReferences { + $FeedReferences(super.$_db, super.$_table, super.$_typedResult); + + static i0.MultiTypedResultKey> + _articleRefsTable(i0.GeneratedDatabase db) => + i0.MultiTypedResultKey.fromTable( + i10.ReadDatabaseContainer(db).resultSet('article'), + aliasName: i0.$_aliasNameGenerator( + i10.ReadDatabaseContainer(db).resultSet('feed').url, + i10.ReadDatabaseContainer(db).resultSet('article').feedId, + ), + ); + + i1.$ArticleProcessedTableManager get articleRefs { + final manager = i1 + .$ArticleTableManager( + $_db, + i10.ReadDatabaseContainer($_db).resultSet('article'), + ) + .filter((f) => f.feedId.url.sqlEquals($_itemColumn('url')!)); + + final cache = $_typedResult.readTableOrNull(_articleRefsTable($_db)); + return i0.ProcessedTableManager( + manager.$state.copyWith(prefetchedData: cache), + ); + } +} + +class $FeedFilterComposer extends i0.Composer { + $FeedFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.ColumnWithTypeConverterFilters get url => + $composableBuilder( + column: $table.url, + builder: (column) => i0.ColumnWithTypeConverterFilters(column), + ); + + i0.ColumnFilters get title => $composableBuilder( + column: $table.title, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get description => $composableBuilder( + column: $table.description, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnWithTypeConverterFilters get icon => + $composableBuilder( + column: $table.icon, + builder: (column) => i0.ColumnWithTypeConverterFilters(column), + ); + + i0.ColumnWithTypeConverterFilters get siteLink => + $composableBuilder( + column: $table.siteLink, + builder: (column) => i0.ColumnWithTypeConverterFilters(column), + ); + + i0.ColumnWithTypeConverterFilters< + List?, + List, + String + > + get authors => $composableBuilder( + column: $table.authors, + builder: (column) => i0.ColumnWithTypeConverterFilters(column), + ); + + i0.ColumnWithTypeConverterFilters< + List?, + List, + String + > + get tags => $composableBuilder( + column: $table.tags, + builder: (column) => i0.ColumnWithTypeConverterFilters(column), + ); + + i0.ColumnFilters get lastFetched => $composableBuilder( + column: $table.lastFetched, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.Expression articleRefs( + i0.Expression Function(i1.$ArticleFilterComposer f) f, + ) { + final i1.$ArticleFilterComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.url, + referencedTable: i10.ReadDatabaseContainer( + $db, + ).resultSet('article'), + getReferencedColumn: (t) => t.feedId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => i1.$ArticleFilterComposer( + $db: $db, + $table: i10.ReadDatabaseContainer( + $db, + ).resultSet('article'), + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); + return f(composer); + } +} + +class $FeedOrderingComposer extends i0.Composer { + $FeedOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.ColumnOrderings get url => $composableBuilder( + column: $table.url, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get title => $composableBuilder( + column: $table.title, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get description => $composableBuilder( + column: $table.description, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get icon => $composableBuilder( + column: $table.icon, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get siteLink => $composableBuilder( + column: $table.siteLink, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get authors => $composableBuilder( + column: $table.authors, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get tags => $composableBuilder( + column: $table.tags, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get lastFetched => $composableBuilder( + column: $table.lastFetched, + builder: (column) => i0.ColumnOrderings(column), + ); +} + +class $FeedAnnotationComposer + extends i0.Composer { + $FeedAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.GeneratedColumnWithTypeConverter get url => + $composableBuilder(column: $table.url, builder: (column) => column); + + i0.GeneratedColumn get title => + $composableBuilder(column: $table.title, builder: (column) => column); + + i0.GeneratedColumn get description => $composableBuilder( + column: $table.description, + builder: (column) => column, + ); + + i0.GeneratedColumnWithTypeConverter get icon => + $composableBuilder(column: $table.icon, builder: (column) => column); + + i0.GeneratedColumnWithTypeConverter get siteLink => + $composableBuilder(column: $table.siteLink, builder: (column) => column); + + i0.GeneratedColumnWithTypeConverter?, String> + get authors => + $composableBuilder(column: $table.authors, builder: (column) => column); + + i0.GeneratedColumnWithTypeConverter?, String> + get tags => + $composableBuilder(column: $table.tags, builder: (column) => column); + + i0.GeneratedColumn get lastFetched => $composableBuilder( + column: $table.lastFetched, + builder: (column) => column, + ); + + i0.Expression articleRefs( + i0.Expression Function(i1.$ArticleAnnotationComposer a) f, + ) { + final i1.$ArticleAnnotationComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.url, + referencedTable: i10.ReadDatabaseContainer( + $db, + ).resultSet('article'), + getReferencedColumn: (t) => t.feedId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => i1.$ArticleAnnotationComposer( + $db: $db, + $table: i10.ReadDatabaseContainer( + $db, + ).resultSet('article'), + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); + return f(composer); + } +} + +class $FeedTableManager + extends + i0.RootTableManager< + i0.GeneratedDatabase, + i1.Feed, + i1.FeedData, + i1.$FeedFilterComposer, + i1.$FeedOrderingComposer, + i1.$FeedAnnotationComposer, + $FeedCreateCompanionBuilder, + $FeedUpdateCompanionBuilder, + (i1.FeedData, i1.$FeedReferences), + i1.FeedData, + i0.PrefetchHooks Function({bool articleRefs}) + > { + $FeedTableManager(i0.GeneratedDatabase db, i1.Feed table) + : super( + i0.TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + i1.$FeedFilterComposer($db: db, $table: table), + createOrderingComposer: () => + i1.$FeedOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + i1.$FeedAnnotationComposer($db: db, $table: table), + updateCompanionCallback: + ({ + i0.Value url = const i0.Value.absent(), + i0.Value title = const i0.Value.absent(), + i0.Value description = const i0.Value.absent(), + i0.Value icon = const i0.Value.absent(), + i0.Value siteLink = const i0.Value.absent(), + i0.Value?> authors = + const i0.Value.absent(), + i0.Value?> tags = const i0.Value.absent(), + i0.Value lastFetched = const i0.Value.absent(), + i0.Value rowid = const i0.Value.absent(), + }) => i1.FeedCompanion( + url: url, + title: title, + description: description, + icon: icon, + siteLink: siteLink, + authors: authors, + tags: tags, + lastFetched: lastFetched, + rowid: rowid, + ), + createCompanionCallback: + ({ + required Uri url, + i0.Value title = const i0.Value.absent(), + i0.Value description = const i0.Value.absent(), + i0.Value icon = const i0.Value.absent(), + i0.Value siteLink = const i0.Value.absent(), + i0.Value?> authors = + const i0.Value.absent(), + i0.Value?> tags = const i0.Value.absent(), + i0.Value lastFetched = const i0.Value.absent(), + i0.Value rowid = const i0.Value.absent(), + }) => i1.FeedCompanion.insert( + url: url, + title: title, + description: description, + icon: icon, + siteLink: siteLink, + authors: authors, + tags: tags, + lastFetched: lastFetched, + rowid: rowid, + ), + withReferenceMapper: (p0) => p0 + .map( + (e) => (e.readTable(table), i1.$FeedReferences(db, table, e)), + ) + .toList(), + prefetchHooksCallback: ({articleRefs = false}) { + return i0.PrefetchHooks( + db: db, + explicitlyWatchedTables: [ + if (articleRefs) + i10.ReadDatabaseContainer( + db, + ).resultSet('article'), + ], + addJoins: null, + getPrefetchedDataCallback: (items) async { + return [ + if (articleRefs) + await i0.$_getPrefetchedData< + i1.FeedData, + i1.Feed, + i7.FeedArticle + >( + currentTable: table, + referencedTable: i1.$FeedReferences._articleRefsTable(db), + managerFromTypedResult: (p0) => + i1.$FeedReferences(db, table, p0).articleRefs, + referencedItemsForCurrentItem: (item, referencedItems) => + referencedItems.where((e) => e.feedId == item.url), + typedResults: items, + ), + ]; + }, + ); + }, + ), + ); +} + +typedef $FeedProcessedTableManager = + i0.ProcessedTableManager< + i0.GeneratedDatabase, + i1.Feed, + i1.FeedData, + i1.$FeedFilterComposer, + i1.$FeedOrderingComposer, + i1.$FeedAnnotationComposer, + $FeedCreateCompanionBuilder, + $FeedUpdateCompanionBuilder, + (i1.FeedData, i1.$FeedReferences), + i1.FeedData, + i0.PrefetchHooks Function({bool articleRefs}) + >; +typedef $ArticleCreateCompanionBuilder = + i1.ArticleCompanion Function({ + required String id, + required Uri feedId, + required DateTime fetched, + i0.Value created, + i0.Value updated, + i0.Value lastRead, + i0.Value title, + i0.Value?> authors, + i0.Value?> tags, + i0.Value?> links, + i0.Value summaryHtml, + i0.Value summaryMarkdown, + i0.Value summaryPlain, + i0.Value contentHtml, + i0.Value contentMarkdown, + i0.Value contentPlain, + i0.Value rowid, + }); +typedef $ArticleUpdateCompanionBuilder = + i1.ArticleCompanion Function({ + i0.Value id, + i0.Value feedId, + i0.Value fetched, + i0.Value created, + i0.Value updated, + i0.Value lastRead, + i0.Value title, + i0.Value?> authors, + i0.Value?> tags, + i0.Value?> links, + i0.Value summaryHtml, + i0.Value summaryMarkdown, + i0.Value summaryPlain, + i0.Value contentHtml, + i0.Value contentMarkdown, + i0.Value contentPlain, + i0.Value rowid, + }); + +final class $ArticleReferences + extends + i0.BaseReferences { + $ArticleReferences(super.$_db, super.$_table, super.$_typedResult); + + static i1.Feed _feedIdTable(i0.GeneratedDatabase db) => + i10.ReadDatabaseContainer(db) + .resultSet('feed') + .createAlias( + i0.$_aliasNameGenerator( + i10.ReadDatabaseContainer( + db, + ).resultSet('article').feedId, + i10.ReadDatabaseContainer(db).resultSet('feed').url, + ), + ); + + i1.$FeedProcessedTableManager get feedId { + final $_column = $_itemColumn('feed_id')!; + + final manager = i1 + .$FeedTableManager( + $_db, + i10.ReadDatabaseContainer($_db).resultSet('feed'), + ) + .filter((f) => f.url.sqlEquals($_column)); + final item = $_typedResult.readTableOrNull(_feedIdTable($_db)); + if (item == null) return manager; + return i0.ProcessedTableManager( + manager.$state.copyWith(prefetchedData: [item]), + ); + } +} + +class $ArticleFilterComposer + extends i0.Composer { + $ArticleFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.ColumnFilters get id => $composableBuilder( + column: $table.id, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get fetched => $composableBuilder( + column: $table.fetched, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get created => $composableBuilder( + column: $table.created, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get updated => $composableBuilder( + column: $table.updated, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get lastRead => $composableBuilder( + column: $table.lastRead, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get title => $composableBuilder( + column: $table.title, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnWithTypeConverterFilters< + List?, + List, + String + > + get authors => $composableBuilder( + column: $table.authors, + builder: (column) => i0.ColumnWithTypeConverterFilters(column), + ); + + i0.ColumnWithTypeConverterFilters< + List?, + List, + String + > + get tags => $composableBuilder( + column: $table.tags, + builder: (column) => i0.ColumnWithTypeConverterFilters(column), + ); + + i0.ColumnWithTypeConverterFilters< + List?, + List, + String + > + get links => $composableBuilder( + column: $table.links, + builder: (column) => i0.ColumnWithTypeConverterFilters(column), + ); + + i0.ColumnFilters get summaryHtml => $composableBuilder( + column: $table.summaryHtml, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get summaryMarkdown => $composableBuilder( + column: $table.summaryMarkdown, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get summaryPlain => $composableBuilder( + column: $table.summaryPlain, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get contentHtml => $composableBuilder( + column: $table.contentHtml, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get contentMarkdown => $composableBuilder( + column: $table.contentMarkdown, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get contentPlain => $composableBuilder( + column: $table.contentPlain, + builder: (column) => i0.ColumnFilters(column), + ); + + i1.$FeedFilterComposer get feedId { + final i1.$FeedFilterComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.feedId, + referencedTable: i10.ReadDatabaseContainer( + $db, + ).resultSet('feed'), + getReferencedColumn: (t) => t.url, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => i1.$FeedFilterComposer( + $db: $db, + $table: i10.ReadDatabaseContainer($db).resultSet('feed'), + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); + return composer; + } +} + +class $ArticleOrderingComposer + extends i0.Composer { + $ArticleOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.ColumnOrderings get id => $composableBuilder( + column: $table.id, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get fetched => $composableBuilder( + column: $table.fetched, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get created => $composableBuilder( + column: $table.created, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get updated => $composableBuilder( + column: $table.updated, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get lastRead => $composableBuilder( + column: $table.lastRead, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get title => $composableBuilder( + column: $table.title, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get authors => $composableBuilder( + column: $table.authors, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get tags => $composableBuilder( + column: $table.tags, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get links => $composableBuilder( + column: $table.links, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get summaryHtml => $composableBuilder( + column: $table.summaryHtml, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get summaryMarkdown => $composableBuilder( + column: $table.summaryMarkdown, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get summaryPlain => $composableBuilder( + column: $table.summaryPlain, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get contentHtml => $composableBuilder( + column: $table.contentHtml, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get contentMarkdown => $composableBuilder( + column: $table.contentMarkdown, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get contentPlain => $composableBuilder( + column: $table.contentPlain, + builder: (column) => i0.ColumnOrderings(column), + ); + + i1.$FeedOrderingComposer get feedId { + final i1.$FeedOrderingComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.feedId, + referencedTable: i10.ReadDatabaseContainer( + $db, + ).resultSet('feed'), + getReferencedColumn: (t) => t.url, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => i1.$FeedOrderingComposer( + $db: $db, + $table: i10.ReadDatabaseContainer($db).resultSet('feed'), + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); + return composer; + } +} + +class $ArticleAnnotationComposer + extends i0.Composer { + $ArticleAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.GeneratedColumn get id => + $composableBuilder(column: $table.id, builder: (column) => column); + + i0.GeneratedColumn get fetched => + $composableBuilder(column: $table.fetched, builder: (column) => column); + + i0.GeneratedColumn get created => + $composableBuilder(column: $table.created, builder: (column) => column); + + i0.GeneratedColumn get updated => + $composableBuilder(column: $table.updated, builder: (column) => column); + + i0.GeneratedColumn get lastRead => + $composableBuilder(column: $table.lastRead, builder: (column) => column); + + i0.GeneratedColumn get title => + $composableBuilder(column: $table.title, builder: (column) => column); + + i0.GeneratedColumnWithTypeConverter?, String> + get authors => + $composableBuilder(column: $table.authors, builder: (column) => column); + + i0.GeneratedColumnWithTypeConverter?, String> + get tags => + $composableBuilder(column: $table.tags, builder: (column) => column); + + i0.GeneratedColumnWithTypeConverter?, String> get links => + $composableBuilder(column: $table.links, builder: (column) => column); + + i0.GeneratedColumn get summaryHtml => $composableBuilder( + column: $table.summaryHtml, + builder: (column) => column, + ); + + i0.GeneratedColumn get summaryMarkdown => $composableBuilder( + column: $table.summaryMarkdown, + builder: (column) => column, + ); + + i0.GeneratedColumn get summaryPlain => $composableBuilder( + column: $table.summaryPlain, + builder: (column) => column, + ); + + i0.GeneratedColumn get contentHtml => $composableBuilder( + column: $table.contentHtml, + builder: (column) => column, + ); + + i0.GeneratedColumn get contentMarkdown => $composableBuilder( + column: $table.contentMarkdown, + builder: (column) => column, + ); + + i0.GeneratedColumn get contentPlain => $composableBuilder( + column: $table.contentPlain, + builder: (column) => column, + ); + + i1.$FeedAnnotationComposer get feedId { + final i1.$FeedAnnotationComposer composer = $composerBuilder( + composer: this, + getCurrentColumn: (t) => t.feedId, + referencedTable: i10.ReadDatabaseContainer( + $db, + ).resultSet('feed'), + getReferencedColumn: (t) => t.url, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => i1.$FeedAnnotationComposer( + $db: $db, + $table: i10.ReadDatabaseContainer($db).resultSet('feed'), + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); + return composer; + } +} + +class $ArticleTableManager + extends + i0.RootTableManager< + i0.GeneratedDatabase, + i1.Article, + i7.FeedArticle, + i1.$ArticleFilterComposer, + i1.$ArticleOrderingComposer, + i1.$ArticleAnnotationComposer, + $ArticleCreateCompanionBuilder, + $ArticleUpdateCompanionBuilder, + (i7.FeedArticle, i1.$ArticleReferences), + i7.FeedArticle, + i0.PrefetchHooks Function({bool feedId}) + > { + $ArticleTableManager(i0.GeneratedDatabase db, i1.Article table) + : super( + i0.TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + i1.$ArticleFilterComposer($db: db, $table: table), + createOrderingComposer: () => + i1.$ArticleOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + i1.$ArticleAnnotationComposer($db: db, $table: table), + updateCompanionCallback: + ({ + i0.Value id = const i0.Value.absent(), + i0.Value feedId = const i0.Value.absent(), + i0.Value fetched = const i0.Value.absent(), + i0.Value created = const i0.Value.absent(), + i0.Value updated = const i0.Value.absent(), + i0.Value lastRead = const i0.Value.absent(), + i0.Value title = const i0.Value.absent(), + i0.Value?> authors = + const i0.Value.absent(), + i0.Value?> tags = const i0.Value.absent(), + i0.Value?> links = const i0.Value.absent(), + i0.Value summaryHtml = const i0.Value.absent(), + i0.Value summaryMarkdown = const i0.Value.absent(), + i0.Value summaryPlain = const i0.Value.absent(), + i0.Value contentHtml = const i0.Value.absent(), + i0.Value contentMarkdown = const i0.Value.absent(), + i0.Value contentPlain = const i0.Value.absent(), + i0.Value rowid = const i0.Value.absent(), + }) => i1.ArticleCompanion( + id: id, + feedId: feedId, + fetched: fetched, + created: created, + updated: updated, + lastRead: lastRead, + title: title, + authors: authors, + tags: tags, + links: links, + summaryHtml: summaryHtml, + summaryMarkdown: summaryMarkdown, + summaryPlain: summaryPlain, + contentHtml: contentHtml, + contentMarkdown: contentMarkdown, + contentPlain: contentPlain, + rowid: rowid, + ), + createCompanionCallback: + ({ + required String id, + required Uri feedId, + required DateTime fetched, + i0.Value created = const i0.Value.absent(), + i0.Value updated = const i0.Value.absent(), + i0.Value lastRead = const i0.Value.absent(), + i0.Value title = const i0.Value.absent(), + i0.Value?> authors = + const i0.Value.absent(), + i0.Value?> tags = const i0.Value.absent(), + i0.Value?> links = const i0.Value.absent(), + i0.Value summaryHtml = const i0.Value.absent(), + i0.Value summaryMarkdown = const i0.Value.absent(), + i0.Value summaryPlain = const i0.Value.absent(), + i0.Value contentHtml = const i0.Value.absent(), + i0.Value contentMarkdown = const i0.Value.absent(), + i0.Value contentPlain = const i0.Value.absent(), + i0.Value rowid = const i0.Value.absent(), + }) => i1.ArticleCompanion.insert( + id: id, + feedId: feedId, + fetched: fetched, + created: created, + updated: updated, + lastRead: lastRead, + title: title, + authors: authors, + tags: tags, + links: links, + summaryHtml: summaryHtml, + summaryMarkdown: summaryMarkdown, + summaryPlain: summaryPlain, + contentHtml: contentHtml, + contentMarkdown: contentMarkdown, + contentPlain: contentPlain, + rowid: rowid, + ), + withReferenceMapper: (p0) => p0 + .map( + (e) => + (e.readTable(table), i1.$ArticleReferences(db, table, e)), + ) + .toList(), + prefetchHooksCallback: ({feedId = false}) { + return i0.PrefetchHooks( + db: db, + explicitlyWatchedTables: [], + addJoins: + < + T extends i0.TableManagerState< + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic + > + >(state) { + if (feedId) { + state = + state.withJoin( + currentTable: table, + currentColumn: table.feedId, + referencedTable: i1.$ArticleReferences + ._feedIdTable(db), + referencedColumn: i1.$ArticleReferences + ._feedIdTable(db) + .url, + ) + as T; + } + + return state; + }, + getPrefetchedDataCallback: (items) async { + return []; + }, + ); + }, + ), + ); +} + +typedef $ArticleProcessedTableManager = + i0.ProcessedTableManager< + i0.GeneratedDatabase, + i1.Article, + i7.FeedArticle, + i1.$ArticleFilterComposer, + i1.$ArticleOrderingComposer, + i1.$ArticleAnnotationComposer, + $ArticleCreateCompanionBuilder, + $ArticleUpdateCompanionBuilder, + (i7.FeedArticle, i1.$ArticleReferences), + i7.FeedArticle, + i0.PrefetchHooks Function({bool feedId}) + >; +typedef $ArticleFtsCreateCompanionBuilder = + i1.ArticleFtsCompanion Function({ + required String title, + required String summaryPlain, + required String contentPlain, + i0.Value rowid, + }); +typedef $ArticleFtsUpdateCompanionBuilder = + i1.ArticleFtsCompanion Function({ + i0.Value title, + i0.Value summaryPlain, + i0.Value contentPlain, + i0.Value rowid, + }); + +class $ArticleFtsFilterComposer + extends i0.Composer { + $ArticleFtsFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.ColumnFilters get title => $composableBuilder( + column: $table.title, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get summaryPlain => $composableBuilder( + column: $table.summaryPlain, + builder: (column) => i0.ColumnFilters(column), + ); + + i0.ColumnFilters get contentPlain => $composableBuilder( + column: $table.contentPlain, + builder: (column) => i0.ColumnFilters(column), + ); +} + +class $ArticleFtsOrderingComposer + extends i0.Composer { + $ArticleFtsOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.ColumnOrderings get title => $composableBuilder( + column: $table.title, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get summaryPlain => $composableBuilder( + column: $table.summaryPlain, + builder: (column) => i0.ColumnOrderings(column), + ); + + i0.ColumnOrderings get contentPlain => $composableBuilder( + column: $table.contentPlain, + builder: (column) => i0.ColumnOrderings(column), + ); +} + +class $ArticleFtsAnnotationComposer + extends i0.Composer { + $ArticleFtsAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.GeneratedColumn get title => + $composableBuilder(column: $table.title, builder: (column) => column); + + i0.GeneratedColumn get summaryPlain => $composableBuilder( + column: $table.summaryPlain, + builder: (column) => column, + ); + + i0.GeneratedColumn get contentPlain => $composableBuilder( + column: $table.contentPlain, + builder: (column) => column, + ); +} + +class $ArticleFtsTableManager + extends + i0.RootTableManager< + i0.GeneratedDatabase, + i1.ArticleFts, + i1.ArticleFt, + i1.$ArticleFtsFilterComposer, + i1.$ArticleFtsOrderingComposer, + i1.$ArticleFtsAnnotationComposer, + $ArticleFtsCreateCompanionBuilder, + $ArticleFtsUpdateCompanionBuilder, + ( + i1.ArticleFt, + i0.BaseReferences< + i0.GeneratedDatabase, + i1.ArticleFts, + i1.ArticleFt + >, + ), + i1.ArticleFt, + i0.PrefetchHooks Function() + > { + $ArticleFtsTableManager(i0.GeneratedDatabase db, i1.ArticleFts table) + : super( + i0.TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + i1.$ArticleFtsFilterComposer($db: db, $table: table), + createOrderingComposer: () => + i1.$ArticleFtsOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + i1.$ArticleFtsAnnotationComposer($db: db, $table: table), + updateCompanionCallback: + ({ + i0.Value title = const i0.Value.absent(), + i0.Value summaryPlain = const i0.Value.absent(), + i0.Value contentPlain = const i0.Value.absent(), + i0.Value rowid = const i0.Value.absent(), + }) => i1.ArticleFtsCompanion( + title: title, + summaryPlain: summaryPlain, + contentPlain: contentPlain, + rowid: rowid, + ), + createCompanionCallback: + ({ + required String title, + required String summaryPlain, + required String contentPlain, + i0.Value rowid = const i0.Value.absent(), + }) => i1.ArticleFtsCompanion.insert( + title: title, + summaryPlain: summaryPlain, + contentPlain: contentPlain, + rowid: rowid, + ), + withReferenceMapper: (p0) => p0 + .map((e) => (e.readTable(table), i0.BaseReferences(db, table, e))) + .toList(), + prefetchHooksCallback: null, + ), + ); +} + +typedef $ArticleFtsProcessedTableManager = + i0.ProcessedTableManager< + i0.GeneratedDatabase, + i1.ArticleFts, + i1.ArticleFt, + i1.$ArticleFtsFilterComposer, + i1.$ArticleFtsOrderingComposer, + i1.$ArticleFtsAnnotationComposer, + $ArticleFtsCreateCompanionBuilder, + $ArticleFtsUpdateCompanionBuilder, + ( + i1.ArticleFt, + i0.BaseReferences, + ), + i1.ArticleFt, + i0.PrefetchHooks Function() + >; + +class Feed extends i0.Table with i0.TableInfo { + @override + final i0.GeneratedDatabase attachedDatabase; + final String? _alias; + Feed(this.attachedDatabase, [this._alias]); + late final i0.GeneratedColumnWithTypeConverter url = + i0.GeneratedColumn( + 'url', + aliasedName, + false, + type: i0.DriftSqlType.string, + requiredDuringInsert: true, + $customConstraints: 'PRIMARY KEY NOT NULL', + ).withConverter(i1.Feed.$converterurl); + late final i0.GeneratedColumn title = i0.GeneratedColumn( + 'title', + aliasedName, + true, + type: i0.DriftSqlType.string, + requiredDuringInsert: false, + $customConstraints: '', + ); + late final i0.GeneratedColumn description = + i0.GeneratedColumn( + 'description', + aliasedName, + true, + type: i0.DriftSqlType.string, + requiredDuringInsert: false, + $customConstraints: '', + ); + late final i0.GeneratedColumnWithTypeConverter icon = + i0.GeneratedColumn( + 'icon', + aliasedName, + true, + type: i0.DriftSqlType.string, + requiredDuringInsert: false, + $customConstraints: '', + ).withConverter(i1.Feed.$convertericon); + late final i0.GeneratedColumnWithTypeConverter siteLink = + i0.GeneratedColumn( + 'site_link', + aliasedName, + true, + type: i0.DriftSqlType.string, + requiredDuringInsert: false, + $customConstraints: '', + ).withConverter(i1.Feed.$convertersiteLink); + late final i0.GeneratedColumnWithTypeConverter?, String> + authors = i0.GeneratedColumn( + 'authors', + aliasedName, + true, + type: i0.DriftSqlType.string, + requiredDuringInsert: false, + $customConstraints: '', + ).withConverter?>(i1.Feed.$converterauthorsn); + late final i0.GeneratedColumnWithTypeConverter?, String> + tags = i0.GeneratedColumn( + 'tags', + aliasedName, + true, + type: i0.DriftSqlType.string, + requiredDuringInsert: false, + $customConstraints: '', + ).withConverter?>(i1.Feed.$convertertagsn); + late final i0.GeneratedColumn lastFetched = + i0.GeneratedColumn( + 'last_fetched', + aliasedName, + true, + type: i0.DriftSqlType.dateTime, + requiredDuringInsert: false, + $customConstraints: '', + ); + @override + List get $columns => [ + url, + title, + description, + icon, + siteLink, + authors, + tags, + lastFetched, + ]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'feed'; + @override + Set get $primaryKey => {url}; + @override + i1.FeedData map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return i1.FeedData( + url: i1.Feed.$converterurl.fromSql( + attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}url'], + )!, + ), + title: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}title'], + ), + description: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}description'], + ), + icon: i1.Feed.$convertericon.fromSql( + attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}icon'], + ), + ), + siteLink: i1.Feed.$convertersiteLink.fromSql( + attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}site_link'], + ), + ), + authors: i1.Feed.$converterauthorsn.fromSql( + attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}authors'], + ), + ), + tags: i1.Feed.$convertertagsn.fromSql( + attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}tags'], + ), + ), + lastFetched: attachedDatabase.typeMapping.read( + i0.DriftSqlType.dateTime, + data['${effectivePrefix}last_fetched'], + ), + ); + } + + @override + Feed createAlias(String alias) { + return Feed(attachedDatabase, alias); + } + + static i0.TypeConverter $converterurl = const i4.UriConverter(); + static i0.TypeConverter $convertericon = + const i4.UriConverterNullable(); + static i0.TypeConverter $convertersiteLink = + const i4.UriConverterNullable(); + static i0.TypeConverter, String> $converterauthors = + const i5.FeedAuthorsConverter(); + static i0.TypeConverter?, String?> $converterauthorsn = + i0.NullAwareTypeConverter.wrap($converterauthors); + static i0.TypeConverter, String> $convertertags = + const i6.FeedCategoriesConverter(); + static i0.TypeConverter?, String?> $convertertagsn = + i0.NullAwareTypeConverter.wrap($convertertags); + @override + bool get dontWriteConstraints => true; +} + +class FeedData extends i0.DataClass implements i0.Insertable { + final Uri url; + final String? title; + final String? description; + final Uri? icon; + final Uri? siteLink; + final List? authors; + final List? tags; + final DateTime? lastFetched; + const FeedData({ + required this.url, + this.title, + this.description, + this.icon, + this.siteLink, + this.authors, + this.tags, + this.lastFetched, + }); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + { + map['url'] = i0.Variable(i1.Feed.$converterurl.toSql(url)); + } + if (!nullToAbsent || title != null) { + map['title'] = i0.Variable(title); + } + if (!nullToAbsent || description != null) { + map['description'] = i0.Variable(description); + } + if (!nullToAbsent || icon != null) { + map['icon'] = i0.Variable(i1.Feed.$convertericon.toSql(icon)); + } + if (!nullToAbsent || siteLink != null) { + map['site_link'] = i0.Variable( + i1.Feed.$convertersiteLink.toSql(siteLink), + ); + } + if (!nullToAbsent || authors != null) { + map['authors'] = i0.Variable( + i1.Feed.$converterauthorsn.toSql(authors), + ); + } + if (!nullToAbsent || tags != null) { + map['tags'] = i0.Variable(i1.Feed.$convertertagsn.toSql(tags)); + } + if (!nullToAbsent || lastFetched != null) { + map['last_fetched'] = i0.Variable(lastFetched); + } + return map; + } + + factory FeedData.fromJson( + Map json, { + i0.ValueSerializer? serializer, + }) { + serializer ??= i0.driftRuntimeOptions.defaultSerializer; + return FeedData( + url: serializer.fromJson(json['url']), + title: serializer.fromJson(json['title']), + description: serializer.fromJson(json['description']), + icon: serializer.fromJson(json['icon']), + siteLink: serializer.fromJson(json['site_link']), + authors: serializer.fromJson?>(json['authors']), + tags: serializer.fromJson?>(json['tags']), + lastFetched: serializer.fromJson(json['last_fetched']), + ); + } + @override + Map toJson({i0.ValueSerializer? serializer}) { + serializer ??= i0.driftRuntimeOptions.defaultSerializer; + return { + 'url': serializer.toJson(url), + 'title': serializer.toJson(title), + 'description': serializer.toJson(description), + 'icon': serializer.toJson(icon), + 'site_link': serializer.toJson(siteLink), + 'authors': serializer.toJson?>(authors), + 'tags': serializer.toJson?>(tags), + 'last_fetched': serializer.toJson(lastFetched), + }; + } + + i1.FeedData copyWith({ + Uri? url, + i0.Value title = const i0.Value.absent(), + i0.Value description = const i0.Value.absent(), + i0.Value icon = const i0.Value.absent(), + i0.Value siteLink = const i0.Value.absent(), + i0.Value?> authors = const i0.Value.absent(), + i0.Value?> tags = const i0.Value.absent(), + i0.Value lastFetched = const i0.Value.absent(), + }) => i1.FeedData( + url: url ?? this.url, + title: title.present ? title.value : this.title, + description: description.present ? description.value : this.description, + icon: icon.present ? icon.value : this.icon, + siteLink: siteLink.present ? siteLink.value : this.siteLink, + authors: authors.present ? authors.value : this.authors, + tags: tags.present ? tags.value : this.tags, + lastFetched: lastFetched.present ? lastFetched.value : this.lastFetched, + ); + FeedData copyWithCompanion(i1.FeedCompanion data) { + return FeedData( + url: data.url.present ? data.url.value : this.url, + title: data.title.present ? data.title.value : this.title, + description: data.description.present + ? data.description.value + : this.description, + icon: data.icon.present ? data.icon.value : this.icon, + siteLink: data.siteLink.present ? data.siteLink.value : this.siteLink, + authors: data.authors.present ? data.authors.value : this.authors, + tags: data.tags.present ? data.tags.value : this.tags, + lastFetched: data.lastFetched.present + ? data.lastFetched.value + : this.lastFetched, + ); + } + + @override + String toString() { + return (StringBuffer('FeedData(') + ..write('url: $url, ') + ..write('title: $title, ') + ..write('description: $description, ') + ..write('icon: $icon, ') + ..write('siteLink: $siteLink, ') + ..write('authors: $authors, ') + ..write('tags: $tags, ') + ..write('lastFetched: $lastFetched') + ..write(')')) + .toString(); + } + + @override + int get hashCode => Object.hash( + url, + title, + description, + icon, + siteLink, + authors, + tags, + lastFetched, + ); + @override + bool operator ==(Object other) => + identical(this, other) || + (other is i1.FeedData && + other.url == this.url && + other.title == this.title && + other.description == this.description && + other.icon == this.icon && + other.siteLink == this.siteLink && + other.authors == this.authors && + other.tags == this.tags && + other.lastFetched == this.lastFetched); +} + +class FeedCompanion extends i0.UpdateCompanion { + final i0.Value url; + final i0.Value title; + final i0.Value description; + final i0.Value icon; + final i0.Value siteLink; + final i0.Value?> authors; + final i0.Value?> tags; + final i0.Value lastFetched; + final i0.Value rowid; + const FeedCompanion({ + this.url = const i0.Value.absent(), + this.title = const i0.Value.absent(), + this.description = const i0.Value.absent(), + this.icon = const i0.Value.absent(), + this.siteLink = const i0.Value.absent(), + this.authors = const i0.Value.absent(), + this.tags = const i0.Value.absent(), + this.lastFetched = const i0.Value.absent(), + this.rowid = const i0.Value.absent(), + }); + FeedCompanion.insert({ + required Uri url, + this.title = const i0.Value.absent(), + this.description = const i0.Value.absent(), + this.icon = const i0.Value.absent(), + this.siteLink = const i0.Value.absent(), + this.authors = const i0.Value.absent(), + this.tags = const i0.Value.absent(), + this.lastFetched = const i0.Value.absent(), + this.rowid = const i0.Value.absent(), + }) : url = i0.Value(url); + static i0.Insertable custom({ + i0.Expression? url, + i0.Expression? title, + i0.Expression? description, + i0.Expression? icon, + i0.Expression? siteLink, + i0.Expression? authors, + i0.Expression? tags, + i0.Expression? lastFetched, + i0.Expression? rowid, + }) { + return i0.RawValuesInsertable({ + if (url != null) 'url': url, + if (title != null) 'title': title, + if (description != null) 'description': description, + if (icon != null) 'icon': icon, + if (siteLink != null) 'site_link': siteLink, + if (authors != null) 'authors': authors, + if (tags != null) 'tags': tags, + if (lastFetched != null) 'last_fetched': lastFetched, + if (rowid != null) 'rowid': rowid, + }); + } + + i1.FeedCompanion copyWith({ + i0.Value? url, + i0.Value? title, + i0.Value? description, + i0.Value? icon, + i0.Value? siteLink, + i0.Value?>? authors, + i0.Value?>? tags, + i0.Value? lastFetched, + i0.Value? rowid, + }) { + return i1.FeedCompanion( + url: url ?? this.url, + title: title ?? this.title, + description: description ?? this.description, + icon: icon ?? this.icon, + siteLink: siteLink ?? this.siteLink, + authors: authors ?? this.authors, + tags: tags ?? this.tags, + lastFetched: lastFetched ?? this.lastFetched, + rowid: rowid ?? this.rowid, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (url.present) { + map['url'] = i0.Variable(i1.Feed.$converterurl.toSql(url.value)); + } + if (title.present) { + map['title'] = i0.Variable(title.value); + } + if (description.present) { + map['description'] = i0.Variable(description.value); + } + if (icon.present) { + map['icon'] = i0.Variable( + i1.Feed.$convertericon.toSql(icon.value), + ); + } + if (siteLink.present) { + map['site_link'] = i0.Variable( + i1.Feed.$convertersiteLink.toSql(siteLink.value), + ); + } + if (authors.present) { + map['authors'] = i0.Variable( + i1.Feed.$converterauthorsn.toSql(authors.value), + ); + } + if (tags.present) { + map['tags'] = i0.Variable( + i1.Feed.$convertertagsn.toSql(tags.value), + ); + } + if (lastFetched.present) { + map['last_fetched'] = i0.Variable(lastFetched.value); + } + if (rowid.present) { + map['rowid'] = i0.Variable(rowid.value); + } + return map; + } + + @override + String toString() { + return (StringBuffer('FeedCompanion(') + ..write('url: $url, ') + ..write('title: $title, ') + ..write('description: $description, ') + ..write('icon: $icon, ') + ..write('siteLink: $siteLink, ') + ..write('authors: $authors, ') + ..write('tags: $tags, ') + ..write('lastFetched: $lastFetched, ') + ..write('rowid: $rowid') + ..write(')')) + .toString(); + } +} + +class Article extends i0.Table with i0.TableInfo { + @override + final i0.GeneratedDatabase attachedDatabase; + final String? _alias; + Article(this.attachedDatabase, [this._alias]); + late final i0.GeneratedColumn id = i0.GeneratedColumn( + 'id', + aliasedName, + false, + type: i0.DriftSqlType.string, + requiredDuringInsert: true, + $customConstraints: 'PRIMARY KEY NOT NULL', + ); + late final i0.GeneratedColumnWithTypeConverter feedId = + i0.GeneratedColumn( + 'feed_id', + aliasedName, + false, + type: i0.DriftSqlType.string, + requiredDuringInsert: true, + $customConstraints: 'NOT NULL REFERENCES feed(url)ON DELETE CASCADE', + ).withConverter(i1.Article.$converterfeedId); + late final i0.GeneratedColumn fetched = + i0.GeneratedColumn( + 'fetched', + aliasedName, + false, + type: i0.DriftSqlType.dateTime, + requiredDuringInsert: true, + $customConstraints: 'NOT NULL', + ); + late final i0.GeneratedColumn created = + i0.GeneratedColumn( + 'created', + aliasedName, + true, + type: i0.DriftSqlType.dateTime, + requiredDuringInsert: false, + $customConstraints: '', + ); + late final i0.GeneratedColumn updated = + i0.GeneratedColumn( + 'updated', + aliasedName, + true, + type: i0.DriftSqlType.dateTime, + requiredDuringInsert: false, + $customConstraints: '', + ); + late final i0.GeneratedColumn lastRead = + i0.GeneratedColumn( + 'last_read', + aliasedName, + true, + type: i0.DriftSqlType.dateTime, + requiredDuringInsert: false, + $customConstraints: '', + ); + late final i0.GeneratedColumn title = i0.GeneratedColumn( + 'title', + aliasedName, + true, + type: i0.DriftSqlType.string, + requiredDuringInsert: false, + $customConstraints: '', + ); + late final i0.GeneratedColumnWithTypeConverter?, String> + authors = i0.GeneratedColumn( + 'authors', + aliasedName, + true, + type: i0.DriftSqlType.string, + requiredDuringInsert: false, + $customConstraints: '', + ).withConverter?>(i1.Article.$converterauthorsn); + late final i0.GeneratedColumnWithTypeConverter?, String> + tags = i0.GeneratedColumn( + 'tags', + aliasedName, + true, + type: i0.DriftSqlType.string, + requiredDuringInsert: false, + $customConstraints: '', + ).withConverter?>(i1.Article.$convertertagsn); + late final i0.GeneratedColumnWithTypeConverter?, String> + links = i0.GeneratedColumn( + 'links', + aliasedName, + true, + type: i0.DriftSqlType.string, + requiredDuringInsert: false, + $customConstraints: '', + ).withConverter?>(i1.Article.$converterlinksn); + late final i0.GeneratedColumn summaryHtml = + i0.GeneratedColumn( + 'summaryHtml', + aliasedName, + true, + type: i0.DriftSqlType.string, + requiredDuringInsert: false, + $customConstraints: '', + ); + late final i0.GeneratedColumn summaryMarkdown = + i0.GeneratedColumn( + 'summaryMarkdown', + aliasedName, + true, + type: i0.DriftSqlType.string, + requiredDuringInsert: false, + $customConstraints: '', + ); + late final i0.GeneratedColumn summaryPlain = + i0.GeneratedColumn( + 'summaryPlain', + aliasedName, + true, + type: i0.DriftSqlType.string, + requiredDuringInsert: false, + $customConstraints: '', + ); + late final i0.GeneratedColumn contentHtml = + i0.GeneratedColumn( + 'contentHtml', + aliasedName, + true, + type: i0.DriftSqlType.string, + requiredDuringInsert: false, + $customConstraints: '', + ); + late final i0.GeneratedColumn contentMarkdown = + i0.GeneratedColumn( + 'contentMarkdown', + aliasedName, + true, + type: i0.DriftSqlType.string, + requiredDuringInsert: false, + $customConstraints: '', + ); + late final i0.GeneratedColumn contentPlain = + i0.GeneratedColumn( + 'contentPlain', + aliasedName, + true, + type: i0.DriftSqlType.string, + requiredDuringInsert: false, + $customConstraints: '', + ); + @override + List get $columns => [ + id, + feedId, + fetched, + created, + updated, + lastRead, + title, + authors, + tags, + links, + summaryHtml, + summaryMarkdown, + summaryPlain, + contentHtml, + contentMarkdown, + contentPlain, + ]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'article'; + @override + Set get $primaryKey => {id}; + @override + i7.FeedArticle map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return i7.FeedArticle( + id: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}id'], + )!, + feedId: i1.Article.$converterfeedId.fromSql( + attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}feed_id'], + )!, + ), + fetched: attachedDatabase.typeMapping.read( + i0.DriftSqlType.dateTime, + data['${effectivePrefix}fetched'], + )!, + created: attachedDatabase.typeMapping.read( + i0.DriftSqlType.dateTime, + data['${effectivePrefix}created'], + ), + updated: attachedDatabase.typeMapping.read( + i0.DriftSqlType.dateTime, + data['${effectivePrefix}updated'], + ), + lastRead: attachedDatabase.typeMapping.read( + i0.DriftSqlType.dateTime, + data['${effectivePrefix}last_read'], + ), + title: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}title'], + ), + authors: i1.Article.$converterauthorsn.fromSql( + attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}authors'], + ), + ), + tags: i1.Article.$convertertagsn.fromSql( + attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}tags'], + ), + ), + links: i1.Article.$converterlinksn.fromSql( + attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}links'], + ), + ), + summaryHtml: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}summaryHtml'], + ), + summaryMarkdown: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}summaryMarkdown'], + ), + summaryPlain: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}summaryPlain'], + ), + contentHtml: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}contentHtml'], + ), + contentMarkdown: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}contentMarkdown'], + ), + contentPlain: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}contentPlain'], + ), + ); + } + + @override + Article createAlias(String alias) { + return Article(attachedDatabase, alias); + } + + static i0.TypeConverter $converterfeedId = + const i4.UriConverter(); + static i0.TypeConverter, String> $converterauthors = + const i5.FeedAuthorsConverter(); + static i0.TypeConverter?, String?> $converterauthorsn = + i0.NullAwareTypeConverter.wrap($converterauthors); + static i0.TypeConverter, String> $convertertags = + const i6.FeedCategoriesConverter(); + static i0.TypeConverter?, String?> $convertertagsn = + i0.NullAwareTypeConverter.wrap($convertertags); + static i0.TypeConverter, String> $converterlinks = + const i9.FeedLinksConverter(); + static i0.TypeConverter?, String?> $converterlinksn = + i0.NullAwareTypeConverter.wrap($converterlinks); + @override + bool get dontWriteConstraints => true; +} + +class ArticleCompanion extends i0.UpdateCompanion { + final i0.Value id; + final i0.Value feedId; + final i0.Value fetched; + final i0.Value created; + final i0.Value updated; + final i0.Value lastRead; + final i0.Value title; + final i0.Value?> authors; + final i0.Value?> tags; + final i0.Value?> links; + final i0.Value summaryHtml; + final i0.Value summaryMarkdown; + final i0.Value summaryPlain; + final i0.Value contentHtml; + final i0.Value contentMarkdown; + final i0.Value contentPlain; + final i0.Value rowid; + const ArticleCompanion({ + this.id = const i0.Value.absent(), + this.feedId = const i0.Value.absent(), + this.fetched = const i0.Value.absent(), + this.created = const i0.Value.absent(), + this.updated = const i0.Value.absent(), + this.lastRead = const i0.Value.absent(), + this.title = const i0.Value.absent(), + this.authors = const i0.Value.absent(), + this.tags = const i0.Value.absent(), + this.links = const i0.Value.absent(), + this.summaryHtml = const i0.Value.absent(), + this.summaryMarkdown = const i0.Value.absent(), + this.summaryPlain = const i0.Value.absent(), + this.contentHtml = const i0.Value.absent(), + this.contentMarkdown = const i0.Value.absent(), + this.contentPlain = const i0.Value.absent(), + this.rowid = const i0.Value.absent(), + }); + ArticleCompanion.insert({ + required String id, + required Uri feedId, + required DateTime fetched, + this.created = const i0.Value.absent(), + this.updated = const i0.Value.absent(), + this.lastRead = const i0.Value.absent(), + this.title = const i0.Value.absent(), + this.authors = const i0.Value.absent(), + this.tags = const i0.Value.absent(), + this.links = const i0.Value.absent(), + this.summaryHtml = const i0.Value.absent(), + this.summaryMarkdown = const i0.Value.absent(), + this.summaryPlain = const i0.Value.absent(), + this.contentHtml = const i0.Value.absent(), + this.contentMarkdown = const i0.Value.absent(), + this.contentPlain = const i0.Value.absent(), + this.rowid = const i0.Value.absent(), + }) : id = i0.Value(id), + feedId = i0.Value(feedId), + fetched = i0.Value(fetched); + static i0.Insertable custom({ + i0.Expression? id, + i0.Expression? feedId, + i0.Expression? fetched, + i0.Expression? created, + i0.Expression? updated, + i0.Expression? lastRead, + i0.Expression? title, + i0.Expression? authors, + i0.Expression? tags, + i0.Expression? links, + i0.Expression? summaryHtml, + i0.Expression? summaryMarkdown, + i0.Expression? summaryPlain, + i0.Expression? contentHtml, + i0.Expression? contentMarkdown, + i0.Expression? contentPlain, + i0.Expression? rowid, + }) { + return i0.RawValuesInsertable({ + if (id != null) 'id': id, + if (feedId != null) 'feed_id': feedId, + if (fetched != null) 'fetched': fetched, + if (created != null) 'created': created, + if (updated != null) 'updated': updated, + if (lastRead != null) 'last_read': lastRead, + if (title != null) 'title': title, + if (authors != null) 'authors': authors, + if (tags != null) 'tags': tags, + if (links != null) 'links': links, + if (summaryHtml != null) 'summaryHtml': summaryHtml, + if (summaryMarkdown != null) 'summaryMarkdown': summaryMarkdown, + if (summaryPlain != null) 'summaryPlain': summaryPlain, + if (contentHtml != null) 'contentHtml': contentHtml, + if (contentMarkdown != null) 'contentMarkdown': contentMarkdown, + if (contentPlain != null) 'contentPlain': contentPlain, + if (rowid != null) 'rowid': rowid, + }); + } + + i1.ArticleCompanion copyWith({ + i0.Value? id, + i0.Value? feedId, + i0.Value? fetched, + i0.Value? created, + i0.Value? updated, + i0.Value? lastRead, + i0.Value? title, + i0.Value?>? authors, + i0.Value?>? tags, + i0.Value?>? links, + i0.Value? summaryHtml, + i0.Value? summaryMarkdown, + i0.Value? summaryPlain, + i0.Value? contentHtml, + i0.Value? contentMarkdown, + i0.Value? contentPlain, + i0.Value? rowid, + }) { + return i1.ArticleCompanion( + id: id ?? this.id, + feedId: feedId ?? this.feedId, + fetched: fetched ?? this.fetched, + created: created ?? this.created, + updated: updated ?? this.updated, + lastRead: lastRead ?? this.lastRead, + title: title ?? this.title, + authors: authors ?? this.authors, + tags: tags ?? this.tags, + links: links ?? this.links, + summaryHtml: summaryHtml ?? this.summaryHtml, + summaryMarkdown: summaryMarkdown ?? this.summaryMarkdown, + summaryPlain: summaryPlain ?? this.summaryPlain, + contentHtml: contentHtml ?? this.contentHtml, + contentMarkdown: contentMarkdown ?? this.contentMarkdown, + contentPlain: contentPlain ?? this.contentPlain, + rowid: rowid ?? this.rowid, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (id.present) { + map['id'] = i0.Variable(id.value); + } + if (feedId.present) { + map['feed_id'] = i0.Variable( + i1.Article.$converterfeedId.toSql(feedId.value), + ); + } + if (fetched.present) { + map['fetched'] = i0.Variable(fetched.value); + } + if (created.present) { + map['created'] = i0.Variable(created.value); + } + if (updated.present) { + map['updated'] = i0.Variable(updated.value); + } + if (lastRead.present) { + map['last_read'] = i0.Variable(lastRead.value); + } + if (title.present) { + map['title'] = i0.Variable(title.value); + } + if (authors.present) { + map['authors'] = i0.Variable( + i1.Article.$converterauthorsn.toSql(authors.value), + ); + } + if (tags.present) { + map['tags'] = i0.Variable( + i1.Article.$convertertagsn.toSql(tags.value), + ); + } + if (links.present) { + map['links'] = i0.Variable( + i1.Article.$converterlinksn.toSql(links.value), + ); + } + if (summaryHtml.present) { + map['summaryHtml'] = i0.Variable(summaryHtml.value); + } + if (summaryMarkdown.present) { + map['summaryMarkdown'] = i0.Variable(summaryMarkdown.value); + } + if (summaryPlain.present) { + map['summaryPlain'] = i0.Variable(summaryPlain.value); + } + if (contentHtml.present) { + map['contentHtml'] = i0.Variable(contentHtml.value); + } + if (contentMarkdown.present) { + map['contentMarkdown'] = i0.Variable(contentMarkdown.value); + } + if (contentPlain.present) { + map['contentPlain'] = i0.Variable(contentPlain.value); + } + if (rowid.present) { + map['rowid'] = i0.Variable(rowid.value); + } + return map; + } + + @override + String toString() { + return (StringBuffer('ArticleCompanion(') + ..write('id: $id, ') + ..write('feedId: $feedId, ') + ..write('fetched: $fetched, ') + ..write('created: $created, ') + ..write('updated: $updated, ') + ..write('lastRead: $lastRead, ') + ..write('title: $title, ') + ..write('authors: $authors, ') + ..write('tags: $tags, ') + ..write('links: $links, ') + ..write('summaryHtml: $summaryHtml, ') + ..write('summaryMarkdown: $summaryMarkdown, ') + ..write('summaryPlain: $summaryPlain, ') + ..write('contentHtml: $contentHtml, ') + ..write('contentMarkdown: $contentMarkdown, ') + ..write('contentPlain: $contentPlain, ') + ..write('rowid: $rowid') + ..write(')')) + .toString(); + } +} + +class ArticleView extends i0.ViewInfo + implements i0.HasResultSet { + final String? _alias; + @override + final i0.GeneratedDatabase attachedDatabase; + ArticleView(this.attachedDatabase, [this._alias]); + @override + List get $columns => [ + id, + feedId, + fetched, + created, + updated, + lastRead, + title, + authors, + tags, + links, + summaryHtml, + summaryMarkdown, + summaryPlain, + contentHtml, + contentMarkdown, + contentPlain, + icon, + siteLink, + ]; + @override + String get aliasedName => _alias ?? entityName; + @override + String get entityName => 'article_view'; + @override + Map get createViewStatements => { + i0.SqlDialect.sqlite: + 'CREATE VIEW article_view AS SELECT a.*, f.icon, f.site_link FROM article AS a INNER JOIN feed AS f ON f.url = a.feed_id', + }; + @override + ArticleView get asDslTable => this; + @override + i7.FeedArticle map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return i7.FeedArticle( + id: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}id'], + )!, + feedId: i1.Article.$converterfeedId.fromSql( + attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}feed_id'], + )!, + ), + fetched: attachedDatabase.typeMapping.read( + i0.DriftSqlType.dateTime, + data['${effectivePrefix}fetched'], + )!, + created: attachedDatabase.typeMapping.read( + i0.DriftSqlType.dateTime, + data['${effectivePrefix}created'], + ), + updated: attachedDatabase.typeMapping.read( + i0.DriftSqlType.dateTime, + data['${effectivePrefix}updated'], + ), + lastRead: attachedDatabase.typeMapping.read( + i0.DriftSqlType.dateTime, + data['${effectivePrefix}last_read'], + ), + title: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}title'], + ), + authors: i1.Article.$converterauthorsn.fromSql( + attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}authors'], + ), + ), + tags: i1.Article.$convertertagsn.fromSql( + attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}tags'], + ), + ), + links: i1.Article.$converterlinksn.fromSql( + attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}links'], + ), + ), + summaryHtml: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}summaryHtml'], + ), + summaryMarkdown: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}summaryMarkdown'], + ), + summaryPlain: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}summaryPlain'], + ), + contentHtml: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}contentHtml'], + ), + contentMarkdown: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}contentMarkdown'], + ), + contentPlain: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}contentPlain'], + ), + icon: i1.Feed.$convertericon.fromSql( + attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}icon'], + ), + ), + siteLink: i1.Feed.$convertersiteLink.fromSql( + attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}site_link'], + ), + ), + ); + } + + late final i0.GeneratedColumn id = i0.GeneratedColumn( + 'id', + aliasedName, + false, + type: i0.DriftSqlType.string, + ); + late final i0.GeneratedColumnWithTypeConverter feedId = + i0.GeneratedColumn( + 'feed_id', + aliasedName, + false, + type: i0.DriftSqlType.string, + ).withConverter(i1.Article.$converterfeedId); + late final i0.GeneratedColumn fetched = + i0.GeneratedColumn( + 'fetched', + aliasedName, + false, + type: i0.DriftSqlType.dateTime, + ); + late final i0.GeneratedColumn created = + i0.GeneratedColumn( + 'created', + aliasedName, + true, + type: i0.DriftSqlType.dateTime, + ); + late final i0.GeneratedColumn updated = + i0.GeneratedColumn( + 'updated', + aliasedName, + true, + type: i0.DriftSqlType.dateTime, + ); + late final i0.GeneratedColumn lastRead = + i0.GeneratedColumn( + 'last_read', + aliasedName, + true, + type: i0.DriftSqlType.dateTime, + ); + late final i0.GeneratedColumn title = i0.GeneratedColumn( + 'title', + aliasedName, + true, + type: i0.DriftSqlType.string, + ); + late final i0.GeneratedColumnWithTypeConverter?, String> + authors = i0.GeneratedColumn( + 'authors', + aliasedName, + true, + type: i0.DriftSqlType.string, + ).withConverter?>(i1.Article.$converterauthorsn); + late final i0.GeneratedColumnWithTypeConverter?, String> + tags = i0.GeneratedColumn( + 'tags', + aliasedName, + true, + type: i0.DriftSqlType.string, + ).withConverter?>(i1.Article.$convertertagsn); + late final i0.GeneratedColumnWithTypeConverter?, String> + links = i0.GeneratedColumn( + 'links', + aliasedName, + true, + type: i0.DriftSqlType.string, + ).withConverter?>(i1.Article.$converterlinksn); + late final i0.GeneratedColumn summaryHtml = + i0.GeneratedColumn( + 'summaryHtml', + aliasedName, + true, + type: i0.DriftSqlType.string, + ); + late final i0.GeneratedColumn summaryMarkdown = + i0.GeneratedColumn( + 'summaryMarkdown', + aliasedName, + true, + type: i0.DriftSqlType.string, + ); + late final i0.GeneratedColumn summaryPlain = + i0.GeneratedColumn( + 'summaryPlain', + aliasedName, + true, + type: i0.DriftSqlType.string, + ); + late final i0.GeneratedColumn contentHtml = + i0.GeneratedColumn( + 'contentHtml', + aliasedName, + true, + type: i0.DriftSqlType.string, + ); + late final i0.GeneratedColumn contentMarkdown = + i0.GeneratedColumn( + 'contentMarkdown', + aliasedName, + true, + type: i0.DriftSqlType.string, + ); + late final i0.GeneratedColumn contentPlain = + i0.GeneratedColumn( + 'contentPlain', + aliasedName, + true, + type: i0.DriftSqlType.string, + ); + late final i0.GeneratedColumnWithTypeConverter icon = + i0.GeneratedColumn( + 'icon', + aliasedName, + true, + type: i0.DriftSqlType.string, + ).withConverter(i1.Feed.$convertericon); + late final i0.GeneratedColumnWithTypeConverter siteLink = + i0.GeneratedColumn( + 'site_link', + aliasedName, + true, + type: i0.DriftSqlType.string, + ).withConverter(i1.Feed.$convertersiteLink); + @override + ArticleView createAlias(String alias) { + return ArticleView(attachedDatabase, alias); + } + + @override + i0.Query? get query => null; + @override + Set get readTables => const {'article', 'feed'}; +} + +i0.Index get articleFeedId => i0.Index( + 'article_feed_id', + 'CREATE INDEX article_feed_id ON article (feed_id)', +); + +class ArticleFts extends i0.Table + with + i0.TableInfo, + i0.VirtualTableInfo { + @override + final i0.GeneratedDatabase attachedDatabase; + final String? _alias; + ArticleFts(this.attachedDatabase, [this._alias]); + late final i0.GeneratedColumn title = i0.GeneratedColumn( + 'title', + aliasedName, + false, + type: i0.DriftSqlType.string, + requiredDuringInsert: true, + $customConstraints: '', + ); + late final i0.GeneratedColumn summaryPlain = + i0.GeneratedColumn( + 'summaryPlain', + aliasedName, + false, + type: i0.DriftSqlType.string, + requiredDuringInsert: true, + $customConstraints: '', + ); + late final i0.GeneratedColumn contentPlain = + i0.GeneratedColumn( + 'contentPlain', + aliasedName, + false, + type: i0.DriftSqlType.string, + requiredDuringInsert: true, + $customConstraints: '', + ); + @override + List get $columns => [title, summaryPlain, contentPlain]; + @override + String get aliasedName => _alias ?? actualTableName; + @override + String get actualTableName => $name; + static const String $name = 'article_fts'; + @override + Set get $primaryKey => const {}; + @override + i1.ArticleFt map(Map data, {String? tablePrefix}) { + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; + return i1.ArticleFt( + title: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}title'], + )!, + summaryPlain: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}summaryPlain'], + )!, + contentPlain: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}contentPlain'], + )!, + ); + } + + @override + ArticleFts createAlias(String alias) { + return ArticleFts(attachedDatabase, alias); + } + + @override + bool get dontWriteConstraints => true; + @override + String get moduleAndArgs => + 'fts5(title, summaryPlain, contentPlain, content=article, tokenize="trigram")'; +} + +class ArticleFt extends i0.DataClass implements i0.Insertable { + final String title; + final String summaryPlain; + final String contentPlain; + const ArticleFt({ + required this.title, + required this.summaryPlain, + required this.contentPlain, + }); + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + map['title'] = i0.Variable(title); + map['summaryPlain'] = i0.Variable(summaryPlain); + map['contentPlain'] = i0.Variable(contentPlain); + return map; + } + + factory ArticleFt.fromJson( + Map json, { + i0.ValueSerializer? serializer, + }) { + serializer ??= i0.driftRuntimeOptions.defaultSerializer; + return ArticleFt( + title: serializer.fromJson(json['title']), + summaryPlain: serializer.fromJson(json['summaryPlain']), + contentPlain: serializer.fromJson(json['contentPlain']), + ); + } + @override + Map toJson({i0.ValueSerializer? serializer}) { + serializer ??= i0.driftRuntimeOptions.defaultSerializer; + return { + 'title': serializer.toJson(title), + 'summaryPlain': serializer.toJson(summaryPlain), + 'contentPlain': serializer.toJson(contentPlain), + }; + } + + i1.ArticleFt copyWith({ + String? title, + String? summaryPlain, + String? contentPlain, + }) => i1.ArticleFt( + title: title ?? this.title, + summaryPlain: summaryPlain ?? this.summaryPlain, + contentPlain: contentPlain ?? this.contentPlain, + ); + ArticleFt copyWithCompanion(i1.ArticleFtsCompanion data) { + return ArticleFt( + title: data.title.present ? data.title.value : this.title, + summaryPlain: data.summaryPlain.present + ? data.summaryPlain.value + : this.summaryPlain, + contentPlain: data.contentPlain.present + ? data.contentPlain.value + : this.contentPlain, + ); + } + + @override + String toString() { + return (StringBuffer('ArticleFt(') + ..write('title: $title, ') + ..write('summaryPlain: $summaryPlain, ') + ..write('contentPlain: $contentPlain') + ..write(')')) + .toString(); + } + + @override + int get hashCode => Object.hash(title, summaryPlain, contentPlain); + @override + bool operator ==(Object other) => + identical(this, other) || + (other is i1.ArticleFt && + other.title == this.title && + other.summaryPlain == this.summaryPlain && + other.contentPlain == this.contentPlain); +} + +class ArticleFtsCompanion extends i0.UpdateCompanion { + final i0.Value title; + final i0.Value summaryPlain; + final i0.Value contentPlain; + final i0.Value rowid; + const ArticleFtsCompanion({ + this.title = const i0.Value.absent(), + this.summaryPlain = const i0.Value.absent(), + this.contentPlain = const i0.Value.absent(), + this.rowid = const i0.Value.absent(), + }); + ArticleFtsCompanion.insert({ + required String title, + required String summaryPlain, + required String contentPlain, + this.rowid = const i0.Value.absent(), + }) : title = i0.Value(title), + summaryPlain = i0.Value(summaryPlain), + contentPlain = i0.Value(contentPlain); + static i0.Insertable custom({ + i0.Expression? title, + i0.Expression? summaryPlain, + i0.Expression? contentPlain, + i0.Expression? rowid, + }) { + return i0.RawValuesInsertable({ + if (title != null) 'title': title, + if (summaryPlain != null) 'summaryPlain': summaryPlain, + if (contentPlain != null) 'contentPlain': contentPlain, + if (rowid != null) 'rowid': rowid, + }); + } + + i1.ArticleFtsCompanion copyWith({ + i0.Value? title, + i0.Value? summaryPlain, + i0.Value? contentPlain, + i0.Value? rowid, + }) { + return i1.ArticleFtsCompanion( + title: title ?? this.title, + summaryPlain: summaryPlain ?? this.summaryPlain, + contentPlain: contentPlain ?? this.contentPlain, + rowid: rowid ?? this.rowid, + ); + } + + @override + Map toColumns(bool nullToAbsent) { + final map = {}; + if (title.present) { + map['title'] = i0.Variable(title.value); + } + if (summaryPlain.present) { + map['summaryPlain'] = i0.Variable(summaryPlain.value); + } + if (contentPlain.present) { + map['contentPlain'] = i0.Variable(contentPlain.value); + } + if (rowid.present) { + map['rowid'] = i0.Variable(rowid.value); + } + return map; + } + + @override + String toString() { + return (StringBuffer('ArticleFtsCompanion(') + ..write('title: $title, ') + ..write('summaryPlain: $summaryPlain, ') + ..write('contentPlain: $contentPlain, ') + ..write('rowid: $rowid') + ..write(')')) + .toString(); + } +} + +i0.Trigger get articleAfterInsert => i0.Trigger( + 'CREATE TRIGGER article_after_insert AFTER INSERT ON article BEGIN INSERT INTO article_fts ("rowid", title, summaryPlain, contentPlain) VALUES (new."rowid", new.title, new.summaryPlain, new.contentPlain);END', + 'article_after_insert', +); +i0.Trigger get articleAfterDelete => i0.Trigger( + 'CREATE TRIGGER article_after_delete AFTER DELETE ON article BEGIN INSERT INTO article_fts (article_fts, "rowid", title, summaryPlain, contentPlain) VALUES (\'delete\', old."rowid", old.title, old.summaryPlain, old.contentPlain);END', + 'article_after_delete', +); +i0.Trigger get articleAfterUpdate => i0.Trigger( + 'CREATE TRIGGER article_after_update AFTER UPDATE ON article BEGIN INSERT INTO article_fts (article_fts, "rowid", title, summaryPlain, contentPlain) VALUES (\'delete\', old."rowid", old.title, old.summaryPlain, old.contentPlain);INSERT INTO article_fts ("rowid", title, summaryPlain, contentPlain) VALUES (new."rowid", new.title, new.summaryPlain, new.contentPlain);END', + 'article_after_update', +); + +class DefinitionsDrift extends i10.ModularAccessor { + DefinitionsDrift(i0.GeneratedDatabase db) : super(db); + Future optimizeFtsIndex() { + return customInsert( + 'INSERT INTO article_fts (article_fts) VALUES (\'optimize\')', + variables: [], + updates: {articleFts}, + ); + } + + i0.Selectable queryArticlesBasic({ + required String query, + String? feedId, + }) { + return customSelect( + 'WITH weights AS (SELECT 1.0 AS title_weight) SELECT a.*, f.icon,(bm25(article_fts, weights.title_weight))AS weighted_rank FROM article_fts AS fts INNER JOIN article AS a ON a."rowid" = fts."rowid" INNER JOIN feed AS f ON f.url = a.feed_id CROSS JOIN weights WHERE fts.title LIKE ?1 AND(?2 IS NULL OR a.feed_id = ?2)ORDER BY weighted_rank ASC, a.created DESC NULLS LAST', + variables: [i0.Variable(query), i0.Variable(feedId)], + readsFrom: {feed, articleFts, article}, + ).map( + (i0.QueryRow row) => i11.FeedArticleQueryResult( + id: row.read('id'), + feedId: i1.Article.$converterfeedId.fromSql( + row.read('feed_id'), + ), + fetched: row.read('fetched'), + weightedRank: row.read('weighted_rank'), + created: row.readNullable('created'), + updated: row.readNullable('updated'), + lastRead: row.readNullable('last_read'), + title: row.readNullable('title'), + authors: i0.NullAwareTypeConverter.wrapFromSql( + i1.Article.$converterauthors, + row.readNullable('authors'), + ), + tags: i0.NullAwareTypeConverter.wrapFromSql( + i1.Article.$convertertags, + row.readNullable('tags'), + ), + links: i0.NullAwareTypeConverter.wrapFromSql( + i1.Article.$converterlinks, + row.readNullable('links'), + ), + summaryHtml: row.readNullable('summaryHtml'), + summaryMarkdown: row.readNullable('summaryMarkdown'), + summaryPlain: row.readNullable('summaryPlain'), + contentHtml: row.readNullable('contentHtml'), + contentMarkdown: row.readNullable('contentMarkdown'), + contentPlain: row.readNullable('contentPlain'), + icon: i1.Feed.$convertericon.fromSql(row.readNullable('icon')), + ), + ); + } + + i0.Selectable queryArticlesFullContent({ + required String beforeMatch, + required String afterMatch, + required String ellipsis, + required int snippetLength, + required String query, + String? feedId, + }) { + return customSelect( + 'WITH weights AS (SELECT 10.0 AS title_weight, 3.0 AS summary_weight, 1.0 AS content_weight) SELECT a.*, f.icon, highlight(article_fts, 0, ?1, ?2) AS title_highlight, snippet(article_fts, 1, ?1, ?2, ?3, ?4) AS summary_snippet, snippet(article_fts, 2, ?1, ?2, ?3, ?4) AS content_snippet,(bm25(article_fts, weights.title_weight, weights.summary_weight, weights.content_weight))AS weighted_rank FROM article_fts(?5)AS fts INNER JOIN article AS a ON a."rowid" = fts."rowid" INNER JOIN feed AS f ON f.url = a.feed_id CROSS JOIN weights WHERE ?6 IS NULL OR a.feed_id = ?6 ORDER BY weighted_rank ASC, a.created DESC NULLS LAST', + variables: [ + i0.Variable(beforeMatch), + i0.Variable(afterMatch), + i0.Variable(ellipsis), + i0.Variable(snippetLength), + i0.Variable(query), + i0.Variable(feedId), + ], + readsFrom: {feed, articleFts, article}, + ).map( + (i0.QueryRow row) => i11.FeedArticleQueryResult( + id: row.read('id'), + feedId: i1.Article.$converterfeedId.fromSql( + row.read('feed_id'), + ), + fetched: row.read('fetched'), + weightedRank: row.read('weighted_rank'), + created: row.readNullable('created'), + updated: row.readNullable('updated'), + lastRead: row.readNullable('last_read'), + title: row.readNullable('title'), + authors: i0.NullAwareTypeConverter.wrapFromSql( + i1.Article.$converterauthors, + row.readNullable('authors'), + ), + tags: i0.NullAwareTypeConverter.wrapFromSql( + i1.Article.$convertertags, + row.readNullable('tags'), + ), + links: i0.NullAwareTypeConverter.wrapFromSql( + i1.Article.$converterlinks, + row.readNullable('links'), + ), + summaryHtml: row.readNullable('summaryHtml'), + summaryMarkdown: row.readNullable('summaryMarkdown'), + summaryPlain: row.readNullable('summaryPlain'), + contentHtml: row.readNullable('contentHtml'), + contentMarkdown: row.readNullable('contentMarkdown'), + contentPlain: row.readNullable('contentPlain'), + icon: i1.Feed.$convertericon.fromSql(row.readNullable('icon')), + titleHighlight: row.readNullable('title_highlight'), + summarySnippet: row.readNullable('summary_snippet'), + contentSnippet: row.readNullable('content_snippet'), + ), + ); + } + + i1.ArticleFts get articleFts => i10.ReadDatabaseContainer( + attachedDatabase, + ).resultSet('article_fts'); + i1.Article get article => i10.ReadDatabaseContainer( + attachedDatabase, + ).resultSet('article'); + i1.Feed get feed => + i10.ReadDatabaseContainer(attachedDatabase).resultSet('feed'); +} diff --git a/app/lib/features/web_feed/data/models/feed_article.dart b/app/lib/features/web_feed/data/models/feed_article.dart index 343e2e4c..6f598ab7 100644 --- a/app/lib/features/web_feed/data/models/feed_article.dart +++ b/app/lib/features/web_feed/data/models/feed_article.dart @@ -21,7 +21,7 @@ import 'package:copy_with_extension/copy_with_extension.dart'; import 'package:drift/drift.dart'; import 'package:fast_equatable/fast_equatable.dart'; import 'package:json_annotation/json_annotation.dart'; -import 'package:weblibre/features/web_feed/data/database/database.dart'; +import 'package:weblibre/features/web_feed/data/database/definitions.drift.dart'; import 'package:weblibre/features/web_feed/data/models/feed_author.dart'; import 'package:weblibre/features/web_feed/data/models/feed_category.dart'; import 'package:weblibre/features/web_feed/data/models/feed_link.dart'; diff --git a/app/lib/features/web_feed/data/models/feed_article.g.dart b/app/lib/features/web_feed/data/models/feed_article.g.dart index 305330b2..9f0bedcf 100644 --- a/app/lib/features/web_feed/data/models/feed_article.g.dart +++ b/app/lib/features/web_feed/data/models/feed_article.g.dart @@ -43,12 +43,13 @@ abstract class _$FeedArticleCWProxy { FeedArticle siteLink(Uri? siteLink); - /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `FeedArticle(...).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 `FeedArticle(...).copyWith.fieldName(value)`. /// - /// Usage + /// Example: /// ```dart /// FeedArticle(...).copyWith(id: 12, name: "My name") - /// ```` + /// ``` FeedArticle call({ String id, Uri feedId, @@ -71,79 +72,81 @@ abstract class _$FeedArticleCWProxy { }); } -/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfFeedArticle.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfFeedArticle.copyWith.fieldName(...)` +/// Callable proxy for `copyWith` functionality. +/// Use as `instanceOfFeedArticle.copyWith(...)` or call `instanceOfFeedArticle.copyWith.fieldName(value)` for a single field. class _$FeedArticleCWProxyImpl implements _$FeedArticleCWProxy { const _$FeedArticleCWProxyImpl(this._value); final FeedArticle _value; @override - FeedArticle id(String id) => this(id: id); + FeedArticle id(String id) => call(id: id); @override - FeedArticle feedId(Uri feedId) => this(feedId: feedId); + FeedArticle feedId(Uri feedId) => call(feedId: feedId); @override - FeedArticle fetched(DateTime fetched) => this(fetched: fetched); + FeedArticle fetched(DateTime fetched) => call(fetched: fetched); @override - FeedArticle created(DateTime? created) => this(created: created); + FeedArticle created(DateTime? created) => call(created: created); @override - FeedArticle updated(DateTime? updated) => this(updated: updated); + FeedArticle updated(DateTime? updated) => call(updated: updated); @override - FeedArticle lastRead(DateTime? lastRead) => this(lastRead: lastRead); + FeedArticle lastRead(DateTime? lastRead) => call(lastRead: lastRead); @override - FeedArticle title(String? title) => this(title: title); + FeedArticle title(String? title) => call(title: title); @override - FeedArticle authors(List? authors) => this(authors: authors); + FeedArticle authors(List? authors) => call(authors: authors); @override - FeedArticle tags(List? tags) => this(tags: tags); + FeedArticle tags(List? tags) => call(tags: tags); @override - FeedArticle links(List? links) => this(links: links); + FeedArticle links(List? links) => call(links: links); @override FeedArticle summaryHtml(String? summaryHtml) => - this(summaryHtml: summaryHtml); + call(summaryHtml: summaryHtml); @override FeedArticle summaryMarkdown(String? summaryMarkdown) => - this(summaryMarkdown: summaryMarkdown); + call(summaryMarkdown: summaryMarkdown); @override FeedArticle summaryPlain(String? summaryPlain) => - this(summaryPlain: summaryPlain); + call(summaryPlain: summaryPlain); @override FeedArticle contentHtml(String? contentHtml) => - this(contentHtml: contentHtml); + call(contentHtml: contentHtml); @override FeedArticle contentMarkdown(String? contentMarkdown) => - this(contentMarkdown: contentMarkdown); + call(contentMarkdown: contentMarkdown); @override FeedArticle contentPlain(String? contentPlain) => - this(contentPlain: contentPlain); + call(contentPlain: contentPlain); @override - FeedArticle icon(Uri? icon) => this(icon: icon); + FeedArticle icon(Uri? icon) => call(icon: icon); @override - FeedArticle siteLink(Uri? siteLink) => this(siteLink: siteLink); + FeedArticle siteLink(Uri? siteLink) => call(siteLink: siteLink); @override - /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `FeedArticle(...).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 `FeedArticle(...).copyWith.fieldName(value)`. /// - /// Usage + /// Example: /// ```dart /// FeedArticle(...).copyWith(id: 12, name: "My name") - /// ```` + /// ``` FeedArticle call({ Object? id = const $CopyWithPlaceholder(), Object? feedId = const $CopyWithPlaceholder(), @@ -165,15 +168,15 @@ class _$FeedArticleCWProxyImpl implements _$FeedArticleCWProxy { Object? siteLink = const $CopyWithPlaceholder(), }) { return FeedArticle( - id: id == const $CopyWithPlaceholder() + id: id == const $CopyWithPlaceholder() || id == null ? _value.id // ignore: cast_nullable_to_non_nullable : id as String, - feedId: feedId == const $CopyWithPlaceholder() + feedId: feedId == const $CopyWithPlaceholder() || feedId == null ? _value.feedId // ignore: cast_nullable_to_non_nullable : feedId as Uri, - fetched: fetched == const $CopyWithPlaceholder() + fetched: fetched == const $CopyWithPlaceholder() || fetched == null ? _value.fetched // ignore: cast_nullable_to_non_nullable : fetched as DateTime, @@ -242,7 +245,8 @@ class _$FeedArticleCWProxyImpl implements _$FeedArticleCWProxy { } extension $FeedArticleCopyWith on FeedArticle { - /// Returns a callable class that can be used as follows: `instanceOfFeedArticle.copyWith(...)` or like so:`instanceOfFeedArticle.copyWith.fieldName(...)`. + /// Returns a callable class used to build a new instance with modified fields. + /// Example: `instanceOfFeedArticle.copyWith(...)` or `instanceOfFeedArticle.copyWith.fieldName(...)`. // ignore: library_private_types_in_public_api _$FeedArticleCWProxy get copyWith => _$FeedArticleCWProxyImpl(this); } diff --git a/app/lib/features/web_feed/data/models/feed_parse_result.dart b/app/lib/features/web_feed/data/models/feed_parse_result.dart index addcac1d..5ac487c1 100644 --- a/app/lib/features/web_feed/data/models/feed_parse_result.dart +++ b/app/lib/features/web_feed/data/models/feed_parse_result.dart @@ -19,7 +19,7 @@ */ import 'package:json_annotation/json_annotation.dart'; import 'package:weblibre/features/web_feed/data/database/converters/feed_data.dart'; -import 'package:weblibre/features/web_feed/data/database/database.dart'; +import 'package:weblibre/features/web_feed/data/database/definitions.drift.dart'; import 'package:weblibre/features/web_feed/data/models/feed_article.dart'; part 'feed_parse_result.g.dart'; diff --git a/app/lib/features/web_feed/data/providers.g.dart b/app/lib/features/web_feed/data/providers.g.dart index a53338cc..5e025349 100644 --- a/app/lib/features/web_feed/data/providers.g.dart +++ b/app/lib/features/web_feed/data/providers.g.dart @@ -6,22 +6,46 @@ part of 'providers.dart'; // RiverpodGenerator // ************************************************************************** -String _$feedDatabaseHash() => r'c3b20e867da5af6e92d1e8c1efa96b79988837a1'; +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning -/// See also [feedDatabase]. @ProviderFor(feedDatabase) -final feedDatabaseProvider = Provider.internal( - feedDatabase, - name: r'feedDatabaseProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$feedDatabaseHash, - dependencies: null, - allTransitiveDependencies: null, -); +const feedDatabaseProvider = FeedDatabaseProvider._(); -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef FeedDatabaseRef = ProviderRef; -// 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 FeedDatabaseProvider + extends $FunctionalProvider + with $Provider { + const FeedDatabaseProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'feedDatabaseProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$feedDatabaseHash(); + + @$internal + @override + $ProviderElement $createElement($ProviderPointer pointer) => + $ProviderElement(pointer); + + @override + FeedDatabase create(Ref ref) { + return feedDatabase(ref); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(FeedDatabase value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + +String _$feedDatabaseHash() => r'c3b20e867da5af6e92d1e8c1efa96b79988837a1'; diff --git a/app/lib/features/web_feed/domain/providers.dart b/app/lib/features/web_feed/domain/providers.dart index 883e93bd..951d46aa 100644 --- a/app/lib/features/web_feed/domain/providers.dart +++ b/app/lib/features/web_feed/domain/providers.dart @@ -20,10 +20,9 @@ import 'dart:async'; import 'package:nullability/nullability.dart'; -import 'package:riverpod/riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; import 'package:rxdart/rxdart.dart'; -import 'package:weblibre/features/web_feed/data/database/database.dart'; +import 'package:weblibre/features/web_feed/data/database/definitions.drift.dart'; import 'package:weblibre/features/web_feed/data/models/feed_article.dart'; import 'package:weblibre/features/web_feed/data/models/feed_parse_result.dart'; import 'package:weblibre/features/web_feed/data/providers.dart'; diff --git a/app/lib/features/web_feed/domain/providers.g.dart b/app/lib/features/web_feed/domain/providers.g.dart index 1c7dacdb..3780bedc 100644 --- a/app/lib/features/web_feed/domain/providers.g.dart +++ b/app/lib/features/web_feed/domain/providers.g.dart @@ -6,966 +6,675 @@ part of 'providers.dart'; // RiverpodGenerator // ************************************************************************** -String _$feedListHash() => r'0076186437354768c39fb1d7c8bcfcf7b94c7dd1'; +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning -/// See also [feedList]. -@ProviderFor(feedList) -final feedListProvider = AutoDisposeStreamProvider>.internal( - feedList, - name: r'feedListProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$feedListHash, - dependencies: null, - allTransitiveDependencies: null, -); +@ProviderFor(ArticleSearch) +const articleSearchProvider = ArticleSearchFamily._(); -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef FeedListRef = AutoDisposeStreamProviderRef>; -String _$feedDataHash() => r'0599a2e3d159ef3abb6c3d2c871f87da2f5e646b'; - -/// Copied from Dart SDK -class _SystemHash { - _SystemHash._(); - - static int combine(int hash, int value) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + value); - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10)); - return hash ^ (hash >> 6); - } - - static int finish(int hash) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); - // ignore: parameter_assignments - hash = hash ^ (hash >> 11); - return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); - } -} - -/// See also [feedData]. -@ProviderFor(feedData) -const feedDataProvider = FeedDataFamily(); - -/// See also [feedData]. -class FeedDataFamily extends Family> { - /// See also [feedData]. - const FeedDataFamily(); - - /// See also [feedData]. - FeedDataProvider call(Uri? feedId) { - return FeedDataProvider(feedId); - } +final class ArticleSearchProvider + extends $StreamNotifierProvider> { + const ArticleSearchProvider._({ + required ArticleSearchFamily super.from, + required Uri? super.argument, + }) : super( + retry: null, + name: r'articleSearchProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); @override - FeedDataProvider getProviderOverride(covariant FeedDataProvider provider) { - return call(provider.feedId); + String debugGetCreateSourceHash() => _$articleSearchHash(); + + @override + String toString() { + return r'articleSearchProvider' + '' + '($argument)'; } - static const Iterable? _dependencies = null; - + @$internal @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'feedDataProvider'; -} - -/// See also [feedData]. -class FeedDataProvider extends AutoDisposeStreamProvider { - /// See also [feedData]. - FeedDataProvider(Uri? feedId) - : this._internal( - (ref) => feedData(ref as FeedDataRef, feedId), - from: feedDataProvider, - name: r'feedDataProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$feedDataHash, - dependencies: FeedDataFamily._dependencies, - allTransitiveDependencies: FeedDataFamily._allTransitiveDependencies, - feedId: feedId, - ); - - FeedDataProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.feedId, - }) : super.internal(); - - final Uri? feedId; - - @override - Override overrideWith( - Stream Function(FeedDataRef provider) create, - ) { - return ProviderOverride( - origin: this, - override: FeedDataProvider._internal( - (ref) => create(ref as FeedDataRef), - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - feedId: feedId, - ), - ); - } - - @override - AutoDisposeStreamProviderElement createElement() { - return _FeedDataProviderElement(this); - } + ArticleSearch create() => ArticleSearch(); @override bool operator ==(Object other) { - return other is FeedDataProvider && other.feedId == feedId; + return other is ArticleSearchProvider && other.argument == argument; } @override int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, feedId.hashCode); - - return _SystemHash.finish(hash); + return argument.hashCode; } } -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin FeedDataRef on AutoDisposeStreamProviderRef { - /// The parameter `feedId` of this provider. - Uri? get feedId; -} - -class _FeedDataProviderElement - extends AutoDisposeStreamProviderElement - with FeedDataRef { - _FeedDataProviderElement(super.provider); - - @override - Uri? get feedId => (origin as FeedDataProvider).feedId; -} - -String _$feedArticleListHash() => r'45d585cc9f59ad48a0d1d6fbcf802b1c7de7f6bc'; - -/// See also [feedArticleList]. -@ProviderFor(feedArticleList) -const feedArticleListProvider = FeedArticleListFamily(); - -/// See also [feedArticleList]. -class FeedArticleListFamily extends Family>> { - /// See also [feedArticleList]. - const FeedArticleListFamily(); - - /// See also [feedArticleList]. - FeedArticleListProvider call(Uri? feedId) { - return FeedArticleListProvider(feedId); - } - - @override - FeedArticleListProvider getProviderOverride( - covariant FeedArticleListProvider provider, - ) { - return call(provider.feedId); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'feedArticleListProvider'; -} - -/// See also [feedArticleList]. -class FeedArticleListProvider - extends AutoDisposeStreamProvider> { - /// See also [feedArticleList]. - FeedArticleListProvider(Uri? feedId) - : this._internal( - (ref) => feedArticleList(ref as FeedArticleListRef, feedId), - from: feedArticleListProvider, - name: r'feedArticleListProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$feedArticleListHash, - dependencies: FeedArticleListFamily._dependencies, - allTransitiveDependencies: - FeedArticleListFamily._allTransitiveDependencies, - feedId: feedId, - ); - - FeedArticleListProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.feedId, - }) : super.internal(); - - final Uri? feedId; - - @override - Override overrideWith( - Stream> Function(FeedArticleListRef provider) create, - ) { - return ProviderOverride( - origin: this, - override: FeedArticleListProvider._internal( - (ref) => create(ref as FeedArticleListRef), - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - feedId: feedId, - ), - ); - } - - @override - AutoDisposeStreamProviderElement> createElement() { - return _FeedArticleListProviderElement(this); - } - - @override - bool operator ==(Object other) { - return other is FeedArticleListProvider && other.feedId == feedId; - } - - @override - int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, feedId.hashCode); - - return _SystemHash.finish(hash); - } -} - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin FeedArticleListRef on AutoDisposeStreamProviderRef> { - /// The parameter `feedId` of this provider. - Uri? get feedId; -} - -class _FeedArticleListProviderElement - extends AutoDisposeStreamProviderElement> - with FeedArticleListRef { - _FeedArticleListProviderElement(super.provider); - - @override - Uri? get feedId => (origin as FeedArticleListProvider).feedId; -} - -String _$feedArticleHash() => r'18b5faf391867b95f4b3bc4f74a6083854b633a5'; - -/// See also [feedArticle]. -@ProviderFor(feedArticle) -const feedArticleProvider = FeedArticleFamily(); - -/// See also [feedArticle]. -class FeedArticleFamily extends Family> { - /// See also [feedArticle]. - const FeedArticleFamily(); - - /// See also [feedArticle]. - FeedArticleProvider call(String articleId, {required bool updateReadDate}) { - return FeedArticleProvider(articleId, updateReadDate: updateReadDate); - } - - @override - FeedArticleProvider getProviderOverride( - covariant FeedArticleProvider provider, - ) { - return call(provider.articleId, updateReadDate: provider.updateReadDate); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'feedArticleProvider'; -} - -/// See also [feedArticle]. -class FeedArticleProvider extends AutoDisposeStreamProvider { - /// See also [feedArticle]. - FeedArticleProvider(String articleId, {required bool updateReadDate}) - : this._internal( - (ref) => feedArticle( - ref as FeedArticleRef, - articleId, - updateReadDate: updateReadDate, - ), - from: feedArticleProvider, - name: r'feedArticleProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$feedArticleHash, - dependencies: FeedArticleFamily._dependencies, - allTransitiveDependencies: FeedArticleFamily._allTransitiveDependencies, - articleId: articleId, - updateReadDate: updateReadDate, - ); - - FeedArticleProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.articleId, - required this.updateReadDate, - }) : super.internal(); - - final String articleId; - final bool updateReadDate; - - @override - Override overrideWith( - Stream Function(FeedArticleRef provider) create, - ) { - return ProviderOverride( - origin: this, - override: FeedArticleProvider._internal( - (ref) => create(ref as FeedArticleRef), - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - articleId: articleId, - updateReadDate: updateReadDate, - ), - ); - } - - @override - AutoDisposeStreamProviderElement createElement() { - return _FeedArticleProviderElement(this); - } - - @override - bool operator ==(Object other) { - return other is FeedArticleProvider && - other.articleId == articleId && - other.updateReadDate == updateReadDate; - } - - @override - int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, articleId.hashCode); - hash = _SystemHash.combine(hash, updateReadDate.hashCode); - - return _SystemHash.finish(hash); - } -} - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin FeedArticleRef on AutoDisposeStreamProviderRef { - /// The parameter `articleId` of this provider. - String get articleId; - - /// The parameter `updateReadDate` of this provider. - bool get updateReadDate; -} - -class _FeedArticleProviderElement - extends AutoDisposeStreamProviderElement - with FeedArticleRef { - _FeedArticleProviderElement(super.provider); - - @override - String get articleId => (origin as FeedArticleProvider).articleId; - @override - bool get updateReadDate => (origin as FeedArticleProvider).updateReadDate; -} - -String _$unreadArticleCountHash() => - r'709518ad229636df0f1095f47e3a6d116b3aa7e6'; - -/// See also [unreadArticleCount]. -@ProviderFor(unreadArticleCount) -final unreadArticleCountProvider = - AutoDisposeProvider>>>.internal( - unreadArticleCount, - name: r'unreadArticleCountProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$unreadArticleCountHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef UnreadArticleCountRef = - AutoDisposeProviderRef>>>; -String _$unreadFeedArticleCountHash() => - r'5e0d8e58b3d1dec978dc07b22367f2cb037b1b15'; - -/// See also [unreadFeedArticleCount]. -@ProviderFor(unreadFeedArticleCount) -const unreadFeedArticleCountProvider = UnreadFeedArticleCountFamily(); - -/// See also [unreadFeedArticleCount]. -class UnreadFeedArticleCountFamily extends Family> { - /// See also [unreadFeedArticleCount]. - const UnreadFeedArticleCountFamily(); - - /// See also [unreadFeedArticleCount]. - UnreadFeedArticleCountProvider call(Uri feedId) { - return UnreadFeedArticleCountProvider(feedId); - } - - @override - UnreadFeedArticleCountProvider getProviderOverride( - covariant UnreadFeedArticleCountProvider provider, - ) { - return call(provider.feedId); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'unreadFeedArticleCountProvider'; -} - -/// See also [unreadFeedArticleCount]. -class UnreadFeedArticleCountProvider extends AutoDisposeStreamProvider { - /// See also [unreadFeedArticleCount]. - UnreadFeedArticleCountProvider(Uri feedId) - : this._internal( - (ref) => - unreadFeedArticleCount(ref as UnreadFeedArticleCountRef, feedId), - from: unreadFeedArticleCountProvider, - name: r'unreadFeedArticleCountProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$unreadFeedArticleCountHash, - dependencies: UnreadFeedArticleCountFamily._dependencies, - allTransitiveDependencies: - UnreadFeedArticleCountFamily._allTransitiveDependencies, - feedId: feedId, - ); - - UnreadFeedArticleCountProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.feedId, - }) : super.internal(); - - final Uri feedId; - - @override - Override overrideWith( - Stream Function(UnreadFeedArticleCountRef provider) create, - ) { - return ProviderOverride( - origin: this, - override: UnreadFeedArticleCountProvider._internal( - (ref) => create(ref as UnreadFeedArticleCountRef), - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - feedId: feedId, - ), - ); - } - - @override - AutoDisposeStreamProviderElement createElement() { - return _UnreadFeedArticleCountProviderElement(this); - } - - @override - bool operator ==(Object other) { - return other is UnreadFeedArticleCountProvider && other.feedId == feedId; - } - - @override - int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, feedId.hashCode); - - return _SystemHash.finish(hash); - } -} - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin UnreadFeedArticleCountRef on AutoDisposeStreamProviderRef { - /// The parameter `feedId` of this provider. - Uri get feedId; -} - -class _UnreadFeedArticleCountProviderElement - extends AutoDisposeStreamProviderElement - with UnreadFeedArticleCountRef { - _UnreadFeedArticleCountProviderElement(super.provider); - - @override - Uri get feedId => (origin as UnreadFeedArticleCountProvider).feedId; -} - -String _$fetchWebFeedHash() => r'73bdf87ad7dbd039c7dc181d80acdf99d96fe1c6'; - -/// See also [fetchWebFeed]. -@ProviderFor(fetchWebFeed) -const fetchWebFeedProvider = FetchWebFeedFamily(); - -/// See also [fetchWebFeed]. -class FetchWebFeedFamily extends Family> { - /// See also [fetchWebFeed]. - const FetchWebFeedFamily(); - - /// See also [fetchWebFeed]. - FetchWebFeedProvider call(Uri url) { - return FetchWebFeedProvider(url); - } - - @override - FetchWebFeedProvider getProviderOverride( - covariant FetchWebFeedProvider provider, - ) { - return call(provider.url); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'fetchWebFeedProvider'; -} - -/// See also [fetchWebFeed]. -class FetchWebFeedProvider extends AutoDisposeFutureProvider { - /// See also [fetchWebFeed]. - FetchWebFeedProvider(Uri url) - : this._internal( - (ref) => fetchWebFeed(ref as FetchWebFeedRef, url), - from: fetchWebFeedProvider, - name: r'fetchWebFeedProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$fetchWebFeedHash, - dependencies: FetchWebFeedFamily._dependencies, - allTransitiveDependencies: - FetchWebFeedFamily._allTransitiveDependencies, - url: url, - ); - - FetchWebFeedProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.url, - }) : super.internal(); - - final Uri url; - - @override - Override overrideWith( - FutureOr Function(FetchWebFeedRef provider) create, - ) { - return ProviderOverride( - origin: this, - override: FetchWebFeedProvider._internal( - (ref) => create(ref as FetchWebFeedRef), - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - url: url, - ), - ); - } - - @override - AutoDisposeFutureProviderElement createElement() { - return _FetchWebFeedProviderElement(this); - } - - @override - bool operator ==(Object other) { - return other is FetchWebFeedProvider && other.url == url; - } - - @override - int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, url.hashCode); - - return _SystemHash.finish(hash); - } -} - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin FetchWebFeedRef on AutoDisposeFutureProviderRef { - /// The parameter `url` of this provider. - Uri get url; -} - -class _FetchWebFeedProviderElement - extends AutoDisposeFutureProviderElement - with FetchWebFeedRef { - _FetchWebFeedProviderElement(super.provider); - - @override - Uri get url => (origin as FetchWebFeedProvider).url; -} - String _$articleSearchHash() => r'cc59a5d3c4b926db9f03ed96db592965ff925b04'; -abstract class _$ArticleSearch - extends BuildlessAutoDisposeStreamNotifier> { - late final Uri? feedId; - - Stream> build(Uri? feedId); -} - -/// See also [ArticleSearch]. -@ProviderFor(ArticleSearch) -const articleSearchProvider = ArticleSearchFamily(); - -/// See also [ArticleSearch]. -class ArticleSearchFamily extends Family>> { - /// See also [ArticleSearch]. - const ArticleSearchFamily(); - - /// See also [ArticleSearch]. - ArticleSearchProvider call(Uri? feedId) { - return ArticleSearchProvider(feedId); - } - - @override - ArticleSearchProvider getProviderOverride( - covariant ArticleSearchProvider provider, - ) { - return call(provider.feedId); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'articleSearchProvider'; -} - -/// See also [ArticleSearch]. -class ArticleSearchProvider - extends - AutoDisposeStreamNotifierProviderImpl< +final class ArticleSearchFamily extends $Family + with + $ClassFamilyOverride< ArticleSearch, - List + AsyncValue>, + List, + Stream>, + Uri? > { - /// See also [ArticleSearch]. - ArticleSearchProvider(Uri? feedId) - : this._internal( - () => ArticleSearch()..feedId = feedId, - from: articleSearchProvider, + const ArticleSearchFamily._() + : super( + retry: null, name: r'articleSearchProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$articleSearchHash, - dependencies: ArticleSearchFamily._dependencies, - allTransitiveDependencies: - ArticleSearchFamily._allTransitiveDependencies, - feedId: feedId, + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, ); - ArticleSearchProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.feedId, - }) : super.internal(); - - final Uri? feedId; + ArticleSearchProvider call(Uri? feedId) => + ArticleSearchProvider._(argument: feedId, from: this); @override - Stream> runNotifierBuild(covariant ArticleSearch notifier) { - return notifier.build(feedId); + String toString() => r'articleSearchProvider'; +} + +abstract class _$ArticleSearch extends $StreamNotifier> { + late final _$args = ref.$arg as Uri?; + Uri? get feedId => _$args; + + Stream> build(Uri? feedId); + @$mustCallSuper + @override + void runBuild() { + final created = build(_$args); + final ref = + this.ref as $Ref>, List>; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier>, List>, + AsyncValue>, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} + +@ProviderFor(feedList) +const feedListProvider = FeedListProvider._(); + +final class FeedListProvider + extends + $FunctionalProvider< + AsyncValue>, + List, + Stream> + > + with $FutureModifier>, $StreamProvider> { + const FeedListProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'feedListProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$feedListHash(); + + @$internal + @override + $StreamProviderElement> $createElement( + $ProviderPointer pointer, + ) => $StreamProviderElement(pointer); + + @override + Stream> create(Ref ref) { + return feedList(ref); + } +} + +String _$feedListHash() => r'0076186437354768c39fb1d7c8bcfcf7b94c7dd1'; + +@ProviderFor(feedData) +const feedDataProvider = FeedDataFamily._(); + +final class FeedDataProvider + extends + $FunctionalProvider, FeedData?, Stream> + with $FutureModifier, $StreamProvider { + const FeedDataProvider._({ + required FeedDataFamily super.from, + required Uri? super.argument, + }) : super( + retry: null, + name: r'feedDataProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$feedDataHash(); + + @override + String toString() { + return r'feedDataProvider' + '' + '($argument)'; + } + + @$internal + @override + $StreamProviderElement $createElement($ProviderPointer pointer) => + $StreamProviderElement(pointer); + + @override + Stream create(Ref ref) { + final argument = this.argument as Uri?; + return feedData(ref, argument); } @override - Override overrideWith(ArticleSearch Function() create) { - return ProviderOverride( - origin: this, - override: ArticleSearchProvider._internal( - () => create()..feedId = feedId, - from: from, - name: null, + bool operator ==(Object other) { + return other is FeedDataProvider && other.argument == argument; + } + + @override + int get hashCode { + return argument.hashCode; + } +} + +String _$feedDataHash() => r'0599a2e3d159ef3abb6c3d2c871f87da2f5e646b'; + +final class FeedDataFamily extends $Family + with $FunctionalFamilyOverride, Uri?> { + const FeedDataFamily._() + : super( + retry: null, + name: r'feedDataProvider', dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - feedId: feedId, + $allTransitiveDependencies: null, + isAutoDispose: true, + ); + + FeedDataProvider call(Uri? feedId) => + FeedDataProvider._(argument: feedId, from: this); + + @override + String toString() => r'feedDataProvider'; +} + +@ProviderFor(feedArticleList) +const feedArticleListProvider = FeedArticleListFamily._(); + +final class FeedArticleListProvider + extends + $FunctionalProvider< + AsyncValue>, + List, + Stream> + > + with + $FutureModifier>, + $StreamProvider> { + const FeedArticleListProvider._({ + required FeedArticleListFamily super.from, + required Uri? super.argument, + }) : super( + retry: null, + name: r'feedArticleListProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$feedArticleListHash(); + + @override + String toString() { + return r'feedArticleListProvider' + '' + '($argument)'; + } + + @$internal + @override + $StreamProviderElement> $createElement( + $ProviderPointer pointer, + ) => $StreamProviderElement(pointer); + + @override + Stream> create(Ref ref) { + final argument = this.argument as Uri?; + return feedArticleList(ref, argument); + } + + @override + bool operator ==(Object other) { + return other is FeedArticleListProvider && other.argument == argument; + } + + @override + int get hashCode { + return argument.hashCode; + } +} + +String _$feedArticleListHash() => r'45d585cc9f59ad48a0d1d6fbcf802b1c7de7f6bc'; + +final class FeedArticleListFamily extends $Family + with $FunctionalFamilyOverride>, Uri?> { + const FeedArticleListFamily._() + : super( + retry: null, + name: r'feedArticleListProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, + ); + + FeedArticleListProvider call(Uri? feedId) => + FeedArticleListProvider._(argument: feedId, from: this); + + @override + String toString() => r'feedArticleListProvider'; +} + +@ProviderFor(FilteredArticleList) +const filteredArticleListProvider = FilteredArticleListFamily._(); + +final class FilteredArticleListProvider + extends + $NotifierProvider>> { + const FilteredArticleListProvider._({ + required FilteredArticleListFamily super.from, + required Uri? super.argument, + }) : super( + retry: null, + name: r'filteredArticleListProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$filteredArticleListHash(); + + @override + String toString() { + return r'filteredArticleListProvider' + '' + '($argument)'; + } + + @$internal + @override + FilteredArticleList create() => FilteredArticleList(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(AsyncValue> value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider>>( + value, ), ); } - @override - AutoDisposeStreamNotifierProviderElement> - createElement() { - return _ArticleSearchProviderElement(this); - } - @override bool operator ==(Object other) { - return other is ArticleSearchProvider && other.feedId == feedId; + return other is FilteredArticleListProvider && other.argument == argument; } @override int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, feedId.hashCode); - - return _SystemHash.finish(hash); + return argument.hashCode; } } -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin ArticleSearchRef - on AutoDisposeStreamNotifierProviderRef> { - /// The parameter `feedId` of this provider. - Uri? get feedId; -} - -class _ArticleSearchProviderElement - extends - AutoDisposeStreamNotifierProviderElement< - ArticleSearch, - List - > - with ArticleSearchRef { - _ArticleSearchProviderElement(super.provider); - - @override - Uri? get feedId => (origin as ArticleSearchProvider).feedId; -} - String _$filteredArticleListHash() => r'a691c3c6aa722dd85ee4980e6c48721a8025f1d8'; -abstract class _$FilteredArticleList - extends BuildlessAutoDisposeNotifier>> { - late final Uri? feedId; - - AsyncValue> build(Uri? feedId); -} - -/// See also [FilteredArticleList]. -@ProviderFor(FilteredArticleList) -const filteredArticleListProvider = FilteredArticleListFamily(); - -/// See also [FilteredArticleList]. -class FilteredArticleListFamily extends Family>> { - /// See also [FilteredArticleList]. - const FilteredArticleListFamily(); - - /// See also [FilteredArticleList]. - FilteredArticleListProvider call(Uri? feedId) { - return FilteredArticleListProvider(feedId); - } - - @override - FilteredArticleListProvider getProviderOverride( - covariant FilteredArticleListProvider provider, - ) { - return call(provider.feedId); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'filteredArticleListProvider'; -} - -/// See also [FilteredArticleList]. -class FilteredArticleListProvider - extends - AutoDisposeNotifierProviderImpl< +final class FilteredArticleListFamily extends $Family + with + $ClassFamilyOverride< FilteredArticleList, - AsyncValue> + AsyncValue>, + AsyncValue>, + AsyncValue>, + Uri? > { - /// See also [FilteredArticleList]. - FilteredArticleListProvider(Uri? feedId) - : this._internal( - () => FilteredArticleList()..feedId = feedId, - from: filteredArticleListProvider, + const FilteredArticleListFamily._() + : super( + retry: null, name: r'filteredArticleListProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$filteredArticleListHash, - dependencies: FilteredArticleListFamily._dependencies, - allTransitiveDependencies: - FilteredArticleListFamily._allTransitiveDependencies, - feedId: feedId, + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, ); - FilteredArticleListProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.feedId, - }) : super.internal(); - - final Uri? feedId; + FilteredArticleListProvider call(Uri? feedId) => + FilteredArticleListProvider._(argument: feedId, from: this); @override - AsyncValue> runNotifierBuild( - covariant FilteredArticleList notifier, - ) { - return notifier.build(feedId); + String toString() => r'filteredArticleListProvider'; +} + +abstract class _$FilteredArticleList + extends $Notifier>> { + late final _$args = ref.$arg as Uri?; + Uri? get feedId => _$args; + + AsyncValue> build(Uri? feedId); + @$mustCallSuper + @override + void runBuild() { + final created = build(_$args); + final ref = + this.ref + as $Ref< + AsyncValue>, + AsyncValue> + >; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier< + AsyncValue>, + AsyncValue> + >, + AsyncValue>, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} + +@ProviderFor(feedArticle) +const feedArticleProvider = FeedArticleFamily._(); + +final class FeedArticleProvider + extends + $FunctionalProvider< + AsyncValue, + FeedArticle?, + Stream + > + with $FutureModifier, $StreamProvider { + const FeedArticleProvider._({ + required FeedArticleFamily super.from, + required (String, {bool updateReadDate}) super.argument, + }) : super( + retry: null, + name: r'feedArticleProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$feedArticleHash(); + + @override + String toString() { + return r'feedArticleProvider' + '' + '$argument'; } + @$internal @override - Override overrideWith(FilteredArticleList Function() create) { - return ProviderOverride( - origin: this, - override: FilteredArticleListProvider._internal( - () => create()..feedId = feedId, - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - feedId: feedId, - ), + $StreamProviderElement $createElement( + $ProviderPointer pointer, + ) => $StreamProviderElement(pointer); + + @override + Stream create(Ref ref) { + final argument = this.argument as (String, {bool updateReadDate}); + return feedArticle( + ref, + argument.$1, + updateReadDate: argument.updateReadDate, ); } - @override - AutoDisposeNotifierProviderElement< - FilteredArticleList, - AsyncValue> - > - createElement() { - return _FilteredArticleListProviderElement(this); - } - @override bool operator ==(Object other) { - return other is FilteredArticleListProvider && other.feedId == feedId; + return other is FeedArticleProvider && other.argument == argument; } @override int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, feedId.hashCode); - - return _SystemHash.finish(hash); + return argument.hashCode; } } -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin FilteredArticleListRef - on AutoDisposeNotifierProviderRef>> { - /// The parameter `feedId` of this provider. - Uri? get feedId; -} +String _$feedArticleHash() => r'18b5faf391867b95f4b3bc4f74a6083854b633a5'; -class _FilteredArticleListProviderElement - extends - AutoDisposeNotifierProviderElement< - FilteredArticleList, - AsyncValue> - > - with FilteredArticleListRef { - _FilteredArticleListProviderElement(super.provider); +final class FeedArticleFamily extends $Family + with + $FunctionalFamilyOverride< + Stream, + (String, {bool updateReadDate}) + > { + const FeedArticleFamily._() + : super( + retry: null, + name: r'feedArticleProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, + ); + + FeedArticleProvider call(String articleId, {required bool updateReadDate}) => + FeedArticleProvider._( + argument: (articleId, updateReadDate: updateReadDate), + from: this, + ); @override - Uri? get feedId => (origin as FilteredArticleListProvider).feedId; + String toString() => r'feedArticleProvider'; } -// 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 +@ProviderFor(unreadArticleCount) +const unreadArticleCountProvider = UnreadArticleCountProvider._(); + +final class UnreadArticleCountProvider + extends + $FunctionalProvider< + Raw>>, + Raw>>, + Raw>> + > + with $Provider>>> { + const UnreadArticleCountProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'unreadArticleCountProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$unreadArticleCountHash(); + + @$internal + @override + $ProviderElement>>> $createElement( + $ProviderPointer pointer, + ) => $ProviderElement(pointer); + + @override + Raw>> create(Ref ref) { + return unreadArticleCount(ref); + } + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(Raw>> value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider>>>( + value, + ), + ); + } +} + +String _$unreadArticleCountHash() => + r'709518ad229636df0f1095f47e3a6d116b3aa7e6'; + +@ProviderFor(unreadFeedArticleCount) +const unreadFeedArticleCountProvider = UnreadFeedArticleCountFamily._(); + +final class UnreadFeedArticleCountProvider + extends $FunctionalProvider, int?, Stream> + with $FutureModifier, $StreamProvider { + const UnreadFeedArticleCountProvider._({ + required UnreadFeedArticleCountFamily super.from, + required Uri super.argument, + }) : super( + retry: null, + name: r'unreadFeedArticleCountProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$unreadFeedArticleCountHash(); + + @override + String toString() { + return r'unreadFeedArticleCountProvider' + '' + '($argument)'; + } + + @$internal + @override + $StreamProviderElement $createElement($ProviderPointer pointer) => + $StreamProviderElement(pointer); + + @override + Stream create(Ref ref) { + final argument = this.argument as Uri; + return unreadFeedArticleCount(ref, argument); + } + + @override + bool operator ==(Object other) { + return other is UnreadFeedArticleCountProvider && + other.argument == argument; + } + + @override + int get hashCode { + return argument.hashCode; + } +} + +String _$unreadFeedArticleCountHash() => + r'5e0d8e58b3d1dec978dc07b22367f2cb037b1b15'; + +final class UnreadFeedArticleCountFamily extends $Family + with $FunctionalFamilyOverride, Uri> { + const UnreadFeedArticleCountFamily._() + : super( + retry: null, + name: r'unreadFeedArticleCountProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, + ); + + UnreadFeedArticleCountProvider call(Uri feedId) => + UnreadFeedArticleCountProvider._(argument: feedId, from: this); + + @override + String toString() => r'unreadFeedArticleCountProvider'; +} + +@ProviderFor(fetchWebFeed) +const fetchWebFeedProvider = FetchWebFeedFamily._(); + +final class FetchWebFeedProvider + extends + $FunctionalProvider< + AsyncValue, + FeedParseResult, + FutureOr + > + with $FutureModifier, $FutureProvider { + const FetchWebFeedProvider._({ + required FetchWebFeedFamily super.from, + required Uri super.argument, + }) : super( + retry: null, + name: r'fetchWebFeedProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$fetchWebFeedHash(); + + @override + String toString() { + return r'fetchWebFeedProvider' + '' + '($argument)'; + } + + @$internal + @override + $FutureProviderElement $createElement( + $ProviderPointer pointer, + ) => $FutureProviderElement(pointer); + + @override + FutureOr create(Ref ref) { + final argument = this.argument as Uri; + return fetchWebFeed(ref, argument); + } + + @override + bool operator ==(Object other) { + return other is FetchWebFeedProvider && other.argument == argument; + } + + @override + int get hashCode { + return argument.hashCode; + } +} + +String _$fetchWebFeedHash() => r'73bdf87ad7dbd039c7dc181d80acdf99d96fe1c6'; + +final class FetchWebFeedFamily extends $Family + with $FunctionalFamilyOverride, Uri> { + const FetchWebFeedFamily._() + : super( + retry: null, + name: r'fetchWebFeedProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, + ); + + FetchWebFeedProvider call(Uri url) => + FetchWebFeedProvider._(argument: url, from: this); + + @override + String toString() => r'fetchWebFeedProvider'; +} diff --git a/app/lib/features/web_feed/domain/providers/add_dialog_blocking.g.dart b/app/lib/features/web_feed/domain/providers/add_dialog_blocking.g.dart index 590dfcef..2f7d59af 100644 --- a/app/lib/features/web_feed/domain/providers/add_dialog_blocking.g.dart +++ b/app/lib/features/web_feed/domain/providers/add_dialog_blocking.g.dart @@ -6,22 +6,59 @@ part of 'add_dialog_blocking.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(AddFeedDialogBlocking) +const addFeedDialogBlockingProvider = AddFeedDialogBlockingProvider._(); + +final class AddFeedDialogBlockingProvider + extends $NotifierProvider { + const AddFeedDialogBlockingProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'addFeedDialogBlockingProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$addFeedDialogBlockingHash(); + + @$internal + @override + AddFeedDialogBlocking create() => AddFeedDialogBlocking(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(void value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + String _$addFeedDialogBlockingHash() => r'513071d5e507dd292df6b4a3ee3ef7d2217db5bb'; -/// See also [AddFeedDialogBlocking]. -@ProviderFor(AddFeedDialogBlocking) -final addFeedDialogBlockingProvider = - NotifierProvider.internal( - AddFeedDialogBlocking.new, - name: r'addFeedDialogBlockingProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$addFeedDialogBlockingHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$AddFeedDialogBlocking = Notifier; -// 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 +abstract class _$AddFeedDialogBlocking extends $Notifier { + void build(); + @$mustCallSuper + @override + void runBuild() { + build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + void, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} diff --git a/app/lib/features/web_feed/domain/providers/article_filter.g.dart b/app/lib/features/web_feed/domain/providers/article_filter.g.dart index 18cf1931..55720de8 100644 --- a/app/lib/features/web_feed/domain/providers/article_filter.g.dart +++ b/app/lib/features/web_feed/domain/providers/article_filter.g.dart @@ -6,21 +6,58 @@ part of 'article_filter.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(ArticleFilter) +const articleFilterProvider = ArticleFilterProvider._(); + +final class ArticleFilterProvider + extends $NotifierProvider> { + const ArticleFilterProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'articleFilterProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$articleFilterHash(); + + @$internal + @override + ArticleFilter create() => ArticleFilter(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(Set value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider>(value), + ); + } +} + String _$articleFilterHash() => r'61e4d5230e214038e753bc173158ed1d4dc57040'; -/// See also [ArticleFilter]. -@ProviderFor(ArticleFilter) -final articleFilterProvider = - NotifierProvider>.internal( - ArticleFilter.new, - name: r'articleFilterProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$articleFilterHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$ArticleFilter = Notifier>; -// 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 +abstract class _$ArticleFilter extends $Notifier> { + Set build(); + @$mustCallSuper + @override + void runBuild() { + final created = build(); + final ref = this.ref as $Ref, Set>; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, Set>, + Set, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} diff --git a/app/lib/features/web_feed/domain/repositories/feed_repository.dart b/app/lib/features/web_feed/domain/repositories/feed_repository.dart index 761671db..97ec2e75 100644 --- a/app/lib/features/web_feed/domain/repositories/feed_repository.dart +++ b/app/lib/features/web_feed/domain/repositories/feed_repository.dart @@ -18,7 +18,7 @@ * along with this program. If not, see . */ import 'package:riverpod_annotation/riverpod_annotation.dart'; -import 'package:weblibre/features/web_feed/data/database/database.dart'; +import 'package:weblibre/features/web_feed/data/database/definitions.drift.dart'; import 'package:weblibre/features/web_feed/data/models/feed_article.dart'; import 'package:weblibre/features/web_feed/data/providers.dart'; diff --git a/app/lib/features/web_feed/domain/repositories/feed_repository.g.dart b/app/lib/features/web_feed/domain/repositories/feed_repository.g.dart index f25c4f85..3de09193 100644 --- a/app/lib/features/web_feed/domain/repositories/feed_repository.g.dart +++ b/app/lib/features/web_feed/domain/repositories/feed_repository.g.dart @@ -6,20 +6,58 @@ part of 'feed_repository.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(FeedRepository) +const feedRepositoryProvider = FeedRepositoryProvider._(); + +final class FeedRepositoryProvider + extends $NotifierProvider { + const FeedRepositoryProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'feedRepositoryProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$feedRepositoryHash(); + + @$internal + @override + FeedRepository create() => FeedRepository(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(void value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + String _$feedRepositoryHash() => r'805cc26890b0d43576a1eab0ecb5851b6649d7b7'; -/// See also [FeedRepository]. -@ProviderFor(FeedRepository) -final feedRepositoryProvider = NotifierProvider.internal( - FeedRepository.new, - name: r'feedRepositoryProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$feedRepositoryHash, - dependencies: null, - allTransitiveDependencies: null, -); - -typedef _$FeedRepository = Notifier; -// 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 +abstract class _$FeedRepository extends $Notifier { + void build(); + @$mustCallSuper + @override + void runBuild() { + build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + void, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} diff --git a/app/lib/features/web_feed/domain/services/article_content_processor.g.dart b/app/lib/features/web_feed/domain/services/article_content_processor.g.dart index 4320631e..4289f43f 100644 --- a/app/lib/features/web_feed/domain/services/article_content_processor.g.dart +++ b/app/lib/features/web_feed/domain/services/article_content_processor.g.dart @@ -6,22 +6,60 @@ part of 'article_content_processor.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(ArticleContentProcessorService) +const articleContentProcessorServiceProvider = + ArticleContentProcessorServiceProvider._(); + +final class ArticleContentProcessorServiceProvider + extends $NotifierProvider { + const ArticleContentProcessorServiceProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'articleContentProcessorServiceProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$articleContentProcessorServiceHash(); + + @$internal + @override + ArticleContentProcessorService create() => ArticleContentProcessorService(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(void value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + String _$articleContentProcessorServiceHash() => r'e7cc3da71f6dcf39b0c10df4dcd061f816d5c12e'; -/// See also [ArticleContentProcessorService]. -@ProviderFor(ArticleContentProcessorService) -final articleContentProcessorServiceProvider = - NotifierProvider.internal( - ArticleContentProcessorService.new, - name: r'articleContentProcessorServiceProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$articleContentProcessorServiceHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$ArticleContentProcessorService = Notifier; -// 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 +abstract class _$ArticleContentProcessorService extends $Notifier { + void build(); + @$mustCallSuper + @override + void runBuild() { + build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + void, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} diff --git a/app/lib/features/web_feed/domain/services/feed_reader.g.dart b/app/lib/features/web_feed/domain/services/feed_reader.g.dart index b72b20e5..944cc381 100644 --- a/app/lib/features/web_feed/domain/services/feed_reader.g.dart +++ b/app/lib/features/web_feed/domain/services/feed_reader.g.dart @@ -6,20 +6,57 @@ part of 'feed_reader.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(FeedReader) +const feedReaderProvider = FeedReaderProvider._(); + +final class FeedReaderProvider extends $NotifierProvider { + const FeedReaderProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'feedReaderProvider', + isAutoDispose: false, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$feedReaderHash(); + + @$internal + @override + FeedReader create() => FeedReader(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(void value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider(value), + ); + } +} + String _$feedReaderHash() => r'5d1ca364fe7ad702628a7f2bbd3e706876bc3111'; -/// See also [FeedReader]. -@ProviderFor(FeedReader) -final feedReaderProvider = NotifierProvider.internal( - FeedReader.new, - name: r'feedReaderProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$feedReaderHash, - dependencies: null, - allTransitiveDependencies: null, -); - -typedef _$FeedReader = Notifier; -// 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 +abstract class _$FeedReader extends $Notifier { + void build(); + @$mustCallSuper + @override + void runBuild() { + build(); + final ref = this.ref as $Ref; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, + void, + Object?, + Object? + >; + element.handleValue(ref, null); + } +} diff --git a/app/lib/features/web_feed/presentation/controllers/fetch_articles.g.dart b/app/lib/features/web_feed/presentation/controllers/fetch_articles.g.dart index 8a629926..0123face 100644 --- a/app/lib/features/web_feed/presentation/controllers/fetch_articles.g.dart +++ b/app/lib/features/web_feed/presentation/controllers/fetch_articles.g.dart @@ -6,25 +6,59 @@ part of 'fetch_articles.dart'; // RiverpodGenerator // ************************************************************************** +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning + +@ProviderFor(FetchArticlesController) +const fetchArticlesControllerProvider = FetchArticlesControllerProvider._(); + +final class FetchArticlesControllerProvider + extends $NotifierProvider> { + const FetchArticlesControllerProvider._() + : super( + from: null, + argument: null, + retry: null, + name: r'fetchArticlesControllerProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$fetchArticlesControllerHash(); + + @$internal + @override + FetchArticlesController create() => FetchArticlesController(); + + /// {@macro riverpod.override_with_value} + Override overrideWithValue(AsyncValue value) { + return $ProviderOverride( + origin: this, + providerOverride: $SyncValueProvider>(value), + ); + } +} + String _$fetchArticlesControllerHash() => r'7604d9352da886624c3cf6862b89c397edda1f28'; -/// See also [FetchArticlesController]. -@ProviderFor(FetchArticlesController) -final fetchArticlesControllerProvider = - AutoDisposeNotifierProvider< - FetchArticlesController, - AsyncValue - >.internal( - FetchArticlesController.new, - name: r'fetchArticlesControllerProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$fetchArticlesControllerHash, - dependencies: null, - allTransitiveDependencies: null, - ); - -typedef _$FetchArticlesController = AutoDisposeNotifier>; -// 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 +abstract class _$FetchArticlesController extends $Notifier> { + AsyncValue build(); + @$mustCallSuper + @override + void runBuild() { + final created = build(); + final ref = this.ref as $Ref, AsyncValue>; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, AsyncValue>, + AsyncValue, + Object?, + Object? + >; + element.handleValue(ref, created); + } +} diff --git a/app/lib/features/web_feed/presentation/screens/feed_article_list.dart b/app/lib/features/web_feed/presentation/screens/feed_article_list.dart index af6bccfa..e5ed6276 100644 --- a/app/lib/features/web_feed/presentation/screens/feed_article_list.dart +++ b/app/lib/features/web_feed/presentation/screens/feed_article_list.dart @@ -48,7 +48,7 @@ class FeedArticleListScreen extends HookConsumerWidget { final feedTitle = ref.watch( feedDataProvider( feedId, - ).select((value) => value.valueOrNull?.title.whenNotEmpty), + ).select((value) => value.value?.title.whenNotEmpty), ); final focusNode = useFocusNode(); diff --git a/app/lib/features/web_feed/presentation/screens/feed_edit.dart b/app/lib/features/web_feed/presentation/screens/feed_edit.dart index 9fd4836a..efa33ca0 100644 --- a/app/lib/features/web_feed/presentation/screens/feed_edit.dart +++ b/app/lib/features/web_feed/presentation/screens/feed_edit.dart @@ -25,7 +25,7 @@ import 'package:go_router/go_router.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:nullability/nullability.dart'; import 'package:weblibre/extensions/uri.dart'; -import 'package:weblibre/features/web_feed/data/database/database.dart'; +import 'package:weblibre/features/web_feed/data/database/definitions.drift.dart'; import 'package:weblibre/features/web_feed/data/models/feed_category.dart'; import 'package:weblibre/features/web_feed/domain/providers.dart'; import 'package:weblibre/features/web_feed/domain/repositories/feed_repository.dart'; diff --git a/app/lib/features/web_feed/presentation/widgets/feed_card.dart b/app/lib/features/web_feed/presentation/widgets/feed_card.dart index 17123e88..42a20eee 100644 --- a/app/lib/features/web_feed/presentation/widgets/feed_card.dart +++ b/app/lib/features/web_feed/presentation/widgets/feed_card.dart @@ -24,7 +24,7 @@ import 'package:nullability/nullability.dart'; import 'package:timeago/timeago.dart' as timeago; import 'package:weblibre/core/routing/routes.dart'; import 'package:weblibre/extensions/uri.dart'; -import 'package:weblibre/features/web_feed/data/database/database.dart'; +import 'package:weblibre/features/web_feed/data/database/definitions.drift.dart'; import 'package:weblibre/features/web_feed/domain/providers.dart'; import 'package:weblibre/features/web_feed/presentation/widgets/authors_horizontal_list.dart'; import 'package:weblibre/features/web_feed/presentation/widgets/tags_horizontal_list.dart'; diff --git a/app/lib/features/web_feed/utils/feed_parser.dart b/app/lib/features/web_feed/utils/feed_parser.dart index 7085d37f..ee96584a 100644 --- a/app/lib/features/web_feed/utils/feed_parser.dart +++ b/app/lib/features/web_feed/utils/feed_parser.dart @@ -21,7 +21,7 @@ import 'package:collection/collection.dart'; import 'package:nullability/nullability.dart'; import 'package:rss_dart/dart_rss.dart'; import 'package:rss_dart/domain/rss1_feed.dart'; -import 'package:weblibre/features/web_feed/data/database/database.dart'; +import 'package:weblibre/features/web_feed/data/database/definitions.drift.dart'; import 'package:weblibre/features/web_feed/data/models/feed_article.dart'; import 'package:weblibre/features/web_feed/data/models/feed_author.dart'; import 'package:weblibre/features/web_feed/data/models/feed_link.dart'; diff --git a/app/lib/presentation/controllers/website_title.dart b/app/lib/presentation/controllers/website_title.dart index a297e753..2f1bb70a 100644 --- a/app/lib/presentation/controllers/website_title.dart +++ b/app/lib/presentation/controllers/website_title.dart @@ -51,7 +51,7 @@ class CompletePageInfo extends _$CompletePageInfo { pageInfoProvider(cached.url, isImageRequest: false), (previous, next) { if (next.hasValue) { - final current = stateOrNull?.valueOrNull ?? cached; + final current = stateOrNull?.value ?? cached; state = AsyncData( current.copyWith( @@ -79,7 +79,7 @@ class CompletePageInfo extends _$CompletePageInfo { tabStateProvider(cached.id).select((value) => value?.title.whenNotEmpty), (previous, next) { if (next != null) { - final current = stateOrNull?.valueOrNull ?? cached; + final current = stateOrNull?.value ?? cached; state = AsyncData(current.copyWith.title(next)); } }, @@ -90,7 +90,7 @@ class CompletePageInfo extends _$CompletePageInfo { tabStateProvider(cached.id).select((value) => value?.favicon), (previous, next) { if (next != null) { - final current = stateOrNull?.valueOrNull ?? cached; + final current = stateOrNull?.value ?? cached; state = AsyncData(current.copyWith.favicon(next)); } }, diff --git a/app/lib/presentation/controllers/website_title.g.dart b/app/lib/presentation/controllers/website_title.g.dart index e7724edc..866dc4d1 100644 --- a/app/lib/presentation/controllers/website_title.g.dart +++ b/app/lib/presentation/controllers/website_title.g.dart @@ -6,299 +6,186 @@ part of 'website_title.dart'; // RiverpodGenerator // ************************************************************************** -String _$pageInfoHash() => r'53380fbf9c67d494944330641cefbde9455cdb60'; +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, type=warning -/// Copied from Dart SDK -class _SystemHash { - _SystemHash._(); +@ProviderFor(CompletePageInfo) +const completePageInfoProvider = CompletePageInfoFamily._(); - static int combine(int hash, int value) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + value); - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10)); - return hash ^ (hash >> 6); - } - - static int finish(int hash) { - // ignore: parameter_assignments - hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); - // ignore: parameter_assignments - hash = hash ^ (hash >> 11); - return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); - } -} - -/// See also [pageInfo]. -@ProviderFor(pageInfo) -const pageInfoProvider = PageInfoFamily(); - -/// See also [pageInfo]. -class PageInfoFamily extends Family> { - /// See also [pageInfo]. - const PageInfoFamily(); - - /// See also [pageInfo]. - PageInfoProvider call(Uri url, {required bool isImageRequest}) { - return PageInfoProvider(url, isImageRequest: isImageRequest); +final class CompletePageInfoProvider + extends $NotifierProvider> { + const CompletePageInfoProvider._({ + required CompletePageInfoFamily super.from, + required TabState super.argument, + }) : super( + retry: null, + name: r'completePageInfoProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); + + @override + String debugGetCreateSourceHash() => _$completePageInfoHash(); + + @override + String toString() { + return r'completePageInfoProvider' + '' + '($argument)'; } + @$internal @override - PageInfoProvider getProviderOverride(covariant PageInfoProvider provider) { - return call(provider.url, isImageRequest: provider.isImageRequest); - } + CompletePageInfo create() => CompletePageInfo(); - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'pageInfoProvider'; -} - -/// See also [pageInfo]. -class PageInfoProvider extends AutoDisposeFutureProvider { - /// See also [pageInfo]. - PageInfoProvider(Uri url, {required bool isImageRequest}) - : this._internal( - (ref) => - pageInfo(ref as PageInfoRef, url, isImageRequest: isImageRequest), - from: pageInfoProvider, - name: r'pageInfoProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$pageInfoHash, - dependencies: PageInfoFamily._dependencies, - allTransitiveDependencies: PageInfoFamily._allTransitiveDependencies, - url: url, - isImageRequest: isImageRequest, - ); - - PageInfoProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.url, - required this.isImageRequest, - }) : super.internal(); - - final Uri url; - final bool isImageRequest; - - @override - Override overrideWith( - FutureOr Function(PageInfoRef provider) create, - ) { - return ProviderOverride( + /// {@macro riverpod.override_with_value} + Override overrideWithValue(AsyncValue value) { + return $ProviderOverride( origin: this, - override: PageInfoProvider._internal( - (ref) => create(ref as PageInfoRef), - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - url: url, - isImageRequest: isImageRequest, - ), + providerOverride: $SyncValueProvider>(value), ); } - @override - AutoDisposeFutureProviderElement createElement() { - return _PageInfoProviderElement(this); - } - @override bool operator ==(Object other) { - return other is PageInfoProvider && - other.url == url && - other.isImageRequest == isImageRequest; + return other is CompletePageInfoProvider && other.argument == argument; } @override int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, url.hashCode); - hash = _SystemHash.combine(hash, isImageRequest.hashCode); - - return _SystemHash.finish(hash); + return argument.hashCode; } } -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin PageInfoRef on AutoDisposeFutureProviderRef { - /// The parameter `url` of this provider. - Uri get url; +String _$completePageInfoHash() => r'fe1804e1aa4ef34ab4b23b58a4f8a0f6852940b7'; - /// The parameter `isImageRequest` of this provider. - bool get isImageRequest; -} +final class CompletePageInfoFamily extends $Family + with + $ClassFamilyOverride< + CompletePageInfo, + AsyncValue, + AsyncValue, + AsyncValue, + TabState + > { + const CompletePageInfoFamily._() + : super( + retry: null, + name: r'completePageInfoProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, + ); -class _PageInfoProviderElement - extends AutoDisposeFutureProviderElement - with PageInfoRef { - _PageInfoProviderElement(super.provider); + CompletePageInfoProvider call(TabState cached) => + CompletePageInfoProvider._(argument: cached, from: this); @override - Uri get url => (origin as PageInfoProvider).url; - @override - bool get isImageRequest => (origin as PageInfoProvider).isImageRequest; + String toString() => r'completePageInfoProvider'; } -String _$completePageInfoHash() => r'face1bf561e0447a1260515816bac00c2b47fc71'; - -abstract class _$CompletePageInfo - extends BuildlessAutoDisposeNotifier> { - late final TabState cached; +abstract class _$CompletePageInfo extends $Notifier> { + late final _$args = ref.$arg as TabState; + TabState get cached => _$args; AsyncValue build(TabState cached); + @$mustCallSuper + @override + void runBuild() { + final created = build(_$args); + final ref = + this.ref as $Ref, AsyncValue>; + final element = + ref.element + as $ClassProviderElement< + AnyNotifier, AsyncValue>, + AsyncValue, + Object?, + Object? + >; + element.handleValue(ref, created); + } } -/// See also [CompletePageInfo]. -@ProviderFor(CompletePageInfo) -const completePageInfoProvider = CompletePageInfoFamily(); +@ProviderFor(pageInfo) +const pageInfoProvider = PageInfoFamily._(); -/// See also [CompletePageInfo]. -class CompletePageInfoFamily extends Family> { - /// See also [CompletePageInfo]. - const CompletePageInfoFamily(); - - /// See also [CompletePageInfo]. - CompletePageInfoProvider call(TabState cached) { - return CompletePageInfoProvider(cached); - } - - @override - CompletePageInfoProvider getProviderOverride( - covariant CompletePageInfoProvider provider, - ) { - return call(provider.cached); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'completePageInfoProvider'; -} - -/// See also [CompletePageInfo]. -class CompletePageInfoProvider +final class PageInfoProvider extends - AutoDisposeNotifierProviderImpl< - CompletePageInfo, - AsyncValue - > { - /// See also [CompletePageInfo]. - CompletePageInfoProvider(TabState cached) - : this._internal( - () => CompletePageInfo()..cached = cached, - from: completePageInfoProvider, - name: r'completePageInfoProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$completePageInfoHash, - dependencies: CompletePageInfoFamily._dependencies, - allTransitiveDependencies: - CompletePageInfoFamily._allTransitiveDependencies, - cached: cached, - ); - - CompletePageInfoProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.cached, - }) : super.internal(); - - final TabState cached; + $FunctionalProvider< + AsyncValue, + WebPageInfo, + FutureOr + > + with $FutureModifier, $FutureProvider { + const PageInfoProvider._({ + required PageInfoFamily super.from, + required (Uri, {bool isImageRequest}) super.argument, + }) : super( + retry: null, + name: r'pageInfoProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); @override - AsyncValue runNotifierBuild( - covariant CompletePageInfo notifier, - ) { - return notifier.build(cached); + String debugGetCreateSourceHash() => _$pageInfoHash(); + + @override + String toString() { + return r'pageInfoProvider' + '' + '$argument'; } + @$internal @override - Override overrideWith(CompletePageInfo Function() create) { - return ProviderOverride( - origin: this, - override: CompletePageInfoProvider._internal( - () => create()..cached = cached, - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - cached: cached, - ), - ); - } + $FutureProviderElement $createElement( + $ProviderPointer pointer, + ) => $FutureProviderElement(pointer); @override - AutoDisposeNotifierProviderElement> - createElement() { - return _CompletePageInfoProviderElement(this); + FutureOr create(Ref ref) { + final argument = this.argument as (Uri, {bool isImageRequest}); + return pageInfo(ref, argument.$1, isImageRequest: argument.isImageRequest); } @override bool operator ==(Object other) { - return other is CompletePageInfoProvider && other.cached == cached; + return other is PageInfoProvider && other.argument == argument; } @override int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, cached.hashCode); - - return _SystemHash.finish(hash); + return argument.hashCode; } } -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -mixin CompletePageInfoRef - on AutoDisposeNotifierProviderRef> { - /// The parameter `cached` of this provider. - TabState get cached; -} +String _$pageInfoHash() => r'53380fbf9c67d494944330641cefbde9455cdb60'; -class _CompletePageInfoProviderElement - extends - AutoDisposeNotifierProviderElement< - CompletePageInfo, - AsyncValue - > - with CompletePageInfoRef { - _CompletePageInfoProviderElement(super.provider); +final class PageInfoFamily extends $Family + with + $FunctionalFamilyOverride< + FutureOr, + (Uri, {bool isImageRequest}) + > { + const PageInfoFamily._() + : super( + retry: null, + name: r'pageInfoProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, + ); + + PageInfoProvider call(Uri url, {required bool isImageRequest}) => + PageInfoProvider._( + argument: (url, isImageRequest: isImageRequest), + from: this, + ); @override - TabState get cached => (origin as CompletePageInfoProvider).cached; + String toString() => r'pageInfoProvider'; } - -// 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 diff --git a/app/lib/presentation/main_app.dart b/app/lib/presentation/main_app.dart index 8c20a088..eadd77f0 100644 --- a/app/lib/presentation/main_app.dart +++ b/app/lib/presentation/main_app.dart @@ -146,7 +146,7 @@ class MainApp extends HookConsumerWidget { theme: theme, darkTheme: darkTheme, themeMode: themeMode, - routerConfig: router.valueOrNull, + routerConfig: router.value, ); }, onFailure: (errorMessage) { diff --git a/app/pubspec.yaml b/app/pubspec.yaml index dfe50b67..27f54655 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -10,7 +10,7 @@ environment: dependencies: background_fetch: ^1.4.0 collection: ^1.19.1 - copy_with_extension: ^6.0.1 + copy_with_extension: ^9.1.1 drift: ^2.28.1 dynamic_color: ^1.8.1 exceptions: ^0.6.1 @@ -33,7 +33,7 @@ dependencies: google_fonts: ^6.3.1 graphview: ^1.2.0 home_widget: ^0.8.0 - hooks_riverpod: ^2.6.1 + hooks_riverpod: ^3.0.0 html: ^0.15.6 http: ^1.5.0 http_parser: ^4.1.2 @@ -47,18 +47,18 @@ dependencies: markdown: ^7.3.0 mime: ^2.0.0 nullability: ^1.0.0 - package_info_plus: ^8.3.1 + package_info_plus: ^9.0.0 path: ^1.9.1 path_provider: ^2.1.5 permission_handler: ^12.0.1 pluggable_transports_proxy: path: ../packages/pluggable_transports_proxy pretty_qr_code: ^3.5.0 - riverpod: ^2.6.1 - riverpod_annotation: ^2.6.1 + riverpod: ^3.0.0 + riverpod_annotation: ^3.0.0 rss_dart: ^1.0.13 rxdart: ^0.28.0 - share_plus: ^11.1.0 + share_plus: ^12.0.0 simple_intent_receiver: path: ../packages/simple_intent_receiver skeletonizer: ^2.1.0+1 @@ -83,28 +83,21 @@ dependencies: uuid: ^4.5.1 vector_math: ^2.2.0 -dependency_overrides: - # Avoid gradle 8.12 for fdroid compatibility for now - flutter_plugin_android_lifecycle: 2.0.29 - local_auth_android: 1.0.51 - path_provider_android: 2.2.17 - url_launcher_android: 6.3.17 - dev_dependencies: - build_runner: ^2.4.15 - copy_with_extension_gen: ^6.0.1 - custom_lint: ^0.7.6 + build_runner: ^2.7.1 + copy_with_extension_gen: ^9.1.1 + custom_lint: ^0.8.0 dependency_validator: ^5.0.2 - drift_dev: ^2.28.0 - fast_equatable_lint: ^0.4.2 + drift_dev: ^2.28.2 + fast_equatable_lint: ^0.5.0 flutter_launcher_icons: ^0.14.4 flutter_test: sdk: flutter - go_router_builder: ^3.0.1 - json_serializable: ^6.9.5 + go_router_builder: ^4.0.1 + json_serializable: ^6.11.1 lint: ^2.8.0 - riverpod_generator: ^2.6.5 - riverpod_lint: ^2.6.5 + riverpod_generator: ^3.0.0 + riverpod_lint: ^3.0.0 flutter: uses-material-design: true diff --git a/packages/pluggable_transports_proxy/pubspec.yaml b/packages/pluggable_transports_proxy/pubspec.yaml index db76be32..2aad2051 100644 --- a/packages/pluggable_transports_proxy/pubspec.yaml +++ b/packages/pluggable_transports_proxy/pubspec.yaml @@ -16,10 +16,10 @@ dependencies: socks5_proxy: ^2.1.1 dev_dependencies: - build_runner: ^2.4.15 + build_runner: ^2.7.1 flutter_test: sdk: flutter - json_serializable: ^6.9.5 + json_serializable: ^6.11.1 lint: ^2.8.0 pigeon: ^26.0.1 diff --git a/packages/tor/lib/generated_bindings.dart b/packages/tor/lib/generated_bindings.dart index aebf996b..1496ae0d 100644 --- a/packages/tor/lib/generated_bindings.dart +++ b/packages/tor/lib/generated_bindings.dart @@ -7,17 +7,16 @@ import 'dart:ffi' as ffi; class NativeLibrary { /// Holds the symbol lookup function. final ffi.Pointer Function(String symbolName) - _lookup; + _lookup; /// The symbols are looked up in [dynamicLibrary]. NativeLibrary(ffi.DynamicLibrary dynamicLibrary) - : _lookup = dynamicLibrary.lookup; + : _lookup = dynamicLibrary.lookup; /// The symbols are looked up with [lookup]. NativeLibrary.fromLookup( - ffi.Pointer Function(String symbolName) - lookup) - : _lookup = lookup; + ffi.Pointer Function(String symbolName) lookup, + ) : _lookup = lookup; Tor tor_start( int socks_port, @@ -37,13 +36,30 @@ class NativeLibrary { ); } - late final _tor_startPtr = _lookup< - ffi.NativeFunction< - Tor Function(ffi.Uint16, ffi.Pointer, ffi.Pointer, - ffi.Uint16, ffi.Uint16, ffi.Pointer)>>('tor_start'); - late final _tor_start = _tor_startPtr.asFunction< - Tor Function(int, ffi.Pointer, ffi.Pointer, int, int, - ffi.Pointer)>(); + late final _tor_startPtr = + _lookup< + ffi.NativeFunction< + Tor Function( + ffi.Uint16, + ffi.Pointer, + ffi.Pointer, + ffi.Uint16, + ffi.Uint16, + ffi.Pointer, + ) + > + >('tor_start'); + late final _tor_start = _tor_startPtr + .asFunction< + Tor Function( + int, + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer, + ) + >(); bool tor_reconfigure( ffi.Pointer client, @@ -63,70 +79,71 @@ class NativeLibrary { ); } - late final _tor_reconfigurePtr = _lookup< - ffi.NativeFunction< + late final _tor_reconfigurePtr = + _lookup< + ffi.NativeFunction< ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Uint16, - ffi.Uint16, - ffi.Pointer)>>('tor_reconfigure'); - late final _tor_reconfigure = _tor_reconfigurePtr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int, ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Uint16, + ffi.Uint16, + ffi.Pointer, + ) + > + >('tor_reconfigure'); + late final _tor_reconfigure = _tor_reconfigurePtr + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer, + ) + >(); - bool tor_client_bootstrap( - ffi.Pointer client, - ) { - return _tor_client_bootstrap( - client, - ); + bool tor_client_bootstrap(ffi.Pointer client) { + return _tor_client_bootstrap(client); } late final _tor_client_bootstrapPtr = _lookup)>>( - 'tor_client_bootstrap'); + 'tor_client_bootstrap', + ); late final _tor_client_bootstrap = _tor_client_bootstrapPtr .asFunction)>(); - void tor_client_set_dormant( - ffi.Pointer client, - bool soft_mode, - ) { - return _tor_client_set_dormant( - client, - soft_mode, - ); + void tor_client_set_dormant(ffi.Pointer client, bool soft_mode) { + return _tor_client_set_dormant(client, soft_mode); } - late final _tor_client_set_dormantPtr = _lookup< - ffi - .NativeFunction, ffi.Bool)>>( - 'tor_client_set_dormant'); + late final _tor_client_set_dormantPtr = + _lookup< + ffi.NativeFunction, ffi.Bool)> + >('tor_client_set_dormant'); late final _tor_client_set_dormant = _tor_client_set_dormantPtr .asFunction, bool)>(); - void tor_proxy_stop( - ffi.Pointer proxy, - ) { - return _tor_proxy_stop( - proxy, - ); + void tor_proxy_stop(ffi.Pointer proxy) { + return _tor_proxy_stop(proxy); } late final _tor_proxy_stopPtr = _lookup)>>( - 'tor_proxy_stop'); - late final _tor_proxy_stop = - _tor_proxy_stopPtr.asFunction)>(); + 'tor_proxy_stop', + ); + late final _tor_proxy_stop = _tor_proxy_stopPtr + .asFunction)>(); void tor_hello() { return _tor_hello(); } - late final _tor_helloPtr = - _lookup>('tor_hello'); + late final _tor_helloPtr = _lookup>( + 'tor_hello', + ); late final _tor_hello = _tor_helloPtr.asFunction(); ffi.Pointer tor_last_error_message() { @@ -135,9 +152,10 @@ class NativeLibrary { late final _tor_last_error_messagePtr = _lookup Function()>>( - 'tor_last_error_message'); - late final _tor_last_error_message = - _tor_last_error_messagePtr.asFunction Function()>(); + 'tor_last_error_message', + ); + late final _tor_last_error_message = _tor_last_error_messagePtr + .asFunction Function()>(); int tor_get_nofile_limit() { return _tor_get_nofile_limit(); @@ -145,23 +163,21 @@ class NativeLibrary { late final _tor_get_nofile_limitPtr = _lookup>( - 'tor_get_nofile_limit'); - late final _tor_get_nofile_limit = - _tor_get_nofile_limitPtr.asFunction(); + 'tor_get_nofile_limit', + ); + late final _tor_get_nofile_limit = _tor_get_nofile_limitPtr + .asFunction(); - int tor_set_nofile_limit( - int limit, - ) { - return _tor_set_nofile_limit( - limit, - ); + int tor_set_nofile_limit(int limit) { + return _tor_set_nofile_limit(limit); } late final _tor_set_nofile_limitPtr = _lookup>( - 'tor_set_nofile_limit'); - late final _tor_set_nofile_limit = - _tor_set_nofile_limitPtr.asFunction(); + 'tor_set_nofile_limit', + ); + late final _tor_set_nofile_limit = _tor_set_nofile_limitPtr + .asFunction(); } typedef __u_char = ffi.UnsignedChar; @@ -391,10 +407,10 @@ typedef pthread_key_t = ffi.UnsignedInt; typedef Dartpthread_key_t = int; typedef pthread_once_t = ffi.Int; typedef Dartpthread_once_t = int; -typedef __compar_fn_tFunction = ffi.Int Function( - ffi.Pointer, ffi.Pointer); -typedef Dart__compar_fn_tFunction = int Function( - ffi.Pointer, ffi.Pointer); +typedef __compar_fn_tFunction = + ffi.Int Function(ffi.Pointer, ffi.Pointer); +typedef Dart__compar_fn_tFunction = + int Function(ffi.Pointer, ffi.Pointer); typedef __compar_fn_t = ffi.Pointer>; final class Tor extends ffi.Struct { diff --git a/packages/tor/pubspec.yaml b/packages/tor/pubspec.yaml index da072ef1..5ba98593 100644 --- a/packages/tor/pubspec.yaml +++ b/packages/tor/pubspec.yaml @@ -20,11 +20,11 @@ environment: flutter: '>=3.3.0' dependencies: - ffi: ^2.0.1 + ffi: ^2.1.4 flutter: sdk: flutter - path_provider: ^2.1.4 - plugin_platform_interface: ^2.0.2 + path_provider: ^2.1.5 + plugin_platform_interface: ^2.1.8 dev_dependencies: ffigen: ^19.1.0 diff --git a/pubspec.yaml b/pubspec.yaml index deb1e517..1d5aff75 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,7 +12,7 @@ workspace: - packages/tor - packages/tor/example dev_dependencies: - melos: ^7.1.0 + melos: ^7.1.1 melos: name: weblibre_project