majro update
This commit is contained in:
@@ -14,9 +14,10 @@ String _$lightSeedColorFallbackHash() =>
|
||||
final lightSeedColorFallbackProvider = Provider<Color>.internal(
|
||||
lightSeedColorFallback,
|
||||
name: r'lightSeedColorFallbackProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$lightSeedColorFallbackHash,
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$lightSeedColorFallbackHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
@@ -32,9 +33,10 @@ String _$darkSeedColorFallbackHash() =>
|
||||
final darkSeedColorFallbackProvider = Provider<Color>.internal(
|
||||
darkSeedColorFallback,
|
||||
name: r'darkSeedColorFallbackProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$darkSeedColorFallbackHash,
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$darkSeedColorFallbackHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import 'package:intl/date_symbol_data_local.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
|
||||
part 'format.g.dart';
|
||||
|
||||
@Riverpod(keepAlive: true)
|
||||
class Format extends _$Format {
|
||||
String fullDateTimeWithTimezone(DateTime date) {
|
||||
final pattern = DateFormat('yMMMMd').addPattern('Hm');
|
||||
|
||||
return pattern.format(date);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> build() async {
|
||||
await initializeDateFormatting();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'format.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$formatHash() => r'fe7fcdd19b512784a36f3838c57701030475e429';
|
||||
|
||||
/// See also [Format].
|
||||
@ProviderFor(Format)
|
||||
final formatProvider = AsyncNotifierProvider<Format, void>.internal(
|
||||
Format.new,
|
||||
name: r'formatProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product') ? null : _$formatHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$Format = AsyncNotifier<void>;
|
||||
// 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
|
||||
@@ -12,14 +12,15 @@ String _$willAcceptDropHash() => r'97b47784ef9101757602b4408d1f545ef2308830';
|
||||
@ProviderFor(WillAcceptDrop)
|
||||
final willAcceptDropProvider =
|
||||
AutoDisposeNotifierProvider<WillAcceptDrop, DropTargetData?>.internal(
|
||||
WillAcceptDrop.new,
|
||||
name: r'willAcceptDropProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$willAcceptDropHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
WillAcceptDrop.new,
|
||||
name: r'willAcceptDropProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$willAcceptDropHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$WillAcceptDrop = AutoDisposeNotifier<DropTargetData?>;
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
@@ -29,9 +29,10 @@ String _$embeddingModelHash() => r'40111a5f08b43afe6edd399ff0e6c022b3387265';
|
||||
final embeddingModelProvider = Provider<OpenAIEmbeddings>.internal(
|
||||
embeddingModel,
|
||||
name: r'embeddingModelProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$embeddingModelHash,
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$embeddingModelHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
@@ -47,9 +48,10 @@ String _$embeddingDimensionsHash() =>
|
||||
final embeddingDimensionsProvider = Provider<int>.internal(
|
||||
embeddingDimensions,
|
||||
name: r'embeddingDimensionsProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$embeddingDimensionsHash,
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$embeddingDimensionsHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@@ -22,11 +22,17 @@ import 'package:lensai/features/settings/presentation/screens/web_engine_hardeni
|
||||
import 'package:lensai/features/settings/presentation/screens/web_engine_settings.dart';
|
||||
import 'package:lensai/features/tor/presentation/screens/tor_proxy.dart';
|
||||
import 'package:lensai/features/user/presentation/screens/auth.dart';
|
||||
import 'package:lensai/features/web_feed/data/database/database.dart';
|
||||
import 'package:lensai/features/web_feed/presentation/screens/feed_article.dart';
|
||||
import 'package:lensai/features/web_feed/presentation/screens/feed_article_list.dart';
|
||||
import 'package:lensai/features/web_feed/presentation/screens/feed_edit.dart';
|
||||
import 'package:lensai/features/web_feed/presentation/screens/feed_list.dart';
|
||||
|
||||
part 'routes.g.dart';
|
||||
part 'routes.settings.dart';
|
||||
part 'routes.browser.dart';
|
||||
part 'routes.bangs.dart';
|
||||
part 'routes.feeds.dart';
|
||||
|
||||
@TypedGoRoute<AboutRoute>(name: 'AboutRoute', path: '/about')
|
||||
class AboutRoute extends GoRouteData {
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
part of 'routes.dart';
|
||||
|
||||
@TypedGoRoute<FeedListRoute>(
|
||||
name: 'FeedListRoute',
|
||||
path: '/feeds',
|
||||
routes: [
|
||||
TypedGoRoute<FeedArticleListRoute>(
|
||||
name: 'FeedArticleListRoute',
|
||||
path: 'articles/:feedId',
|
||||
),
|
||||
TypedGoRoute<FeedArticleRoute>(
|
||||
name: 'FeedArticleRoute',
|
||||
path: 'article/:articleId',
|
||||
),
|
||||
TypedGoRoute<FeedCreateRoute>(name: 'FeedCreateRoute', path: 'create'),
|
||||
],
|
||||
)
|
||||
class FeedListRoute extends GoRouteData {
|
||||
@override
|
||||
Widget build(BuildContext context, GoRouterState state) {
|
||||
return const FeedListScreen();
|
||||
}
|
||||
}
|
||||
|
||||
class FeedCreateRoute extends GoRouteData {
|
||||
@override
|
||||
Widget build(BuildContext context, GoRouterState state) {
|
||||
return FeedEditScreen.create(initialFeed: state.extra! as FeedData);
|
||||
}
|
||||
}
|
||||
|
||||
class FeedArticleListRoute extends GoRouteData {
|
||||
final Uri feedId;
|
||||
|
||||
FeedArticleListRoute({required this.feedId});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, GoRouterState state) {
|
||||
return FeedArticleListScreen(feedId: feedId);
|
||||
}
|
||||
}
|
||||
|
||||
class FeedArticleRoute extends GoRouteData {
|
||||
final String articleId;
|
||||
|
||||
FeedArticleRoute({required this.articleId});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, GoRouterState state) {
|
||||
return FeedArticleScreen(articleId: articleId);
|
||||
}
|
||||
}
|
||||
+248
-170
@@ -7,25 +7,25 @@ part of 'routes.dart';
|
||||
// **************************************************************************
|
||||
|
||||
List<RouteBase> get $appRoutes => [
|
||||
$aboutRoute,
|
||||
$userAuthRoute,
|
||||
$settingsRoute,
|
||||
$browserRoute,
|
||||
$bangCategoriesRoute,
|
||||
];
|
||||
$aboutRoute,
|
||||
$userAuthRoute,
|
||||
$settingsRoute,
|
||||
$browserRoute,
|
||||
$bangCategoriesRoute,
|
||||
$feedListRoute,
|
||||
];
|
||||
|
||||
RouteBase get $aboutRoute => GoRouteData.$route(
|
||||
path: '/about',
|
||||
name: 'AboutRoute',
|
||||
factory: $AboutRouteExtension._fromState,
|
||||
);
|
||||
path: '/about',
|
||||
name: 'AboutRoute',
|
||||
|
||||
factory: $AboutRouteExtension._fromState,
|
||||
);
|
||||
|
||||
extension $AboutRouteExtension on AboutRoute {
|
||||
static AboutRoute _fromState(GoRouterState state) => AboutRoute();
|
||||
|
||||
String get location => GoRouteData.$location(
|
||||
'/about',
|
||||
);
|
||||
String get location => GoRouteData.$location('/about');
|
||||
|
||||
void go(BuildContext context) => context.go(location);
|
||||
|
||||
@@ -38,17 +38,16 @@ extension $AboutRouteExtension on AboutRoute {
|
||||
}
|
||||
|
||||
RouteBase get $userAuthRoute => GoRouteData.$route(
|
||||
path: '/userAuth',
|
||||
name: 'UserAuthRoute',
|
||||
factory: $UserAuthRouteExtension._fromState,
|
||||
);
|
||||
path: '/userAuth',
|
||||
name: 'UserAuthRoute',
|
||||
|
||||
factory: $UserAuthRouteExtension._fromState,
|
||||
);
|
||||
|
||||
extension $UserAuthRouteExtension on UserAuthRoute {
|
||||
static UserAuthRoute _fromState(GoRouterState state) => UserAuthRoute();
|
||||
|
||||
String get location => GoRouteData.$location(
|
||||
'/userAuth',
|
||||
);
|
||||
String get location => GoRouteData.$location('/userAuth');
|
||||
|
||||
void go(BuildContext context) => context.go(location);
|
||||
|
||||
@@ -61,48 +60,52 @@ extension $UserAuthRouteExtension on UserAuthRoute {
|
||||
}
|
||||
|
||||
RouteBase get $settingsRoute => GoRouteData.$route(
|
||||
path: '/settings',
|
||||
name: 'SettingsRoute',
|
||||
factory: $SettingsRouteExtension._fromState,
|
||||
path: '/settings',
|
||||
name: 'SettingsRoute',
|
||||
|
||||
factory: $SettingsRouteExtension._fromState,
|
||||
routes: [
|
||||
GoRouteData.$route(
|
||||
path: 'general',
|
||||
name: 'GeneralSettingsRoute',
|
||||
|
||||
factory: $GeneralSettingsRouteExtension._fromState,
|
||||
),
|
||||
GoRouteData.$route(
|
||||
path: 'bang',
|
||||
name: 'BangSettingsRoute',
|
||||
|
||||
factory: $BangSettingsRouteExtension._fromState,
|
||||
),
|
||||
GoRouteData.$route(
|
||||
path: 'web_engine',
|
||||
name: 'WebEngineSettingsRoute',
|
||||
|
||||
factory: $WebEngineSettingsRouteExtension._fromState,
|
||||
routes: [
|
||||
GoRouteData.$route(
|
||||
path: 'general',
|
||||
name: 'GeneralSettingsRoute',
|
||||
factory: $GeneralSettingsRouteExtension._fromState,
|
||||
),
|
||||
GoRouteData.$route(
|
||||
path: 'bang',
|
||||
name: 'BangSettingsRoute',
|
||||
factory: $BangSettingsRouteExtension._fromState,
|
||||
),
|
||||
GoRouteData.$route(
|
||||
path: 'web_engine',
|
||||
name: 'WebEngineSettingsRoute',
|
||||
factory: $WebEngineSettingsRouteExtension._fromState,
|
||||
path: 'hardening',
|
||||
name: 'WebEngineHardeningRoute',
|
||||
|
||||
factory: $WebEngineHardeningRouteExtension._fromState,
|
||||
routes: [
|
||||
GoRouteData.$route(
|
||||
path: 'hardening',
|
||||
name: 'WebEngineHardeningRoute',
|
||||
factory: $WebEngineHardeningRouteExtension._fromState,
|
||||
routes: [
|
||||
GoRouteData.$route(
|
||||
path: 'group/:group',
|
||||
name: 'WebEngineHardeningGroupRoute',
|
||||
factory: $WebEngineHardeningGroupRouteExtension._fromState,
|
||||
),
|
||||
],
|
||||
path: 'group/:group',
|
||||
name: 'WebEngineHardeningGroupRoute',
|
||||
|
||||
factory: $WebEngineHardeningGroupRouteExtension._fromState,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
extension $SettingsRouteExtension on SettingsRoute {
|
||||
static SettingsRoute _fromState(GoRouterState state) => SettingsRoute();
|
||||
|
||||
String get location => GoRouteData.$location(
|
||||
'/settings',
|
||||
);
|
||||
String get location => GoRouteData.$location('/settings');
|
||||
|
||||
void go(BuildContext context) => context.go(location);
|
||||
|
||||
@@ -118,9 +121,7 @@ extension $GeneralSettingsRouteExtension on GeneralSettingsRoute {
|
||||
static GeneralSettingsRoute _fromState(GoRouterState state) =>
|
||||
GeneralSettingsRoute();
|
||||
|
||||
String get location => GoRouteData.$location(
|
||||
'/settings/general',
|
||||
);
|
||||
String get location => GoRouteData.$location('/settings/general');
|
||||
|
||||
void go(BuildContext context) => context.go(location);
|
||||
|
||||
@@ -136,9 +137,7 @@ extension $BangSettingsRouteExtension on BangSettingsRoute {
|
||||
static BangSettingsRoute _fromState(GoRouterState state) =>
|
||||
BangSettingsRoute();
|
||||
|
||||
String get location => GoRouteData.$location(
|
||||
'/settings/bang',
|
||||
);
|
||||
String get location => GoRouteData.$location('/settings/bang');
|
||||
|
||||
void go(BuildContext context) => context.go(location);
|
||||
|
||||
@@ -154,9 +153,7 @@ extension $WebEngineSettingsRouteExtension on WebEngineSettingsRoute {
|
||||
static WebEngineSettingsRoute _fromState(GoRouterState state) =>
|
||||
WebEngineSettingsRoute();
|
||||
|
||||
String get location => GoRouteData.$location(
|
||||
'/settings/web_engine',
|
||||
);
|
||||
String get location => GoRouteData.$location('/settings/web_engine');
|
||||
|
||||
void go(BuildContext context) => context.go(location);
|
||||
|
||||
@@ -172,9 +169,8 @@ extension $WebEngineHardeningRouteExtension on WebEngineHardeningRoute {
|
||||
static WebEngineHardeningRoute _fromState(GoRouterState state) =>
|
||||
WebEngineHardeningRoute();
|
||||
|
||||
String get location => GoRouteData.$location(
|
||||
'/settings/web_engine/hardening',
|
||||
);
|
||||
String get location =>
|
||||
GoRouteData.$location('/settings/web_engine/hardening');
|
||||
|
||||
void go(BuildContext context) => context.go(location);
|
||||
|
||||
@@ -189,13 +185,11 @@ extension $WebEngineHardeningRouteExtension on WebEngineHardeningRoute {
|
||||
extension $WebEngineHardeningGroupRouteExtension
|
||||
on WebEngineHardeningGroupRoute {
|
||||
static WebEngineHardeningGroupRoute _fromState(GoRouterState state) =>
|
||||
WebEngineHardeningGroupRoute(
|
||||
group: state.pathParameters['group']!,
|
||||
);
|
||||
WebEngineHardeningGroupRoute(group: state.pathParameters['group']!);
|
||||
|
||||
String get location => GoRouteData.$location(
|
||||
'/settings/web_engine/hardening/group/${Uri.encodeComponent(group)}',
|
||||
);
|
||||
'/settings/web_engine/hardening/group/${Uri.encodeComponent(group)}',
|
||||
);
|
||||
|
||||
void go(BuildContext context) => context.go(location);
|
||||
|
||||
@@ -208,56 +202,62 @@ extension $WebEngineHardeningGroupRouteExtension
|
||||
}
|
||||
|
||||
RouteBase get $browserRoute => GoRouteData.$route(
|
||||
path: '/',
|
||||
name: 'BrowserRoute',
|
||||
factory: $BrowserRouteExtension._fromState,
|
||||
path: '/',
|
||||
name: 'BrowserRoute',
|
||||
|
||||
factory: $BrowserRouteExtension._fromState,
|
||||
routes: [
|
||||
GoRouteData.$route(
|
||||
path: 'page/:url',
|
||||
name: 'WebPageRoute',
|
||||
|
||||
factory: $WebPageRouteExtension._fromState,
|
||||
),
|
||||
GoRouteData.$route(
|
||||
path: 'search/:searchText',
|
||||
name: 'SearchRoute',
|
||||
|
||||
factory: $SearchRouteExtension._fromState,
|
||||
),
|
||||
GoRouteData.$route(
|
||||
path: 'tor_proxy',
|
||||
name: 'TorProxyRoute',
|
||||
|
||||
factory: $TorProxyRouteExtension._fromState,
|
||||
),
|
||||
GoRouteData.$route(
|
||||
path: 'context_menu',
|
||||
name: 'ContextMenuRoute',
|
||||
|
||||
factory: $ContextMenuRouteExtension._fromState,
|
||||
),
|
||||
GoRouteData.$route(
|
||||
path: 'containers',
|
||||
name: 'ContainerListRoute',
|
||||
|
||||
factory: $ContainerListRouteExtension._fromState,
|
||||
routes: [
|
||||
GoRouteData.$route(
|
||||
path: 'page/:url',
|
||||
name: 'WebPageRoute',
|
||||
factory: $WebPageRouteExtension._fromState,
|
||||
path: 'create',
|
||||
name: 'ContainerCreateRoute',
|
||||
|
||||
factory: $ContainerCreateRouteExtension._fromState,
|
||||
),
|
||||
GoRouteData.$route(
|
||||
path: 'search/:searchText',
|
||||
name: 'SearchRoute',
|
||||
factory: $SearchRouteExtension._fromState,
|
||||
),
|
||||
GoRouteData.$route(
|
||||
path: 'tor_proxy',
|
||||
name: 'TorProxyRoute',
|
||||
factory: $TorProxyRouteExtension._fromState,
|
||||
),
|
||||
GoRouteData.$route(
|
||||
path: 'context_menu',
|
||||
name: 'ContextMenuRoute',
|
||||
factory: $ContextMenuRouteExtension._fromState,
|
||||
),
|
||||
GoRouteData.$route(
|
||||
path: 'containers',
|
||||
name: 'ContainerListRoute',
|
||||
factory: $ContainerListRouteExtension._fromState,
|
||||
routes: [
|
||||
GoRouteData.$route(
|
||||
path: 'create',
|
||||
name: 'ContainerCreateRoute',
|
||||
factory: $ContainerCreateRouteExtension._fromState,
|
||||
),
|
||||
GoRouteData.$route(
|
||||
path: 'edit',
|
||||
name: 'ContainerEditRoute',
|
||||
factory: $ContainerEditRouteExtension._fromState,
|
||||
),
|
||||
],
|
||||
path: 'edit',
|
||||
name: 'ContainerEditRoute',
|
||||
|
||||
factory: $ContainerEditRouteExtension._fromState,
|
||||
),
|
||||
],
|
||||
);
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
extension $BrowserRouteExtension on BrowserRoute {
|
||||
static BrowserRoute _fromState(GoRouterState state) => BrowserRoute();
|
||||
|
||||
String get location => GoRouteData.$location(
|
||||
'/',
|
||||
);
|
||||
String get location => GoRouteData.$location('/');
|
||||
|
||||
void go(BuildContext context) => context.go(location);
|
||||
|
||||
@@ -270,13 +270,11 @@ extension $BrowserRouteExtension on BrowserRoute {
|
||||
}
|
||||
|
||||
extension $WebPageRouteExtension on WebPageRoute {
|
||||
static WebPageRoute _fromState(GoRouterState state) => WebPageRoute(
|
||||
url: state.pathParameters['url']!,
|
||||
);
|
||||
static WebPageRoute _fromState(GoRouterState state) =>
|
||||
WebPageRoute(url: state.pathParameters['url']!);
|
||||
|
||||
String get location => GoRouteData.$location(
|
||||
'/page/${Uri.encodeComponent(url)}',
|
||||
);
|
||||
String get location =>
|
||||
GoRouteData.$location('/page/${Uri.encodeComponent(url)}');
|
||||
|
||||
void go(BuildContext context) => context.go(location);
|
||||
|
||||
@@ -290,13 +288,12 @@ extension $WebPageRouteExtension on WebPageRoute {
|
||||
|
||||
extension $SearchRouteExtension on SearchRoute {
|
||||
static SearchRoute _fromState(GoRouterState state) => SearchRoute(
|
||||
searchText:
|
||||
state.pathParameters['searchText']! ?? SearchRoute.emptySearchText,
|
||||
);
|
||||
searchText:
|
||||
state.pathParameters['searchText'] ?? SearchRoute.emptySearchText,
|
||||
);
|
||||
|
||||
String get location => GoRouteData.$location(
|
||||
'/search/${Uri.encodeComponent(searchText)}',
|
||||
);
|
||||
String get location =>
|
||||
GoRouteData.$location('/search/${Uri.encodeComponent(searchText)}');
|
||||
|
||||
void go(BuildContext context) => context.go(location);
|
||||
|
||||
@@ -311,9 +308,7 @@ extension $SearchRouteExtension on SearchRoute {
|
||||
extension $TorProxyRouteExtension on TorProxyRoute {
|
||||
static TorProxyRoute _fromState(GoRouterState state) => TorProxyRoute();
|
||||
|
||||
String get location => GoRouteData.$location(
|
||||
'/tor_proxy',
|
||||
);
|
||||
String get location => GoRouteData.$location('/tor_proxy');
|
||||
|
||||
void go(BuildContext context) => context.go(location);
|
||||
|
||||
@@ -329,9 +324,7 @@ extension $ContextMenuRouteExtension on ContextMenuRoute {
|
||||
static ContextMenuRoute _fromState(GoRouterState state) =>
|
||||
const ContextMenuRoute();
|
||||
|
||||
String get location => GoRouteData.$location(
|
||||
'/context_menu',
|
||||
);
|
||||
String get location => GoRouteData.$location('/context_menu');
|
||||
|
||||
void go(BuildContext context) => context.go(location);
|
||||
|
||||
@@ -347,9 +340,7 @@ extension $ContainerListRouteExtension on ContainerListRoute {
|
||||
static ContainerListRoute _fromState(GoRouterState state) =>
|
||||
ContainerListRoute();
|
||||
|
||||
String get location => GoRouteData.$location(
|
||||
'/containers',
|
||||
);
|
||||
String get location => GoRouteData.$location('/containers');
|
||||
|
||||
void go(BuildContext context) => context.go(location);
|
||||
|
||||
@@ -365,9 +356,7 @@ extension $ContainerCreateRouteExtension on ContainerCreateRoute {
|
||||
static ContainerCreateRoute _fromState(GoRouterState state) =>
|
||||
ContainerCreateRoute();
|
||||
|
||||
String get location => GoRouteData.$location(
|
||||
'/containers/create',
|
||||
);
|
||||
String get location => GoRouteData.$location('/containers/create');
|
||||
|
||||
void go(BuildContext context) => context.go(location);
|
||||
|
||||
@@ -383,9 +372,7 @@ extension $ContainerEditRouteExtension on ContainerEditRoute {
|
||||
static ContainerEditRoute _fromState(GoRouterState state) =>
|
||||
ContainerEditRoute();
|
||||
|
||||
String get location => GoRouteData.$location(
|
||||
'/containers/edit',
|
||||
);
|
||||
String get location => GoRouteData.$location('/containers/edit');
|
||||
|
||||
void go(BuildContext context) => context.go(location);
|
||||
|
||||
@@ -398,37 +385,39 @@ extension $ContainerEditRouteExtension on ContainerEditRoute {
|
||||
}
|
||||
|
||||
RouteBase get $bangCategoriesRoute => GoRouteData.$route(
|
||||
path: '/bangs',
|
||||
name: 'BangRoute',
|
||||
factory: $BangCategoriesRouteExtension._fromState,
|
||||
path: '/bangs',
|
||||
name: 'BangRoute',
|
||||
|
||||
factory: $BangCategoriesRouteExtension._fromState,
|
||||
routes: [
|
||||
GoRouteData.$route(
|
||||
path: 'search/:searchText',
|
||||
name: 'BangSearchRoute',
|
||||
|
||||
factory: $BangSearchRouteExtension._fromState,
|
||||
),
|
||||
GoRouteData.$route(
|
||||
path: 'category/:category',
|
||||
name: 'BangCategoryRoute',
|
||||
|
||||
factory: $BangCategoryRouteExtension._fromState,
|
||||
routes: [
|
||||
GoRouteData.$route(
|
||||
path: 'search/:searchText',
|
||||
name: 'BangSearchRoute',
|
||||
factory: $BangSearchRouteExtension._fromState,
|
||||
),
|
||||
GoRouteData.$route(
|
||||
path: 'category/:category',
|
||||
name: 'BangCategoryRoute',
|
||||
factory: $BangCategoryRouteExtension._fromState,
|
||||
routes: [
|
||||
GoRouteData.$route(
|
||||
path: ':subCategory',
|
||||
name: 'BangSubCategoryRoute',
|
||||
factory: $BangSubCategoryRouteExtension._fromState,
|
||||
),
|
||||
],
|
||||
path: ':subCategory',
|
||||
name: 'BangSubCategoryRoute',
|
||||
|
||||
factory: $BangSubCategoryRouteExtension._fromState,
|
||||
),
|
||||
],
|
||||
);
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
extension $BangCategoriesRouteExtension on BangCategoriesRoute {
|
||||
static BangCategoriesRoute _fromState(GoRouterState state) =>
|
||||
BangCategoriesRoute();
|
||||
|
||||
String get location => GoRouteData.$location(
|
||||
'/bangs',
|
||||
);
|
||||
String get location => GoRouteData.$location('/bangs');
|
||||
|
||||
void go(BuildContext context) => context.go(location);
|
||||
|
||||
@@ -442,13 +431,12 @@ extension $BangCategoriesRouteExtension on BangCategoriesRoute {
|
||||
|
||||
extension $BangSearchRouteExtension on BangSearchRoute {
|
||||
static BangSearchRoute _fromState(GoRouterState state) => BangSearchRoute(
|
||||
searchText: state.pathParameters['searchText']! ??
|
||||
BangSearchRoute.emptySearchText,
|
||||
);
|
||||
searchText:
|
||||
state.pathParameters['searchText'] ?? BangSearchRoute.emptySearchText,
|
||||
);
|
||||
|
||||
String get location => GoRouteData.$location(
|
||||
'/bangs/search/${Uri.encodeComponent(searchText)}',
|
||||
);
|
||||
String get location =>
|
||||
GoRouteData.$location('/bangs/search/${Uri.encodeComponent(searchText)}');
|
||||
|
||||
void go(BuildContext context) => context.go(location);
|
||||
|
||||
@@ -461,13 +449,11 @@ extension $BangSearchRouteExtension on BangSearchRoute {
|
||||
}
|
||||
|
||||
extension $BangCategoryRouteExtension on BangCategoryRoute {
|
||||
static BangCategoryRoute _fromState(GoRouterState state) => BangCategoryRoute(
|
||||
category: state.pathParameters['category']!,
|
||||
);
|
||||
static BangCategoryRoute _fromState(GoRouterState state) =>
|
||||
BangCategoryRoute(category: state.pathParameters['category']!);
|
||||
|
||||
String get location => GoRouteData.$location(
|
||||
'/bangs/category/${Uri.encodeComponent(category)}',
|
||||
);
|
||||
String get location =>
|
||||
GoRouteData.$location('/bangs/category/${Uri.encodeComponent(category)}');
|
||||
|
||||
void go(BuildContext context) => context.go(location);
|
||||
|
||||
@@ -487,8 +473,100 @@ extension $BangSubCategoryRouteExtension on BangSubCategoryRoute {
|
||||
);
|
||||
|
||||
String get location => GoRouteData.$location(
|
||||
'/bangs/category/${Uri.encodeComponent(category)}/${Uri.encodeComponent(subCategory)}',
|
||||
);
|
||||
'/bangs/category/${Uri.encodeComponent(category)}/${Uri.encodeComponent(subCategory)}',
|
||||
);
|
||||
|
||||
void go(BuildContext context) => context.go(location);
|
||||
|
||||
Future<T?> push<T>(BuildContext context) => context.push<T>(location);
|
||||
|
||||
void pushReplacement(BuildContext context) =>
|
||||
context.pushReplacement(location);
|
||||
|
||||
void replace(BuildContext context) => context.replace(location);
|
||||
}
|
||||
|
||||
RouteBase get $feedListRoute => GoRouteData.$route(
|
||||
path: '/feeds',
|
||||
name: 'FeedListRoute',
|
||||
|
||||
factory: $FeedListRouteExtension._fromState,
|
||||
routes: [
|
||||
GoRouteData.$route(
|
||||
path: 'articles/:feedId',
|
||||
name: 'FeedArticleListRoute',
|
||||
|
||||
factory: $FeedArticleListRouteExtension._fromState,
|
||||
),
|
||||
GoRouteData.$route(
|
||||
path: 'article/:articleId',
|
||||
name: 'FeedArticleRoute',
|
||||
|
||||
factory: $FeedArticleRouteExtension._fromState,
|
||||
),
|
||||
GoRouteData.$route(
|
||||
path: 'create',
|
||||
name: 'FeedCreateRoute',
|
||||
|
||||
factory: $FeedCreateRouteExtension._fromState,
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
extension $FeedListRouteExtension on FeedListRoute {
|
||||
static FeedListRoute _fromState(GoRouterState state) => FeedListRoute();
|
||||
|
||||
String get location => GoRouteData.$location('/feeds');
|
||||
|
||||
void go(BuildContext context) => context.go(location);
|
||||
|
||||
Future<T?> push<T>(BuildContext context) => context.push<T>(location);
|
||||
|
||||
void pushReplacement(BuildContext context) =>
|
||||
context.pushReplacement(location);
|
||||
|
||||
void replace(BuildContext context) => context.replace(location);
|
||||
}
|
||||
|
||||
extension $FeedArticleListRouteExtension on FeedArticleListRoute {
|
||||
static FeedArticleListRoute _fromState(GoRouterState state) =>
|
||||
FeedArticleListRoute(feedId: Uri.parse(state.pathParameters['feedId']!)!);
|
||||
|
||||
String get location => GoRouteData.$location(
|
||||
'/feeds/articles/${Uri.encodeComponent(feedId.toString())}',
|
||||
);
|
||||
|
||||
void go(BuildContext context) => context.go(location);
|
||||
|
||||
Future<T?> push<T>(BuildContext context) => context.push<T>(location);
|
||||
|
||||
void pushReplacement(BuildContext context) =>
|
||||
context.pushReplacement(location);
|
||||
|
||||
void replace(BuildContext context) => context.replace(location);
|
||||
}
|
||||
|
||||
extension $FeedArticleRouteExtension on FeedArticleRoute {
|
||||
static FeedArticleRoute _fromState(GoRouterState state) =>
|
||||
FeedArticleRoute(articleId: state.pathParameters['articleId']!);
|
||||
|
||||
String get location =>
|
||||
GoRouteData.$location('/feeds/article/${Uri.encodeComponent(articleId)}');
|
||||
|
||||
void go(BuildContext context) => context.go(location);
|
||||
|
||||
Future<T?> push<T>(BuildContext context) => context.push<T>(location);
|
||||
|
||||
void pushReplacement(BuildContext context) =>
|
||||
context.pushReplacement(location);
|
||||
|
||||
void replace(BuildContext context) => context.replace(location);
|
||||
}
|
||||
|
||||
extension $FeedCreateRouteExtension on FeedCreateRoute {
|
||||
static FeedCreateRoute _fromState(GoRouterState state) => FeedCreateRoute();
|
||||
|
||||
String get location => GoRouteData.$location('/feeds/create');
|
||||
|
||||
void go(BuildContext context) => context.go(location);
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:drift/drift.dart';
|
||||
|
||||
class StringListConverter extends TypeConverter<List<String>, String> {
|
||||
const StringListConverter();
|
||||
|
||||
@override
|
||||
List<String> fromSql(String fromDb) {
|
||||
return jsonDecode(fromDb) as List<String>;
|
||||
}
|
||||
|
||||
@override
|
||||
String toSql(List<String> value) {
|
||||
return jsonEncode(value);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:fast_equatable/fast_equatable.dart';
|
||||
import 'package:lensai/extensions/nullable.dart';
|
||||
import 'package:lensai/features/geckoview/domain/entities/browser_icon.dart';
|
||||
|
||||
part 'web_page_info.g.dart';
|
||||
@@ -12,7 +13,7 @@ class WebPageInfo with FastEquatable {
|
||||
final Set<String>? feeds;
|
||||
|
||||
bool get isPageInfoComplete =>
|
||||
(title?.isNotEmpty ?? false) && favicon != null;
|
||||
title.isNotEmpty && favicon != null && feeds != null;
|
||||
|
||||
WebPageInfo({required this.url, this.title, this.favicon, this.feeds});
|
||||
|
||||
|
||||
@@ -48,7 +48,6 @@ class _$WebPageInfoCWProxyImpl implements _$WebPageInfoCWProxy {
|
||||
WebPageInfo feeds(Set<String>? feeds) => this(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.
|
||||
///
|
||||
/// Usage
|
||||
@@ -62,22 +61,26 @@ class _$WebPageInfoCWProxyImpl implements _$WebPageInfoCWProxy {
|
||||
Object? feeds = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return WebPageInfo(
|
||||
url: url == const $CopyWithPlaceholder()
|
||||
? _value.url
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: url as Uri,
|
||||
title: title == const $CopyWithPlaceholder()
|
||||
? _value.title
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: title as String?,
|
||||
favicon: favicon == const $CopyWithPlaceholder()
|
||||
? _value.favicon
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: favicon as BrowserIcon?,
|
||||
feeds: feeds == const $CopyWithPlaceholder()
|
||||
? _value.feeds
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: feeds as Set<String>?,
|
||||
url:
|
||||
url == const $CopyWithPlaceholder()
|
||||
? _value.url
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: url as Uri,
|
||||
title:
|
||||
title == const $CopyWithPlaceholder()
|
||||
? _value.title
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: title as String?,
|
||||
favicon:
|
||||
favicon == const $CopyWithPlaceholder()
|
||||
? _value.favicon
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: favicon as BrowserIcon?,
|
||||
feeds:
|
||||
feeds == const $CopyWithPlaceholder()
|
||||
? _value.feeds
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: feeds as Set<String>?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:exceptions/exceptions.dart';
|
||||
import 'package:lensai/core/providers/format.dart';
|
||||
import 'package:lensai/features/about/data/repositories/package_info_repository.dart';
|
||||
import 'package:lensai/features/bangs/data/models/bang_group.dart';
|
||||
import 'package:lensai/features/bangs/domain/repositories/sync.dart';
|
||||
@@ -43,6 +44,8 @@ class AppInitializationService extends _$AppInitializationService {
|
||||
state = await Result.fromAsync(() async {
|
||||
final errors = <ErrorMessage>[];
|
||||
|
||||
await ref.read(formatProvider.future);
|
||||
|
||||
await _initPackageInfo();
|
||||
|
||||
final bangSyncResults = await _initBangs();
|
||||
|
||||
@@ -7,28 +7,27 @@ part of 'app_initialization.dart';
|
||||
// **************************************************************************
|
||||
|
||||
String _$appInitializationServiceHash() =>
|
||||
r'fa383398929c8f3c8b430986304775e044b9af7a';
|
||||
r'5e537f916825d6c5f660cf62ff133c2ef00ab091';
|
||||
|
||||
/// See also [AppInitializationService].
|
||||
@ProviderFor(AppInitializationService)
|
||||
final appInitializationServiceProvider = NotifierProvider<
|
||||
AppInitializationService,
|
||||
Result<
|
||||
({
|
||||
bool initialized,
|
||||
String? stage,
|
||||
List<ErrorMessage> errors
|
||||
})>>.internal(
|
||||
AppInitializationService,
|
||||
Result<({bool initialized, String? stage, List<ErrorMessage> errors})>
|
||||
>.internal(
|
||||
AppInitializationService.new,
|
||||
name: r'appInitializationServiceProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$appInitializationServiceHash,
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$appInitializationServiceHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$AppInitializationService = Notifier<
|
||||
Result<({bool initialized, String? stage, List<ErrorMessage> errors})>>;
|
||||
typedef _$AppInitializationService =
|
||||
Notifier<
|
||||
Result<({bool initialized, String? stage, List<ErrorMessage> 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
|
||||
|
||||
@@ -13,8 +13,8 @@ import 'package:lensai/data/models/web_page_info.dart';
|
||||
import 'package:lensai/extensions/nullable.dart';
|
||||
import 'package:lensai/features/geckoview/domain/entities/browser_icon.dart';
|
||||
import 'package:lensai/features/user/domain/repositories/cache.dart';
|
||||
import 'package:lensai/features/web_feed/utils/feed_finder.dart';
|
||||
import 'package:lensai/presentation/controllers/website_title.dart';
|
||||
import 'package:lensai/utils/feed_finder.dart';
|
||||
import 'package:lensai/utils/lru_cache.dart';
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
|
||||
@@ -119,7 +119,7 @@ class GenericWebsiteService extends _$GenericWebsiteService {
|
||||
url: _resolveRelativeUri(baseUrl, url).toString(),
|
||||
type: type,
|
||||
sizes: sizesToList(link.attributes['sizes']).toList(),
|
||||
mimeType: (mimeType?.isNotEmpty ?? true) ? null : mimeType,
|
||||
mimeType: mimeType.isNotEmpty ? mimeType : null,
|
||||
maskable: false,
|
||||
),
|
||||
);
|
||||
@@ -186,7 +186,7 @@ class GenericWebsiteService extends _$GenericWebsiteService {
|
||||
return icons;
|
||||
}
|
||||
|
||||
Future<Result<WebPageInfo>> fetchPageInfo(Uri url) async {
|
||||
Future<Result<WebPageInfo>> fetchPageInfo(Uri url) {
|
||||
return Result.fromAsync(() async {
|
||||
final result = await compute((String urlString) async {
|
||||
final client = http.Client();
|
||||
@@ -200,10 +200,8 @@ class GenericWebsiteService extends _$GenericWebsiteService {
|
||||
|
||||
final title = document.querySelector('title')?.text;
|
||||
final resources = _extractIcons(baseUri, document);
|
||||
final feeds = await FeedFinder(
|
||||
url: baseUri,
|
||||
document: document,
|
||||
).parse(verifyCandidates: false);
|
||||
final feeds =
|
||||
await FeedFinder(url: baseUri, document: document).parse();
|
||||
|
||||
return {
|
||||
'title': title,
|
||||
|
||||
@@ -7,20 +7,21 @@ part of 'generic_website.dart';
|
||||
// **************************************************************************
|
||||
|
||||
String _$genericWebsiteServiceHash() =>
|
||||
r'12396df7370ebc31b0a53b786e5a3e27c6d05177';
|
||||
r'9d17f41596579c289a6cd021ed8d8049e1fb7aff';
|
||||
|
||||
/// See also [GenericWebsiteService].
|
||||
@ProviderFor(GenericWebsiteService)
|
||||
final genericWebsiteServiceProvider =
|
||||
NotifierProvider<GenericWebsiteService, void>.internal(
|
||||
GenericWebsiteService.new,
|
||||
name: r'genericWebsiteServiceProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$genericWebsiteServiceHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
GenericWebsiteService.new,
|
||||
name: r'genericWebsiteServiceProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$genericWebsiteServiceHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$GenericWebsiteService = Notifier<void>;
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
extension DurationX on Duration {
|
||||
String formatTimeZoneOffset() {
|
||||
final hours = inHours.abs().toString().padLeft(2, '0');
|
||||
final minutes = (inMinutes.abs() % 60).toString().padLeft(2, '0');
|
||||
final sign = isNegative ? '-' : '+';
|
||||
|
||||
return '$sign$hours$minutes';
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:xxh3/xxh3.dart';
|
||||
import 'package:fast_equatable/hash.dart';
|
||||
|
||||
extension ImageHash on Image {
|
||||
Future<int?> calculateHash() async {
|
||||
final bytes = await toByteData();
|
||||
if (bytes != null) {
|
||||
final digest = xxh3(bytes.buffer.asUint8List());
|
||||
final byteData = await toByteData();
|
||||
if (byteData != null) {
|
||||
final digest = secureHash(byteData);
|
||||
return digest;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,26 @@
|
||||
extension NullableX<T> on T? {
|
||||
extension NullableX<T extends Object?> on T? {
|
||||
@pragma('vm:prefer-inline')
|
||||
R? mapNotNull<R>(R? Function(T) callback) {
|
||||
// ignore: null_check_on_nullable_type_parameter validated
|
||||
return (this != null) ? callback(this!) : null;
|
||||
// We can simplify this by using the null-aware operator
|
||||
return this != null ? callback(this as T) : null;
|
||||
}
|
||||
}
|
||||
|
||||
extension NullableStringX on String? {
|
||||
@pragma('vm:prefer-inline')
|
||||
String? get whenNotEmpty => (this?.isNotEmpty ?? false) ? this : null;
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
bool get isNotEmpty => this?.isNotEmpty ?? false;
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
bool get isEmpty => this?.isEmpty ?? true;
|
||||
}
|
||||
|
||||
extension NullableIterable on Iterable? {
|
||||
@pragma('vm:prefer-inline')
|
||||
bool get isNotEmpty => this?.isNotEmpty ?? false;
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
bool get isEmpty => this?.isEmpty ?? true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
extension UriX on Uri {
|
||||
Uri get base => Uri.parse('$scheme://$authority');
|
||||
}
|
||||
@@ -13,9 +13,10 @@ String _$widgetPinnableHash() => r'f91041f0f051ad0f00dd765cafea5571ca8c8088';
|
||||
final widgetPinnableProvider = FutureProvider<bool>.internal(
|
||||
widgetPinnable,
|
||||
name: r'widgetPinnableProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$widgetPinnableHash,
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$widgetPinnableHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
@@ -30,18 +31,19 @@ String _$appWidgetLaunchStreamHash() =>
|
||||
@ProviderFor(appWidgetLaunchStream)
|
||||
final appWidgetLaunchStreamProvider =
|
||||
AutoDisposeProvider<Raw<Stream<ReceivedIntentParameter>>>.internal(
|
||||
appWidgetLaunchStream,
|
||||
name: r'appWidgetLaunchStreamProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$appWidgetLaunchStreamHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
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<Raw<Stream<ReceivedIntentParameter>>>;
|
||||
typedef AppWidgetLaunchStreamRef =
|
||||
AutoDisposeProviderRef<Raw<Stream<ReceivedIntentParameter>>>;
|
||||
// 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
|
||||
|
||||
@@ -111,9 +111,9 @@ class BangDao extends DatabaseAccessor<BangDatabase> with _$BangDaoMixin {
|
||||
),
|
||||
onConflict: DoUpdate(
|
||||
target: [db.bangHistory.searchQuery],
|
||||
(old) => BangHistoryCompanion.custom(
|
||||
trigger: Variable(trigger),
|
||||
searchDate: Variable(DateTime.now()),
|
||||
(old) => BangHistoryCompanion(
|
||||
trigger: Value(trigger),
|
||||
searchDate: Value(DateTime.now()),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -22,7 +22,7 @@ class SyncDao extends DatabaseAccessor<BangDatabase> with _$SyncDaoMixin {
|
||||
return db.bangSync.insertOne(
|
||||
BangSyncCompanion.insert(group: Value(group), lastSync: lastSync),
|
||||
onConflict: DoUpdate(
|
||||
(old) => BangSyncCompanion.custom(lastSync: Variable(lastSync)),
|
||||
(old) => BangSyncCompanion(lastSync: Value(lastSync)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -72,7 +72,6 @@ class _$BangCWProxyImpl implements _$BangCWProxy {
|
||||
Bang format(Set<BangFormat>? format) => this(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.
|
||||
///
|
||||
/// Usage
|
||||
@@ -90,38 +89,46 @@ class _$BangCWProxyImpl implements _$BangCWProxy {
|
||||
Object? format = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return Bang(
|
||||
websiteName: websiteName == const $CopyWithPlaceholder()
|
||||
? _value.websiteName
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: websiteName as String,
|
||||
domain: domain == const $CopyWithPlaceholder()
|
||||
? _value.domain
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: domain as String,
|
||||
trigger: trigger == const $CopyWithPlaceholder()
|
||||
? _value.trigger
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: trigger as String,
|
||||
urlTemplate: urlTemplate == const $CopyWithPlaceholder()
|
||||
? _value.urlTemplate
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: urlTemplate as String,
|
||||
group: group == const $CopyWithPlaceholder()
|
||||
? _value.group
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: group as BangGroup?,
|
||||
category: category == const $CopyWithPlaceholder()
|
||||
? _value.category
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: category as String?,
|
||||
subCategory: subCategory == const $CopyWithPlaceholder()
|
||||
? _value.subCategory
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: subCategory as String?,
|
||||
format: format == const $CopyWithPlaceholder()
|
||||
? _value.format
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: format as Set<BangFormat>?,
|
||||
websiteName:
|
||||
websiteName == const $CopyWithPlaceholder()
|
||||
? _value.websiteName
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: websiteName as String,
|
||||
domain:
|
||||
domain == const $CopyWithPlaceholder()
|
||||
? _value.domain
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: domain as String,
|
||||
trigger:
|
||||
trigger == const $CopyWithPlaceholder()
|
||||
? _value.trigger
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: trigger as String,
|
||||
urlTemplate:
|
||||
urlTemplate == const $CopyWithPlaceholder()
|
||||
? _value.urlTemplate
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: urlTemplate as String,
|
||||
group:
|
||||
group == const $CopyWithPlaceholder()
|
||||
? _value.group
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: group as BangGroup?,
|
||||
category:
|
||||
category == const $CopyWithPlaceholder()
|
||||
? _value.category
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: category as String?,
|
||||
subCategory:
|
||||
subCategory == const $CopyWithPlaceholder()
|
||||
? _value.subCategory
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: subCategory as String?,
|
||||
format:
|
||||
format == const $CopyWithPlaceholder()
|
||||
? _value.format
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: format as Set<BangFormat>?,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -137,26 +144,27 @@ extension $BangCopyWith on Bang {
|
||||
// **************************************************************************
|
||||
|
||||
Bang _$BangFromJson(Map<String, dynamic> json) => Bang(
|
||||
websiteName: json['s'] as String,
|
||||
domain: json['d'] as String,
|
||||
trigger: json['t'] as String,
|
||||
urlTemplate: json['u'] as String,
|
||||
category: json['c'] as String?,
|
||||
subCategory: json['sc'] as String?,
|
||||
format: (json['fmt'] as List<dynamic>?)
|
||||
websiteName: json['s'] as String,
|
||||
domain: json['d'] as String,
|
||||
trigger: json['t'] as String,
|
||||
urlTemplate: json['u'] as String,
|
||||
category: json['c'] as String?,
|
||||
subCategory: json['sc'] as String?,
|
||||
format:
|
||||
(json['fmt'] as List<dynamic>?)
|
||||
?.map((e) => $enumDecode(_$BangFormatEnumMap, e))
|
||||
.toSet(),
|
||||
);
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$BangToJson(Bang instance) => <String, dynamic>{
|
||||
's': instance.websiteName,
|
||||
'd': instance.domain,
|
||||
't': instance.trigger,
|
||||
'u': instance.urlTemplate,
|
||||
'c': instance.category,
|
||||
'sc': instance.subCategory,
|
||||
'fmt': instance.format?.map((e) => _$BangFormatEnumMap[e]!).toList(),
|
||||
};
|
||||
's': instance.websiteName,
|
||||
'd': instance.domain,
|
||||
't': instance.trigger,
|
||||
'u': instance.urlTemplate,
|
||||
'c': instance.category,
|
||||
'sc': instance.subCategory,
|
||||
'fmt': instance.format?.map((e) => _$BangFormatEnumMap[e]!).toList(),
|
||||
};
|
||||
|
||||
const _$BangFormatEnumMap = {
|
||||
BangFormat.openBasePath: 'open_base_path',
|
||||
|
||||
@@ -84,7 +84,6 @@ class _$BangDataCWProxyImpl implements _$BangDataCWProxy {
|
||||
BangData icon(BrowserIcon? icon) => this(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.
|
||||
///
|
||||
/// Usage
|
||||
@@ -104,46 +103,56 @@ class _$BangDataCWProxyImpl implements _$BangDataCWProxy {
|
||||
Object? icon = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return BangData(
|
||||
websiteName: websiteName == const $CopyWithPlaceholder()
|
||||
? _value.websiteName
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: websiteName as String,
|
||||
domain: domain == const $CopyWithPlaceholder()
|
||||
? _value.domain
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: domain as String,
|
||||
trigger: trigger == const $CopyWithPlaceholder()
|
||||
? _value.trigger
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: trigger as String,
|
||||
urlTemplate: urlTemplate == const $CopyWithPlaceholder()
|
||||
? _value.urlTemplate
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: urlTemplate as String,
|
||||
category: category == const $CopyWithPlaceholder()
|
||||
? _value.category
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: category as String?,
|
||||
subCategory: subCategory == const $CopyWithPlaceholder()
|
||||
? _value.subCategory
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: subCategory as String?,
|
||||
format: format == const $CopyWithPlaceholder()
|
||||
? _value.format
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: format as Set<BangFormat>?,
|
||||
frequency: frequency == const $CopyWithPlaceholder()
|
||||
? _value.frequency
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: frequency as int?,
|
||||
lastUsed: lastUsed == const $CopyWithPlaceholder()
|
||||
? _value.lastUsed
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: lastUsed as DateTime?,
|
||||
icon: icon == const $CopyWithPlaceholder()
|
||||
? _value.icon
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: icon as BrowserIcon?,
|
||||
websiteName:
|
||||
websiteName == const $CopyWithPlaceholder()
|
||||
? _value.websiteName
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: websiteName as String,
|
||||
domain:
|
||||
domain == const $CopyWithPlaceholder()
|
||||
? _value.domain
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: domain as String,
|
||||
trigger:
|
||||
trigger == const $CopyWithPlaceholder()
|
||||
? _value.trigger
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: trigger as String,
|
||||
urlTemplate:
|
||||
urlTemplate == const $CopyWithPlaceholder()
|
||||
? _value.urlTemplate
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: urlTemplate as String,
|
||||
category:
|
||||
category == const $CopyWithPlaceholder()
|
||||
? _value.category
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: category as String?,
|
||||
subCategory:
|
||||
subCategory == const $CopyWithPlaceholder()
|
||||
? _value.subCategory
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: subCategory as String?,
|
||||
format:
|
||||
format == const $CopyWithPlaceholder()
|
||||
? _value.format
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: format as Set<BangFormat>?,
|
||||
frequency:
|
||||
frequency == const $CopyWithPlaceholder()
|
||||
? _value.frequency
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: frequency as int?,
|
||||
lastUsed:
|
||||
lastUsed == const $CopyWithPlaceholder()
|
||||
? _value.lastUsed
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: lastUsed as DateTime?,
|
||||
icon:
|
||||
icon == const $CopyWithPlaceholder()
|
||||
? _value.icon
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: icon as BrowserIcon?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ class BangDataSourceService extends _$BangDataSourceService {
|
||||
@override
|
||||
void build() {}
|
||||
|
||||
Future<Result<List<Bang>>> getBangs(Uri url, BangGroup? group) async {
|
||||
Future<Result<List<Bang>>> getBangs(Uri url, BangGroup? group) {
|
||||
return Result.fromAsync(() async {
|
||||
return await compute((args) async {
|
||||
final client = http.Client();
|
||||
|
||||
@@ -7,20 +7,21 @@ part of 'data_source.dart';
|
||||
// **************************************************************************
|
||||
|
||||
String _$bangDataSourceServiceHash() =>
|
||||
r'28b774af3338e3e949ccd0f04205ccd4a7fe67a5';
|
||||
r'f802b9fb3c467a24d65d170229d37f745ae869e5';
|
||||
|
||||
/// See also [BangDataSourceService].
|
||||
@ProviderFor(BangDataSourceService)
|
||||
final bangDataSourceServiceProvider =
|
||||
AutoDisposeNotifierProvider<BangDataSourceService, void>.internal(
|
||||
BangDataSourceService.new,
|
||||
name: r'bangDataSourceServiceProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bangDataSourceServiceHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
BangDataSourceService.new,
|
||||
name: r'bangDataSourceServiceProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bangDataSourceServiceHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$BangDataSourceService = AutoDisposeNotifier<void>;
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
@@ -14,9 +14,10 @@ String _$defaultSearchBangDataHash() =>
|
||||
final defaultSearchBangDataProvider = StreamProvider<BangData?>.internal(
|
||||
defaultSearchBangData,
|
||||
name: r'defaultSearchBangDataProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$defaultSearchBangDataHash,
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$defaultSearchBangDataHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
@@ -30,19 +31,20 @@ String _$bangCategoriesHash() => r'947fcfd2dffcc7f585c6ed7379d319f4fe72293a';
|
||||
@ProviderFor(bangCategories)
|
||||
final bangCategoriesProvider =
|
||||
AutoDisposeStreamProvider<Map<String, List<String>>>.internal(
|
||||
bangCategories,
|
||||
name: r'bangCategoriesProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bangCategoriesHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
bangCategories,
|
||||
name: r'bangCategoriesProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bangCategoriesHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
typedef BangCategoriesRef
|
||||
= AutoDisposeStreamProviderRef<Map<String, List<String>>>;
|
||||
typedef BangCategoriesRef =
|
||||
AutoDisposeStreamProviderRef<Map<String, List<String>>>;
|
||||
String _$bangListHash() => r'dc168bd1246bea3e5f8015dd52fbf41c5f98ca13';
|
||||
|
||||
/// Copied from Dart SDK
|
||||
@@ -91,9 +93,7 @@ class BangListFamily extends Family<AsyncValue<List<BangData>>> {
|
||||
}
|
||||
|
||||
@override
|
||||
BangListProvider getProviderOverride(
|
||||
covariant BangListProvider provider,
|
||||
) {
|
||||
BangListProvider getProviderOverride(covariant BangListProvider provider) {
|
||||
return call(
|
||||
groups: provider.groups,
|
||||
domain: provider.domain,
|
||||
@@ -126,26 +126,26 @@ class BangListProvider extends AutoDisposeStreamProvider<List<BangData>> {
|
||||
({String category, String? subCategory})? categoryFilter,
|
||||
bool? orderMostFrequentFirst,
|
||||
}) : this._internal(
|
||||
(ref) => bangList(
|
||||
ref as BangListRef,
|
||||
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,
|
||||
groups: groups,
|
||||
domain: domain,
|
||||
categoryFilter: categoryFilter,
|
||||
orderMostFrequentFirst: orderMostFrequentFirst,
|
||||
);
|
||||
(ref) => bangList(
|
||||
ref as BangListRef,
|
||||
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,
|
||||
groups: groups,
|
||||
domain: domain,
|
||||
categoryFilter: categoryFilter,
|
||||
orderMostFrequentFirst: orderMostFrequentFirst,
|
||||
);
|
||||
|
||||
BangListProvider._internal(
|
||||
super._createNotifier, {
|
||||
@@ -229,7 +229,8 @@ mixin BangListRef on AutoDisposeStreamProviderRef<List<BangData>> {
|
||||
}
|
||||
|
||||
class _BangListProviderElement
|
||||
extends AutoDisposeStreamProviderElement<List<BangData>> with BangListRef {
|
||||
extends AutoDisposeStreamProviderElement<List<BangData>>
|
||||
with BangListRef {
|
||||
_BangListProviderElement(super.provider);
|
||||
|
||||
@override
|
||||
@@ -250,14 +251,15 @@ String _$frequentBangListHash() => r'2c1ecb7e9416772fc1c32d01d767e1eb4f865975';
|
||||
@ProviderFor(frequentBangList)
|
||||
final frequentBangListProvider =
|
||||
AutoDisposeStreamProvider<List<BangData>>.internal(
|
||||
frequentBangList,
|
||||
name: r'frequentBangListProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$frequentBangListHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
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
|
||||
@@ -268,19 +270,20 @@ String _$searchHistoryHash() => r'7b97798729643de8e44fd8024cdc02f35124b08b';
|
||||
@ProviderFor(searchHistory)
|
||||
final searchHistoryProvider =
|
||||
AutoDisposeStreamProvider<List<SearchHistoryEntry>>.internal(
|
||||
searchHistory,
|
||||
name: r'searchHistoryProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$searchHistoryHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
searchHistory,
|
||||
name: r'searchHistoryProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$searchHistoryHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
typedef SearchHistoryRef
|
||||
= AutoDisposeStreamProviderRef<List<SearchHistoryEntry>>;
|
||||
typedef SearchHistoryRef =
|
||||
AutoDisposeStreamProviderRef<List<SearchHistoryEntry>>;
|
||||
String _$lastSyncOfGroupHash() => r'23d07f3132ba9bb35a31f74e3a69698d31d4c569';
|
||||
|
||||
/// See also [lastSyncOfGroup].
|
||||
@@ -293,21 +296,15 @@ class LastSyncOfGroupFamily extends Family<AsyncValue<DateTime?>> {
|
||||
const LastSyncOfGroupFamily();
|
||||
|
||||
/// See also [lastSyncOfGroup].
|
||||
LastSyncOfGroupProvider call(
|
||||
BangGroup group,
|
||||
) {
|
||||
return LastSyncOfGroupProvider(
|
||||
group,
|
||||
);
|
||||
LastSyncOfGroupProvider call(BangGroup group) {
|
||||
return LastSyncOfGroupProvider(group);
|
||||
}
|
||||
|
||||
@override
|
||||
LastSyncOfGroupProvider getProviderOverride(
|
||||
covariant LastSyncOfGroupProvider provider,
|
||||
) {
|
||||
return call(
|
||||
provider.group,
|
||||
);
|
||||
return call(provider.group);
|
||||
}
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
||||
@@ -328,24 +325,20 @@ class LastSyncOfGroupFamily extends Family<AsyncValue<DateTime?>> {
|
||||
/// See also [lastSyncOfGroup].
|
||||
class LastSyncOfGroupProvider extends AutoDisposeStreamProvider<DateTime?> {
|
||||
/// 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,
|
||||
);
|
||||
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,
|
||||
);
|
||||
|
||||
LastSyncOfGroupProvider._internal(
|
||||
super._createNotifier, {
|
||||
@@ -424,21 +417,15 @@ class BangCountOfGroupFamily extends Family<AsyncValue<int>> {
|
||||
const BangCountOfGroupFamily();
|
||||
|
||||
/// See also [bangCountOfGroup].
|
||||
BangCountOfGroupProvider call(
|
||||
BangGroup group,
|
||||
) {
|
||||
return BangCountOfGroupProvider(
|
||||
group,
|
||||
);
|
||||
BangCountOfGroupProvider call(BangGroup group) {
|
||||
return BangCountOfGroupProvider(group);
|
||||
}
|
||||
|
||||
@override
|
||||
BangCountOfGroupProvider getProviderOverride(
|
||||
covariant BangCountOfGroupProvider provider,
|
||||
) {
|
||||
return call(
|
||||
provider.group,
|
||||
);
|
||||
return call(provider.group);
|
||||
}
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
||||
@@ -459,24 +446,20 @@ class BangCountOfGroupFamily extends Family<AsyncValue<int>> {
|
||||
/// See also [bangCountOfGroup].
|
||||
class BangCountOfGroupProvider extends AutoDisposeStreamProvider<int> {
|
||||
/// See also [bangCountOfGroup].
|
||||
BangCountOfGroupProvider(
|
||||
BangGroup group,
|
||||
) : this._internal(
|
||||
(ref) => bangCountOfGroup(
|
||||
ref as BangCountOfGroupRef,
|
||||
group,
|
||||
),
|
||||
from: bangCountOfGroupProvider,
|
||||
name: r'bangCountOfGroupProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bangCountOfGroupHash,
|
||||
dependencies: BangCountOfGroupFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
BangCountOfGroupFamily._allTransitiveDependencies,
|
||||
group: group,
|
||||
);
|
||||
BangCountOfGroupProvider(BangGroup group)
|
||||
: this._internal(
|
||||
(ref) => bangCountOfGroup(ref as BangCountOfGroupRef, group),
|
||||
from: bangCountOfGroupProvider,
|
||||
name: r'bangCountOfGroupProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bangCountOfGroupHash,
|
||||
dependencies: BangCountOfGroupFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
BangCountOfGroupFamily._allTransitiveDependencies,
|
||||
group: group,
|
||||
);
|
||||
|
||||
BangCountOfGroupProvider._internal(
|
||||
super._createNotifier, {
|
||||
@@ -535,11 +518,13 @@ mixin BangCountOfGroupRef on AutoDisposeStreamProviderRef<int> {
|
||||
}
|
||||
|
||||
class _BangCountOfGroupProviderElement
|
||||
extends AutoDisposeStreamProviderElement<int> with BangCountOfGroupRef {
|
||||
extends AutoDisposeStreamProviderElement<int>
|
||||
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
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:lensai/features/bangs/data/models/bang_data.dart';
|
||||
import 'package:lensai/features/bangs/data/providers.dart';
|
||||
import 'package:lensai/features/bangs/domain/providers/bangs.dart';
|
||||
import 'package:lensai/features/bangs/domain/repositories/data.dart';
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
|
||||
@@ -6,6 +10,8 @@ part 'search.g.dart';
|
||||
|
||||
@Riverpod()
|
||||
class BangSearch extends _$BangSearch {
|
||||
late StreamController<List<BangData>> _streamController;
|
||||
|
||||
Future<Uri> triggerBangSearch(BangData bang, String searchQuery) async {
|
||||
final bangDataNotifier = ref.read(bangDataRepositoryProvider.notifier);
|
||||
|
||||
@@ -19,6 +25,52 @@ class BangSearch extends _$BangSearch {
|
||||
return bang.getUrl(searchQuery);
|
||||
}
|
||||
|
||||
Future<void> search(String input) async {
|
||||
if (input.isNotEmpty) {
|
||||
await ref.read(bangDatabaseProvider).bangDao.queryBangs(input).get().then(
|
||||
(value) {
|
||||
if (!_streamController.isClosed) {
|
||||
_streamController.add(value);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void build() {}
|
||||
Stream<List<BangData>> build() {
|
||||
_streamController = StreamController();
|
||||
|
||||
ref.onDispose(() async {
|
||||
await _streamController.close();
|
||||
});
|
||||
|
||||
return _streamController.stream;
|
||||
}
|
||||
}
|
||||
|
||||
@Riverpod()
|
||||
class SeamlessBangProvider extends _$SeamlessBangProvider {
|
||||
bool _hasSearch = false;
|
||||
|
||||
void search(String input) {
|
||||
if (input.isNotEmpty) {
|
||||
if (!_hasSearch) {
|
||||
_hasSearch = true;
|
||||
ref.invalidateSelf();
|
||||
}
|
||||
|
||||
unawaited(ref.read(bangSearchProvider.notifier).search(input));
|
||||
} else if (_hasSearch) {
|
||||
_hasSearch = false;
|
||||
ref.invalidateSelf();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
AsyncValue<List<BangData>> build() {
|
||||
return _hasSearch
|
||||
? ref.watch(bangSearchProvider)
|
||||
: ref.watch(frequentBangListProvider);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,20 +6,43 @@ part of 'search.dart';
|
||||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$bangSearchHash() => r'a9bc5efc6e0df7b64bb648623f65911373a8e8e4';
|
||||
String _$bangSearchHash() => r'ff7035d269041c6415f2a2afb0a71ef67d3b9841';
|
||||
|
||||
/// See also [BangSearch].
|
||||
@ProviderFor(BangSearch)
|
||||
final bangSearchProvider =
|
||||
AutoDisposeNotifierProvider<BangSearch, void>.internal(
|
||||
BangSearch.new,
|
||||
name: r'bangSearchProvider',
|
||||
AutoDisposeStreamNotifierProvider<BangSearch, List<BangData>>.internal(
|
||||
BangSearch.new,
|
||||
name: r'bangSearchProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bangSearchHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$BangSearch = AutoDisposeStreamNotifier<List<BangData>>;
|
||||
String _$seamlessBangProviderHash() =>
|
||||
r'c4c0b452c94ba447be5b02dfef5bc16148cc3dc7';
|
||||
|
||||
/// See also [SeamlessBangProvider].
|
||||
@ProviderFor(SeamlessBangProvider)
|
||||
final seamlessBangProviderProvider = AutoDisposeNotifierProvider<
|
||||
SeamlessBangProvider,
|
||||
AsyncValue<List<BangData>>
|
||||
>.internal(
|
||||
SeamlessBangProvider.new,
|
||||
name: r'seamlessBangProviderProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product') ? null : _$bangSearchHash,
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$seamlessBangProviderHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$BangSearch = AutoDisposeNotifier<void>;
|
||||
typedef _$SeamlessBangProvider =
|
||||
AutoDisposeNotifier<AsyncValue<List<BangData>>>;
|
||||
// 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
|
||||
|
||||
@@ -13,14 +13,15 @@ String _$bangDataRepositoryHash() =>
|
||||
@ProviderFor(BangDataRepository)
|
||||
final bangDataRepositoryProvider =
|
||||
NotifierProvider<BangDataRepository, void>.internal(
|
||||
BangDataRepository.new,
|
||||
name: r'bangDataRepositoryProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bangDataRepositoryHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
BangDataRepository.new,
|
||||
name: r'bangDataRepositoryProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bangDataRepositoryHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$BangDataRepository = Notifier<void>;
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:lensai/features/bangs/data/models/bang_data.dart';
|
||||
import 'package:lensai/features/bangs/data/providers.dart';
|
||||
import 'package:lensai/features/bangs/domain/providers/bangs.dart';
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
|
||||
part 'search.g.dart';
|
||||
|
||||
@Riverpod()
|
||||
class BangSearch extends _$BangSearch {
|
||||
late StreamController<List<BangData>> _streamController;
|
||||
|
||||
Future<void> search(String input) async {
|
||||
if (input.isNotEmpty) {
|
||||
await ref.read(bangDatabaseProvider).bangDao.queryBangs(input).get().then(
|
||||
(value) {
|
||||
if (!_streamController.isClosed) {
|
||||
_streamController.add(value);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Stream<List<BangData>> build() {
|
||||
_streamController = StreamController();
|
||||
|
||||
ref.onDispose(() async {
|
||||
await _streamController.close();
|
||||
});
|
||||
|
||||
return _streamController.stream;
|
||||
}
|
||||
}
|
||||
|
||||
@Riverpod()
|
||||
class SeamlessBangProvider extends _$SeamlessBangProvider {
|
||||
bool _hasSearch = false;
|
||||
|
||||
void search(String input) {
|
||||
if (input.isNotEmpty) {
|
||||
if (!_hasSearch) {
|
||||
_hasSearch = true;
|
||||
ref.invalidateSelf();
|
||||
}
|
||||
|
||||
unawaited(ref.read(bangSearchProvider.notifier).search(input));
|
||||
} else if (_hasSearch) {
|
||||
_hasSearch = false;
|
||||
ref.invalidateSelf();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
AsyncValue<List<BangData>> build() {
|
||||
return _hasSearch
|
||||
? ref.watch(bangSearchProvider)
|
||||
: ref.watch(frequentBangListProvider);
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'search.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$bangSearchHash() => r'abf9ff5badf2ecfbcbde148fd2c849beac83bec4';
|
||||
|
||||
/// See also [BangSearch].
|
||||
@ProviderFor(BangSearch)
|
||||
final bangSearchProvider =
|
||||
AutoDisposeStreamNotifierProvider<BangSearch, List<BangData>>.internal(
|
||||
BangSearch.new,
|
||||
name: r'bangSearchProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product') ? null : _$bangSearchHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$BangSearch = AutoDisposeStreamNotifier<List<BangData>>;
|
||||
String _$seamlessBangProviderHash() =>
|
||||
r'c4c0b452c94ba447be5b02dfef5bc16148cc3dc7';
|
||||
|
||||
/// See also [SeamlessBangProvider].
|
||||
@ProviderFor(SeamlessBangProvider)
|
||||
final seamlessBangProviderProvider = AutoDisposeNotifierProvider<
|
||||
SeamlessBangProvider, AsyncValue<List<BangData>>>.internal(
|
||||
SeamlessBangProvider.new,
|
||||
name: r'seamlessBangProviderProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$seamlessBangProviderHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$SeamlessBangProvider
|
||||
= AutoDisposeNotifier<AsyncValue<List<BangData>>>;
|
||||
// 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
|
||||
@@ -13,14 +13,15 @@ String _$bangSyncRepositoryHash() =>
|
||||
@ProviderFor(BangSyncRepository)
|
||||
final bangSyncRepositoryProvider =
|
||||
NotifierProvider<BangSyncRepository, void>.internal(
|
||||
BangSyncRepository.new,
|
||||
name: r'bangSyncRepositoryProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bangSyncRepositoryHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
BangSyncRepository.new,
|
||||
name: r'bangSyncRepositoryProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bangSyncRepositoryHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$BangSyncRepository = Notifier<void>;
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
@@ -5,7 +5,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:lensai/features/bangs/domain/repositories/search.dart';
|
||||
import 'package:lensai/features/bangs/domain/providers/search.dart';
|
||||
import 'package:lensai/features/bangs/presentation/widgets/bang_details.dart';
|
||||
import 'package:lensai/features/geckoview/features/browser/domain/providers.dart';
|
||||
import 'package:lensai/features/user/domain/providers.dart';
|
||||
@@ -26,7 +26,7 @@ class BangSearchScreen extends HookConsumerWidget {
|
||||
text: initialSearchText,
|
||||
);
|
||||
|
||||
useListenableCallback(textEditingController, () async {
|
||||
useListenableCallback(textEditingController, () {
|
||||
unawaited(
|
||||
ref
|
||||
.read(bangSearchProvider.notifier)
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:lensai/core/routing/routes.dart';
|
||||
import 'package:lensai/features/bangs/data/models/bang_data.dart';
|
||||
import 'package:lensai/features/geckoview/domain/repositories/tab.dart';
|
||||
import 'package:lensai/presentation/widgets/bang_icon.dart';
|
||||
import 'package:lensai/presentation/widgets/url_icon.dart';
|
||||
|
||||
class BangDetails extends HookConsumerWidget {
|
||||
final BangData bangData;
|
||||
|
||||
@@ -12,8 +12,8 @@ import 'package:lensai/features/geckoview/features/search/domain/providers/searc
|
||||
import 'package:lensai/features/geckoview/features/search/presentation/widgets/search_field.dart';
|
||||
import 'package:lensai/features/geckoview/features/search/presentation/widgets/search_modules/search_suggestions.dart';
|
||||
import 'package:lensai/presentation/hooks/listenable_callback.dart';
|
||||
import 'package:lensai/presentation/widgets/bang_icon.dart';
|
||||
import 'package:lensai/presentation/widgets/selectable_chips.dart';
|
||||
import 'package:lensai/presentation/widgets/url_icon.dart';
|
||||
|
||||
class SiteSearch extends HookConsumerWidget {
|
||||
final String domain;
|
||||
@@ -33,7 +33,7 @@ class SiteSearch extends HookConsumerWidget {
|
||||
|
||||
final searchTextController = useTextEditingController();
|
||||
|
||||
useListenableCallback(searchTextController, () async {
|
||||
useListenableCallback(searchTextController, () {
|
||||
ref
|
||||
.read(searchSuggestionsProvider().notifier)
|
||||
.addQuery(searchTextController.text);
|
||||
|
||||
@@ -110,7 +110,7 @@ class MessagesDao extends DatabaseAccessor<ChatDatabase>
|
||||
Future<void> replaceChatMessages({
|
||||
required String chatId,
|
||||
required List<Message> messages,
|
||||
}) async {
|
||||
}) {
|
||||
return db.transaction(() async {
|
||||
await deleteChatMessages(chatId: chatId);
|
||||
|
||||
|
||||
@@ -9,16 +9,22 @@ class ChatData extends Table with TableInfo<ChatData, ChatDataData> {
|
||||
final String? _alias;
|
||||
ChatData(this.attachedDatabase, [this._alias]);
|
||||
late final GeneratedColumn<String> chatId = GeneratedColumn<String>(
|
||||
'chat_id', aliasedName, false,
|
||||
type: DriftSqlType.string,
|
||||
requiredDuringInsert: true,
|
||||
$customConstraints: 'PRIMARY KEY NOT NULL');
|
||||
'chat_id',
|
||||
aliasedName,
|
||||
false,
|
||||
type: DriftSqlType.string,
|
||||
requiredDuringInsert: true,
|
||||
$customConstraints: 'PRIMARY KEY NOT NULL',
|
||||
);
|
||||
late final GeneratedColumnWithTypeConverter<ChatMetadata, String> metadata =
|
||||
GeneratedColumn<String>('metadata', aliasedName, false,
|
||||
type: DriftSqlType.string,
|
||||
requiredDuringInsert: true,
|
||||
$customConstraints: 'NOT NULL')
|
||||
.withConverter<ChatMetadata>(ChatData.$convertermetadata);
|
||||
GeneratedColumn<String>(
|
||||
'metadata',
|
||||
aliasedName,
|
||||
false,
|
||||
type: DriftSqlType.string,
|
||||
requiredDuringInsert: true,
|
||||
$customConstraints: 'NOT NULL',
|
||||
).withConverter<ChatMetadata>(ChatData.$convertermetadata);
|
||||
@override
|
||||
List<GeneratedColumn> get $columns => [chatId, metadata];
|
||||
@override
|
||||
@@ -32,10 +38,17 @@ class ChatData extends Table with TableInfo<ChatData, ChatDataData> {
|
||||
ChatDataData map(Map<String, dynamic> data, {String? tablePrefix}) {
|
||||
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
||||
return ChatDataData(
|
||||
chatId: attachedDatabase.typeMapping
|
||||
.read(DriftSqlType.string, data['${effectivePrefix}chat_id'])!,
|
||||
metadata: ChatData.$convertermetadata.fromSql(attachedDatabase.typeMapping
|
||||
.read(DriftSqlType.string, data['${effectivePrefix}metadata'])!),
|
||||
chatId:
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}chat_id'],
|
||||
)!,
|
||||
metadata: ChatData.$convertermetadata.fromSql(
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}metadata'],
|
||||
)!,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -59,14 +72,17 @@ class ChatDataData extends DataClass implements Insertable<ChatDataData> {
|
||||
final map = <String, Expression>{};
|
||||
map['chat_id'] = Variable<String>(chatId);
|
||||
{
|
||||
map['metadata'] =
|
||||
Variable<String>(ChatData.$convertermetadata.toSql(metadata));
|
||||
map['metadata'] = Variable<String>(
|
||||
ChatData.$convertermetadata.toSql(metadata),
|
||||
);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
factory ChatDataData.fromJson(Map<String, dynamic> json,
|
||||
{ValueSerializer? serializer}) {
|
||||
factory ChatDataData.fromJson(
|
||||
Map<String, dynamic> json, {
|
||||
ValueSerializer? serializer,
|
||||
}) {
|
||||
serializer ??= driftRuntimeOptions.defaultSerializer;
|
||||
return ChatDataData(
|
||||
chatId: serializer.fromJson<String>(json['chat_id']),
|
||||
@@ -126,8 +142,8 @@ class ChatDataCompanion extends UpdateCompanion<ChatDataData> {
|
||||
required String chatId,
|
||||
required ChatMetadata metadata,
|
||||
this.rowid = const Value.absent(),
|
||||
}) : chatId = Value(chatId),
|
||||
metadata = Value(metadata);
|
||||
}) : chatId = Value(chatId),
|
||||
metadata = Value(metadata);
|
||||
static Insertable<ChatDataData> custom({
|
||||
Expression<String>? chatId,
|
||||
Expression<String>? metadata,
|
||||
@@ -140,10 +156,11 @@ class ChatDataCompanion extends UpdateCompanion<ChatDataData> {
|
||||
});
|
||||
}
|
||||
|
||||
ChatDataCompanion copyWith(
|
||||
{Value<String>? chatId,
|
||||
Value<ChatMetadata>? metadata,
|
||||
Value<int>? rowid}) {
|
||||
ChatDataCompanion copyWith({
|
||||
Value<String>? chatId,
|
||||
Value<ChatMetadata>? metadata,
|
||||
Value<int>? rowid,
|
||||
}) {
|
||||
return ChatDataCompanion(
|
||||
chatId: chatId ?? this.chatId,
|
||||
metadata: metadata ?? this.metadata,
|
||||
@@ -158,8 +175,9 @@ class ChatDataCompanion extends UpdateCompanion<ChatDataData> {
|
||||
map['chat_id'] = Variable<String>(chatId.value);
|
||||
}
|
||||
if (metadata.present) {
|
||||
map['metadata'] =
|
||||
Variable<String>(ChatData.$convertermetadata.toSql(metadata.value));
|
||||
map['metadata'] = Variable<String>(
|
||||
ChatData.$convertermetadata.toSql(metadata.value),
|
||||
);
|
||||
}
|
||||
if (rowid.present) {
|
||||
map['rowid'] = Variable<int>(rowid.value);
|
||||
@@ -184,28 +202,44 @@ class ChatMessage extends Table with TableInfo<ChatMessage, ChatMessageData> {
|
||||
final String? _alias;
|
||||
ChatMessage(this.attachedDatabase, [this._alias]);
|
||||
late final GeneratedColumn<String> messageId = GeneratedColumn<String>(
|
||||
'message_id', aliasedName, false,
|
||||
type: DriftSqlType.string,
|
||||
requiredDuringInsert: true,
|
||||
$customConstraints: 'PRIMARY KEY NOT NULL');
|
||||
'message_id',
|
||||
aliasedName,
|
||||
false,
|
||||
type: DriftSqlType.string,
|
||||
requiredDuringInsert: true,
|
||||
$customConstraints: 'PRIMARY KEY NOT NULL',
|
||||
);
|
||||
late final GeneratedColumn<String> chatId = GeneratedColumn<String>(
|
||||
'chat_id', aliasedName, false,
|
||||
type: DriftSqlType.string,
|
||||
requiredDuringInsert: true,
|
||||
$customConstraints: 'NOT NULL');
|
||||
'chat_id',
|
||||
aliasedName,
|
||||
false,
|
||||
type: DriftSqlType.string,
|
||||
requiredDuringInsert: true,
|
||||
$customConstraints: 'NOT NULL',
|
||||
);
|
||||
late final GeneratedColumn<String> orderKey = GeneratedColumn<String>(
|
||||
'order_key', aliasedName, false,
|
||||
type: DriftSqlType.string,
|
||||
requiredDuringInsert: true,
|
||||
$customConstraints: 'NOT NULL');
|
||||
'order_key',
|
||||
aliasedName,
|
||||
false,
|
||||
type: DriftSqlType.string,
|
||||
requiredDuringInsert: true,
|
||||
$customConstraints: 'NOT NULL',
|
||||
);
|
||||
late final GeneratedColumn<String> messageJson = GeneratedColumn<String>(
|
||||
'message_json', aliasedName, false,
|
||||
type: DriftSqlType.string,
|
||||
requiredDuringInsert: true,
|
||||
$customConstraints: 'NOT NULL');
|
||||
'message_json',
|
||||
aliasedName,
|
||||
false,
|
||||
type: DriftSqlType.string,
|
||||
requiredDuringInsert: true,
|
||||
$customConstraints: 'NOT NULL',
|
||||
);
|
||||
@override
|
||||
List<GeneratedColumn> get $columns =>
|
||||
[messageId, chatId, orderKey, messageJson];
|
||||
List<GeneratedColumn> get $columns => [
|
||||
messageId,
|
||||
chatId,
|
||||
orderKey,
|
||||
messageJson,
|
||||
];
|
||||
@override
|
||||
String get aliasedName => _alias ?? actualTableName;
|
||||
@override
|
||||
@@ -217,14 +251,26 @@ class ChatMessage extends Table with TableInfo<ChatMessage, ChatMessageData> {
|
||||
ChatMessageData map(Map<String, dynamic> data, {String? tablePrefix}) {
|
||||
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
||||
return ChatMessageData(
|
||||
messageId: attachedDatabase.typeMapping
|
||||
.read(DriftSqlType.string, data['${effectivePrefix}message_id'])!,
|
||||
chatId: attachedDatabase.typeMapping
|
||||
.read(DriftSqlType.string, data['${effectivePrefix}chat_id'])!,
|
||||
orderKey: attachedDatabase.typeMapping
|
||||
.read(DriftSqlType.string, data['${effectivePrefix}order_key'])!,
|
||||
messageJson: attachedDatabase.typeMapping
|
||||
.read(DriftSqlType.string, data['${effectivePrefix}message_json'])!,
|
||||
messageId:
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}message_id'],
|
||||
)!,
|
||||
chatId:
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}chat_id'],
|
||||
)!,
|
||||
orderKey:
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}order_key'],
|
||||
)!,
|
||||
messageJson:
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}message_json'],
|
||||
)!,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -242,11 +288,12 @@ class ChatMessageData extends DataClass implements Insertable<ChatMessageData> {
|
||||
final String chatId;
|
||||
final String orderKey;
|
||||
final String messageJson;
|
||||
const ChatMessageData(
|
||||
{required this.messageId,
|
||||
required this.chatId,
|
||||
required this.orderKey,
|
||||
required this.messageJson});
|
||||
const ChatMessageData({
|
||||
required this.messageId,
|
||||
required this.chatId,
|
||||
required this.orderKey,
|
||||
required this.messageJson,
|
||||
});
|
||||
@override
|
||||
Map<String, Expression> toColumns(bool nullToAbsent) {
|
||||
final map = <String, Expression>{};
|
||||
@@ -257,8 +304,10 @@ class ChatMessageData extends DataClass implements Insertable<ChatMessageData> {
|
||||
return map;
|
||||
}
|
||||
|
||||
factory ChatMessageData.fromJson(Map<String, dynamic> json,
|
||||
{ValueSerializer? serializer}) {
|
||||
factory ChatMessageData.fromJson(
|
||||
Map<String, dynamic> json, {
|
||||
ValueSerializer? serializer,
|
||||
}) {
|
||||
serializer ??= driftRuntimeOptions.defaultSerializer;
|
||||
return ChatMessageData(
|
||||
messageId: serializer.fromJson<String>(json['message_id']),
|
||||
@@ -278,17 +327,17 @@ class ChatMessageData extends DataClass implements Insertable<ChatMessageData> {
|
||||
};
|
||||
}
|
||||
|
||||
ChatMessageData copyWith(
|
||||
{String? messageId,
|
||||
String? chatId,
|
||||
String? orderKey,
|
||||
String? messageJson}) =>
|
||||
ChatMessageData(
|
||||
messageId: messageId ?? this.messageId,
|
||||
chatId: chatId ?? this.chatId,
|
||||
orderKey: orderKey ?? this.orderKey,
|
||||
messageJson: messageJson ?? this.messageJson,
|
||||
);
|
||||
ChatMessageData copyWith({
|
||||
String? messageId,
|
||||
String? chatId,
|
||||
String? orderKey,
|
||||
String? messageJson,
|
||||
}) => ChatMessageData(
|
||||
messageId: messageId ?? this.messageId,
|
||||
chatId: chatId ?? this.chatId,
|
||||
orderKey: orderKey ?? this.orderKey,
|
||||
messageJson: messageJson ?? this.messageJson,
|
||||
);
|
||||
ChatMessageData copyWithCompanion(ChatMessageCompanion data) {
|
||||
return ChatMessageData(
|
||||
messageId: data.messageId.present ? data.messageId.value : this.messageId,
|
||||
@@ -341,10 +390,10 @@ class ChatMessageCompanion extends UpdateCompanion<ChatMessageData> {
|
||||
required String orderKey,
|
||||
required String messageJson,
|
||||
this.rowid = const Value.absent(),
|
||||
}) : messageId = Value(messageId),
|
||||
chatId = Value(chatId),
|
||||
orderKey = Value(orderKey),
|
||||
messageJson = Value(messageJson);
|
||||
}) : messageId = Value(messageId),
|
||||
chatId = Value(chatId),
|
||||
orderKey = Value(orderKey),
|
||||
messageJson = Value(messageJson);
|
||||
static Insertable<ChatMessageData> custom({
|
||||
Expression<String>? messageId,
|
||||
Expression<String>? chatId,
|
||||
@@ -361,12 +410,13 @@ class ChatMessageCompanion extends UpdateCompanion<ChatMessageData> {
|
||||
});
|
||||
}
|
||||
|
||||
ChatMessageCompanion copyWith(
|
||||
{Value<String>? messageId,
|
||||
Value<String>? chatId,
|
||||
Value<String>? orderKey,
|
||||
Value<String>? messageJson,
|
||||
Value<int>? rowid}) {
|
||||
ChatMessageCompanion copyWith({
|
||||
Value<String>? messageId,
|
||||
Value<String>? chatId,
|
||||
Value<String>? orderKey,
|
||||
Value<String>? messageJson,
|
||||
Value<int>? rowid,
|
||||
}) {
|
||||
return ChatMessageCompanion(
|
||||
messageId: messageId ?? this.messageId,
|
||||
chatId: chatId ?? this.chatId,
|
||||
@@ -415,80 +465,79 @@ abstract class _$ChatDatabase extends GeneratedDatabase {
|
||||
$ChatDatabaseManager get managers => $ChatDatabaseManager(this);
|
||||
late final ChatData chatData = ChatData(this);
|
||||
late final ChatMessage chatMessage = ChatMessage(this);
|
||||
late final Index groupOrderIdx = Index('group_order_idx',
|
||||
'CREATE UNIQUE INDEX group_order_idx ON chat_message (chat_id, order_key)');
|
||||
late final Index groupOrderIdx = Index(
|
||||
'group_order_idx',
|
||||
'CREATE UNIQUE INDEX group_order_idx ON chat_message (chat_id, order_key)',
|
||||
);
|
||||
late final MessagesDao messagesDao = MessagesDao(this as ChatDatabase);
|
||||
late final MetadataDao metadataDao = MetadataDao(this as ChatDatabase);
|
||||
Selectable<String> leadingOrderKey(
|
||||
{required int bucket, required String chatId}) {
|
||||
Selectable<String> leadingOrderKey({
|
||||
required int bucket,
|
||||
required String chatId,
|
||||
}) {
|
||||
return customSelect(
|
||||
'SELECT lexo_rank_previous(?1, (SELECT order_key FROM chat_message WHERE chat_id = ?2 ORDER BY order_key LIMIT 1)) AS _c0',
|
||||
variables: [
|
||||
Variable<int>(bucket),
|
||||
Variable<String>(chatId)
|
||||
],
|
||||
readsFrom: {
|
||||
chatMessage,
|
||||
}).map((QueryRow row) => row.read<String>('_c0'));
|
||||
'SELECT lexo_rank_previous(?1, (SELECT order_key FROM chat_message WHERE chat_id = ?2 ORDER BY order_key LIMIT 1)) AS _c0',
|
||||
variables: [Variable<int>(bucket), Variable<String>(chatId)],
|
||||
readsFrom: {chatMessage},
|
||||
).map((QueryRow row) => row.read<String>('_c0'));
|
||||
}
|
||||
|
||||
Selectable<String> trailingOrderKey(
|
||||
{required int bucket, required String chatId}) {
|
||||
Selectable<String> trailingOrderKey({
|
||||
required int bucket,
|
||||
required String chatId,
|
||||
}) {
|
||||
return customSelect(
|
||||
'SELECT lexo_rank_next(?1, (SELECT order_key FROM chat_message WHERE chat_id = ?2 ORDER BY order_key DESC LIMIT 1)) AS _c0',
|
||||
variables: [
|
||||
Variable<int>(bucket),
|
||||
Variable<String>(chatId)
|
||||
],
|
||||
readsFrom: {
|
||||
chatMessage,
|
||||
}).map((QueryRow row) => row.read<String>('_c0'));
|
||||
'SELECT lexo_rank_next(?1, (SELECT order_key FROM chat_message WHERE chat_id = ?2 ORDER BY order_key DESC LIMIT 1)) AS _c0',
|
||||
variables: [Variable<int>(bucket), Variable<String>(chatId)],
|
||||
readsFrom: {chatMessage},
|
||||
).map((QueryRow row) => row.read<String>('_c0'));
|
||||
}
|
||||
|
||||
Selectable<String> orderKeyBeforeIndex(
|
||||
{required String chatId, required int rowIdx}) {
|
||||
Selectable<String> orderKeyBeforeIndex({
|
||||
required String chatId,
|
||||
required int rowIdx,
|
||||
}) {
|
||||
return customSelect(
|
||||
'WITH ordered_table AS (SELECT message_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, ROW_NUMBER()OVER (ORDER BY order_key RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE NO OTHERS) AS row_idx, COUNT(*)OVER (RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE NO OTHERS) AS total_rows FROM chat_message WHERE chat_id = ?1) SELECT lexo_rank_reorder_after(order_key, next_order_key) AS _c0 FROM ordered_table WHERE row_idx = MIN(?2, total_rows)',
|
||||
variables: [
|
||||
Variable<String>(chatId),
|
||||
Variable<int>(rowIdx)
|
||||
],
|
||||
readsFrom: {
|
||||
chatMessage,
|
||||
}).map((QueryRow row) => row.read<String>('_c0'));
|
||||
'WITH ordered_table AS (SELECT message_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, ROW_NUMBER()OVER (ORDER BY order_key RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE NO OTHERS) AS row_idx, COUNT(*)OVER (RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE NO OTHERS) AS total_rows FROM chat_message WHERE chat_id = ?1) SELECT lexo_rank_reorder_after(order_key, next_order_key) AS _c0 FROM ordered_table WHERE row_idx = MIN(?2, total_rows)',
|
||||
variables: [Variable<String>(chatId), Variable<int>(rowIdx)],
|
||||
readsFrom: {chatMessage},
|
||||
).map((QueryRow row) => row.read<String>('_c0'));
|
||||
}
|
||||
|
||||
Selectable<int> messageIndex(
|
||||
{required String chatId, required String messageId}) {
|
||||
Selectable<int> messageIndex({
|
||||
required String chatId,
|
||||
required String messageId,
|
||||
}) {
|
||||
return customSelect(
|
||||
'WITH ordered_table AS (SELECT message_id, ROW_NUMBER()OVER (ORDER BY order_key RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE NO OTHERS) AS row_idx FROM chat_message WHERE chat_id = ?1) SELECT row_idx FROM ordered_table WHERE message_id = ?2',
|
||||
variables: [
|
||||
Variable<String>(chatId),
|
||||
Variable<String>(messageId)
|
||||
],
|
||||
readsFrom: {
|
||||
chatMessage,
|
||||
}).map((QueryRow row) => row.read<int>('row_idx'));
|
||||
'WITH ordered_table AS (SELECT message_id, ROW_NUMBER()OVER (ORDER BY order_key RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE NO OTHERS) AS row_idx FROM chat_message WHERE chat_id = ?1) SELECT row_idx FROM ordered_table WHERE message_id = ?2',
|
||||
variables: [Variable<String>(chatId), Variable<String>(messageId)],
|
||||
readsFrom: {chatMessage},
|
||||
).map((QueryRow row) => row.read<int>('row_idx'));
|
||||
}
|
||||
|
||||
@override
|
||||
Iterable<TableInfo<Table, Object?>> get allTables =>
|
||||
allSchemaEntities.whereType<TableInfo<Table, Object?>>();
|
||||
@override
|
||||
List<DatabaseSchemaEntity> get allSchemaEntities =>
|
||||
[chatData, chatMessage, groupOrderIdx];
|
||||
List<DatabaseSchemaEntity> get allSchemaEntities => [
|
||||
chatData,
|
||||
chatMessage,
|
||||
groupOrderIdx,
|
||||
];
|
||||
}
|
||||
|
||||
typedef $ChatDataCreateCompanionBuilder = ChatDataCompanion Function({
|
||||
required String chatId,
|
||||
required ChatMetadata metadata,
|
||||
Value<int> rowid,
|
||||
});
|
||||
typedef $ChatDataUpdateCompanionBuilder = ChatDataCompanion Function({
|
||||
Value<String> chatId,
|
||||
Value<ChatMetadata> metadata,
|
||||
Value<int> rowid,
|
||||
});
|
||||
typedef $ChatDataCreateCompanionBuilder =
|
||||
ChatDataCompanion Function({
|
||||
required String chatId,
|
||||
required ChatMetadata metadata,
|
||||
Value<int> rowid,
|
||||
});
|
||||
typedef $ChatDataUpdateCompanionBuilder =
|
||||
ChatDataCompanion Function({
|
||||
Value<String> chatId,
|
||||
Value<ChatMetadata> metadata,
|
||||
Value<int> rowid,
|
||||
});
|
||||
|
||||
class $ChatDataFilterComposer extends Composer<_$ChatDatabase, ChatData> {
|
||||
$ChatDataFilterComposer({
|
||||
@@ -499,12 +548,15 @@ class $ChatDataFilterComposer extends Composer<_$ChatDatabase, ChatData> {
|
||||
super.$removeJoinBuilderFromRootComposer,
|
||||
});
|
||||
ColumnFilters<String> get chatId => $composableBuilder(
|
||||
column: $table.chatId, builder: (column) => ColumnFilters(column));
|
||||
column: $table.chatId,
|
||||
builder: (column) => ColumnFilters(column),
|
||||
);
|
||||
|
||||
ColumnWithTypeConverterFilters<ChatMetadata, ChatMetadata, String>
|
||||
get metadata => $composableBuilder(
|
||||
column: $table.metadata,
|
||||
builder: (column) => ColumnWithTypeConverterFilters(column));
|
||||
get metadata => $composableBuilder(
|
||||
column: $table.metadata,
|
||||
builder: (column) => ColumnWithTypeConverterFilters(column),
|
||||
);
|
||||
}
|
||||
|
||||
class $ChatDataOrderingComposer extends Composer<_$ChatDatabase, ChatData> {
|
||||
@@ -516,10 +568,14 @@ class $ChatDataOrderingComposer extends Composer<_$ChatDatabase, ChatData> {
|
||||
super.$removeJoinBuilderFromRootComposer,
|
||||
});
|
||||
ColumnOrderings<String> get chatId => $composableBuilder(
|
||||
column: $table.chatId, builder: (column) => ColumnOrderings(column));
|
||||
column: $table.chatId,
|
||||
builder: (column) => ColumnOrderings(column),
|
||||
);
|
||||
|
||||
ColumnOrderings<String> get metadata => $composableBuilder(
|
||||
column: $table.metadata, builder: (column) => ColumnOrderings(column));
|
||||
column: $table.metadata,
|
||||
builder: (column) => ColumnOrderings(column),
|
||||
);
|
||||
}
|
||||
|
||||
class $ChatDataAnnotationComposer extends Composer<_$ChatDatabase, ChatData> {
|
||||
@@ -537,81 +593,100 @@ class $ChatDataAnnotationComposer extends Composer<_$ChatDatabase, ChatData> {
|
||||
$composableBuilder(column: $table.metadata, builder: (column) => column);
|
||||
}
|
||||
|
||||
class $ChatDataTableManager extends RootTableManager<
|
||||
_$ChatDatabase,
|
||||
ChatData,
|
||||
ChatDataData,
|
||||
$ChatDataFilterComposer,
|
||||
$ChatDataOrderingComposer,
|
||||
$ChatDataAnnotationComposer,
|
||||
$ChatDataCreateCompanionBuilder,
|
||||
$ChatDataUpdateCompanionBuilder,
|
||||
(ChatDataData, BaseReferences<_$ChatDatabase, ChatData, ChatDataData>),
|
||||
ChatDataData,
|
||||
PrefetchHooks Function()> {
|
||||
class $ChatDataTableManager
|
||||
extends
|
||||
RootTableManager<
|
||||
_$ChatDatabase,
|
||||
ChatData,
|
||||
ChatDataData,
|
||||
$ChatDataFilterComposer,
|
||||
$ChatDataOrderingComposer,
|
||||
$ChatDataAnnotationComposer,
|
||||
$ChatDataCreateCompanionBuilder,
|
||||
$ChatDataUpdateCompanionBuilder,
|
||||
(
|
||||
ChatDataData,
|
||||
BaseReferences<_$ChatDatabase, ChatData, ChatDataData>,
|
||||
),
|
||||
ChatDataData,
|
||||
PrefetchHooks Function()
|
||||
> {
|
||||
$ChatDataTableManager(_$ChatDatabase db, ChatData table)
|
||||
: super(TableManagerState(
|
||||
: super(
|
||||
TableManagerState(
|
||||
db: db,
|
||||
table: table,
|
||||
createFilteringComposer: () =>
|
||||
$ChatDataFilterComposer($db: db, $table: table),
|
||||
createOrderingComposer: () =>
|
||||
$ChatDataOrderingComposer($db: db, $table: table),
|
||||
createComputedFieldComposer: () =>
|
||||
$ChatDataAnnotationComposer($db: db, $table: table),
|
||||
updateCompanionCallback: ({
|
||||
Value<String> chatId = const Value.absent(),
|
||||
Value<ChatMetadata> metadata = const Value.absent(),
|
||||
Value<int> rowid = const Value.absent(),
|
||||
}) =>
|
||||
ChatDataCompanion(
|
||||
chatId: chatId,
|
||||
metadata: metadata,
|
||||
rowid: rowid,
|
||||
),
|
||||
createCompanionCallback: ({
|
||||
required String chatId,
|
||||
required ChatMetadata metadata,
|
||||
Value<int> rowid = const Value.absent(),
|
||||
}) =>
|
||||
ChatDataCompanion.insert(
|
||||
chatId: chatId,
|
||||
metadata: metadata,
|
||||
rowid: rowid,
|
||||
),
|
||||
withReferenceMapper: (p0) => p0
|
||||
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
||||
.toList(),
|
||||
createFilteringComposer:
|
||||
() => $ChatDataFilterComposer($db: db, $table: table),
|
||||
createOrderingComposer:
|
||||
() => $ChatDataOrderingComposer($db: db, $table: table),
|
||||
createComputedFieldComposer:
|
||||
() => $ChatDataAnnotationComposer($db: db, $table: table),
|
||||
updateCompanionCallback:
|
||||
({
|
||||
Value<String> chatId = const Value.absent(),
|
||||
Value<ChatMetadata> metadata = const Value.absent(),
|
||||
Value<int> rowid = const Value.absent(),
|
||||
}) => ChatDataCompanion(
|
||||
chatId: chatId,
|
||||
metadata: metadata,
|
||||
rowid: rowid,
|
||||
),
|
||||
createCompanionCallback:
|
||||
({
|
||||
required String chatId,
|
||||
required ChatMetadata metadata,
|
||||
Value<int> rowid = const Value.absent(),
|
||||
}) => ChatDataCompanion.insert(
|
||||
chatId: chatId,
|
||||
metadata: metadata,
|
||||
rowid: rowid,
|
||||
),
|
||||
withReferenceMapper:
|
||||
(p0) =>
|
||||
p0
|
||||
.map(
|
||||
(e) => (
|
||||
e.readTable(table),
|
||||
BaseReferences(db, table, e),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
prefetchHooksCallback: null,
|
||||
));
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
typedef $ChatDataProcessedTableManager = ProcessedTableManager<
|
||||
_$ChatDatabase,
|
||||
ChatData,
|
||||
ChatDataData,
|
||||
$ChatDataFilterComposer,
|
||||
$ChatDataOrderingComposer,
|
||||
$ChatDataAnnotationComposer,
|
||||
$ChatDataCreateCompanionBuilder,
|
||||
$ChatDataUpdateCompanionBuilder,
|
||||
(ChatDataData, BaseReferences<_$ChatDatabase, ChatData, ChatDataData>),
|
||||
ChatDataData,
|
||||
PrefetchHooks Function()>;
|
||||
typedef $ChatMessageCreateCompanionBuilder = ChatMessageCompanion Function({
|
||||
required String messageId,
|
||||
required String chatId,
|
||||
required String orderKey,
|
||||
required String messageJson,
|
||||
Value<int> rowid,
|
||||
});
|
||||
typedef $ChatMessageUpdateCompanionBuilder = ChatMessageCompanion Function({
|
||||
Value<String> messageId,
|
||||
Value<String> chatId,
|
||||
Value<String> orderKey,
|
||||
Value<String> messageJson,
|
||||
Value<int> rowid,
|
||||
});
|
||||
typedef $ChatDataProcessedTableManager =
|
||||
ProcessedTableManager<
|
||||
_$ChatDatabase,
|
||||
ChatData,
|
||||
ChatDataData,
|
||||
$ChatDataFilterComposer,
|
||||
$ChatDataOrderingComposer,
|
||||
$ChatDataAnnotationComposer,
|
||||
$ChatDataCreateCompanionBuilder,
|
||||
$ChatDataUpdateCompanionBuilder,
|
||||
(ChatDataData, BaseReferences<_$ChatDatabase, ChatData, ChatDataData>),
|
||||
ChatDataData,
|
||||
PrefetchHooks Function()
|
||||
>;
|
||||
typedef $ChatMessageCreateCompanionBuilder =
|
||||
ChatMessageCompanion Function({
|
||||
required String messageId,
|
||||
required String chatId,
|
||||
required String orderKey,
|
||||
required String messageJson,
|
||||
Value<int> rowid,
|
||||
});
|
||||
typedef $ChatMessageUpdateCompanionBuilder =
|
||||
ChatMessageCompanion Function({
|
||||
Value<String> messageId,
|
||||
Value<String> chatId,
|
||||
Value<String> orderKey,
|
||||
Value<String> messageJson,
|
||||
Value<int> rowid,
|
||||
});
|
||||
|
||||
class $ChatMessageFilterComposer extends Composer<_$ChatDatabase, ChatMessage> {
|
||||
$ChatMessageFilterComposer({
|
||||
@@ -622,16 +697,24 @@ class $ChatMessageFilterComposer extends Composer<_$ChatDatabase, ChatMessage> {
|
||||
super.$removeJoinBuilderFromRootComposer,
|
||||
});
|
||||
ColumnFilters<String> get messageId => $composableBuilder(
|
||||
column: $table.messageId, builder: (column) => ColumnFilters(column));
|
||||
column: $table.messageId,
|
||||
builder: (column) => ColumnFilters(column),
|
||||
);
|
||||
|
||||
ColumnFilters<String> get chatId => $composableBuilder(
|
||||
column: $table.chatId, builder: (column) => ColumnFilters(column));
|
||||
column: $table.chatId,
|
||||
builder: (column) => ColumnFilters(column),
|
||||
);
|
||||
|
||||
ColumnFilters<String> get orderKey => $composableBuilder(
|
||||
column: $table.orderKey, builder: (column) => ColumnFilters(column));
|
||||
column: $table.orderKey,
|
||||
builder: (column) => ColumnFilters(column),
|
||||
);
|
||||
|
||||
ColumnFilters<String> get messageJson => $composableBuilder(
|
||||
column: $table.messageJson, builder: (column) => ColumnFilters(column));
|
||||
column: $table.messageJson,
|
||||
builder: (column) => ColumnFilters(column),
|
||||
);
|
||||
}
|
||||
|
||||
class $ChatMessageOrderingComposer
|
||||
@@ -644,16 +727,24 @@ class $ChatMessageOrderingComposer
|
||||
super.$removeJoinBuilderFromRootComposer,
|
||||
});
|
||||
ColumnOrderings<String> get messageId => $composableBuilder(
|
||||
column: $table.messageId, builder: (column) => ColumnOrderings(column));
|
||||
column: $table.messageId,
|
||||
builder: (column) => ColumnOrderings(column),
|
||||
);
|
||||
|
||||
ColumnOrderings<String> get chatId => $composableBuilder(
|
||||
column: $table.chatId, builder: (column) => ColumnOrderings(column));
|
||||
column: $table.chatId,
|
||||
builder: (column) => ColumnOrderings(column),
|
||||
);
|
||||
|
||||
ColumnOrderings<String> get orderKey => $composableBuilder(
|
||||
column: $table.orderKey, builder: (column) => ColumnOrderings(column));
|
||||
column: $table.orderKey,
|
||||
builder: (column) => ColumnOrderings(column),
|
||||
);
|
||||
|
||||
ColumnOrderings<String> get messageJson => $composableBuilder(
|
||||
column: $table.messageJson, builder: (column) => ColumnOrderings(column));
|
||||
column: $table.messageJson,
|
||||
builder: (column) => ColumnOrderings(column),
|
||||
);
|
||||
}
|
||||
|
||||
class $ChatMessageAnnotationComposer
|
||||
@@ -675,84 +766,100 @@ class $ChatMessageAnnotationComposer
|
||||
$composableBuilder(column: $table.orderKey, builder: (column) => column);
|
||||
|
||||
GeneratedColumn<String> get messageJson => $composableBuilder(
|
||||
column: $table.messageJson, builder: (column) => column);
|
||||
column: $table.messageJson,
|
||||
builder: (column) => column,
|
||||
);
|
||||
}
|
||||
|
||||
class $ChatMessageTableManager extends RootTableManager<
|
||||
_$ChatDatabase,
|
||||
ChatMessage,
|
||||
ChatMessageData,
|
||||
$ChatMessageFilterComposer,
|
||||
$ChatMessageOrderingComposer,
|
||||
$ChatMessageAnnotationComposer,
|
||||
$ChatMessageCreateCompanionBuilder,
|
||||
$ChatMessageUpdateCompanionBuilder,
|
||||
(
|
||||
ChatMessageData,
|
||||
BaseReferences<_$ChatDatabase, ChatMessage, ChatMessageData>
|
||||
),
|
||||
ChatMessageData,
|
||||
PrefetchHooks Function()> {
|
||||
class $ChatMessageTableManager
|
||||
extends
|
||||
RootTableManager<
|
||||
_$ChatDatabase,
|
||||
ChatMessage,
|
||||
ChatMessageData,
|
||||
$ChatMessageFilterComposer,
|
||||
$ChatMessageOrderingComposer,
|
||||
$ChatMessageAnnotationComposer,
|
||||
$ChatMessageCreateCompanionBuilder,
|
||||
$ChatMessageUpdateCompanionBuilder,
|
||||
(
|
||||
ChatMessageData,
|
||||
BaseReferences<_$ChatDatabase, ChatMessage, ChatMessageData>,
|
||||
),
|
||||
ChatMessageData,
|
||||
PrefetchHooks Function()
|
||||
> {
|
||||
$ChatMessageTableManager(_$ChatDatabase db, ChatMessage table)
|
||||
: super(TableManagerState(
|
||||
: super(
|
||||
TableManagerState(
|
||||
db: db,
|
||||
table: table,
|
||||
createFilteringComposer: () =>
|
||||
$ChatMessageFilterComposer($db: db, $table: table),
|
||||
createOrderingComposer: () =>
|
||||
$ChatMessageOrderingComposer($db: db, $table: table),
|
||||
createComputedFieldComposer: () =>
|
||||
$ChatMessageAnnotationComposer($db: db, $table: table),
|
||||
updateCompanionCallback: ({
|
||||
Value<String> messageId = const Value.absent(),
|
||||
Value<String> chatId = const Value.absent(),
|
||||
Value<String> orderKey = const Value.absent(),
|
||||
Value<String> messageJson = const Value.absent(),
|
||||
Value<int> rowid = const Value.absent(),
|
||||
}) =>
|
||||
ChatMessageCompanion(
|
||||
messageId: messageId,
|
||||
chatId: chatId,
|
||||
orderKey: orderKey,
|
||||
messageJson: messageJson,
|
||||
rowid: rowid,
|
||||
),
|
||||
createCompanionCallback: ({
|
||||
required String messageId,
|
||||
required String chatId,
|
||||
required String orderKey,
|
||||
required String messageJson,
|
||||
Value<int> rowid = const Value.absent(),
|
||||
}) =>
|
||||
ChatMessageCompanion.insert(
|
||||
messageId: messageId,
|
||||
chatId: chatId,
|
||||
orderKey: orderKey,
|
||||
messageJson: messageJson,
|
||||
rowid: rowid,
|
||||
),
|
||||
withReferenceMapper: (p0) => p0
|
||||
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
||||
.toList(),
|
||||
createFilteringComposer:
|
||||
() => $ChatMessageFilterComposer($db: db, $table: table),
|
||||
createOrderingComposer:
|
||||
() => $ChatMessageOrderingComposer($db: db, $table: table),
|
||||
createComputedFieldComposer:
|
||||
() => $ChatMessageAnnotationComposer($db: db, $table: table),
|
||||
updateCompanionCallback:
|
||||
({
|
||||
Value<String> messageId = const Value.absent(),
|
||||
Value<String> chatId = const Value.absent(),
|
||||
Value<String> orderKey = const Value.absent(),
|
||||
Value<String> messageJson = const Value.absent(),
|
||||
Value<int> rowid = const Value.absent(),
|
||||
}) => ChatMessageCompanion(
|
||||
messageId: messageId,
|
||||
chatId: chatId,
|
||||
orderKey: orderKey,
|
||||
messageJson: messageJson,
|
||||
rowid: rowid,
|
||||
),
|
||||
createCompanionCallback:
|
||||
({
|
||||
required String messageId,
|
||||
required String chatId,
|
||||
required String orderKey,
|
||||
required String messageJson,
|
||||
Value<int> rowid = const Value.absent(),
|
||||
}) => ChatMessageCompanion.insert(
|
||||
messageId: messageId,
|
||||
chatId: chatId,
|
||||
orderKey: orderKey,
|
||||
messageJson: messageJson,
|
||||
rowid: rowid,
|
||||
),
|
||||
withReferenceMapper:
|
||||
(p0) =>
|
||||
p0
|
||||
.map(
|
||||
(e) => (
|
||||
e.readTable(table),
|
||||
BaseReferences(db, table, e),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
prefetchHooksCallback: null,
|
||||
));
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
typedef $ChatMessageProcessedTableManager = ProcessedTableManager<
|
||||
_$ChatDatabase,
|
||||
ChatMessage,
|
||||
ChatMessageData,
|
||||
$ChatMessageFilterComposer,
|
||||
$ChatMessageOrderingComposer,
|
||||
$ChatMessageAnnotationComposer,
|
||||
$ChatMessageCreateCompanionBuilder,
|
||||
$ChatMessageUpdateCompanionBuilder,
|
||||
(
|
||||
typedef $ChatMessageProcessedTableManager =
|
||||
ProcessedTableManager<
|
||||
_$ChatDatabase,
|
||||
ChatMessage,
|
||||
ChatMessageData,
|
||||
BaseReferences<_$ChatDatabase, ChatMessage, ChatMessageData>
|
||||
),
|
||||
ChatMessageData,
|
||||
PrefetchHooks Function()>;
|
||||
$ChatMessageFilterComposer,
|
||||
$ChatMessageOrderingComposer,
|
||||
$ChatMessageAnnotationComposer,
|
||||
$ChatMessageCreateCompanionBuilder,
|
||||
$ChatMessageUpdateCompanionBuilder,
|
||||
(
|
||||
ChatMessageData,
|
||||
BaseReferences<_$ChatDatabase, ChatMessage, ChatMessageData>,
|
||||
),
|
||||
ChatMessageData,
|
||||
PrefetchHooks Function()
|
||||
>;
|
||||
|
||||
class $ChatDatabaseManager {
|
||||
final _$ChatDatabase _db;
|
||||
|
||||
@@ -7,9 +7,9 @@ part of 'chat_metadata.dart';
|
||||
// **************************************************************************
|
||||
|
||||
ChatMetadata _$ChatMetadataFromJson(Map<String, dynamic> json) => ChatMetadata(
|
||||
mainDocumentId: json['mainDocumentId'] as String?,
|
||||
contextId: json['contextId'] as String?,
|
||||
);
|
||||
mainDocumentId: json['mainDocumentId'] as String?,
|
||||
contextId: json['contextId'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ChatMetadataToJson(ChatMetadata instance) =>
|
||||
<String, dynamic>{
|
||||
|
||||
@@ -39,21 +39,15 @@ class ChatControllerFamily extends Family<DriftChatController> {
|
||||
const ChatControllerFamily();
|
||||
|
||||
/// See also [chatController].
|
||||
ChatControllerProvider call(
|
||||
String chatId,
|
||||
) {
|
||||
return ChatControllerProvider(
|
||||
chatId,
|
||||
);
|
||||
ChatControllerProvider call(String chatId) {
|
||||
return ChatControllerProvider(chatId);
|
||||
}
|
||||
|
||||
@override
|
||||
ChatControllerProvider getProviderOverride(
|
||||
covariant ChatControllerProvider provider,
|
||||
) {
|
||||
return call(
|
||||
provider.chatId,
|
||||
);
|
||||
return call(provider.chatId);
|
||||
}
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
||||
@@ -74,24 +68,20 @@ class ChatControllerFamily extends Family<DriftChatController> {
|
||||
/// See also [chatController].
|
||||
class ChatControllerProvider extends AutoDisposeProvider<DriftChatController> {
|
||||
/// See also [chatController].
|
||||
ChatControllerProvider(
|
||||
String chatId,
|
||||
) : this._internal(
|
||||
(ref) => chatController(
|
||||
ref as ChatControllerRef,
|
||||
chatId,
|
||||
),
|
||||
from: chatControllerProvider,
|
||||
name: r'chatControllerProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$chatControllerHash,
|
||||
dependencies: ChatControllerFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
ChatControllerFamily._allTransitiveDependencies,
|
||||
chatId: chatId,
|
||||
);
|
||||
ChatControllerProvider(String chatId)
|
||||
: this._internal(
|
||||
(ref) => chatController(ref as ChatControllerRef, chatId),
|
||||
from: chatControllerProvider,
|
||||
name: r'chatControllerProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$chatControllerHash,
|
||||
dependencies: ChatControllerFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
ChatControllerFamily._allTransitiveDependencies,
|
||||
chatId: chatId,
|
||||
);
|
||||
|
||||
ChatControllerProvider._internal(
|
||||
super._createNotifier, {
|
||||
@@ -170,21 +160,15 @@ class ChatMetadataFamily extends Family<AsyncValue<ChatMetadata?>> {
|
||||
const ChatMetadataFamily();
|
||||
|
||||
/// See also [chatMetadata].
|
||||
ChatMetadataProvider call(
|
||||
String chatId,
|
||||
) {
|
||||
return ChatMetadataProvider(
|
||||
chatId,
|
||||
);
|
||||
ChatMetadataProvider call(String chatId) {
|
||||
return ChatMetadataProvider(chatId);
|
||||
}
|
||||
|
||||
@override
|
||||
ChatMetadataProvider getProviderOverride(
|
||||
covariant ChatMetadataProvider provider,
|
||||
) {
|
||||
return call(
|
||||
provider.chatId,
|
||||
);
|
||||
return call(provider.chatId);
|
||||
}
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
||||
@@ -205,24 +189,20 @@ class ChatMetadataFamily extends Family<AsyncValue<ChatMetadata?>> {
|
||||
/// See also [chatMetadata].
|
||||
class ChatMetadataProvider extends AutoDisposeStreamProvider<ChatMetadata?> {
|
||||
/// See also [chatMetadata].
|
||||
ChatMetadataProvider(
|
||||
String chatId,
|
||||
) : this._internal(
|
||||
(ref) => chatMetadata(
|
||||
ref as ChatMetadataRef,
|
||||
chatId,
|
||||
),
|
||||
from: chatMetadataProvider,
|
||||
name: r'chatMetadataProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$chatMetadataHash,
|
||||
dependencies: ChatMetadataFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
ChatMetadataFamily._allTransitiveDependencies,
|
||||
chatId: chatId,
|
||||
);
|
||||
ChatMetadataProvider(String chatId)
|
||||
: this._internal(
|
||||
(ref) => chatMetadata(ref as ChatMetadataRef, chatId),
|
||||
from: chatMetadataProvider,
|
||||
name: r'chatMetadataProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$chatMetadataHash,
|
||||
dependencies: ChatMetadataFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
ChatMetadataFamily._allTransitiveDependencies,
|
||||
chatId: chatId,
|
||||
);
|
||||
|
||||
ChatMetadataProvider._internal(
|
||||
super._createNotifier, {
|
||||
@@ -288,5 +268,6 @@ class _ChatMetadataProviderElement
|
||||
@override
|
||||
String get chatId => (origin as ChatMetadataProvider).chatId;
|
||||
}
|
||||
|
||||
// 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
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:exceptions/exceptions.dart';
|
||||
import 'package:flutter_chat_core/flutter_chat_core.dart';
|
||||
import 'package:langchain/langchain.dart';
|
||||
import 'package:lensai/core/uuid.dart';
|
||||
import 'package:lensai/extensions/nullable.dart';
|
||||
import 'package:lensai/features/chat/features/chat_store/data/models/message_types.dart';
|
||||
import 'package:lensai/features/chat/features/chat_store/domain/controllers/drift_chat_controller.dart';
|
||||
import 'package:lensai/features/chat/features/chat_store/domain/providers.dart';
|
||||
@@ -44,7 +45,7 @@ class ChatMessageRepository extends _$ChatMessageRepository {
|
||||
);
|
||||
|
||||
await Future.wait(
|
||||
typingMessages.map((message) => _controller.remove(message)),
|
||||
typingMessages.map((message) => _controller.remove(message)).toList(),
|
||||
);
|
||||
|
||||
_isTyping.remove(author);
|
||||
@@ -56,7 +57,7 @@ class ChatMessageRepository extends _$ChatMessageRepository {
|
||||
required String content,
|
||||
List<AIChatMessageToolCall>? toolCalls,
|
||||
bool hideFromModelChatHistory = false,
|
||||
}) async {
|
||||
}) {
|
||||
final message = TextMessage(
|
||||
id: uuid.v4(),
|
||||
authorId: author.user.id,
|
||||
@@ -64,7 +65,7 @@ class ChatMessageRepository extends _$ChatMessageRepository {
|
||||
text: content,
|
||||
isOnlyEmoji: isOnlyEmoji(content),
|
||||
metadata:
|
||||
(hideFromModelChatHistory || (toolCalls?.isNotEmpty ?? false))
|
||||
(hideFromModelChatHistory || (toolCalls.isNotEmpty))
|
||||
? {
|
||||
'toolCalls': toolCalls?.map((tool) => tool.toMap()).toList(),
|
||||
if (hideFromModelChatHistory) 'hideFromModelChatHistory': true,
|
||||
|
||||
@@ -7,7 +7,7 @@ part of 'chat_message.dart';
|
||||
// **************************************************************************
|
||||
|
||||
String _$chatMessageRepositoryHash() =>
|
||||
r'a4144618b339f7c0c329a01a294b6bebbb648bf6';
|
||||
r'34055588fb83fd3d4a91219e96a0c5e961af5212';
|
||||
|
||||
/// Copied from Dart SDK
|
||||
class _SystemHash {
|
||||
@@ -34,9 +34,7 @@ abstract class _$ChatMessageRepository
|
||||
extends BuildlessAutoDisposeNotifier<void> {
|
||||
late final String chatId;
|
||||
|
||||
void build(
|
||||
String chatId,
|
||||
);
|
||||
void build(String chatId);
|
||||
}
|
||||
|
||||
/// See also [ChatMessageRepository].
|
||||
@@ -49,21 +47,15 @@ class ChatMessageRepositoryFamily extends Family<void> {
|
||||
const ChatMessageRepositoryFamily();
|
||||
|
||||
/// See also [ChatMessageRepository].
|
||||
ChatMessageRepositoryProvider call(
|
||||
String chatId,
|
||||
) {
|
||||
return ChatMessageRepositoryProvider(
|
||||
chatId,
|
||||
);
|
||||
ChatMessageRepositoryProvider call(String chatId) {
|
||||
return ChatMessageRepositoryProvider(chatId);
|
||||
}
|
||||
|
||||
@override
|
||||
ChatMessageRepositoryProvider getProviderOverride(
|
||||
covariant ChatMessageRepositoryProvider provider,
|
||||
) {
|
||||
return call(
|
||||
provider.chatId,
|
||||
);
|
||||
return call(provider.chatId);
|
||||
}
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
||||
@@ -85,21 +77,20 @@ class ChatMessageRepositoryFamily extends Family<void> {
|
||||
class ChatMessageRepositoryProvider
|
||||
extends AutoDisposeNotifierProviderImpl<ChatMessageRepository, void> {
|
||||
/// See also [ChatMessageRepository].
|
||||
ChatMessageRepositoryProvider(
|
||||
String chatId,
|
||||
) : this._internal(
|
||||
() => ChatMessageRepository()..chatId = chatId,
|
||||
from: chatMessageRepositoryProvider,
|
||||
name: r'chatMessageRepositoryProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$chatMessageRepositoryHash,
|
||||
dependencies: ChatMessageRepositoryFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
ChatMessageRepositoryFamily._allTransitiveDependencies,
|
||||
chatId: chatId,
|
||||
);
|
||||
ChatMessageRepositoryProvider(String chatId)
|
||||
: this._internal(
|
||||
() => ChatMessageRepository()..chatId = chatId,
|
||||
from: chatMessageRepositoryProvider,
|
||||
name: r'chatMessageRepositoryProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$chatMessageRepositoryHash,
|
||||
dependencies: ChatMessageRepositoryFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
ChatMessageRepositoryFamily._allTransitiveDependencies,
|
||||
chatId: chatId,
|
||||
);
|
||||
|
||||
ChatMessageRepositoryProvider._internal(
|
||||
super._createNotifier, {
|
||||
@@ -114,12 +105,8 @@ class ChatMessageRepositoryProvider
|
||||
final String chatId;
|
||||
|
||||
@override
|
||||
void runNotifierBuild(
|
||||
covariant ChatMessageRepository notifier,
|
||||
) {
|
||||
return notifier.build(
|
||||
chatId,
|
||||
);
|
||||
void runNotifierBuild(covariant ChatMessageRepository notifier) {
|
||||
return notifier.build(chatId);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -140,7 +127,7 @@ class ChatMessageRepositoryProvider
|
||||
|
||||
@override
|
||||
AutoDisposeNotifierProviderElement<ChatMessageRepository, void>
|
||||
createElement() {
|
||||
createElement() {
|
||||
return _ChatMessageRepositoryProviderElement(this);
|
||||
}
|
||||
|
||||
@@ -173,5 +160,6 @@ class _ChatMessageRepositoryProviderElement
|
||||
@override
|
||||
String get chatId => (origin as ChatMessageRepositoryProvider).chatId;
|
||||
}
|
||||
|
||||
// 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
|
||||
|
||||
+22
-34
@@ -34,9 +34,7 @@ abstract class _$ChatMetadataRepository
|
||||
extends BuildlessAutoDisposeNotifier<void> {
|
||||
late final String chatId;
|
||||
|
||||
void build(
|
||||
String chatId,
|
||||
);
|
||||
void build(String chatId);
|
||||
}
|
||||
|
||||
/// See also [ChatMetadataRepository].
|
||||
@@ -49,21 +47,15 @@ class ChatMetadataRepositoryFamily extends Family<void> {
|
||||
const ChatMetadataRepositoryFamily();
|
||||
|
||||
/// See also [ChatMetadataRepository].
|
||||
ChatMetadataRepositoryProvider call(
|
||||
String chatId,
|
||||
) {
|
||||
return ChatMetadataRepositoryProvider(
|
||||
chatId,
|
||||
);
|
||||
ChatMetadataRepositoryProvider call(String chatId) {
|
||||
return ChatMetadataRepositoryProvider(chatId);
|
||||
}
|
||||
|
||||
@override
|
||||
ChatMetadataRepositoryProvider getProviderOverride(
|
||||
covariant ChatMetadataRepositoryProvider provider,
|
||||
) {
|
||||
return call(
|
||||
provider.chatId,
|
||||
);
|
||||
return call(provider.chatId);
|
||||
}
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
||||
@@ -85,21 +77,20 @@ class ChatMetadataRepositoryFamily extends Family<void> {
|
||||
class ChatMetadataRepositoryProvider
|
||||
extends AutoDisposeNotifierProviderImpl<ChatMetadataRepository, void> {
|
||||
/// See also [ChatMetadataRepository].
|
||||
ChatMetadataRepositoryProvider(
|
||||
String chatId,
|
||||
) : this._internal(
|
||||
() => ChatMetadataRepository()..chatId = chatId,
|
||||
from: chatMetadataRepositoryProvider,
|
||||
name: r'chatMetadataRepositoryProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$chatMetadataRepositoryHash,
|
||||
dependencies: ChatMetadataRepositoryFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
ChatMetadataRepositoryFamily._allTransitiveDependencies,
|
||||
chatId: chatId,
|
||||
);
|
||||
ChatMetadataRepositoryProvider(String chatId)
|
||||
: this._internal(
|
||||
() => ChatMetadataRepository()..chatId = chatId,
|
||||
from: chatMetadataRepositoryProvider,
|
||||
name: r'chatMetadataRepositoryProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$chatMetadataRepositoryHash,
|
||||
dependencies: ChatMetadataRepositoryFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
ChatMetadataRepositoryFamily._allTransitiveDependencies,
|
||||
chatId: chatId,
|
||||
);
|
||||
|
||||
ChatMetadataRepositoryProvider._internal(
|
||||
super._createNotifier, {
|
||||
@@ -114,12 +105,8 @@ class ChatMetadataRepositoryProvider
|
||||
final String chatId;
|
||||
|
||||
@override
|
||||
void runNotifierBuild(
|
||||
covariant ChatMetadataRepository notifier,
|
||||
) {
|
||||
return notifier.build(
|
||||
chatId,
|
||||
);
|
||||
void runNotifierBuild(covariant ChatMetadataRepository notifier) {
|
||||
return notifier.build(chatId);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -140,7 +127,7 @@ class ChatMetadataRepositoryProvider
|
||||
|
||||
@override
|
||||
AutoDisposeNotifierProviderElement<ChatMetadataRepository, void>
|
||||
createElement() {
|
||||
createElement() {
|
||||
return _ChatMetadataRepositoryProviderElement(this);
|
||||
}
|
||||
|
||||
@@ -173,5 +160,6 @@ class _ChatMetadataRepositoryProviderElement
|
||||
@override
|
||||
String get chatId => (origin as ChatMetadataRepositoryProvider).chatId;
|
||||
}
|
||||
|
||||
// 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
|
||||
|
||||
@@ -13,14 +13,15 @@ String _$bottomSheetControllerHash() =>
|
||||
@ProviderFor(BottomSheetController)
|
||||
final bottomSheetControllerProvider =
|
||||
AutoDisposeNotifierProvider<BottomSheetController, Sheet?>.internal(
|
||||
BottomSheetController.new,
|
||||
name: r'bottomSheetControllerProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bottomSheetControllerHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
BottomSheetController.new,
|
||||
name: r'bottomSheetControllerProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bottomSheetControllerHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$BottomSheetController = AutoDisposeNotifier<Sheet?>;
|
||||
String _$bottomSheetExtendHash() => r'7e11b9047c15bdeb4dfcb488a8573daadb64e25c';
|
||||
@@ -29,14 +30,15 @@ String _$bottomSheetExtendHash() => r'7e11b9047c15bdeb4dfcb488a8573daadb64e25c';
|
||||
@ProviderFor(BottomSheetExtend)
|
||||
final bottomSheetExtendProvider =
|
||||
StreamNotifierProvider<BottomSheetExtend, double>.internal(
|
||||
BottomSheetExtend.new,
|
||||
name: r'bottomSheetExtendProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bottomSheetExtendHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
BottomSheetExtend.new,
|
||||
name: r'bottomSheetExtendProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bottomSheetExtendHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$BottomSheetExtend = StreamNotifier<double>;
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
@@ -12,14 +12,15 @@ String _$overlayControllerHash() => r'b6dc3ca17611c4efadc7e8248d493cd3c7061e01';
|
||||
@ProviderFor(OverlayController)
|
||||
final overlayControllerProvider =
|
||||
AutoDisposeNotifierProvider<OverlayController, Widget?>.internal(
|
||||
OverlayController.new,
|
||||
name: r'overlayControllerProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$overlayControllerHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
OverlayController.new,
|
||||
name: r'overlayControllerProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$overlayControllerHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$OverlayController = AutoDisposeNotifier<Widget?>;
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
@@ -106,7 +106,6 @@ class _$TabStateCWProxyImpl implements _$TabStateCWProxy {
|
||||
this(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.
|
||||
///
|
||||
/// Usage
|
||||
@@ -130,58 +129,71 @@ class _$TabStateCWProxyImpl implements _$TabStateCWProxy {
|
||||
}) {
|
||||
return TabState(
|
||||
id: _value.id,
|
||||
contextId: contextId == const $CopyWithPlaceholder()
|
||||
? _value.contextId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: contextId as String?,
|
||||
url: url == const $CopyWithPlaceholder()
|
||||
? _value.url
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: url as Uri,
|
||||
title: title == const $CopyWithPlaceholder()
|
||||
? _value.title
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: title as String,
|
||||
icon: icon == const $CopyWithPlaceholder()
|
||||
? _value.icon
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: icon as EquatableImage?,
|
||||
thumbnail: thumbnail == const $CopyWithPlaceholder()
|
||||
? _value.thumbnail
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: thumbnail as EquatableImage?,
|
||||
progress: progress == const $CopyWithPlaceholder()
|
||||
? _value.progress
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: progress as int,
|
||||
isPrivate: isPrivate == const $CopyWithPlaceholder()
|
||||
? _value.isPrivate
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: isPrivate as bool,
|
||||
isFullScreen: isFullScreen == const $CopyWithPlaceholder()
|
||||
? _value.isFullScreen
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: isFullScreen as bool,
|
||||
isLoading: isLoading == const $CopyWithPlaceholder()
|
||||
? _value.isLoading
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: isLoading as bool,
|
||||
securityInfoState: securityInfoState == const $CopyWithPlaceholder()
|
||||
? _value.securityInfoState
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: securityInfoState as SecurityState,
|
||||
historyState: historyState == const $CopyWithPlaceholder()
|
||||
? _value.historyState
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: historyState as HistoryState,
|
||||
readerableState: readerableState == const $CopyWithPlaceholder()
|
||||
? _value.readerableState
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: readerableState as ReaderableState,
|
||||
findResultState: findResultState == const $CopyWithPlaceholder()
|
||||
? _value.findResultState
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: findResultState as FindResultState,
|
||||
contextId:
|
||||
contextId == const $CopyWithPlaceholder()
|
||||
? _value.contextId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: contextId as String?,
|
||||
url:
|
||||
url == const $CopyWithPlaceholder()
|
||||
? _value.url
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: url as Uri,
|
||||
title:
|
||||
title == const $CopyWithPlaceholder()
|
||||
? _value.title
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: title as String,
|
||||
icon:
|
||||
icon == const $CopyWithPlaceholder()
|
||||
? _value.icon
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: icon as EquatableImage?,
|
||||
thumbnail:
|
||||
thumbnail == const $CopyWithPlaceholder()
|
||||
? _value.thumbnail
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: thumbnail as EquatableImage?,
|
||||
progress:
|
||||
progress == const $CopyWithPlaceholder()
|
||||
? _value.progress
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: progress as int,
|
||||
isPrivate:
|
||||
isPrivate == const $CopyWithPlaceholder()
|
||||
? _value.isPrivate
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: isPrivate as bool,
|
||||
isFullScreen:
|
||||
isFullScreen == const $CopyWithPlaceholder()
|
||||
? _value.isFullScreen
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: isFullScreen as bool,
|
||||
isLoading:
|
||||
isLoading == const $CopyWithPlaceholder()
|
||||
? _value.isLoading
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: isLoading as bool,
|
||||
securityInfoState:
|
||||
securityInfoState == const $CopyWithPlaceholder()
|
||||
? _value.securityInfoState
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: securityInfoState as SecurityState,
|
||||
historyState:
|
||||
historyState == const $CopyWithPlaceholder()
|
||||
? _value.historyState
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: historyState as HistoryState,
|
||||
readerableState:
|
||||
readerableState == const $CopyWithPlaceholder()
|
||||
? _value.readerableState
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: readerableState as ReaderableState,
|
||||
findResultState:
|
||||
findResultState == const $CopyWithPlaceholder()
|
||||
? _value.findResultState
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: findResultState as FindResultState,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,6 @@ class _$WebExtensionStateCWProxyImpl implements _$WebExtensionStateCWProxy {
|
||||
WebExtensionState icon(EquatableImage? icon) => this(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.
|
||||
///
|
||||
/// Usage
|
||||
@@ -86,34 +85,41 @@ class _$WebExtensionStateCWProxyImpl implements _$WebExtensionStateCWProxy {
|
||||
Object? icon = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return WebExtensionState(
|
||||
extensionId: extensionId == const $CopyWithPlaceholder()
|
||||
? _value.extensionId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: extensionId as String,
|
||||
enabled: enabled == const $CopyWithPlaceholder()
|
||||
? _value.enabled
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: enabled as bool,
|
||||
title: title == const $CopyWithPlaceholder()
|
||||
? _value.title
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: title as String?,
|
||||
badgeText: badgeText == const $CopyWithPlaceholder()
|
||||
? _value.badgeText
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: badgeText as String?,
|
||||
badgeTextColor: badgeTextColor == const $CopyWithPlaceholder()
|
||||
? _value.badgeTextColor
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: badgeTextColor as Color?,
|
||||
badgeBackgroundColor: badgeBackgroundColor == const $CopyWithPlaceholder()
|
||||
? _value.badgeBackgroundColor
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: badgeBackgroundColor as Color?,
|
||||
icon: icon == const $CopyWithPlaceholder()
|
||||
? _value.icon
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: icon as EquatableImage?,
|
||||
extensionId:
|
||||
extensionId == const $CopyWithPlaceholder()
|
||||
? _value.extensionId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: extensionId as String,
|
||||
enabled:
|
||||
enabled == const $CopyWithPlaceholder()
|
||||
? _value.enabled
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: enabled as bool,
|
||||
title:
|
||||
title == const $CopyWithPlaceholder()
|
||||
? _value.title
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: title as String?,
|
||||
badgeText:
|
||||
badgeText == const $CopyWithPlaceholder()
|
||||
? _value.badgeText
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: badgeText as String?,
|
||||
badgeTextColor:
|
||||
badgeTextColor == const $CopyWithPlaceholder()
|
||||
? _value.badgeTextColor
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: badgeTextColor as Color?,
|
||||
badgeBackgroundColor:
|
||||
badgeBackgroundColor == const $CopyWithPlaceholder()
|
||||
? _value.badgeBackgroundColor
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: badgeBackgroundColor as Color?,
|
||||
icon:
|
||||
icon == const $CopyWithPlaceholder()
|
||||
? _value.icon
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: icon as EquatableImage?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'dart:async';
|
||||
import 'package:flutter_mozilla_components/flutter_mozilla_components.dart';
|
||||
import 'package:lensai/core/logger.dart';
|
||||
import 'package:lensai/features/bangs/domain/providers/bangs.dart';
|
||||
import 'package:lensai/features/geckoview/domain/providers/selected_tab.dart';
|
||||
import 'package:lensai/features/geckoview/domain/repositories/tab.dart';
|
||||
import 'package:riverpod/riverpod.dart';
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
@@ -23,26 +24,31 @@ GeckoSelectionActionService selectionActionService(Ref ref) {
|
||||
);
|
||||
|
||||
if (defaultSearchBang != null) {
|
||||
await ref
|
||||
.read(tabRepositoryProvider.notifier)
|
||||
.addTab(url: defaultSearchBang.getUrl(text));
|
||||
} else {
|
||||
logger.e('No default search bang found');
|
||||
}
|
||||
}),
|
||||
PrivateSearchAction((text) async {
|
||||
final defaultSearchBang = await ref.read(
|
||||
defaultSearchBangDataProvider.future,
|
||||
);
|
||||
final currentTabId = ref.read(selectedTabProvider);
|
||||
|
||||
if (defaultSearchBang != null) {
|
||||
await ref
|
||||
.read(tabRepositoryProvider.notifier)
|
||||
.addTab(url: defaultSearchBang.getUrl(text), private: true);
|
||||
.addTab(
|
||||
url: defaultSearchBang.getUrl(text),
|
||||
parentId: currentTabId,
|
||||
);
|
||||
} else {
|
||||
logger.e('No default search bang found');
|
||||
}
|
||||
}),
|
||||
// PrivateSearchAction((text) async {
|
||||
// final defaultSearchBang = await ref.read(
|
||||
// defaultSearchBangDataProvider.future,
|
||||
// );
|
||||
|
||||
// if (defaultSearchBang != null) {
|
||||
// await ref
|
||||
// .read(tabRepositoryProvider.notifier)
|
||||
// .addTab(url: defaultSearchBang.getUrl(text), private: true);
|
||||
// } else {
|
||||
// logger.e('No default search bang found');
|
||||
// }
|
||||
// }),
|
||||
ShareAction((text) async {
|
||||
await Share.share(text);
|
||||
}),
|
||||
|
||||
@@ -7,20 +7,21 @@ part of 'providers.dart';
|
||||
// **************************************************************************
|
||||
|
||||
String _$selectionActionServiceHash() =>
|
||||
r'd0c04262171976c21441297706273417e3d79b67';
|
||||
r'8d0af53213bdb924bcf5f8df6ceec6c81a345345';
|
||||
|
||||
/// See also [selectionActionService].
|
||||
@ProviderFor(selectionActionService)
|
||||
final selectionActionServiceProvider =
|
||||
Provider<GeckoSelectionActionService>.internal(
|
||||
selectionActionService,
|
||||
name: r'selectionActionServiceProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$selectionActionServiceHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
selectionActionService,
|
||||
name: r'selectionActionServiceProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$selectionActionServiceHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
@@ -64,9 +65,10 @@ String _$tabContentServiceHash() => r'd9a991add907ecc138c62790883e59d8e9aa9266';
|
||||
final tabContentServiceProvider = Provider<GeckoTabContentService>.internal(
|
||||
tabContentService,
|
||||
name: r'tabContentServiceProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$tabContentServiceHash,
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$tabContentServiceHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
@@ -81,14 +83,15 @@ String _$engineSuggestionsServiceHash() =>
|
||||
@ProviderFor(engineSuggestionsService)
|
||||
final engineSuggestionsServiceProvider =
|
||||
Provider<GeckoSuggestionsService>.internal(
|
||||
engineSuggestionsService,
|
||||
name: r'engineSuggestionsServiceProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$engineSuggestionsServiceHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
engineSuggestionsService,
|
||||
name: r'engineSuggestionsServiceProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$engineSuggestionsServiceHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
@@ -99,14 +102,15 @@ String _$engineReadyStateHash() => r'c682333e2e07cf0635aa7ae793a2088ca648c950';
|
||||
@ProviderFor(EngineReadyState)
|
||||
final engineReadyStateProvider =
|
||||
NotifierProvider<EngineReadyState, bool>.internal(
|
||||
EngineReadyState.new,
|
||||
name: r'engineReadyStateProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$engineReadyStateHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
EngineReadyState.new,
|
||||
name: r'engineReadyStateProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$engineReadyStateHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$EngineReadyState = Notifier<bool>;
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
@@ -21,7 +21,7 @@ class SelectedTab extends _$SelectedTab {
|
||||
}
|
||||
});
|
||||
|
||||
final selectedTabSub = eventSerivce.selectedTabEvents.listen((tabId) async {
|
||||
final selectedTabSub = eventSerivce.selectedTabEvents.listen((tabId) {
|
||||
state = tabId;
|
||||
});
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ part of 'selected_tab.dart';
|
||||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$selectedTabHash() => r'f550ac5b471bab8f8e5d75ef4d7669cde769db9a';
|
||||
String _$selectedTabHash() => r'250f54fe9a56d14876e0979e5370eb76879da11c';
|
||||
|
||||
/// See also [SelectedTab].
|
||||
@ProviderFor(SelectedTab)
|
||||
|
||||
@@ -22,7 +22,7 @@ class TabList extends _$TabList {
|
||||
}
|
||||
});
|
||||
|
||||
final tabListSub = eventService.tabListEvents.listen((tabs) async {
|
||||
final tabListSub = eventService.tabListEvents.listen((tabs) {
|
||||
final equatableTabs = EquatableCollection(tabs, immutable: true);
|
||||
|
||||
if (equatableTabs != state) {
|
||||
|
||||
@@ -6,19 +6,19 @@ part of 'tab_list.dart';
|
||||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$tabListHash() => r'bb8b6cca42a8aace8bd9808fdeac4fe4965ac867';
|
||||
String _$tabListHash() => r'cdcbfd9c12e06f350d8284d48c81826b3aa57b6d';
|
||||
|
||||
/// See also [TabList].
|
||||
@ProviderFor(TabList)
|
||||
final tabListProvider =
|
||||
NotifierProvider<TabList, EquatableCollection<List<String>>>.internal(
|
||||
TabList.new,
|
||||
name: r'tabListProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product') ? null : _$tabListHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
TabList.new,
|
||||
name: r'tabListProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product') ? null : _$tabListHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$TabList = Notifier<EquatableCollection<List<String>>>;
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
@@ -13,14 +13,15 @@ String _$selectedTabSessionNotifierHash() =>
|
||||
@ProviderFor(selectedTabSessionNotifier)
|
||||
final selectedTabSessionNotifierProvider =
|
||||
AutoDisposeProvider<Raw<TabSession>>.internal(
|
||||
selectedTabSessionNotifier,
|
||||
name: r'selectedTabSessionNotifierProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$selectedTabSessionNotifierHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
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
|
||||
@@ -51,9 +52,7 @@ class _SystemHash {
|
||||
abstract class _$TabSession extends BuildlessAutoDisposeNotifier<void> {
|
||||
late final String? tabId;
|
||||
|
||||
void build({
|
||||
required String? tabId,
|
||||
});
|
||||
void build({required String? tabId});
|
||||
}
|
||||
|
||||
/// See also [TabSession].
|
||||
@@ -66,21 +65,15 @@ class TabSessionFamily extends Family<void> {
|
||||
const TabSessionFamily();
|
||||
|
||||
/// See also [TabSession].
|
||||
TabSessionProvider call({
|
||||
required String? tabId,
|
||||
}) {
|
||||
return TabSessionProvider(
|
||||
tabId: tabId,
|
||||
);
|
||||
TabSessionProvider call({required String? tabId}) {
|
||||
return TabSessionProvider(tabId: tabId);
|
||||
}
|
||||
|
||||
@override
|
||||
TabSessionProvider getProviderOverride(
|
||||
covariant TabSessionProvider provider,
|
||||
) {
|
||||
return call(
|
||||
tabId: provider.tabId,
|
||||
);
|
||||
return call(tabId: provider.tabId);
|
||||
}
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
||||
@@ -102,21 +95,19 @@ class TabSessionFamily extends Family<void> {
|
||||
class TabSessionProvider
|
||||
extends AutoDisposeNotifierProviderImpl<TabSession, void> {
|
||||
/// 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({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, {
|
||||
@@ -131,12 +122,8 @@ class TabSessionProvider
|
||||
final String? tabId;
|
||||
|
||||
@override
|
||||
void runNotifierBuild(
|
||||
covariant TabSession notifier,
|
||||
) {
|
||||
return notifier.build(
|
||||
tabId: tabId,
|
||||
);
|
||||
void runNotifierBuild(covariant TabSession notifier) {
|
||||
return notifier.build(tabId: tabId);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -189,5 +176,6 @@ class _TabSessionProviderElement
|
||||
@override
|
||||
String? get tabId => (origin as TabSessionProvider).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
|
||||
|
||||
@@ -126,7 +126,7 @@ class TabStates extends _$TabStates {
|
||||
final eventService = ref.watch(eventServiceProvider);
|
||||
|
||||
final subscriptions = [
|
||||
eventService.tabContentEvents.listen((event) async {
|
||||
eventService.tabContentEvents.listen((event) {
|
||||
_onTabContentStateChange(event);
|
||||
}),
|
||||
eventService.iconChangeEvents.listen((event) async {
|
||||
@@ -135,16 +135,16 @@ class TabStates extends _$TabStates {
|
||||
eventService.thumbnailEvents.listen((event) async {
|
||||
await _onThumbnailChange(event);
|
||||
}),
|
||||
eventService.securityInfoEvents.listen((event) async {
|
||||
eventService.securityInfoEvents.listen((event) {
|
||||
_onSecurityInfoStateChange(event);
|
||||
}),
|
||||
eventService.historyEvents.listen((event) async {
|
||||
eventService.historyEvents.listen((event) {
|
||||
_onHistoryStateChange(event);
|
||||
}),
|
||||
eventService.readerableEvents.listen((event) async {
|
||||
eventService.readerableEvents.listen((event) {
|
||||
_onReaderableStateChange(event);
|
||||
}),
|
||||
eventService.findResultsEvent.listen((event) async {
|
||||
eventService.findResultsEvent.listen((event) {
|
||||
_onFindResultsChange(event);
|
||||
}),
|
||||
];
|
||||
|
||||
@@ -39,21 +39,13 @@ class TabStateFamily extends Family<TabState?> {
|
||||
const TabStateFamily();
|
||||
|
||||
/// See also [tabState].
|
||||
TabStateProvider call(
|
||||
String? tabId,
|
||||
) {
|
||||
return TabStateProvider(
|
||||
tabId,
|
||||
);
|
||||
TabStateProvider call(String? tabId) {
|
||||
return TabStateProvider(tabId);
|
||||
}
|
||||
|
||||
@override
|
||||
TabStateProvider getProviderOverride(
|
||||
covariant TabStateProvider provider,
|
||||
) {
|
||||
return call(
|
||||
provider.tabId,
|
||||
);
|
||||
TabStateProvider getProviderOverride(covariant TabStateProvider provider) {
|
||||
return call(provider.tabId);
|
||||
}
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
||||
@@ -74,23 +66,19 @@ class TabStateFamily extends Family<TabState?> {
|
||||
/// See also [tabState].
|
||||
class TabStateProvider extends AutoDisposeProvider<TabState?> {
|
||||
/// 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,
|
||||
);
|
||||
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,
|
||||
);
|
||||
|
||||
TabStateProvider._internal(
|
||||
super._createNotifier, {
|
||||
@@ -105,9 +93,7 @@ class TabStateProvider extends AutoDisposeProvider<TabState?> {
|
||||
final String? tabId;
|
||||
|
||||
@override
|
||||
Override overrideWith(
|
||||
TabState? Function(TabStateRef provider) create,
|
||||
) {
|
||||
Override overrideWith(TabState? Function(TabStateRef provider) create) {
|
||||
return ProviderOverride(
|
||||
origin: this,
|
||||
override: TabStateProvider._internal(
|
||||
@@ -163,9 +149,10 @@ String _$selectedTabStateHash() => r'dbd36af7af286bd9d079f30e8e11bbda23bf7728';
|
||||
final selectedTabStateProvider = AutoDisposeProvider<TabState?>.internal(
|
||||
selectedTabState,
|
||||
name: r'selectedTabStateProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$selectedTabStateHash,
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$selectedTabStateHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
@@ -173,19 +160,21 @@ final selectedTabStateProvider = AutoDisposeProvider<TabState?>.internal(
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
typedef SelectedTabStateRef = AutoDisposeProviderRef<TabState?>;
|
||||
String _$tabStatesHash() => r'2f4af9df4d648f7fb940f02e14f4a6762bb21d8a';
|
||||
String _$tabStatesHash() => r'b136dbf6d68b67f0fe0db302a4147b67789db853';
|
||||
|
||||
/// See also [TabStates].
|
||||
@ProviderFor(TabStates)
|
||||
final tabStatesProvider =
|
||||
NotifierProvider<TabStates, Map<String, TabState>>.internal(
|
||||
TabStates.new,
|
||||
name: r'tabStatesProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product') ? null : _$tabStatesHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
TabStates.new,
|
||||
name: r'tabStatesProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$tabStatesHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$TabStates = Notifier<Map<String, TabState>>;
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
@@ -69,7 +69,7 @@ class WebExtensionsState extends _$WebExtensionsState {
|
||||
|
||||
final subscriptions = switch (actionType) {
|
||||
WebExtensionActionType.browser => [
|
||||
addonService.browserExtensionStream.listen((event) async {
|
||||
addonService.browserExtensionStream.listen((event) {
|
||||
_onExtensionUpdate(event);
|
||||
}),
|
||||
addonService.browserIconStream.listen((event) async {
|
||||
@@ -77,7 +77,7 @@ class WebExtensionsState extends _$WebExtensionsState {
|
||||
}),
|
||||
],
|
||||
WebExtensionActionType.page => [
|
||||
addonService.pageExtensionStream.listen((event) async {
|
||||
addonService.pageExtensionStream.listen((event) {
|
||||
_onExtensionUpdate(event);
|
||||
}),
|
||||
addonService.pageIconStream.listen((event) async {
|
||||
|
||||
@@ -7,7 +7,7 @@ part of 'web_extensions_state.dart';
|
||||
// **************************************************************************
|
||||
|
||||
String _$webExtensionsStateHash() =>
|
||||
r'9382461e7e72c31946a5308642baaac307977a15';
|
||||
r'eab924e9c17e805a3c29065289be5d1c8ffe3bc9';
|
||||
|
||||
/// Copied from Dart SDK
|
||||
class _SystemHash {
|
||||
@@ -34,9 +34,7 @@ abstract class _$WebExtensionsState
|
||||
extends BuildlessNotifier<Map<String, WebExtensionState>> {
|
||||
late final WebExtensionActionType actionType;
|
||||
|
||||
Map<String, WebExtensionState> build(
|
||||
WebExtensionActionType actionType,
|
||||
);
|
||||
Map<String, WebExtensionState> build(WebExtensionActionType actionType);
|
||||
}
|
||||
|
||||
/// See also [WebExtensionsState].
|
||||
@@ -49,21 +47,15 @@ class WebExtensionsStateFamily extends Family<Map<String, WebExtensionState>> {
|
||||
const WebExtensionsStateFamily();
|
||||
|
||||
/// See also [WebExtensionsState].
|
||||
WebExtensionsStateProvider call(
|
||||
WebExtensionActionType actionType,
|
||||
) {
|
||||
return WebExtensionsStateProvider(
|
||||
actionType,
|
||||
);
|
||||
WebExtensionsStateProvider call(WebExtensionActionType actionType) {
|
||||
return WebExtensionsStateProvider(actionType);
|
||||
}
|
||||
|
||||
@override
|
||||
WebExtensionsStateProvider getProviderOverride(
|
||||
covariant WebExtensionsStateProvider provider,
|
||||
) {
|
||||
return call(
|
||||
provider.actionType,
|
||||
);
|
||||
return call(provider.actionType);
|
||||
}
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
||||
@@ -82,24 +74,27 @@ class WebExtensionsStateFamily extends Family<Map<String, WebExtensionState>> {
|
||||
}
|
||||
|
||||
/// See also [WebExtensionsState].
|
||||
class WebExtensionsStateProvider extends NotifierProviderImpl<
|
||||
WebExtensionsState, Map<String, WebExtensionState>> {
|
||||
class WebExtensionsStateProvider
|
||||
extends
|
||||
NotifierProviderImpl<
|
||||
WebExtensionsState,
|
||||
Map<String, WebExtensionState>
|
||||
> {
|
||||
/// 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(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, {
|
||||
@@ -117,9 +112,7 @@ class WebExtensionsStateProvider extends NotifierProviderImpl<
|
||||
Map<String, WebExtensionState> runNotifierBuild(
|
||||
covariant WebExtensionsState notifier,
|
||||
) {
|
||||
return notifier.build(
|
||||
actionType,
|
||||
);
|
||||
return notifier.build(actionType);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -140,7 +133,7 @@ class WebExtensionsStateProvider extends NotifierProviderImpl<
|
||||
|
||||
@override
|
||||
NotifierProviderElement<WebExtensionsState, Map<String, WebExtensionState>>
|
||||
createElement() {
|
||||
createElement() {
|
||||
return _WebExtensionsStateProviderElement(this);
|
||||
}
|
||||
|
||||
@@ -167,14 +160,19 @@ mixin WebExtensionsStateRef
|
||||
WebExtensionActionType get actionType;
|
||||
}
|
||||
|
||||
class _WebExtensionsStateProviderElement extends NotifierProviderElement<
|
||||
WebExtensionsState,
|
||||
Map<String, WebExtensionState>> with WebExtensionsStateRef {
|
||||
class _WebExtensionsStateProviderElement
|
||||
extends
|
||||
NotifierProviderElement<
|
||||
WebExtensionsState,
|
||||
Map<String, WebExtensionState>
|
||||
>
|
||||
with WebExtensionsStateRef {
|
||||
_WebExtensionsStateProviderElement(super.provider);
|
||||
|
||||
@override
|
||||
WebExtensionActionType get actionType =>
|
||||
(origin as WebExtensionsStateProvider).actionType;
|
||||
}
|
||||
|
||||
// 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
|
||||
|
||||
@@ -140,7 +140,7 @@ class TabRepository extends _$TabRepository {
|
||||
final tabStateDebouncer = Debouncer(const Duration(seconds: 3));
|
||||
Map<String, TabState>? debounceStartValue;
|
||||
|
||||
ref.listen(tabStatesProvider, (previous, next) async {
|
||||
ref.listen(tabStatesProvider, (previous, next) {
|
||||
//Since state changes occure pretty often and our map always contains
|
||||
//the latest state, we cache the value before starting debouncing and
|
||||
//later diff to that, to avoid frequent database writes
|
||||
|
||||
@@ -6,16 +6,17 @@ part of 'tab.dart';
|
||||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$tabRepositoryHash() => r'f7d6584d9d6a320ebe4964dd5dc80bda987c40c2';
|
||||
String _$tabRepositoryHash() => r'e6f9d58982f3bbe389e3a3299bb498c6e8e101eb';
|
||||
|
||||
/// See also [TabRepository].
|
||||
@ProviderFor(TabRepository)
|
||||
final tabRepositoryProvider = NotifierProvider<TabRepository, void>.internal(
|
||||
TabRepository.new,
|
||||
name: r'tabRepositoryProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$tabRepositoryHash,
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$tabRepositoryHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@@ -7,7 +7,7 @@ final class ViewTabsSheet extends Sheet {
|
||||
bool get cacheHash => true;
|
||||
|
||||
@override
|
||||
List<Object?> get hashParameters => [];
|
||||
List<Object?> get hashParameters => [null];
|
||||
}
|
||||
|
||||
final class TabQaChatSheet extends Sheet {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:lensai/domain/entities/equatable_iterable.dart';
|
||||
import 'package:lensai/extensions/nullable.dart';
|
||||
import 'package:lensai/features/bangs/data/models/bang_data.dart';
|
||||
import 'package:lensai/features/bangs/domain/repositories/data.dart';
|
||||
import 'package:lensai/features/geckoview/domain/entities/states/tab.dart';
|
||||
@@ -184,9 +183,7 @@ EquatableCollection<List<TabPreview>> seamlessFilteredTabPreviews(
|
||||
id: tab.id,
|
||||
title: tab.title ?? availableTabStates.collection[tab.id]!.title,
|
||||
icon: null,
|
||||
url:
|
||||
tab.cleanUrl.mapNotNull(Uri.tryParse) ??
|
||||
availableTabStates.collection[tab.id]!.url,
|
||||
url: tab.cleanUrl ?? availableTabStates.collection[tab.id]!.url,
|
||||
highlightedUrl: tab.url,
|
||||
content: tab.extractedContent ?? tab.fullContent,
|
||||
);
|
||||
|
||||
@@ -39,21 +39,15 @@ class AvailableTabIdsFamily extends Family<EquatableCollection<List<String>>> {
|
||||
const AvailableTabIdsFamily();
|
||||
|
||||
/// See also [availableTabIds].
|
||||
AvailableTabIdsProvider call(
|
||||
ContainerFilter containerFilter,
|
||||
) {
|
||||
return AvailableTabIdsProvider(
|
||||
containerFilter,
|
||||
);
|
||||
AvailableTabIdsProvider call(ContainerFilter containerFilter) {
|
||||
return AvailableTabIdsProvider(containerFilter);
|
||||
}
|
||||
|
||||
@override
|
||||
AvailableTabIdsProvider getProviderOverride(
|
||||
covariant AvailableTabIdsProvider provider,
|
||||
) {
|
||||
return call(
|
||||
provider.containerFilter,
|
||||
);
|
||||
return call(provider.containerFilter);
|
||||
}
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
||||
@@ -75,24 +69,20 @@ class AvailableTabIdsFamily extends Family<EquatableCollection<List<String>>> {
|
||||
class AvailableTabIdsProvider
|
||||
extends AutoDisposeProvider<EquatableCollection<List<String>>> {
|
||||
/// 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(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, {
|
||||
@@ -109,7 +99,7 @@ class AvailableTabIdsProvider
|
||||
@override
|
||||
Override overrideWith(
|
||||
EquatableCollection<List<String>> Function(AvailableTabIdsRef provider)
|
||||
create,
|
||||
create,
|
||||
) {
|
||||
return ProviderOverride(
|
||||
origin: this,
|
||||
@@ -127,7 +117,7 @@ class AvailableTabIdsProvider
|
||||
|
||||
@override
|
||||
AutoDisposeProviderElement<EquatableCollection<List<String>>>
|
||||
createElement() {
|
||||
createElement() {
|
||||
return _AvailableTabIdsProviderElement(this);
|
||||
}
|
||||
|
||||
@@ -178,21 +168,15 @@ class AvailableTabStatesFamily
|
||||
const AvailableTabStatesFamily();
|
||||
|
||||
/// See also [availableTabStates].
|
||||
AvailableTabStatesProvider call(
|
||||
ContainerFilter containerFilter,
|
||||
) {
|
||||
return AvailableTabStatesProvider(
|
||||
containerFilter,
|
||||
);
|
||||
AvailableTabStatesProvider call(ContainerFilter containerFilter) {
|
||||
return AvailableTabStatesProvider(containerFilter);
|
||||
}
|
||||
|
||||
@override
|
||||
AvailableTabStatesProvider getProviderOverride(
|
||||
covariant AvailableTabStatesProvider provider,
|
||||
) {
|
||||
return call(
|
||||
provider.containerFilter,
|
||||
);
|
||||
return call(provider.containerFilter);
|
||||
}
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
||||
@@ -214,24 +198,21 @@ class AvailableTabStatesFamily
|
||||
class AvailableTabStatesProvider
|
||||
extends AutoDisposeProvider<EquatableCollection<Map<String, TabState>>> {
|
||||
/// 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(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, {
|
||||
@@ -248,8 +229,9 @@ class AvailableTabStatesProvider
|
||||
@override
|
||||
Override overrideWith(
|
||||
EquatableCollection<Map<String, TabState>> Function(
|
||||
AvailableTabStatesRef provider)
|
||||
create,
|
||||
AvailableTabStatesRef provider,
|
||||
)
|
||||
create,
|
||||
) {
|
||||
return ProviderOverride(
|
||||
origin: this,
|
||||
@@ -267,7 +249,7 @@ class AvailableTabStatesProvider
|
||||
|
||||
@override
|
||||
AutoDisposeProviderElement<EquatableCollection<Map<String, TabState>>>
|
||||
createElement() {
|
||||
createElement() {
|
||||
return _AvailableTabStatesProviderElement(this);
|
||||
}
|
||||
|
||||
@@ -294,8 +276,10 @@ mixin AvailableTabStatesRef
|
||||
ContainerFilter get containerFilter;
|
||||
}
|
||||
|
||||
class _AvailableTabStatesProviderElement extends AutoDisposeProviderElement<
|
||||
EquatableCollection<Map<String, TabState>>> with AvailableTabStatesRef {
|
||||
class _AvailableTabStatesProviderElement
|
||||
extends
|
||||
AutoDisposeProviderElement<EquatableCollection<Map<String, TabState>>>
|
||||
with AvailableTabStatesRef {
|
||||
_AvailableTabStatesProviderElement(super.provider);
|
||||
|
||||
@override
|
||||
@@ -321,20 +305,14 @@ class SeamlessFilteredTabIdsFamily
|
||||
TabSearchPartition searchPartition,
|
||||
ContainerFilter containerFilter,
|
||||
) {
|
||||
return SeamlessFilteredTabIdsProvider(
|
||||
searchPartition,
|
||||
containerFilter,
|
||||
);
|
||||
return SeamlessFilteredTabIdsProvider(searchPartition, containerFilter);
|
||||
}
|
||||
|
||||
@override
|
||||
SeamlessFilteredTabIdsProvider getProviderOverride(
|
||||
covariant SeamlessFilteredTabIdsProvider provider,
|
||||
) {
|
||||
return call(
|
||||
provider.searchPartition,
|
||||
provider.containerFilter,
|
||||
);
|
||||
return call(provider.searchPartition, provider.containerFilter);
|
||||
}
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
||||
@@ -360,23 +338,23 @@ class SeamlessFilteredTabIdsProvider
|
||||
TabSearchPartition searchPartition,
|
||||
ContainerFilter containerFilter,
|
||||
) : this._internal(
|
||||
(ref) => seamlessFilteredTabIds(
|
||||
ref as SeamlessFilteredTabIdsRef,
|
||||
searchPartition,
|
||||
containerFilter,
|
||||
),
|
||||
from: seamlessFilteredTabIdsProvider,
|
||||
name: r'seamlessFilteredTabIdsProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$seamlessFilteredTabIdsHash,
|
||||
dependencies: SeamlessFilteredTabIdsFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
SeamlessFilteredTabIdsFamily._allTransitiveDependencies,
|
||||
searchPartition: searchPartition,
|
||||
containerFilter: containerFilter,
|
||||
);
|
||||
(ref) => seamlessFilteredTabIds(
|
||||
ref as SeamlessFilteredTabIdsRef,
|
||||
searchPartition,
|
||||
containerFilter,
|
||||
),
|
||||
from: seamlessFilteredTabIdsProvider,
|
||||
name: r'seamlessFilteredTabIdsProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$seamlessFilteredTabIdsHash,
|
||||
dependencies: SeamlessFilteredTabIdsFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
SeamlessFilteredTabIdsFamily._allTransitiveDependencies,
|
||||
searchPartition: searchPartition,
|
||||
containerFilter: containerFilter,
|
||||
);
|
||||
|
||||
SeamlessFilteredTabIdsProvider._internal(
|
||||
super._createNotifier, {
|
||||
@@ -395,8 +373,9 @@ class SeamlessFilteredTabIdsProvider
|
||||
@override
|
||||
Override overrideWith(
|
||||
EquatableCollection<List<String>> Function(
|
||||
SeamlessFilteredTabIdsRef provider)
|
||||
create,
|
||||
SeamlessFilteredTabIdsRef provider,
|
||||
)
|
||||
create,
|
||||
) {
|
||||
return ProviderOverride(
|
||||
origin: this,
|
||||
@@ -415,7 +394,7 @@ class SeamlessFilteredTabIdsProvider
|
||||
|
||||
@override
|
||||
AutoDisposeProviderElement<EquatableCollection<List<String>>>
|
||||
createElement() {
|
||||
createElement() {
|
||||
return _SeamlessFilteredTabIdsProviderElement(this);
|
||||
}
|
||||
|
||||
@@ -461,7 +440,7 @@ class _SeamlessFilteredTabIdsProviderElement
|
||||
}
|
||||
|
||||
String _$seamlessFilteredTabPreviewsHash() =>
|
||||
r'7a70eb2f3f59de5188d94a73790e39c339a6293b';
|
||||
r'6beefa943d298b81482276f12484e27346ff9907';
|
||||
|
||||
/// See also [seamlessFilteredTabPreviews].
|
||||
@ProviderFor(seamlessFilteredTabPreviews)
|
||||
@@ -488,10 +467,7 @@ class SeamlessFilteredTabPreviewsFamily
|
||||
SeamlessFilteredTabPreviewsProvider getProviderOverride(
|
||||
covariant SeamlessFilteredTabPreviewsProvider provider,
|
||||
) {
|
||||
return call(
|
||||
provider.searchPartition,
|
||||
provider.containerFilter,
|
||||
);
|
||||
return call(provider.searchPartition, provider.containerFilter);
|
||||
}
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
||||
@@ -517,23 +493,23 @@ class 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,
|
||||
);
|
||||
(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, {
|
||||
@@ -552,8 +528,9 @@ class SeamlessFilteredTabPreviewsProvider
|
||||
@override
|
||||
Override overrideWith(
|
||||
EquatableCollection<List<TabPreview>> Function(
|
||||
SeamlessFilteredTabPreviewsRef provider)
|
||||
create,
|
||||
SeamlessFilteredTabPreviewsRef provider,
|
||||
)
|
||||
create,
|
||||
) {
|
||||
return ProviderOverride(
|
||||
origin: this,
|
||||
@@ -572,7 +549,7 @@ class SeamlessFilteredTabPreviewsProvider
|
||||
|
||||
@override
|
||||
AutoDisposeProviderElement<EquatableCollection<List<TabPreview>>>
|
||||
createElement() {
|
||||
createElement() {
|
||||
return _SeamlessFilteredTabPreviewsProviderElement(this);
|
||||
}
|
||||
|
||||
@@ -623,9 +600,7 @@ String _$selectedBangTriggerHash() =>
|
||||
abstract class _$SelectedBangTrigger extends BuildlessNotifier<String?> {
|
||||
late final String? domain;
|
||||
|
||||
String? build({
|
||||
String? domain,
|
||||
});
|
||||
String? build({String? domain});
|
||||
}
|
||||
|
||||
/// See also [SelectedBangTrigger].
|
||||
@@ -638,21 +613,15 @@ class SelectedBangTriggerFamily extends Family<String?> {
|
||||
const SelectedBangTriggerFamily();
|
||||
|
||||
/// See also [SelectedBangTrigger].
|
||||
SelectedBangTriggerProvider call({
|
||||
String? domain,
|
||||
}) {
|
||||
return SelectedBangTriggerProvider(
|
||||
domain: domain,
|
||||
);
|
||||
SelectedBangTriggerProvider call({String? domain}) {
|
||||
return SelectedBangTriggerProvider(domain: domain);
|
||||
}
|
||||
|
||||
@override
|
||||
SelectedBangTriggerProvider getProviderOverride(
|
||||
covariant SelectedBangTriggerProvider provider,
|
||||
) {
|
||||
return call(
|
||||
domain: provider.domain,
|
||||
);
|
||||
return call(domain: provider.domain);
|
||||
}
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
||||
@@ -674,21 +643,20 @@ class SelectedBangTriggerFamily extends Family<String?> {
|
||||
class SelectedBangTriggerProvider
|
||||
extends NotifierProviderImpl<SelectedBangTrigger, String?> {
|
||||
/// See also [SelectedBangTrigger].
|
||||
SelectedBangTriggerProvider({
|
||||
String? domain,
|
||||
}) : this._internal(
|
||||
() => SelectedBangTrigger()..domain = domain,
|
||||
from: selectedBangTriggerProvider,
|
||||
name: r'selectedBangTriggerProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$selectedBangTriggerHash,
|
||||
dependencies: SelectedBangTriggerFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
SelectedBangTriggerFamily._allTransitiveDependencies,
|
||||
domain: domain,
|
||||
);
|
||||
SelectedBangTriggerProvider({String? domain})
|
||||
: this._internal(
|
||||
() => SelectedBangTrigger()..domain = domain,
|
||||
from: selectedBangTriggerProvider,
|
||||
name: r'selectedBangTriggerProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$selectedBangTriggerHash,
|
||||
dependencies: SelectedBangTriggerFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
SelectedBangTriggerFamily._allTransitiveDependencies,
|
||||
domain: domain,
|
||||
);
|
||||
|
||||
SelectedBangTriggerProvider._internal(
|
||||
super._createNotifier, {
|
||||
@@ -703,12 +671,8 @@ class SelectedBangTriggerProvider
|
||||
final String? domain;
|
||||
|
||||
@override
|
||||
String? runNotifierBuild(
|
||||
covariant SelectedBangTrigger notifier,
|
||||
) {
|
||||
return notifier.build(
|
||||
domain: domain,
|
||||
);
|
||||
String? runNotifierBuild(covariant SelectedBangTrigger notifier) {
|
||||
return notifier.build(domain: domain);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -768,9 +732,7 @@ abstract class _$SelectedBangData
|
||||
extends BuildlessAutoDisposeNotifier<BangData?> {
|
||||
late final String? domain;
|
||||
|
||||
BangData? build({
|
||||
String? domain,
|
||||
});
|
||||
BangData? build({String? domain});
|
||||
}
|
||||
|
||||
/// See also [SelectedBangData].
|
||||
@@ -783,21 +745,15 @@ class SelectedBangDataFamily extends Family<BangData?> {
|
||||
const SelectedBangDataFamily();
|
||||
|
||||
/// See also [SelectedBangData].
|
||||
SelectedBangDataProvider call({
|
||||
String? domain,
|
||||
}) {
|
||||
return SelectedBangDataProvider(
|
||||
domain: domain,
|
||||
);
|
||||
SelectedBangDataProvider call({String? domain}) {
|
||||
return SelectedBangDataProvider(domain: domain);
|
||||
}
|
||||
|
||||
@override
|
||||
SelectedBangDataProvider getProviderOverride(
|
||||
covariant SelectedBangDataProvider provider,
|
||||
) {
|
||||
return call(
|
||||
domain: provider.domain,
|
||||
);
|
||||
return call(domain: provider.domain);
|
||||
}
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
||||
@@ -819,21 +775,20 @@ class SelectedBangDataFamily extends Family<BangData?> {
|
||||
class SelectedBangDataProvider
|
||||
extends AutoDisposeNotifierProviderImpl<SelectedBangData, BangData?> {
|
||||
/// See also [SelectedBangData].
|
||||
SelectedBangDataProvider({
|
||||
String? domain,
|
||||
}) : this._internal(
|
||||
() => SelectedBangData()..domain = domain,
|
||||
from: selectedBangDataProvider,
|
||||
name: r'selectedBangDataProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$selectedBangDataHash,
|
||||
dependencies: SelectedBangDataFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
SelectedBangDataFamily._allTransitiveDependencies,
|
||||
domain: domain,
|
||||
);
|
||||
SelectedBangDataProvider({String? domain})
|
||||
: this._internal(
|
||||
() => SelectedBangData()..domain = domain,
|
||||
from: selectedBangDataProvider,
|
||||
name: r'selectedBangDataProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$selectedBangDataHash,
|
||||
dependencies: SelectedBangDataFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
SelectedBangDataFamily._allTransitiveDependencies,
|
||||
domain: domain,
|
||||
);
|
||||
|
||||
SelectedBangDataProvider._internal(
|
||||
super._createNotifier, {
|
||||
@@ -848,12 +803,8 @@ class SelectedBangDataProvider
|
||||
final String? domain;
|
||||
|
||||
@override
|
||||
BangData? runNotifierBuild(
|
||||
covariant SelectedBangData notifier,
|
||||
) {
|
||||
return notifier.build(
|
||||
domain: domain,
|
||||
);
|
||||
BangData? runNotifierBuild(covariant SelectedBangData notifier) {
|
||||
return notifier.build(domain: domain);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -874,7 +825,7 @@ class SelectedBangDataProvider
|
||||
|
||||
@override
|
||||
AutoDisposeNotifierProviderElement<SelectedBangData, BangData?>
|
||||
createElement() {
|
||||
createElement() {
|
||||
return _SelectedBangDataProviderElement(this);
|
||||
}
|
||||
|
||||
@@ -915,9 +866,10 @@ String _$showFindInPageHash() => r'7ee5703f7d0c7e8a8dd6b0849d7b1e0a41fe24d9';
|
||||
final showFindInPageProvider = NotifierProvider<ShowFindInPage, bool>.internal(
|
||||
ShowFindInPage.new,
|
||||
name: r'showFindInPageProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$showFindInPageHash,
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$showFindInPageHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@@ -12,13 +12,15 @@ String _$intentStreamHash() => r'e78268ec703cd0d1f08d41b9e10a487e6000b7da';
|
||||
@ProviderFor(IntentStream)
|
||||
final intentStreamProvider =
|
||||
AutoDisposeStreamNotifierProvider<IntentStream, SharedContent>.internal(
|
||||
IntentStream.new,
|
||||
name: r'intentStreamProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product') ? null : _$intentStreamHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
IntentStream.new,
|
||||
name: r'intentStreamProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$intentStreamHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$IntentStream = AutoDisposeStreamNotifier<SharedContent>;
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
@@ -13,14 +13,15 @@ String _$browserDataServiceHash() =>
|
||||
@ProviderFor(BrowserDataService)
|
||||
final browserDataServiceProvider =
|
||||
AutoDisposeNotifierProvider<BrowserDataService, void>.internal(
|
||||
BrowserDataService.new,
|
||||
name: r'browserDataServiceProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$browserDataServiceHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
BrowserDataService.new,
|
||||
name: r'browserDataServiceProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$browserDataServiceHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$BrowserDataService = AutoDisposeNotifier<void>;
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
+9
-8
@@ -13,14 +13,15 @@ String _$engineSettingsReplicationServiceHash() =>
|
||||
@ProviderFor(EngineSettingsReplicationService)
|
||||
final engineSettingsReplicationServiceProvider =
|
||||
NotifierProvider<EngineSettingsReplicationService, void>.internal(
|
||||
EngineSettingsReplicationService.new,
|
||||
name: r'engineSettingsReplicationServiceProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$engineSettingsReplicationServiceHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
EngineSettingsReplicationService.new,
|
||||
name: r'engineSettingsReplicationServiceProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$engineSettingsReplicationServiceHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$EngineSettingsReplicationService = Notifier<void>;
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
+9
-8
@@ -13,14 +13,15 @@ String _$proxySettingsReplucationHash() =>
|
||||
@ProviderFor(ProxySettingsReplucation)
|
||||
final proxySettingsReplucationProvider =
|
||||
NotifierProvider<ProxySettingsReplucation, void>.internal(
|
||||
ProxySettingsReplucation.new,
|
||||
name: r'proxySettingsReplucationProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$proxySettingsReplucationHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
ProxySettingsReplucation.new,
|
||||
name: r'proxySettingsReplucationProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$proxySettingsReplucationHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$ProxySettingsReplucation = Notifier<void>;
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
+22
-9
@@ -7,7 +7,6 @@ import 'package:flutter_material_design_icons/flutter_material_design_icons.dart
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:lensai/data/models/web_page_info.dart';
|
||||
import 'package:lensai/features/bangs/data/models/bang_data.dart';
|
||||
import 'package:lensai/features/bangs/domain/providers/bangs.dart';
|
||||
import 'package:lensai/features/bangs/presentation/widgets/site_search.dart';
|
||||
import 'package:lensai/features/chat/features/chat_store/data/models/chat_metadata.dart';
|
||||
@@ -20,6 +19,7 @@ import 'package:lensai/features/geckoview/features/browser/domain/entities/sheet
|
||||
import 'package:lensai/features/geckoview/features/browser/presentation/widgets/browser_modules/address_with_suggestions_field.dart';
|
||||
import 'package:lensai/features/user/domain/providers.dart';
|
||||
import 'package:lensai/presentation/widgets/failure_widget.dart';
|
||||
import 'package:lensai/presentation/widgets/website_feed_tile.dart';
|
||||
import 'package:lensai/presentation/widgets/website_title_tile.dart';
|
||||
import 'package:lensai/utils/ui_helper.dart' as ui_helper;
|
||||
|
||||
@@ -100,13 +100,13 @@ class WebPageDialog extends HookConsumerWidget {
|
||||
loading:
|
||||
() => SiteSearch(
|
||||
domain: url.host,
|
||||
availableBangs: [
|
||||
BangData(
|
||||
websiteName: 'websiteName',
|
||||
domain: 'domain',
|
||||
trigger: 'trigger',
|
||||
urlTemplate: 'urlTemplate',
|
||||
),
|
||||
availableBangs: const [
|
||||
// BangData(
|
||||
// websiteName: 'websiteName',
|
||||
// domain: 'domain',
|
||||
// trigger: 'trigger',
|
||||
// urlTemplate: 'urlTemplate',
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -115,6 +115,7 @@ class WebPageDialog extends HookConsumerWidget {
|
||||
availableBangCount == null ||
|
||||
availableBangCount > 0)
|
||||
const Divider(),
|
||||
WebsiteFeedTile(url, precachedInfo: precachedInfo),
|
||||
ListTile(
|
||||
leading: const Icon(MdiIcons.contentCopy),
|
||||
title: const Text('Copy address'),
|
||||
@@ -138,11 +139,23 @@ class WebPageDialog extends HookConsumerWidget {
|
||||
leading: const Icon(MdiIcons.tabPlus),
|
||||
title: const Text('Clone tab'),
|
||||
onTap: () async {
|
||||
await ref
|
||||
final tabId = await ref
|
||||
.read(tabRepositoryProvider.notifier)
|
||||
.addTab(url: url);
|
||||
|
||||
if (context.mounted) {
|
||||
//save reference before pop `ref` gets disposed
|
||||
final repo = ref.read(
|
||||
tabRepositoryProvider.notifier,
|
||||
);
|
||||
|
||||
ui_helper.showTabSwitchMessage(
|
||||
context,
|
||||
onSwitch: () {
|
||||
repo.selectTab(tabId);
|
||||
},
|
||||
);
|
||||
|
||||
context.pop();
|
||||
}
|
||||
},
|
||||
|
||||
@@ -22,8 +22,6 @@ import 'package:lensai/features/geckoview/features/contextmenu/extensions/hit_re
|
||||
import 'package:lensai/features/geckoview/features/find_in_page/presentation/widgets/find_in_page.dart';
|
||||
import 'package:lensai/features/geckoview/features/readerview/presentation/widgets/reader_appearance_button.dart';
|
||||
import 'package:lensai/features/geckoview/features/tabs/features/chat/presentation/widgets/tab_qa_chat.dart';
|
||||
import 'package:lensai/presentation/hooks/draggable_scrollable_controller.dart';
|
||||
import 'package:lensai/presentation/hooks/overlay_portal_controller.dart';
|
||||
import 'package:lensai/utils/ui_helper.dart' as ui_helper;
|
||||
|
||||
class BrowserScreen extends HookConsumerWidget {
|
||||
@@ -98,7 +96,7 @@ class BrowserScreen extends HookConsumerWidget {
|
||||
.read(tabRepositoryProvider.notifier)
|
||||
.closeTab(details.data.tabId);
|
||||
},
|
||||
builder: (context, _, __) {
|
||||
builder: (context, _, _) {
|
||||
return OverlayPortal(
|
||||
controller: overlayController,
|
||||
overlayChildBuilder: (context) {
|
||||
@@ -160,6 +158,11 @@ class BrowserScreen extends HookConsumerWidget {
|
||||
return true;
|
||||
}
|
||||
|
||||
//Go router has routes to go back to
|
||||
if (context.canPop()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (lastBackButtonPress.value != null &&
|
||||
DateTime.now().difference(lastBackButtonPress.value!) <
|
||||
const Duration(seconds: 2)) {
|
||||
|
||||
+21
-2
@@ -17,6 +17,7 @@ import 'package:lensai/features/geckoview/features/browser/presentation/widgets/
|
||||
import 'package:lensai/features/geckoview/features/browser/presentation/widgets/tabs_action_button.dart';
|
||||
import 'package:lensai/features/geckoview/features/find_in_page/presentation/controllers/find_in_page_visibility.dart';
|
||||
import 'package:lensai/features/geckoview/features/readerview/presentation/widgets/reader_button.dart';
|
||||
import 'package:lensai/features/web_feed/domain/services/feed_reader.dart';
|
||||
import 'package:lensai/presentation/hooks/menu_controller.dart';
|
||||
import 'package:lensai/presentation/icons/tor_icons.dart';
|
||||
import 'package:lensai/utils/ui_helper.dart' as ui_helper;
|
||||
@@ -359,10 +360,28 @@ class BrowserBottomAppBar extends HookConsumerWidget {
|
||||
),
|
||||
MenuItemButton(
|
||||
onPressed: () async {
|
||||
await context.push(UserAuthRoute().location);
|
||||
final res = await ref
|
||||
.read(feedReaderProvider.notifier)
|
||||
.parseFeed(
|
||||
Uri.parse('https://simonwillison.net/atom/everything/'),
|
||||
);
|
||||
|
||||
if (context.mounted) {
|
||||
await context.push(
|
||||
FeedCreateRoute().location,
|
||||
extra: res.feedData,
|
||||
);
|
||||
}
|
||||
},
|
||||
leadingIcon: const Icon(Icons.info),
|
||||
child: const Text('Auth'),
|
||||
child: const Text('Add'),
|
||||
),
|
||||
MenuItemButton(
|
||||
onPressed: () async {
|
||||
await context.push(FeedListRoute().location);
|
||||
},
|
||||
leadingIcon: const Icon(Icons.info),
|
||||
child: const Text('List'),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ import 'package:lensai/features/user/domain/services/local_authentication.dart';
|
||||
|
||||
class BrowserView extends StatefulHookConsumerWidget {
|
||||
final Duration screenshotPeriod;
|
||||
final FutureOr<void> Function()? postInitializationStep;
|
||||
final Future<void> Function()? postInitializationStep;
|
||||
|
||||
const BrowserView({
|
||||
this.screenshotPeriod = const Duration(seconds: 10),
|
||||
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:lensai/extensions/nullable.dart';
|
||||
import 'package:lensai/features/geckoview/domain/entities/states/web_extension.dart';
|
||||
|
||||
class ExtensionBadgeIcon extends StatelessWidget {
|
||||
@@ -8,7 +9,7 @@ class ExtensionBadgeIcon extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final hasBadge = state.badgeText?.isNotEmpty ?? false;
|
||||
final hasBadge = state.badgeText.isNotEmpty;
|
||||
|
||||
return Badge(
|
||||
isLabelVisible: hasBadge,
|
||||
|
||||
+1
-1
@@ -137,7 +137,7 @@ class _TabSheetHeader extends HookConsumerWidget {
|
||||
.maybeStartProxy(context);
|
||||
}
|
||||
},
|
||||
onDeleted: (container) async {
|
||||
onDeleted: (container) {
|
||||
ref
|
||||
.read(selectedContainerProvider.notifier)
|
||||
.clearContainer();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter_mozilla_components/flutter_mozilla_components.dart';
|
||||
import 'package:lensai/extensions/nullable.dart';
|
||||
import 'package:lensai/features/geckoview/features/contextmenu/domain/converters/hit_result_converter.dart';
|
||||
|
||||
extension HitResultJson on HitResult {
|
||||
@@ -38,13 +39,11 @@ extension HitResultX on HitResult {
|
||||
UnknownHitResult(src: final src) => src,
|
||||
ImageSrcHitResult(uri: final uri) => uri,
|
||||
ImageHitResult(src: final src, title: final title) =>
|
||||
title?.isEmpty ?? true
|
||||
? (src.length > maxTitleLength ? 'image' : src)
|
||||
: title!,
|
||||
title.isEmpty ? (src.length > maxTitleLength ? 'image' : src) : title!,
|
||||
VideoHitResult(src: final src, title: final title) =>
|
||||
(title?.isEmpty ?? true) ? src : title!,
|
||||
(title.isEmpty) ? src : title!,
|
||||
AudioHitResult(src: final src, title: final title) =>
|
||||
(title?.isEmpty ?? true) ? src : title!,
|
||||
(title.isEmpty) ? src : title!,
|
||||
_ => 'about:blank',
|
||||
};
|
||||
}
|
||||
|
||||
+5
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_material_design_icons/flutter_material_design_icons.dart';
|
||||
import 'package:flutter_mozilla_components/flutter_mozilla_components.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:lensai/extensions/nullable.dart';
|
||||
import 'package:lensai/features/geckoview/features/contextmenu/extensions/hit_result.dart';
|
||||
@@ -24,6 +25,10 @@ class CopyEmail extends HookConsumerWidget {
|
||||
final email = hitResult.tryGetLink().mapNotNull((url) => url.host);
|
||||
if (email != null) {
|
||||
await Clipboard.setData(ClipboardData(text: email));
|
||||
|
||||
if (context.mounted) {
|
||||
context.pop();
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
+5
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_material_design_icons/flutter_material_design_icons.dart';
|
||||
import 'package:flutter_mozilla_components/flutter_mozilla_components.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:lensai/features/geckoview/domain/providers/tab_state.dart';
|
||||
import 'package:lensai/features/geckoview/features/contextmenu/extensions/hit_result.dart';
|
||||
@@ -30,6 +31,10 @@ class CopyImage extends HookConsumerWidget {
|
||||
isPrivate: currentTab.isPrivate,
|
||||
referrerUrl: currentTab.url,
|
||||
);
|
||||
|
||||
if (context.mounted) {
|
||||
context.pop();
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
+8
-3
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_material_design_icons/flutter_material_design_icons.dart';
|
||||
import 'package:flutter_mozilla_components/flutter_mozilla_components.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:lensai/extensions/nullable.dart';
|
||||
import 'package:lensai/features/geckoview/features/contextmenu/extensions/hit_result.dart';
|
||||
@@ -21,9 +22,13 @@ class CopyImageLocation extends HookConsumerWidget {
|
||||
leading: const Icon(MdiIcons.imageMarker),
|
||||
title: const Text('Copy image location'),
|
||||
onTap: () async {
|
||||
await hitResult.tryGetLink().mapNotNull(
|
||||
(link) => Clipboard.setData(ClipboardData(text: link.toString())),
|
||||
);
|
||||
await hitResult.tryGetLink().mapNotNull((link) async {
|
||||
await Clipboard.setData(ClipboardData(text: link.toString()));
|
||||
|
||||
if (context.mounted) {
|
||||
context.pop();
|
||||
}
|
||||
});
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
+8
-3
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_material_design_icons/flutter_material_design_icons.dart';
|
||||
import 'package:flutter_mozilla_components/flutter_mozilla_components.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:lensai/extensions/nullable.dart';
|
||||
import 'package:lensai/features/geckoview/features/contextmenu/extensions/hit_result.dart';
|
||||
@@ -21,9 +22,13 @@ class CopyLink extends HookConsumerWidget {
|
||||
leading: const Icon(MdiIcons.contentCopy),
|
||||
title: const Text('Copy link'),
|
||||
onTap: () async {
|
||||
await hitResult.tryGetLink().mapNotNull(
|
||||
(link) => Clipboard.setData(ClipboardData(text: link.toString())),
|
||||
);
|
||||
await hitResult.tryGetLink().mapNotNull((link) async {
|
||||
await Clipboard.setData(ClipboardData(text: link.toString()));
|
||||
|
||||
if (context.mounted) {
|
||||
context.pop();
|
||||
}
|
||||
});
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
+8
-3
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_mozilla_components/flutter_mozilla_components.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:lensai/extensions/nullable.dart';
|
||||
import 'package:lensai/features/geckoview/features/contextmenu/extensions/hit_result.dart';
|
||||
@@ -22,9 +23,13 @@ class LaunchExternal extends HookConsumerWidget {
|
||||
leading: const Icon(Icons.open_in_browser),
|
||||
title: const Text('Launch External'),
|
||||
onTap: () async {
|
||||
await hitResult.tryGetLink().mapNotNull(
|
||||
(url) => launchUrlFeedback(context, url),
|
||||
);
|
||||
await hitResult.tryGetLink().mapNotNull((url) async {
|
||||
await launchUrlFeedback(context, url);
|
||||
|
||||
if (context.mounted) {
|
||||
context.pop();
|
||||
}
|
||||
});
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
+23
-2
@@ -1,10 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_material_design_icons/flutter_material_design_icons.dart';
|
||||
import 'package:flutter_mozilla_components/flutter_mozilla_components.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:lensai/features/geckoview/domain/providers/selected_tab.dart';
|
||||
import 'package:lensai/features/geckoview/domain/repositories/tab.dart';
|
||||
import 'package:lensai/features/geckoview/features/contextmenu/extensions/hit_result.dart';
|
||||
import 'package:lensai/utils/ui_helper.dart';
|
||||
|
||||
class OpenImageInNewTab extends HookConsumerWidget {
|
||||
final HitResult hitResult;
|
||||
@@ -22,9 +24,28 @@ class OpenImageInNewTab extends HookConsumerWidget {
|
||||
title: const Text('Open image in new tab'),
|
||||
onTap: () async {
|
||||
final currentTabId = ref.read(selectedTabProvider);
|
||||
await ref
|
||||
|
||||
final tabId = await ref
|
||||
.read(tabRepositoryProvider.notifier)
|
||||
.addTab(url: hitResult.tryGetLink(), parentId: currentTabId);
|
||||
.addTab(
|
||||
url: hitResult.tryGetLink(),
|
||||
parentId: currentTabId,
|
||||
selectTab: false,
|
||||
);
|
||||
|
||||
if (context.mounted) {
|
||||
//save reference before pop `ref` gets disposed
|
||||
final repo = ref.read(tabRepositoryProvider.notifier);
|
||||
|
||||
showTabSwitchMessage(
|
||||
context,
|
||||
onSwitch: () {
|
||||
repo.selectTab(tabId);
|
||||
},
|
||||
);
|
||||
|
||||
context.pop();
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
+25
-2
@@ -1,9 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_material_design_icons/flutter_material_design_icons.dart';
|
||||
import 'package:flutter_mozilla_components/flutter_mozilla_components.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:lensai/features/geckoview/domain/providers/selected_tab.dart';
|
||||
import 'package:lensai/features/geckoview/domain/repositories/tab.dart';
|
||||
import 'package:lensai/features/geckoview/features/contextmenu/extensions/hit_result.dart';
|
||||
import 'package:lensai/utils/ui_helper.dart';
|
||||
|
||||
class OpenInNewTab extends HookConsumerWidget {
|
||||
final HitResult hitResult;
|
||||
@@ -20,9 +23,29 @@ class OpenInNewTab extends HookConsumerWidget {
|
||||
leading: const Icon(MdiIcons.tabPlus),
|
||||
title: const Text('Open in new tab'),
|
||||
onTap: () async {
|
||||
await ref
|
||||
final currentTabId = ref.read(selectedTabProvider);
|
||||
|
||||
final tabId = await ref
|
||||
.read(tabRepositoryProvider.notifier)
|
||||
.addTab(url: hitResult.tryGetLink());
|
||||
.addTab(
|
||||
url: hitResult.tryGetLink(),
|
||||
parentId: currentTabId,
|
||||
selectTab: false,
|
||||
);
|
||||
|
||||
if (context.mounted) {
|
||||
//save reference before pop `ref` gets disposed
|
||||
final repo = ref.read(tabRepositoryProvider.notifier);
|
||||
|
||||
showTabSwitchMessage(
|
||||
context,
|
||||
onSwitch: () {
|
||||
repo.selectTab(tabId);
|
||||
},
|
||||
);
|
||||
|
||||
context.pop();
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_material_design_icons/flutter_material_design_icons.dart';
|
||||
import 'package:flutter_mozilla_components/flutter_mozilla_components.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:lensai/features/geckoview/domain/providers/tab_state.dart';
|
||||
import 'package:lensai/features/geckoview/features/contextmenu/extensions/hit_result.dart';
|
||||
@@ -31,6 +32,10 @@ class SaveFile extends HookConsumerWidget {
|
||||
isPrivate: currentTab.isPrivate,
|
||||
referrerUrl: currentTab.url,
|
||||
);
|
||||
|
||||
if (context.mounted) {
|
||||
context.pop();
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
+5
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_material_design_icons/flutter_material_design_icons.dart';
|
||||
import 'package:flutter_mozilla_components/flutter_mozilla_components.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:lensai/features/geckoview/domain/providers/tab_state.dart';
|
||||
import 'package:lensai/features/geckoview/features/contextmenu/extensions/hit_result.dart';
|
||||
@@ -31,6 +32,10 @@ class SaveImage extends HookConsumerWidget {
|
||||
isPrivate: currentTab.isPrivate,
|
||||
referrerUrl: currentTab.url,
|
||||
);
|
||||
|
||||
if (context.mounted) {
|
||||
context.pop();
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
+5
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_material_design_icons/flutter_material_design_icons.dart';
|
||||
import 'package:flutter_mozilla_components/flutter_mozilla_components.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:lensai/extensions/nullable.dart';
|
||||
import 'package:lensai/features/geckoview/features/contextmenu/extensions/hit_result.dart';
|
||||
@@ -24,6 +25,10 @@ class ShareEmail extends HookConsumerWidget {
|
||||
final email = hitResult.tryGetLink().mapNotNull((url) => url.path);
|
||||
if (email != null) {
|
||||
await Share.share(email);
|
||||
|
||||
if (context.mounted) {
|
||||
context.pop();
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
+5
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_material_design_icons/flutter_material_design_icons.dart';
|
||||
import 'package:flutter_mozilla_components/flutter_mozilla_components.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:lensai/features/geckoview/domain/providers/tab_state.dart';
|
||||
import 'package:lensai/features/geckoview/features/contextmenu/extensions/hit_result.dart';
|
||||
@@ -30,6 +31,10 @@ class ShareImage extends HookConsumerWidget {
|
||||
isPrivate: currentTab.isPrivate,
|
||||
referrerUrl: currentTab.url,
|
||||
);
|
||||
|
||||
if (context.mounted) {
|
||||
context.pop();
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
+5
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_mozilla_components/flutter_mozilla_components.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:lensai/extensions/nullable.dart';
|
||||
import 'package:lensai/features/geckoview/features/contextmenu/extensions/hit_result.dart';
|
||||
@@ -21,6 +22,10 @@ class ShareLink extends HookConsumerWidget {
|
||||
title: const Text('Share link'),
|
||||
onTap: () async {
|
||||
await hitResult.tryGetLink().mapNotNull((url) => Share.shareUri(url));
|
||||
|
||||
if (context.mounted) {
|
||||
context.pop();
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
+22
-34
@@ -34,9 +34,7 @@ abstract class _$FindInPageRepository
|
||||
extends BuildlessAutoDisposeNotifier<void> {
|
||||
late final String? tabId;
|
||||
|
||||
void build(
|
||||
String? tabId,
|
||||
);
|
||||
void build(String? tabId);
|
||||
}
|
||||
|
||||
/// See also [FindInPageRepository].
|
||||
@@ -49,21 +47,15 @@ class FindInPageRepositoryFamily extends Family<void> {
|
||||
const FindInPageRepositoryFamily();
|
||||
|
||||
/// See also [FindInPageRepository].
|
||||
FindInPageRepositoryProvider call(
|
||||
String? tabId,
|
||||
) {
|
||||
return FindInPageRepositoryProvider(
|
||||
tabId,
|
||||
);
|
||||
FindInPageRepositoryProvider call(String? tabId) {
|
||||
return FindInPageRepositoryProvider(tabId);
|
||||
}
|
||||
|
||||
@override
|
||||
FindInPageRepositoryProvider getProviderOverride(
|
||||
covariant FindInPageRepositoryProvider provider,
|
||||
) {
|
||||
return call(
|
||||
provider.tabId,
|
||||
);
|
||||
return call(provider.tabId);
|
||||
}
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
||||
@@ -85,21 +77,20 @@ class FindInPageRepositoryFamily extends Family<void> {
|
||||
class FindInPageRepositoryProvider
|
||||
extends AutoDisposeNotifierProviderImpl<FindInPageRepository, void> {
|
||||
/// 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(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, {
|
||||
@@ -114,12 +105,8 @@ class FindInPageRepositoryProvider
|
||||
final String? tabId;
|
||||
|
||||
@override
|
||||
void runNotifierBuild(
|
||||
covariant FindInPageRepository notifier,
|
||||
) {
|
||||
return notifier.build(
|
||||
tabId,
|
||||
);
|
||||
void runNotifierBuild(covariant FindInPageRepository notifier) {
|
||||
return notifier.build(tabId);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -140,7 +127,7 @@ class FindInPageRepositoryProvider
|
||||
|
||||
@override
|
||||
AutoDisposeNotifierProviderElement<FindInPageRepository, void>
|
||||
createElement() {
|
||||
createElement() {
|
||||
return _FindInPageRepositoryProviderElement(this);
|
||||
}
|
||||
|
||||
@@ -173,5 +160,6 @@ class _FindInPageRepositoryProviderElement
|
||||
@override
|
||||
String? get tabId => (origin as FindInPageRepositoryProvider).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
|
||||
|
||||
+9
-8
@@ -13,14 +13,15 @@ String _$findInPageVisibilityControllerHash() =>
|
||||
@ProviderFor(FindInPageVisibilityController)
|
||||
final findInPageVisibilityControllerProvider =
|
||||
AutoDisposeNotifierProvider<FindInPageVisibilityController, bool>.internal(
|
||||
FindInPageVisibilityController.new,
|
||||
name: r'findInPageVisibilityControllerProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$findInPageVisibilityControllerHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
FindInPageVisibilityController.new,
|
||||
name: r'findInPageVisibilityControllerProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$findInPageVisibilityControllerHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$FindInPageVisibilityController = AutoDisposeNotifier<bool>;
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
+40
-34
@@ -39,7 +39,6 @@ class _$PreferenceSettingGroupCWProxyImpl
|
||||
this(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.
|
||||
///
|
||||
/// Usage
|
||||
@@ -51,14 +50,16 @@ class _$PreferenceSettingGroupCWProxyImpl
|
||||
Object? settings = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return PreferenceSettingGroup(
|
||||
description: description == const $CopyWithPlaceholder()
|
||||
? _value.description
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: description as String?,
|
||||
settings: settings == const $CopyWithPlaceholder()
|
||||
? _value.settings
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: settings as Map<String, PreferenceSetting>,
|
||||
description:
|
||||
description == const $CopyWithPlaceholder()
|
||||
? _value.description
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: description as String?,
|
||||
settings:
|
||||
settings == const $CopyWithPlaceholder()
|
||||
? _value.settings
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: settings as Map<String, PreferenceSetting>,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -128,7 +129,6 @@ class _$PreferenceSettingCWProxyImpl implements _$PreferenceSettingCWProxy {
|
||||
this(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.
|
||||
///
|
||||
/// Usage
|
||||
@@ -144,30 +144,36 @@ class _$PreferenceSettingCWProxyImpl implements _$PreferenceSettingCWProxy {
|
||||
Object? shouldBeDefault = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return PreferenceSetting(
|
||||
value: value == const $CopyWithPlaceholder()
|
||||
? _value.value
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: value as Object,
|
||||
title: title == const $CopyWithPlaceholder()
|
||||
? _value.title
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: title as String?,
|
||||
description: description == const $CopyWithPlaceholder()
|
||||
? _value.description
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: description as String?,
|
||||
actualValue: actualValue == const $CopyWithPlaceholder()
|
||||
? _value.actualValue
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: actualValue as Object?,
|
||||
requireUserOptIn: requireUserOptIn == const $CopyWithPlaceholder()
|
||||
? _value.requireUserOptIn
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: requireUserOptIn as bool,
|
||||
shouldBeDefault: shouldBeDefault == const $CopyWithPlaceholder()
|
||||
? _value.shouldBeDefault
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: shouldBeDefault as bool,
|
||||
value:
|
||||
value == const $CopyWithPlaceholder()
|
||||
? _value.value
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: value as Object,
|
||||
title:
|
||||
title == const $CopyWithPlaceholder()
|
||||
? _value.title
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: title as String?,
|
||||
description:
|
||||
description == const $CopyWithPlaceholder()
|
||||
? _value.description
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: description as String?,
|
||||
actualValue:
|
||||
actualValue == const $CopyWithPlaceholder()
|
||||
? _value.actualValue
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: actualValue as Object?,
|
||||
requireUserOptIn:
|
||||
requireUserOptIn == const $CopyWithPlaceholder()
|
||||
? _value.requireUserOptIn
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: requireUserOptIn as bool,
|
||||
shouldBeDefault:
|
||||
shouldBeDefault == const $CopyWithPlaceholder()
|
||||
? _value.shouldBeDefault
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: shouldBeDefault as bool,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
+144
-143
@@ -13,14 +13,15 @@ String _$preferenceSettingContentHash() =>
|
||||
@ProviderFor(_preferenceSettingContent)
|
||||
final _preferenceSettingContentProvider =
|
||||
FutureProvider<Map<String, dynamic>>.internal(
|
||||
_preferenceSettingContent,
|
||||
name: r'_preferenceSettingContentProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$preferenceSettingContentHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
_preferenceSettingContent,
|
||||
name: r'_preferenceSettingContentProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$preferenceSettingContentHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
@@ -60,21 +61,15 @@ class _PreferenceSettingGroupsFamily
|
||||
const _PreferenceSettingGroupsFamily();
|
||||
|
||||
/// See also [_preferenceSettingGroups].
|
||||
_PreferenceSettingGroupsProvider call(
|
||||
PreferencePartition partition,
|
||||
) {
|
||||
return _PreferenceSettingGroupsProvider(
|
||||
partition,
|
||||
);
|
||||
_PreferenceSettingGroupsProvider call(PreferencePartition partition) {
|
||||
return _PreferenceSettingGroupsProvider(partition);
|
||||
}
|
||||
|
||||
@override
|
||||
_PreferenceSettingGroupsProvider getProviderOverride(
|
||||
covariant _PreferenceSettingGroupsProvider provider,
|
||||
) {
|
||||
return call(
|
||||
provider.partition,
|
||||
);
|
||||
return call(provider.partition);
|
||||
}
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
||||
@@ -96,24 +91,23 @@ class _PreferenceSettingGroupsFamily
|
||||
class _PreferenceSettingGroupsProvider
|
||||
extends FutureProvider<Map<String, PreferenceSettingGroup>> {
|
||||
/// 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,
|
||||
);
|
||||
_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,
|
||||
);
|
||||
|
||||
_PreferenceSettingGroupsProvider._internal(
|
||||
super._createNotifier, {
|
||||
@@ -130,8 +124,9 @@ class _PreferenceSettingGroupsProvider
|
||||
@override
|
||||
Override overrideWith(
|
||||
FutureOr<Map<String, PreferenceSettingGroup>> Function(
|
||||
_PreferenceSettingGroupsRef provider)
|
||||
create,
|
||||
_PreferenceSettingGroupsRef provider,
|
||||
)
|
||||
create,
|
||||
) {
|
||||
return ProviderOverride(
|
||||
origin: this,
|
||||
@@ -203,20 +198,14 @@ class _PreferenceSettingGroupFamily
|
||||
PreferencePartition partition,
|
||||
String groupName,
|
||||
) {
|
||||
return _PreferenceSettingGroupProvider(
|
||||
partition,
|
||||
groupName,
|
||||
);
|
||||
return _PreferenceSettingGroupProvider(partition, groupName);
|
||||
}
|
||||
|
||||
@override
|
||||
_PreferenceSettingGroupProvider getProviderOverride(
|
||||
covariant _PreferenceSettingGroupProvider provider,
|
||||
) {
|
||||
return call(
|
||||
provider.partition,
|
||||
provider.groupName,
|
||||
);
|
||||
return call(provider.partition, provider.groupName);
|
||||
}
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
||||
@@ -242,23 +231,23 @@ class _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,
|
||||
);
|
||||
(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,
|
||||
);
|
||||
|
||||
_PreferenceSettingGroupProvider._internal(
|
||||
super._createNotifier, {
|
||||
@@ -277,8 +266,9 @@ class _PreferenceSettingGroupProvider
|
||||
@override
|
||||
Override overrideWith(
|
||||
FutureOr<PreferenceSettingGroup> Function(
|
||||
_PreferenceSettingGroupRef provider)
|
||||
create,
|
||||
_PreferenceSettingGroupRef provider,
|
||||
)
|
||||
create,
|
||||
) {
|
||||
return ProviderOverride(
|
||||
origin: this,
|
||||
@@ -345,24 +335,29 @@ String _$preferenceRepositoryHash() =>
|
||||
/// See also [_PreferenceRepository].
|
||||
@ProviderFor(_PreferenceRepository)
|
||||
final _preferenceRepositoryProvider = AutoDisposeNotifierProvider<
|
||||
_PreferenceRepository, Raw<Stream<Map<String, Object>>>>.internal(
|
||||
_PreferenceRepository,
|
||||
Raw<Stream<Map<String, Object>>>
|
||||
>.internal(
|
||||
_PreferenceRepository.new,
|
||||
name: r'_preferenceRepositoryProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$preferenceRepositoryHash,
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$preferenceRepositoryHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$PreferenceRepository
|
||||
= AutoDisposeNotifier<Raw<Stream<Map<String, Object>>>>;
|
||||
typedef _$PreferenceRepository =
|
||||
AutoDisposeNotifier<Raw<Stream<Map<String, Object>>>>;
|
||||
String _$unifiedPreferenceSettingsRepositoryHash() =>
|
||||
r'35aa16ffa7aa1453c8331ed7470ef85a68d27178';
|
||||
|
||||
abstract class _$UnifiedPreferenceSettingsRepository
|
||||
extends BuildlessAutoDisposeStreamNotifier<
|
||||
Map<String, PreferenceSettingGroup>> {
|
||||
extends
|
||||
BuildlessAutoDisposeStreamNotifier<
|
||||
Map<String, PreferenceSettingGroup>
|
||||
> {
|
||||
late final PreferencePartition partition;
|
||||
|
||||
Stream<Map<String, PreferenceSettingGroup>> build(
|
||||
@@ -385,18 +380,14 @@ class UnifiedPreferenceSettingsRepositoryFamily
|
||||
UnifiedPreferenceSettingsRepositoryProvider call(
|
||||
PreferencePartition partition,
|
||||
) {
|
||||
return UnifiedPreferenceSettingsRepositoryProvider(
|
||||
partition,
|
||||
);
|
||||
return UnifiedPreferenceSettingsRepositoryProvider(partition);
|
||||
}
|
||||
|
||||
@override
|
||||
UnifiedPreferenceSettingsRepositoryProvider getProviderOverride(
|
||||
covariant UnifiedPreferenceSettingsRepositoryProvider provider,
|
||||
) {
|
||||
return call(
|
||||
provider.partition,
|
||||
);
|
||||
return call(provider.partition);
|
||||
}
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
||||
@@ -416,25 +407,27 @@ class UnifiedPreferenceSettingsRepositoryFamily
|
||||
|
||||
/// See also [UnifiedPreferenceSettingsRepository].
|
||||
class UnifiedPreferenceSettingsRepositoryProvider
|
||||
extends AutoDisposeStreamNotifierProviderImpl<
|
||||
UnifiedPreferenceSettingsRepository,
|
||||
Map<String, PreferenceSettingGroup>> {
|
||||
extends
|
||||
AutoDisposeStreamNotifierProviderImpl<
|
||||
UnifiedPreferenceSettingsRepository,
|
||||
Map<String, PreferenceSettingGroup>
|
||||
> {
|
||||
/// 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,
|
||||
);
|
||||
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,
|
||||
);
|
||||
|
||||
UnifiedPreferenceSettingsRepositoryProvider._internal(
|
||||
super._createNotifier, {
|
||||
@@ -452,9 +445,7 @@ class UnifiedPreferenceSettingsRepositoryProvider
|
||||
Stream<Map<String, PreferenceSettingGroup>> runNotifierBuild(
|
||||
covariant UnifiedPreferenceSettingsRepository notifier,
|
||||
) {
|
||||
return notifier.build(
|
||||
partition,
|
||||
);
|
||||
return notifier.build(partition);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -474,8 +465,11 @@ class UnifiedPreferenceSettingsRepositoryProvider
|
||||
}
|
||||
|
||||
@override
|
||||
AutoDisposeStreamNotifierProviderElement<UnifiedPreferenceSettingsRepository,
|
||||
Map<String, PreferenceSettingGroup>> createElement() {
|
||||
AutoDisposeStreamNotifierProviderElement<
|
||||
UnifiedPreferenceSettingsRepository,
|
||||
Map<String, PreferenceSettingGroup>
|
||||
>
|
||||
createElement() {
|
||||
return _UnifiedPreferenceSettingsRepositoryProviderElement(this);
|
||||
}
|
||||
|
||||
@@ -497,16 +491,20 @@ class UnifiedPreferenceSettingsRepositoryProvider
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
mixin UnifiedPreferenceSettingsRepositoryRef
|
||||
on AutoDisposeStreamNotifierProviderRef<
|
||||
Map<String, PreferenceSettingGroup>> {
|
||||
on
|
||||
AutoDisposeStreamNotifierProviderRef<
|
||||
Map<String, PreferenceSettingGroup>
|
||||
> {
|
||||
/// The parameter `partition` of this provider.
|
||||
PreferencePartition get partition;
|
||||
}
|
||||
|
||||
class _UnifiedPreferenceSettingsRepositoryProviderElement
|
||||
extends AutoDisposeStreamNotifierProviderElement<
|
||||
UnifiedPreferenceSettingsRepository,
|
||||
Map<String, PreferenceSettingGroup>>
|
||||
extends
|
||||
AutoDisposeStreamNotifierProviderElement<
|
||||
UnifiedPreferenceSettingsRepository,
|
||||
Map<String, PreferenceSettingGroup>
|
||||
>
|
||||
with UnifiedPreferenceSettingsRepositoryRef {
|
||||
_UnifiedPreferenceSettingsRepositoryProviderElement(super.provider);
|
||||
|
||||
@@ -545,20 +543,14 @@ class PreferenceSettingsGroupRepositoryFamily
|
||||
PreferencePartition partition,
|
||||
String groupName,
|
||||
) {
|
||||
return PreferenceSettingsGroupRepositoryProvider(
|
||||
partition,
|
||||
groupName,
|
||||
);
|
||||
return PreferenceSettingsGroupRepositoryProvider(partition, groupName);
|
||||
}
|
||||
|
||||
@override
|
||||
PreferenceSettingsGroupRepositoryProvider getProviderOverride(
|
||||
covariant PreferenceSettingsGroupRepositoryProvider provider,
|
||||
) {
|
||||
return call(
|
||||
provider.partition,
|
||||
provider.groupName,
|
||||
);
|
||||
return call(provider.partition, provider.groupName);
|
||||
}
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
||||
@@ -578,28 +570,32 @@ class PreferenceSettingsGroupRepositoryFamily
|
||||
|
||||
/// See also [PreferenceSettingsGroupRepository].
|
||||
class PreferenceSettingsGroupRepositoryProvider
|
||||
extends AutoDisposeStreamNotifierProviderImpl<
|
||||
PreferenceSettingsGroupRepository, PreferenceSettingGroup> {
|
||||
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,
|
||||
);
|
||||
() =>
|
||||
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, {
|
||||
@@ -619,10 +615,7 @@ class PreferenceSettingsGroupRepositoryProvider
|
||||
Stream<PreferenceSettingGroup> runNotifierBuild(
|
||||
covariant PreferenceSettingsGroupRepository notifier,
|
||||
) {
|
||||
return notifier.build(
|
||||
partition,
|
||||
groupName,
|
||||
);
|
||||
return notifier.build(partition, groupName);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -630,9 +623,10 @@ class PreferenceSettingsGroupRepositoryProvider
|
||||
return ProviderOverride(
|
||||
origin: this,
|
||||
override: PreferenceSettingsGroupRepositoryProvider._internal(
|
||||
() => create()
|
||||
..partition = partition
|
||||
..groupName = groupName,
|
||||
() =>
|
||||
create()
|
||||
..partition = partition
|
||||
..groupName = groupName,
|
||||
from: from,
|
||||
name: null,
|
||||
dependencies: null,
|
||||
@@ -645,8 +639,11 @@ class PreferenceSettingsGroupRepositoryProvider
|
||||
}
|
||||
|
||||
@override
|
||||
AutoDisposeStreamNotifierProviderElement<PreferenceSettingsGroupRepository,
|
||||
PreferenceSettingGroup> createElement() {
|
||||
AutoDisposeStreamNotifierProviderElement<
|
||||
PreferenceSettingsGroupRepository,
|
||||
PreferenceSettingGroup
|
||||
>
|
||||
createElement() {
|
||||
return _PreferenceSettingsGroupRepositoryProviderElement(this);
|
||||
}
|
||||
|
||||
@@ -679,9 +676,12 @@ mixin PreferenceSettingsGroupRepositoryRef
|
||||
}
|
||||
|
||||
class _PreferenceSettingsGroupRepositoryProviderElement
|
||||
extends AutoDisposeStreamNotifierProviderElement<
|
||||
PreferenceSettingsGroupRepository,
|
||||
PreferenceSettingGroup> with PreferenceSettingsGroupRepositoryRef {
|
||||
extends
|
||||
AutoDisposeStreamNotifierProviderElement<
|
||||
PreferenceSettingsGroupRepository,
|
||||
PreferenceSettingGroup
|
||||
>
|
||||
with PreferenceSettingsGroupRepositoryRef {
|
||||
_PreferenceSettingsGroupRepositoryProviderElement(super.provider);
|
||||
|
||||
@override
|
||||
@@ -691,5 +691,6 @@ class _PreferenceSettingsGroupRepositoryProviderElement
|
||||
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
|
||||
|
||||
@@ -13,9 +13,10 @@ String _$readerableServiceHash() => r'03182c8afc41f5184322a3206473cbfa96df5819';
|
||||
final readerableServiceProvider = Provider<GeckoReaderableService>.internal(
|
||||
readerableService,
|
||||
name: r'readerableServiceProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$readerableServiceHash,
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$readerableServiceHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
@@ -30,14 +31,15 @@ String _$appearanceButtonVisibilityHash() =>
|
||||
@ProviderFor(appearanceButtonVisibility)
|
||||
final appearanceButtonVisibilityProvider =
|
||||
AutoDisposeStreamProvider<bool>.internal(
|
||||
appearanceButtonVisibility,
|
||||
name: r'appearanceButtonVisibilityProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$appearanceButtonVisibilityHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
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
|
||||
|
||||
+2
-2
@@ -19,9 +19,9 @@ class ReaderableScreenController extends _$ReaderableScreenController {
|
||||
}
|
||||
|
||||
@override
|
||||
FutureOr<void> build() {
|
||||
Future<void> build() {
|
||||
_service = ref.watch(readerableServiceProvider);
|
||||
|
||||
return null;
|
||||
return Future.value();
|
||||
}
|
||||
}
|
||||
|
||||
+10
-9
@@ -7,20 +7,21 @@ part of 'readerable.dart';
|
||||
// **************************************************************************
|
||||
|
||||
String _$readerableScreenControllerHash() =>
|
||||
r'463c032a6d07936954fead58589101ccb31c2765';
|
||||
r'62b2167ff8f9fe21c3cf3339e135a50aa684160c';
|
||||
|
||||
/// See also [ReaderableScreenController].
|
||||
@ProviderFor(ReaderableScreenController)
|
||||
final readerableScreenControllerProvider =
|
||||
AsyncNotifierProvider<ReaderableScreenController, void>.internal(
|
||||
ReaderableScreenController.new,
|
||||
name: r'readerableScreenControllerProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$readerableScreenControllerHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
ReaderableScreenController.new,
|
||||
name: r'readerableScreenControllerProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$readerableScreenControllerHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$ReaderableScreenController = AsyncNotifier<void>;
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
@@ -42,7 +42,7 @@ AsyncValue<List<GeckoSuggestion>> engineHistorySuggestions(Ref ref) {
|
||||
.where(
|
||||
(suggestion) =>
|
||||
suggestion.type == GeckoSuggestionType.history &&
|
||||
(suggestion.title?.isNotEmpty ?? false) &&
|
||||
(suggestion.title.isNotEmpty) &&
|
||||
(suggestion.description.mapNotNull(
|
||||
(url) => Uri.tryParse(url),
|
||||
) !=
|
||||
|
||||
+19
-15
@@ -7,36 +7,40 @@ part of 'engine_suggestions.dart';
|
||||
// **************************************************************************
|
||||
|
||||
String _$engineHistorySuggestionsHash() =>
|
||||
r'218f1da2140a76c3b02634619955b1382c6ef182';
|
||||
r'7e6c17e6a2df98098ca1a683a438d1c261ccabdf';
|
||||
|
||||
/// See also [engineHistorySuggestions].
|
||||
@ProviderFor(engineHistorySuggestions)
|
||||
final engineHistorySuggestionsProvider =
|
||||
AutoDisposeProvider<AsyncValue<List<GeckoSuggestion>>>.internal(
|
||||
engineHistorySuggestions,
|
||||
name: r'engineHistorySuggestionsProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$engineHistorySuggestionsHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
engineHistorySuggestions,
|
||||
name: r'engineHistorySuggestionsProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$engineHistorySuggestionsHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
typedef EngineHistorySuggestionsRef
|
||||
= AutoDisposeProviderRef<AsyncValue<List<GeckoSuggestion>>>;
|
||||
typedef EngineHistorySuggestionsRef =
|
||||
AutoDisposeProviderRef<AsyncValue<List<GeckoSuggestion>>>;
|
||||
String _$engineSuggestionsHash() => r'ba2c2d7f0a5e99fd9e639acd020b8cf3016c6126';
|
||||
|
||||
/// See also [EngineSuggestions].
|
||||
@ProviderFor(EngineSuggestions)
|
||||
final engineSuggestionsProvider = AutoDisposeStreamNotifierProvider<
|
||||
EngineSuggestions, List<GeckoSuggestion>>.internal(
|
||||
EngineSuggestions,
|
||||
List<GeckoSuggestion>
|
||||
>.internal(
|
||||
EngineSuggestions.new,
|
||||
name: r'engineSuggestionsProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$engineSuggestionsHash,
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$engineSuggestionsHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
+39
-43
@@ -13,14 +13,15 @@ String _$defaultSearchSuggestionsHash() =>
|
||||
@ProviderFor(defaultSearchSuggestions)
|
||||
final defaultSearchSuggestionsProvider =
|
||||
Provider<ISearchSuggestionProvider>.internal(
|
||||
defaultSearchSuggestions,
|
||||
name: r'defaultSearchSuggestionsProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$defaultSearchSuggestionsHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
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
|
||||
@@ -52,9 +53,7 @@ abstract class _$SearchSuggestions
|
||||
extends BuildlessAutoDisposeStreamNotifier<List<String>> {
|
||||
late final ISearchSuggestionProvider? suggestionsProvider;
|
||||
|
||||
Stream<List<String>> build({
|
||||
ISearchSuggestionProvider? suggestionsProvider,
|
||||
});
|
||||
Stream<List<String>> build({ISearchSuggestionProvider? suggestionsProvider});
|
||||
}
|
||||
|
||||
/// See also [SearchSuggestions].
|
||||
@@ -70,18 +69,14 @@ class SearchSuggestionsFamily extends Family<AsyncValue<List<String>>> {
|
||||
SearchSuggestionsProvider call({
|
||||
ISearchSuggestionProvider? suggestionsProvider,
|
||||
}) {
|
||||
return SearchSuggestionsProvider(
|
||||
suggestionsProvider: suggestionsProvider,
|
||||
);
|
||||
return SearchSuggestionsProvider(suggestionsProvider: suggestionsProvider);
|
||||
}
|
||||
|
||||
@override
|
||||
SearchSuggestionsProvider getProviderOverride(
|
||||
covariant SearchSuggestionsProvider provider,
|
||||
) {
|
||||
return call(
|
||||
suggestionsProvider: provider.suggestionsProvider,
|
||||
);
|
||||
return call(suggestionsProvider: provider.suggestionsProvider);
|
||||
}
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
||||
@@ -100,24 +95,24 @@ class SearchSuggestionsFamily extends Family<AsyncValue<List<String>>> {
|
||||
}
|
||||
|
||||
/// See also [SearchSuggestions].
|
||||
class SearchSuggestionsProvider extends AutoDisposeStreamNotifierProviderImpl<
|
||||
SearchSuggestions, List<String>> {
|
||||
class SearchSuggestionsProvider
|
||||
extends
|
||||
AutoDisposeStreamNotifierProviderImpl<SearchSuggestions, List<String>> {
|
||||
/// 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({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, {
|
||||
@@ -132,12 +127,8 @@ class SearchSuggestionsProvider extends AutoDisposeStreamNotifierProviderImpl<
|
||||
final ISearchSuggestionProvider? suggestionsProvider;
|
||||
|
||||
@override
|
||||
Stream<List<String>> runNotifierBuild(
|
||||
covariant SearchSuggestions notifier,
|
||||
) {
|
||||
return notifier.build(
|
||||
suggestionsProvider: suggestionsProvider,
|
||||
);
|
||||
Stream<List<String>> runNotifierBuild(covariant SearchSuggestions notifier) {
|
||||
return notifier.build(suggestionsProvider: suggestionsProvider);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -158,7 +149,7 @@ class SearchSuggestionsProvider extends AutoDisposeStreamNotifierProviderImpl<
|
||||
|
||||
@override
|
||||
AutoDisposeStreamNotifierProviderElement<SearchSuggestions, List<String>>
|
||||
createElement() {
|
||||
createElement() {
|
||||
return _SearchSuggestionsProviderElement(this);
|
||||
}
|
||||
|
||||
@@ -186,13 +177,18 @@ mixin SearchSuggestionsRef
|
||||
}
|
||||
|
||||
class _SearchSuggestionsProviderElement
|
||||
extends AutoDisposeStreamNotifierProviderElement<SearchSuggestions,
|
||||
List<String>> with SearchSuggestionsRef {
|
||||
extends
|
||||
AutoDisposeStreamNotifierProviderElement<
|
||||
SearchSuggestions,
|
||||
List<String>
|
||||
>
|
||||
with SearchSuggestionsRef {
|
||||
_SearchSuggestionsProviderElement(super.provider);
|
||||
|
||||
@override
|
||||
ISearchSuggestionProvider? get suggestionsProvider =>
|
||||
(origin as SearchSuggestionsProvider).suggestionsProvider;
|
||||
}
|
||||
|
||||
// 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
|
||||
|
||||
+35
-28
@@ -53,18 +53,14 @@ class SearchSuggestionsRepositoryFamily
|
||||
SearchSuggestionsRepositoryProvider call(
|
||||
ISearchSuggestionProvider suggestionsProvider,
|
||||
) {
|
||||
return SearchSuggestionsRepositoryProvider(
|
||||
suggestionsProvider,
|
||||
);
|
||||
return SearchSuggestionsRepositoryProvider(suggestionsProvider);
|
||||
}
|
||||
|
||||
@override
|
||||
SearchSuggestionsRepositoryProvider getProviderOverride(
|
||||
covariant SearchSuggestionsRepositoryProvider provider,
|
||||
) {
|
||||
return call(
|
||||
provider.suggestionsProvider,
|
||||
);
|
||||
return call(provider.suggestionsProvider);
|
||||
}
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
||||
@@ -83,25 +79,30 @@ class SearchSuggestionsRepositoryFamily
|
||||
}
|
||||
|
||||
/// See also [SearchSuggestionsRepository].
|
||||
class SearchSuggestionsRepositoryProvider extends NotifierProviderImpl<
|
||||
SearchSuggestionsRepository, Raw<Stream<List<String>>>> {
|
||||
class SearchSuggestionsRepositoryProvider
|
||||
extends
|
||||
NotifierProviderImpl<
|
||||
SearchSuggestionsRepository,
|
||||
Raw<Stream<List<String>>>
|
||||
> {
|
||||
/// 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,
|
||||
);
|
||||
() =>
|
||||
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, {
|
||||
@@ -119,9 +120,7 @@ class SearchSuggestionsRepositoryProvider extends NotifierProviderImpl<
|
||||
Raw<Stream<List<String>>> runNotifierBuild(
|
||||
covariant SearchSuggestionsRepository notifier,
|
||||
) {
|
||||
return notifier.build(
|
||||
suggestionsProvider,
|
||||
);
|
||||
return notifier.build(suggestionsProvider);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -141,8 +140,11 @@ class SearchSuggestionsRepositoryProvider extends NotifierProviderImpl<
|
||||
}
|
||||
|
||||
@override
|
||||
NotifierProviderElement<SearchSuggestionsRepository,
|
||||
Raw<Stream<List<String>>>> createElement() {
|
||||
NotifierProviderElement<
|
||||
SearchSuggestionsRepository,
|
||||
Raw<Stream<List<String>>>
|
||||
>
|
||||
createElement() {
|
||||
return _SearchSuggestionsRepositoryProviderElement(this);
|
||||
}
|
||||
|
||||
@@ -170,13 +172,18 @@ mixin SearchSuggestionsRepositoryRef
|
||||
}
|
||||
|
||||
class _SearchSuggestionsRepositoryProviderElement
|
||||
extends NotifierProviderElement<SearchSuggestionsRepository,
|
||||
Raw<Stream<List<String>>>> with SearchSuggestionsRepositoryRef {
|
||||
extends
|
||||
NotifierProviderElement<
|
||||
SearchSuggestionsRepository,
|
||||
Raw<Stream<List<String>>>
|
||||
>
|
||||
with SearchSuggestionsRepositoryRef {
|
||||
_SearchSuggestionsRepositoryProviderElement(super.provider);
|
||||
|
||||
@override
|
||||
ISearchSuggestionProvider get suggestionsProvider =>
|
||||
(origin as SearchSuggestionsRepositoryProvider).suggestionsProvider;
|
||||
}
|
||||
|
||||
// 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
|
||||
|
||||
@@ -2,11 +2,12 @@ import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:lensai/core/routing/routes.dart';
|
||||
import 'package:lensai/extensions/nullable.dart';
|
||||
import 'package:lensai/features/bangs/data/models/bang_data.dart';
|
||||
import 'package:lensai/features/bangs/domain/repositories/search.dart';
|
||||
import 'package:lensai/features/bangs/domain/providers/search.dart';
|
||||
import 'package:lensai/presentation/hooks/listenable_callback.dart';
|
||||
import 'package:lensai/presentation/widgets/bang_icon.dart';
|
||||
import 'package:lensai/presentation/widgets/selectable_chips.dart';
|
||||
import 'package:lensai/presentation/widgets/url_icon.dart';
|
||||
|
||||
class BangChips extends HookConsumerWidget {
|
||||
final bool displayMenu;
|
||||
@@ -99,7 +100,7 @@ class BangChips extends HookConsumerWidget {
|
||||
await context.push(
|
||||
BangSearchRoute(
|
||||
searchText:
|
||||
(searchText?.isEmpty ?? true)
|
||||
(searchText.isEmpty)
|
||||
? BangSearchRoute.emptySearchText
|
||||
: searchText!,
|
||||
).location,
|
||||
|
||||
@@ -6,8 +6,8 @@ import 'package:lensai/features/geckoview/features/search/domain/providers/engin
|
||||
import 'package:lensai/features/user/domain/providers.dart';
|
||||
import 'package:lensai/presentation/hooks/listenable_callback.dart';
|
||||
import 'package:lensai/presentation/widgets/auto_suggest_text_field.dart';
|
||||
import 'package:lensai/presentation/widgets/bang_icon.dart';
|
||||
import 'package:lensai/presentation/widgets/speech_to_text_button.dart';
|
||||
import 'package:lensai/presentation/widgets/url_icon.dart';
|
||||
|
||||
class SearchField extends HookConsumerWidget {
|
||||
final TextEditingController textEditingController;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user