upgrade min sdk; run formatter
This commit is contained in:
@@ -14,10 +14,9 @@ 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,
|
||||
);
|
||||
@@ -33,10 +32,9 @@ 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,
|
||||
);
|
||||
|
||||
@@ -13,8 +13,9 @@ String _$formatHash() => r'fe7fcdd19b512784a36f3838c57701030475e429';
|
||||
final formatProvider = AsyncNotifierProvider<Format, void>.internal(
|
||||
Format.new,
|
||||
name: r'formatProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product') ? null : _$formatHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$formatHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@@ -14,10 +14,9 @@ final willAcceptDropProvider =
|
||||
AutoDisposeNotifierProvider<WillAcceptDrop, DropTargetData?>.internal(
|
||||
WillAcceptDrop.new,
|
||||
name: r'willAcceptDropProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$willAcceptDropHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$willAcceptDropHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@@ -13,8 +13,9 @@ String _$routerHash() => r'25fc899b87c080600f6e1d87d510db333378bdfd';
|
||||
final routerProvider = Provider<GoRouter>.internal(
|
||||
router,
|
||||
name: r'routerProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product') ? null : _$routerHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$routerHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@@ -64,10 +64,9 @@ class BangSearchRoute extends GoRouteData {
|
||||
@override
|
||||
Widget build(BuildContext context, GoRouterState state) {
|
||||
return BangSearchScreen(
|
||||
initialSearchText:
|
||||
(searchText.isEmpty || searchText == emptySearchText)
|
||||
? null
|
||||
: searchText,
|
||||
initialSearchText: (searchText.isEmpty || searchText == emptySearchText)
|
||||
? null
|
||||
: searchText,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,10 +72,9 @@ class SearchRoute extends GoRouteData {
|
||||
Widget build(BuildContext context, GoRouterState state) {
|
||||
return SearchScreen(
|
||||
tabType: tabType,
|
||||
initialSearchText:
|
||||
(searchText.isEmpty || searchText == emptySearchText)
|
||||
? null
|
||||
: searchText,
|
||||
initialSearchText: (searchText.isEmpty || searchText == emptySearchText)
|
||||
? null
|
||||
: searchText,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -124,8 +123,8 @@ class ContextMenuRoute extends GoRouteData {
|
||||
@override
|
||||
Page<void> buildPage(BuildContext context, GoRouterState state) {
|
||||
return DialogPage(
|
||||
builder:
|
||||
(_) => ContextMenuDialog(hitResult: HitResultJson.fromJson($extra)),
|
||||
builder: (_) =>
|
||||
ContextMenuDialog(hitResult: HitResultJson.fromJson($extra)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,26 +61,22 @@ 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<Uri>?,
|
||||
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<Uri>?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,19 +11,19 @@ String _$appInitializationServiceHash() =>
|
||||
|
||||
/// See also [AppInitializationService].
|
||||
@ProviderFor(AppInitializationService)
|
||||
final appInitializationServiceProvider = NotifierProvider<
|
||||
AppInitializationService,
|
||||
Result<({bool initialized, String? stage, List<ErrorMessage> errors})>
|
||||
>.internal(
|
||||
AppInitializationService.new,
|
||||
name: r'appInitializationServiceProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
final appInitializationServiceProvider =
|
||||
NotifierProvider<
|
||||
AppInitializationService,
|
||||
Result<({bool initialized, String? stage, List<ErrorMessage> errors})>
|
||||
>.internal(
|
||||
AppInitializationService.new,
|
||||
name: r'appInitializationServiceProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$appInitializationServiceHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$AppInitializationService =
|
||||
Notifier<
|
||||
|
||||
@@ -37,8 +37,10 @@ const _typeMap = {
|
||||
|
||||
Iterable<ResourceSize> sizesToList(String? sizes) sync* {
|
||||
if (sizes != null) {
|
||||
final splitted =
|
||||
sizes.split(' ').where((size) => size.contains('x')).toList();
|
||||
final splitted = sizes
|
||||
.split(' ')
|
||||
.where((size) => size.contains('x'))
|
||||
.toList();
|
||||
|
||||
for (final size in splitted) {
|
||||
final dimensions = size.split('x');
|
||||
@@ -87,10 +89,9 @@ class GenericWebsiteService extends _$GenericWebsiteService {
|
||||
url: resource['url'] as String,
|
||||
type: resource['type'] as IconType,
|
||||
mimeType: resource['mimeType'] as String?,
|
||||
sizes:
|
||||
(resource['sizes'] as List<List<int>>)
|
||||
.map((s) => ResourceSize(height: s[0], width: s[1]))
|
||||
.toList(),
|
||||
sizes: (resource['sizes'] as List<List<int>>)
|
||||
.map((s) => ResourceSize(height: s[0], width: s[1]))
|
||||
.toList(),
|
||||
maskable: resource['maskable'] as bool,
|
||||
);
|
||||
}
|
||||
@@ -211,8 +212,10 @@ class GenericWebsiteService extends _$GenericWebsiteService {
|
||||
|
||||
final title = document.querySelector('title')?.text;
|
||||
final resources = _extractIcons(baseUri, document);
|
||||
final feeds =
|
||||
await FeedFinder(url: baseUri, document: document).parse();
|
||||
final feeds = await FeedFinder(
|
||||
url: baseUri,
|
||||
document: document,
|
||||
).parse();
|
||||
|
||||
return {
|
||||
'title': title,
|
||||
@@ -235,10 +238,9 @@ class GenericWebsiteService extends _$GenericWebsiteService {
|
||||
);
|
||||
}
|
||||
|
||||
final resources =
|
||||
(result['resources']! as List<Map<String, dynamic>>)
|
||||
.map(_deserializeResource)
|
||||
.toList();
|
||||
final resources = (result['resources']! as List<Map<String, dynamic>>)
|
||||
.map(_deserializeResource)
|
||||
.toList();
|
||||
|
||||
final favicon =
|
||||
await getCachedIcon(url) ??
|
||||
|
||||
@@ -15,10 +15,9 @@ final genericWebsiteServiceProvider =
|
||||
NotifierProvider<GenericWebsiteService, void>.internal(
|
||||
GenericWebsiteService.new,
|
||||
name: r'genericWebsiteServiceProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$genericWebsiteServiceHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$genericWebsiteServiceHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@@ -13,8 +13,9 @@ String _$packageInfoHash() => r'cc57db7b4684ab0d5df0f050b8ea045a3658e89a';
|
||||
final packageInfoProvider = FutureProvider<PackageInfo>.internal(
|
||||
packageInfo,
|
||||
name: r'packageInfoProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product') ? null : _$packageInfoHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$packageInfoHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@@ -13,10 +13,9 @@ 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,
|
||||
);
|
||||
@@ -33,10 +32,9 @@ final appWidgetLaunchStreamProvider =
|
||||
AutoDisposeProvider<Raw<Stream<ReceivedIntentParameter>>>.internal(
|
||||
appWidgetLaunchStream,
|
||||
name: r'appWidgetLaunchStreamProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$appWidgetLaunchStreamHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$appWidgetLaunchStreamHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@@ -22,7 +22,10 @@ class BangDao extends DatabaseAccessor<BangDatabase> with _$BangDaoMixin {
|
||||
|
||||
SingleSelectable<int> getBangCount({Iterable<BangGroup>? groups}) {
|
||||
return db.bang.count(
|
||||
where: groups.mapNotNull((groups) => (t) => t.group.isInValues(groups)),
|
||||
where: groups.mapNotNull(
|
||||
(groups) =>
|
||||
(t) => t.group.isInValues(groups),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,10 +10,9 @@ class SyncDao extends DatabaseAccessor<BangDatabase> with _$SyncDaoMixin {
|
||||
SyncDao(super.db);
|
||||
|
||||
SingleOrNullSelectable<DateTime?> getLastSyncOfGroup(BangGroup group) {
|
||||
final query =
|
||||
selectOnly(db.bangSync)
|
||||
..addColumns([db.bangSync.lastSync])
|
||||
..where(db.bangSync.group.equalsValue(group));
|
||||
final query = selectOnly(db.bangSync)
|
||||
..addColumns([db.bangSync.lastSync])
|
||||
..where(db.bangSync.group.equalsValue(group));
|
||||
|
||||
return query.map((row) => row.read(db.bangSync.lastSync));
|
||||
}
|
||||
|
||||
@@ -96,26 +96,22 @@ class BangTable extends Table with TableInfo<BangTable, Bang> {
|
||||
Bang map(Map<String, dynamic> data, {String? tablePrefix}) {
|
||||
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
||||
return Bang(
|
||||
websiteName:
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}website_name'],
|
||||
)!,
|
||||
domain:
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}domain'],
|
||||
)!,
|
||||
trigger:
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}trigger'],
|
||||
)!,
|
||||
urlTemplate:
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}url_template'],
|
||||
)!,
|
||||
websiteName: attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}website_name'],
|
||||
)!,
|
||||
domain: attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}domain'],
|
||||
)!,
|
||||
trigger: attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}trigger'],
|
||||
)!,
|
||||
urlTemplate: attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}url_template'],
|
||||
)!,
|
||||
group: BangTable.$convertergroup.fromSql(
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.int,
|
||||
@@ -331,11 +327,10 @@ class BangSync extends Table with TableInfo<BangSync, BangSyncData> {
|
||||
data['${effectivePrefix}group'],
|
||||
)!,
|
||||
),
|
||||
lastSync:
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.dateTime,
|
||||
data['${effectivePrefix}last_sync'],
|
||||
)!,
|
||||
lastSync: attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.dateTime,
|
||||
data['${effectivePrefix}last_sync'],
|
||||
)!,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -512,21 +507,18 @@ class BangFrequency extends Table
|
||||
BangFrequencyData map(Map<String, dynamic> data, {String? tablePrefix}) {
|
||||
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
||||
return BangFrequencyData(
|
||||
trigger:
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}trigger'],
|
||||
)!,
|
||||
frequency:
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.int,
|
||||
data['${effectivePrefix}frequency'],
|
||||
)!,
|
||||
lastUsed:
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.dateTime,
|
||||
data['${effectivePrefix}last_used'],
|
||||
)!,
|
||||
trigger: attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}trigger'],
|
||||
)!,
|
||||
frequency: attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.int,
|
||||
data['${effectivePrefix}frequency'],
|
||||
)!,
|
||||
lastUsed: attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.dateTime,
|
||||
data['${effectivePrefix}last_used'],
|
||||
)!,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -736,21 +728,18 @@ class BangHistory extends Table with TableInfo<BangHistory, BangHistoryData> {
|
||||
BangHistoryData map(Map<String, dynamic> data, {String? tablePrefix}) {
|
||||
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
||||
return BangHistoryData(
|
||||
searchQuery:
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}search_query'],
|
||||
)!,
|
||||
trigger:
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}trigger'],
|
||||
)!,
|
||||
searchDate:
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.dateTime,
|
||||
data['${effectivePrefix}search_date'],
|
||||
)!,
|
||||
searchQuery: attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}search_query'],
|
||||
)!,
|
||||
trigger: attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}trigger'],
|
||||
)!,
|
||||
searchDate: attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.dateTime,
|
||||
data['${effectivePrefix}search_date'],
|
||||
)!,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -813,11 +802,13 @@ class BangHistoryData extends DataClass implements Insertable<BangHistoryData> {
|
||||
);
|
||||
BangHistoryData copyWithCompanion(BangHistoryCompanion data) {
|
||||
return BangHistoryData(
|
||||
searchQuery:
|
||||
data.searchQuery.present ? data.searchQuery.value : this.searchQuery,
|
||||
searchQuery: data.searchQuery.present
|
||||
? data.searchQuery.value
|
||||
: this.searchQuery,
|
||||
trigger: data.trigger.present ? data.trigger.value : this.trigger,
|
||||
searchDate:
|
||||
data.searchDate.present ? data.searchDate.value : this.searchDate,
|
||||
searchDate: data.searchDate.present
|
||||
? data.searchDate.value
|
||||
: this.searchDate,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -954,16 +945,14 @@ class BangFts extends Table
|
||||
BangFt map(Map<String, dynamic> data, {String? tablePrefix}) {
|
||||
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
||||
return BangFt(
|
||||
trigger:
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}trigger'],
|
||||
)!,
|
||||
websiteName:
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}website_name'],
|
||||
)!,
|
||||
trigger: attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}trigger'],
|
||||
)!,
|
||||
websiteName: attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}website_name'],
|
||||
)!,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1017,8 +1006,9 @@ class BangFt extends DataClass implements Insertable<BangFt> {
|
||||
BangFt copyWithCompanion(BangFtsCompanion data) {
|
||||
return BangFt(
|
||||
trigger: data.trigger.present ? data.trigger.value : this.trigger,
|
||||
websiteName:
|
||||
data.websiteName.present ? data.websiteName.value : this.websiteName,
|
||||
websiteName: data.websiteName.present
|
||||
? data.websiteName.value
|
||||
: this.websiteName,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1140,26 +1130,22 @@ class BangDataView extends ViewInfo<BangDataView, BangData>
|
||||
BangData map(Map<String, dynamic> data, {String? tablePrefix}) {
|
||||
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
||||
return BangData(
|
||||
websiteName:
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}website_name'],
|
||||
)!,
|
||||
domain:
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}domain'],
|
||||
)!,
|
||||
trigger:
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}trigger'],
|
||||
)!,
|
||||
urlTemplate:
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}url_template'],
|
||||
)!,
|
||||
websiteName: attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}website_name'],
|
||||
)!,
|
||||
domain: attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}domain'],
|
||||
)!,
|
||||
trigger: attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}trigger'],
|
||||
)!,
|
||||
urlTemplate: attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}url_template'],
|
||||
)!,
|
||||
category: attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}category'],
|
||||
@@ -1735,12 +1721,12 @@ class $BangTableTableManager
|
||||
TableManagerState(
|
||||
db: db,
|
||||
table: table,
|
||||
createFilteringComposer:
|
||||
() => $BangTableFilterComposer($db: db, $table: table),
|
||||
createOrderingComposer:
|
||||
() => $BangTableOrderingComposer($db: db, $table: table),
|
||||
createComputedFieldComposer:
|
||||
() => $BangTableAnnotationComposer($db: db, $table: table),
|
||||
createFilteringComposer: () =>
|
||||
$BangTableFilterComposer($db: db, $table: table),
|
||||
createOrderingComposer: () =>
|
||||
$BangTableOrderingComposer($db: db, $table: table),
|
||||
createComputedFieldComposer: () =>
|
||||
$BangTableAnnotationComposer($db: db, $table: table),
|
||||
updateCompanionCallback:
|
||||
({
|
||||
Value<String> trigger = const Value.absent(),
|
||||
@@ -1785,73 +1771,66 @@ class $BangTableTableManager
|
||||
format: format,
|
||||
rowid: rowid,
|
||||
),
|
||||
withReferenceMapper:
|
||||
(p0) =>
|
||||
p0
|
||||
.map(
|
||||
(e) => (
|
||||
e.readTable(table),
|
||||
$BangTableReferences(db, table, e),
|
||||
withReferenceMapper: (p0) => p0
|
||||
.map(
|
||||
(e) => (e.readTable(table), $BangTableReferences(db, table, e)),
|
||||
)
|
||||
.toList(),
|
||||
prefetchHooksCallback:
|
||||
({bangFrequencyRefs = false, bangHistoryRefs = false}) {
|
||||
return PrefetchHooks(
|
||||
db: db,
|
||||
explicitlyWatchedTables: [
|
||||
if (bangFrequencyRefs) db.bangFrequency,
|
||||
if (bangHistoryRefs) db.bangHistory,
|
||||
],
|
||||
addJoins: null,
|
||||
getPrefetchedDataCallback: (items) async {
|
||||
return [
|
||||
if (bangFrequencyRefs)
|
||||
await $_getPrefetchedData<
|
||||
Bang,
|
||||
BangTable,
|
||||
BangFrequencyData
|
||||
>(
|
||||
currentTable: table,
|
||||
referencedTable: $BangTableReferences
|
||||
._bangFrequencyRefsTable(db),
|
||||
managerFromTypedResult: (p0) => $BangTableReferences(
|
||||
db,
|
||||
table,
|
||||
p0,
|
||||
).bangFrequencyRefs,
|
||||
referencedItemsForCurrentItem:
|
||||
(item, referencedItems) => referencedItems.where(
|
||||
(e) => e.trigger == item.trigger,
|
||||
),
|
||||
typedResults: items,
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
prefetchHooksCallback: ({
|
||||
bangFrequencyRefs = false,
|
||||
bangHistoryRefs = false,
|
||||
}) {
|
||||
return PrefetchHooks(
|
||||
db: db,
|
||||
explicitlyWatchedTables: [
|
||||
if (bangFrequencyRefs) db.bangFrequency,
|
||||
if (bangHistoryRefs) db.bangHistory,
|
||||
],
|
||||
addJoins: null,
|
||||
getPrefetchedDataCallback: (items) async {
|
||||
return [
|
||||
if (bangFrequencyRefs)
|
||||
await $_getPrefetchedData<
|
||||
Bang,
|
||||
BangTable,
|
||||
BangFrequencyData
|
||||
>(
|
||||
currentTable: table,
|
||||
referencedTable: $BangTableReferences
|
||||
._bangFrequencyRefsTable(db),
|
||||
managerFromTypedResult:
|
||||
(p0) =>
|
||||
$BangTableReferences(
|
||||
db,
|
||||
table,
|
||||
p0,
|
||||
).bangFrequencyRefs,
|
||||
referencedItemsForCurrentItem:
|
||||
(item, referencedItems) => referencedItems.where(
|
||||
(e) => e.trigger == item.trigger,
|
||||
),
|
||||
typedResults: items,
|
||||
),
|
||||
if (bangHistoryRefs)
|
||||
await $_getPrefetchedData<Bang, BangTable, BangHistoryData>(
|
||||
currentTable: table,
|
||||
referencedTable: $BangTableReferences
|
||||
._bangHistoryRefsTable(db),
|
||||
managerFromTypedResult:
|
||||
(p0) =>
|
||||
$BangTableReferences(
|
||||
db,
|
||||
table,
|
||||
p0,
|
||||
).bangHistoryRefs,
|
||||
referencedItemsForCurrentItem:
|
||||
(item, referencedItems) => referencedItems.where(
|
||||
(e) => e.trigger == item.trigger,
|
||||
),
|
||||
typedResults: items,
|
||||
),
|
||||
];
|
||||
if (bangHistoryRefs)
|
||||
await $_getPrefetchedData<
|
||||
Bang,
|
||||
BangTable,
|
||||
BangHistoryData
|
||||
>(
|
||||
currentTable: table,
|
||||
referencedTable: $BangTableReferences
|
||||
._bangHistoryRefsTable(db),
|
||||
managerFromTypedResult: (p0) => $BangTableReferences(
|
||||
db,
|
||||
table,
|
||||
p0,
|
||||
).bangHistoryRefs,
|
||||
referencedItemsForCurrentItem:
|
||||
(item, referencedItems) => referencedItems.where(
|
||||
(e) => e.trigger == item.trigger,
|
||||
),
|
||||
typedResults: items,
|
||||
),
|
||||
];
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -1958,12 +1937,12 @@ class $BangSyncTableManager
|
||||
TableManagerState(
|
||||
db: db,
|
||||
table: table,
|
||||
createFilteringComposer:
|
||||
() => $BangSyncFilterComposer($db: db, $table: table),
|
||||
createOrderingComposer:
|
||||
() => $BangSyncOrderingComposer($db: db, $table: table),
|
||||
createComputedFieldComposer:
|
||||
() => $BangSyncAnnotationComposer($db: db, $table: table),
|
||||
createFilteringComposer: () =>
|
||||
$BangSyncFilterComposer($db: db, $table: table),
|
||||
createOrderingComposer: () =>
|
||||
$BangSyncOrderingComposer($db: db, $table: table),
|
||||
createComputedFieldComposer: () =>
|
||||
$BangSyncAnnotationComposer($db: db, $table: table),
|
||||
updateCompanionCallback:
|
||||
({
|
||||
Value<BangGroup> group = const Value.absent(),
|
||||
@@ -1974,16 +1953,9 @@ class $BangSyncTableManager
|
||||
Value<BangGroup> group = const Value.absent(),
|
||||
required DateTime lastSync,
|
||||
}) => BangSyncCompanion.insert(group: group, lastSync: lastSync),
|
||||
withReferenceMapper:
|
||||
(p0) =>
|
||||
p0
|
||||
.map(
|
||||
(e) => (
|
||||
e.readTable(table),
|
||||
BaseReferences(db, table, e),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
withReferenceMapper: (p0) => p0
|
||||
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
||||
.toList(),
|
||||
prefetchHooksCallback: null,
|
||||
),
|
||||
);
|
||||
@@ -2186,12 +2158,12 @@ class $BangFrequencyTableManager
|
||||
TableManagerState(
|
||||
db: db,
|
||||
table: table,
|
||||
createFilteringComposer:
|
||||
() => $BangFrequencyFilterComposer($db: db, $table: table),
|
||||
createOrderingComposer:
|
||||
() => $BangFrequencyOrderingComposer($db: db, $table: table),
|
||||
createComputedFieldComposer:
|
||||
() => $BangFrequencyAnnotationComposer($db: db, $table: table),
|
||||
createFilteringComposer: () =>
|
||||
$BangFrequencyFilterComposer($db: db, $table: table),
|
||||
createOrderingComposer: () =>
|
||||
$BangFrequencyOrderingComposer($db: db, $table: table),
|
||||
createComputedFieldComposer: () =>
|
||||
$BangFrequencyAnnotationComposer($db: db, $table: table),
|
||||
updateCompanionCallback:
|
||||
({
|
||||
Value<String> trigger = const Value.absent(),
|
||||
@@ -2216,52 +2188,50 @@ class $BangFrequencyTableManager
|
||||
lastUsed: lastUsed,
|
||||
rowid: rowid,
|
||||
),
|
||||
withReferenceMapper:
|
||||
(p0) =>
|
||||
p0
|
||||
.map(
|
||||
(e) => (
|
||||
e.readTable(table),
|
||||
$BangFrequencyReferences(db, table, e),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
withReferenceMapper: (p0) => p0
|
||||
.map(
|
||||
(e) => (
|
||||
e.readTable(table),
|
||||
$BangFrequencyReferences(db, table, e),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
prefetchHooksCallback: ({trigger = false}) {
|
||||
return PrefetchHooks(
|
||||
db: db,
|
||||
explicitlyWatchedTables: [],
|
||||
addJoins: <
|
||||
T extends TableManagerState<
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic
|
||||
>
|
||||
>(state) {
|
||||
if (trigger) {
|
||||
state =
|
||||
state.withJoin(
|
||||
currentTable: table,
|
||||
currentColumn: table.trigger,
|
||||
referencedTable: $BangFrequencyReferences
|
||||
._triggerTable(db),
|
||||
referencedColumn:
|
||||
$BangFrequencyReferences
|
||||
addJoins:
|
||||
<
|
||||
T extends TableManagerState<
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic
|
||||
>
|
||||
>(state) {
|
||||
if (trigger) {
|
||||
state =
|
||||
state.withJoin(
|
||||
currentTable: table,
|
||||
currentColumn: table.trigger,
|
||||
referencedTable: $BangFrequencyReferences
|
||||
._triggerTable(db),
|
||||
referencedColumn: $BangFrequencyReferences
|
||||
._triggerTable(db)
|
||||
.trigger,
|
||||
)
|
||||
as T;
|
||||
}
|
||||
)
|
||||
as T;
|
||||
}
|
||||
|
||||
return state;
|
||||
},
|
||||
return state;
|
||||
},
|
||||
getPrefetchedDataCallback: (items) async {
|
||||
return [];
|
||||
},
|
||||
@@ -2471,12 +2441,12 @@ class $BangHistoryTableManager
|
||||
TableManagerState(
|
||||
db: db,
|
||||
table: table,
|
||||
createFilteringComposer:
|
||||
() => $BangHistoryFilterComposer($db: db, $table: table),
|
||||
createOrderingComposer:
|
||||
() => $BangHistoryOrderingComposer($db: db, $table: table),
|
||||
createComputedFieldComposer:
|
||||
() => $BangHistoryAnnotationComposer($db: db, $table: table),
|
||||
createFilteringComposer: () =>
|
||||
$BangHistoryFilterComposer($db: db, $table: table),
|
||||
createOrderingComposer: () =>
|
||||
$BangHistoryOrderingComposer($db: db, $table: table),
|
||||
createComputedFieldComposer: () =>
|
||||
$BangHistoryAnnotationComposer($db: db, $table: table),
|
||||
updateCompanionCallback:
|
||||
({
|
||||
Value<String> searchQuery = const Value.absent(),
|
||||
@@ -2501,52 +2471,48 @@ class $BangHistoryTableManager
|
||||
searchDate: searchDate,
|
||||
rowid: rowid,
|
||||
),
|
||||
withReferenceMapper:
|
||||
(p0) =>
|
||||
p0
|
||||
.map(
|
||||
(e) => (
|
||||
e.readTable(table),
|
||||
$BangHistoryReferences(db, table, e),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
withReferenceMapper: (p0) => p0
|
||||
.map(
|
||||
(e) =>
|
||||
(e.readTable(table), $BangHistoryReferences(db, table, e)),
|
||||
)
|
||||
.toList(),
|
||||
prefetchHooksCallback: ({trigger = false}) {
|
||||
return PrefetchHooks(
|
||||
db: db,
|
||||
explicitlyWatchedTables: [],
|
||||
addJoins: <
|
||||
T extends TableManagerState<
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic
|
||||
>
|
||||
>(state) {
|
||||
if (trigger) {
|
||||
state =
|
||||
state.withJoin(
|
||||
currentTable: table,
|
||||
currentColumn: table.trigger,
|
||||
referencedTable: $BangHistoryReferences
|
||||
._triggerTable(db),
|
||||
referencedColumn:
|
||||
$BangHistoryReferences
|
||||
addJoins:
|
||||
<
|
||||
T extends TableManagerState<
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic
|
||||
>
|
||||
>(state) {
|
||||
if (trigger) {
|
||||
state =
|
||||
state.withJoin(
|
||||
currentTable: table,
|
||||
currentColumn: table.trigger,
|
||||
referencedTable: $BangHistoryReferences
|
||||
._triggerTable(db),
|
||||
referencedColumn: $BangHistoryReferences
|
||||
._triggerTable(db)
|
||||
.trigger,
|
||||
)
|
||||
as T;
|
||||
}
|
||||
)
|
||||
as T;
|
||||
}
|
||||
|
||||
return state;
|
||||
},
|
||||
return state;
|
||||
},
|
||||
getPrefetchedDataCallback: (items) async {
|
||||
return [];
|
||||
},
|
||||
@@ -2658,12 +2624,12 @@ class $BangFtsTableManager
|
||||
TableManagerState(
|
||||
db: db,
|
||||
table: table,
|
||||
createFilteringComposer:
|
||||
() => $BangFtsFilterComposer($db: db, $table: table),
|
||||
createOrderingComposer:
|
||||
() => $BangFtsOrderingComposer($db: db, $table: table),
|
||||
createComputedFieldComposer:
|
||||
() => $BangFtsAnnotationComposer($db: db, $table: table),
|
||||
createFilteringComposer: () =>
|
||||
$BangFtsFilterComposer($db: db, $table: table),
|
||||
createOrderingComposer: () =>
|
||||
$BangFtsOrderingComposer($db: db, $table: table),
|
||||
createComputedFieldComposer: () =>
|
||||
$BangFtsAnnotationComposer($db: db, $table: table),
|
||||
updateCompanionCallback:
|
||||
({
|
||||
Value<String> trigger = const Value.absent(),
|
||||
@@ -2684,16 +2650,9 @@ class $BangFtsTableManager
|
||||
websiteName: websiteName,
|
||||
rowid: rowid,
|
||||
),
|
||||
withReferenceMapper:
|
||||
(p0) =>
|
||||
p0
|
||||
.map(
|
||||
(e) => (
|
||||
e.readTable(table),
|
||||
BaseReferences(db, table, e),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
withReferenceMapper: (p0) => p0
|
||||
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
||||
.toList(),
|
||||
prefetchHooksCallback: null,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -65,20 +65,16 @@ class Bang with FastEquatable implements Insertable<Bang> {
|
||||
return (format == null ||
|
||||
format!.contains(BangFormat.urlEncodePlaceholder) == true)
|
||||
? (format == null ||
|
||||
format?.contains(BangFormat.urlEncodeSpaceToPlus) == true)
|
||||
? Uri.encodeQueryComponent(input)
|
||||
: Uri.encodeComponent(input)
|
||||
format?.contains(BangFormat.urlEncodeSpaceToPlus) == true)
|
||||
? Uri.encodeQueryComponent(input)
|
||||
: Uri.encodeComponent(input)
|
||||
: input;
|
||||
}
|
||||
|
||||
Uri getTemplateUrl(String? query) {
|
||||
final url =
|
||||
(query != null)
|
||||
? urlTemplate.replaceAll(
|
||||
_templateQueryPlaceholder,
|
||||
formatQuery(query),
|
||||
)
|
||||
: urlTemplate;
|
||||
final url = (query != null)
|
||||
? urlTemplate.replaceAll(_templateQueryPlaceholder, formatQuery(query))
|
||||
: urlTemplate;
|
||||
|
||||
var template = Uri.parse(url);
|
||||
if (!template.hasScheme || template.origin.isEmpty) {
|
||||
|
||||
@@ -89,46 +89,38 @@ 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>?,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -150,10 +142,9 @@ Bang _$BangFromJson(Map<String, dynamic> json) => Bang(
|
||||
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(),
|
||||
format: (json['fmt'] as List<dynamic>?)
|
||||
?.map((e) => $enumDecode(_$BangFormatEnumMap, e))
|
||||
.toSet(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$BangToJson(Bang instance) => <String, dynamic>{
|
||||
|
||||
@@ -103,56 +103,46 @@ 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?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,8 +13,9 @@ String _$bangDatabaseHash() => r'e31cf4b499300aff65174a16fb74c7dd8ec3d6f0';
|
||||
final bangDatabaseProvider = Provider<BangDatabase>.internal(
|
||||
bangDatabase,
|
||||
name: r'bangDatabaseProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product') ? null : _$bangDatabaseHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bangDatabaseHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@@ -30,16 +30,15 @@ class BangDataSourceService extends _$BangDataSourceService {
|
||||
client.close();
|
||||
}
|
||||
}, [url.toString()]).then(
|
||||
(json) =>
|
||||
json.map((e) {
|
||||
var bang = Bang.fromJson(e as Map<String, dynamic>);
|
||||
(json) => json.map((e) {
|
||||
var bang = Bang.fromJson(e as Map<String, dynamic>);
|
||||
|
||||
if (group != null) {
|
||||
bang = bang.copyWith.group(group);
|
||||
}
|
||||
if (group != null) {
|
||||
bang = bang.copyWith.group(group);
|
||||
}
|
||||
|
||||
return bang;
|
||||
}).toList(),
|
||||
return bang;
|
||||
}).toList(),
|
||||
);
|
||||
}, exceptionHandler: handleHttpError);
|
||||
}
|
||||
|
||||
@@ -15,10 +15,9 @@ final bangDataSourceServiceProvider =
|
||||
AutoDisposeNotifierProvider<BangDataSourceService, void>.internal(
|
||||
BangDataSourceService.new,
|
||||
name: r'bangDataSourceServiceProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bangDataSourceServiceHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bangDataSourceServiceHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@@ -14,10 +14,9 @@ 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,
|
||||
);
|
||||
@@ -33,10 +32,9 @@ final bangCategoriesProvider =
|
||||
AutoDisposeStreamProvider<Map<String, List<String>>>.internal(
|
||||
bangCategories,
|
||||
name: r'bangCategoriesProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bangCategoriesHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bangCategoriesHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
@@ -135,10 +133,9 @@ class BangListProvider extends AutoDisposeStreamProvider<List<BangData>> {
|
||||
),
|
||||
from: bangListProvider,
|
||||
name: r'bangListProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bangListHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bangListHash,
|
||||
dependencies: BangListFamily._dependencies,
|
||||
allTransitiveDependencies: BangListFamily._allTransitiveDependencies,
|
||||
groups: groups,
|
||||
@@ -253,10 +250,9 @@ final frequentBangListProvider =
|
||||
AutoDisposeStreamProvider<List<BangData>>.internal(
|
||||
frequentBangList,
|
||||
name: r'frequentBangListProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$frequentBangListHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$frequentBangListHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
@@ -272,10 +268,9 @@ final searchHistoryProvider =
|
||||
AutoDisposeStreamProvider<List<SearchHistoryEntry>>.internal(
|
||||
searchHistory,
|
||||
name: r'searchHistoryProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$searchHistoryHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$searchHistoryHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
@@ -330,10 +325,9 @@ class LastSyncOfGroupProvider extends AutoDisposeStreamProvider<DateTime?> {
|
||||
(ref) => lastSyncOfGroup(ref as LastSyncOfGroupRef, group),
|
||||
from: lastSyncOfGroupProvider,
|
||||
name: r'lastSyncOfGroupProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$lastSyncOfGroupHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$lastSyncOfGroupHash,
|
||||
dependencies: LastSyncOfGroupFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
LastSyncOfGroupFamily._allTransitiveDependencies,
|
||||
@@ -451,10 +445,9 @@ class BangCountOfGroupProvider extends AutoDisposeStreamProvider<int> {
|
||||
(ref) => bangCountOfGroup(ref as BangCountOfGroupRef, group),
|
||||
from: bangCountOfGroupProvider,
|
||||
name: r'bangCountOfGroupProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bangCountOfGroupHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bangCountOfGroupHash,
|
||||
dependencies: BangCountOfGroupFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
BangCountOfGroupFamily._allTransitiveDependencies,
|
||||
|
||||
@@ -14,10 +14,9 @@ final bangSearchProvider =
|
||||
AutoDisposeStreamNotifierProvider<BangSearch, List<BangData>>.internal(
|
||||
BangSearch.new,
|
||||
name: r'bangSearchProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bangSearchHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bangSearchHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
@@ -27,17 +26,19 @@ String _$seamlessBangHash() => r'8bd7a2cbe4c302ae08f85167290666a7437f8b9b';
|
||||
|
||||
/// See also [SeamlessBang].
|
||||
@ProviderFor(SeamlessBang)
|
||||
final seamlessBangProvider = AutoDisposeNotifierProvider<
|
||||
SeamlessBang,
|
||||
AsyncValue<List<BangData>>
|
||||
>.internal(
|
||||
SeamlessBang.new,
|
||||
name: r'seamlessBangProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product') ? null : _$seamlessBangHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
final seamlessBangProvider =
|
||||
AutoDisposeNotifierProvider<
|
||||
SeamlessBang,
|
||||
AsyncValue<List<BangData>>
|
||||
>.internal(
|
||||
SeamlessBang.new,
|
||||
name: r'seamlessBangProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$seamlessBangHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$SeamlessBang = AutoDisposeNotifier<AsyncValue<List<BangData>>>;
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
@@ -15,10 +15,9 @@ final bangDataRepositoryProvider =
|
||||
NotifierProvider<BangDataRepository, void>.internal(
|
||||
BangDataRepository.new,
|
||||
name: r'bangDataRepositoryProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bangDataRepositoryHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bangDataRepositoryHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@@ -19,8 +19,9 @@ class BangSyncRepository extends _$BangSyncRepository {
|
||||
required Duration? syncInterval,
|
||||
}) async {
|
||||
if (syncInterval != null) {
|
||||
final lastSync =
|
||||
await db.syncDao.getLastSyncOfGroup(group).getSingleOrNull();
|
||||
final lastSync = await db.syncDao
|
||||
.getLastSyncOfGroup(group)
|
||||
.getSingleOrNull();
|
||||
|
||||
if (lastSync != null &&
|
||||
DateTime.now().difference(lastSync) < syncInterval) {
|
||||
|
||||
@@ -15,10 +15,9 @@ final bangSyncRepositoryProvider =
|
||||
NotifierProvider<BangSyncRepository, void>.internal(
|
||||
BangSyncRepository.new,
|
||||
name: r'bangSyncRepositoryProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bangSyncRepositoryHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bangSyncRepositoryHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@@ -54,40 +54,35 @@ class BangCategoriesScreen extends HookConsumerWidget {
|
||||
expanded.value = {...expanded.value}..remove(key);
|
||||
}
|
||||
},
|
||||
children:
|
||||
categories.entries
|
||||
.map(
|
||||
(category) => ExpansionPanel(
|
||||
canTapOnHeader: true,
|
||||
isExpanded: expanded.value.contains(
|
||||
category.key,
|
||||
),
|
||||
headerBuilder:
|
||||
(context, isExpanded) =>
|
||||
ListTile(title: Text(category.key)),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.only(left: 16.0),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children:
|
||||
category.value
|
||||
.map(
|
||||
(subCategory) => ListTile(
|
||||
title: Text(subCategory),
|
||||
onTap: () async {
|
||||
await BangSubCategoryRoute(
|
||||
category: category.key,
|
||||
subCategory: subCategory,
|
||||
).push(context);
|
||||
},
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
children: categories.entries
|
||||
.map(
|
||||
(category) => ExpansionPanel(
|
||||
canTapOnHeader: true,
|
||||
isExpanded: expanded.value.contains(category.key),
|
||||
headerBuilder: (context, isExpanded) =>
|
||||
ListTile(title: Text(category.key)),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.only(left: 16.0),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: category.value
|
||||
.map(
|
||||
(subCategory) => ListTile(
|
||||
title: Text(subCategory),
|
||||
onTap: () async {
|
||||
await BangSubCategoryRoute(
|
||||
category: category.key,
|
||||
subCategory: subCategory,
|
||||
).push(context);
|
||||
},
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -95,13 +90,12 @@ class BangCategoriesScreen extends HookConsumerWidget {
|
||||
},
|
||||
);
|
||||
},
|
||||
error:
|
||||
(error, stackTrace) => Center(
|
||||
child: FailureWidget(
|
||||
title: 'Failed to load Bang Categories',
|
||||
exception: error,
|
||||
),
|
||||
),
|
||||
error: (error, stackTrace) => Center(
|
||||
child: FailureWidget(
|
||||
title: 'Failed to load Bang Categories',
|
||||
exception: error,
|
||||
),
|
||||
),
|
||||
loading: () => const Center(child: CircularProgressIndicator()),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -47,19 +47,17 @@ class BangListScreen extends HookConsumerWidget {
|
||||
},
|
||||
);
|
||||
},
|
||||
error:
|
||||
(error, stackTrace) => SliverToBoxAdapter(
|
||||
child: Center(
|
||||
child: FailureWidget(
|
||||
title: 'Failed to load Bangs',
|
||||
exception: error,
|
||||
),
|
||||
),
|
||||
),
|
||||
loading:
|
||||
() => const SliverToBoxAdapter(
|
||||
child: Center(child: CircularProgressIndicator()),
|
||||
error: (error, stackTrace) => SliverToBoxAdapter(
|
||||
child: Center(
|
||||
child: FailureWidget(
|
||||
title: 'Failed to load Bangs',
|
||||
exception: error,
|
||||
),
|
||||
),
|
||||
),
|
||||
loading: () => const SliverToBoxAdapter(
|
||||
child: Center(child: CircularProgressIndicator()),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -60,32 +60,27 @@ class BangSearchScreen extends HookConsumerWidget {
|
||||
),
|
||||
body: resultsAsync.when(
|
||||
skipLoadingOnReload: true,
|
||||
data:
|
||||
(bangs) => FadingScroll(
|
||||
fadingSize: 25,
|
||||
builder: (context, controller) {
|
||||
return ListView.builder(
|
||||
controller: controller,
|
||||
itemCount: bangs.length,
|
||||
itemBuilder: (context, index) {
|
||||
final bang = bangs[index];
|
||||
return BangDetails(
|
||||
bang,
|
||||
onTap: () {
|
||||
context.pop(bang.trigger);
|
||||
},
|
||||
);
|
||||
data: (bangs) => FadingScroll(
|
||||
fadingSize: 25,
|
||||
builder: (context, controller) {
|
||||
return ListView.builder(
|
||||
controller: controller,
|
||||
itemCount: bangs.length,
|
||||
itemBuilder: (context, index) {
|
||||
final bang = bangs[index];
|
||||
return BangDetails(
|
||||
bang,
|
||||
onTap: () {
|
||||
context.pop(bang.trigger);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
error:
|
||||
(error, stackTrace) => Center(
|
||||
child: FailureWidget(
|
||||
title: 'Bang Search failed',
|
||||
exception: error,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
error: (error, stackTrace) => Center(
|
||||
child: FailureWidget(title: 'Bang Search failed', exception: error),
|
||||
),
|
||||
loading: () => const SizedBox.shrink(),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -83,8 +83,8 @@ class SiteSearch extends HookConsumerWidget {
|
||||
width: double.maxFinite,
|
||||
child: SelectableChips(
|
||||
itemId: (bang) => bang.trigger,
|
||||
itemAvatar:
|
||||
(bang) => UrlIcon([bang.getTemplateUrl('')], iconSize: 20),
|
||||
itemAvatar: (bang) =>
|
||||
UrlIcon([bang.getTemplateUrl('')], iconSize: 20),
|
||||
itemLabel: (bang) => Text(bang.websiteName),
|
||||
availableItems: availableBangs,
|
||||
selectedItem: selectedBang,
|
||||
|
||||
@@ -15,10 +15,9 @@ final bottomSheetControllerProvider =
|
||||
AutoDisposeNotifierProvider<BottomSheetController, Sheet?>.internal(
|
||||
BottomSheetController.new,
|
||||
name: r'bottomSheetControllerProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bottomSheetControllerHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bottomSheetControllerHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
@@ -32,10 +31,9 @@ final bottomSheetExtendProvider =
|
||||
StreamNotifierProvider<BottomSheetExtend, double>.internal(
|
||||
BottomSheetExtend.new,
|
||||
name: r'bottomSheetExtendProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bottomSheetExtendHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$bottomSheetExtendHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@@ -14,10 +14,9 @@ final overlayControllerProvider =
|
||||
AutoDisposeNotifierProvider<OverlayController, Widget?>.internal(
|
||||
OverlayController.new,
|
||||
name: r'overlayControllerProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$overlayControllerHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$overlayControllerHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@@ -129,71 +129,58 @@ 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,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,41 +85,34 @@ 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?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,10 +15,9 @@ final selectionActionServiceProvider =
|
||||
Provider<GeckoSelectionActionService>.internal(
|
||||
selectionActionService,
|
||||
name: r'selectionActionServiceProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$selectionActionServiceHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$selectionActionServiceHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
@@ -33,8 +32,9 @@ String _$eventServiceHash() => r'166b01f636fbdd4355dbc55a18ca4f83e0006de8';
|
||||
final eventServiceProvider = Provider<GeckoEventService>.internal(
|
||||
eventService,
|
||||
name: r'eventServiceProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product') ? null : _$eventServiceHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$eventServiceHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
@@ -49,8 +49,9 @@ String _$addonServiceHash() => r'c7aca09b99c3810908176f3464f5f90a185aa5e7';
|
||||
final addonServiceProvider = Provider<GeckoAddonService>.internal(
|
||||
addonService,
|
||||
name: r'addonServiceProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product') ? null : _$addonServiceHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$addonServiceHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
@@ -65,10 +66,9 @@ 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,
|
||||
);
|
||||
@@ -85,10 +85,9 @@ final engineSuggestionsServiceProvider =
|
||||
Provider<GeckoSuggestionsService>.internal(
|
||||
engineSuggestionsService,
|
||||
name: r'engineSuggestionsServiceProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$engineSuggestionsServiceHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$engineSuggestionsServiceHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
@@ -104,10 +103,9 @@ final engineReadyStateProvider =
|
||||
NotifierProvider<EngineReadyState, bool>.internal(
|
||||
EngineReadyState.new,
|
||||
name: r'engineReadyStateProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$engineReadyStateHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$engineReadyStateHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@@ -15,10 +15,9 @@ final browserExtensionServiceProvider =
|
||||
Provider<GeckoBrowserExtensionService>.internal(
|
||||
browserExtensionService,
|
||||
name: r'browserExtensionServiceProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$browserExtensionServiceHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$browserExtensionServiceHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
@@ -33,10 +32,9 @@ String _$feedRequestedHash() => r'4f179d0878072a77a87422ff6afdac53a3d57c04';
|
||||
final feedRequestedProvider = AutoDisposeStreamProvider<String>.internal(
|
||||
feedRequested,
|
||||
name: r'feedRequestedProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$feedRequestedHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$feedRequestedHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@@ -13,8 +13,9 @@ String _$selectedTabHash() => r'12b670dd76c3416e8d62bafd63bf69a83a603e3a';
|
||||
final selectedTabProvider = NotifierProvider<SelectedTab, String?>.internal(
|
||||
SelectedTab.new,
|
||||
name: r'selectedTabProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product') ? null : _$selectedTabHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$selectedTabHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@@ -14,8 +14,9 @@ final tabListProvider =
|
||||
NotifierProvider<TabList, EquatableValue<List<String>>>.internal(
|
||||
TabList.new,
|
||||
name: r'tabListProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product') ? null : _$tabListHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$tabListHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@@ -48,10 +48,9 @@ class TabSession extends _$TabSession {
|
||||
|
||||
@override
|
||||
void build({required String? tabId}) {
|
||||
_sessionService =
|
||||
(tabId != null)
|
||||
? GeckoSessionService(tabId: tabId)
|
||||
: GeckoSessionService.forActiveTab();
|
||||
_sessionService = (tabId != null)
|
||||
? GeckoSessionService(tabId: tabId)
|
||||
: GeckoSessionService.forActiveTab();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,10 +15,9 @@ final selectedTabSessionNotifierProvider =
|
||||
AutoDisposeProvider<Raw<TabSession>>.internal(
|
||||
selectedTabSessionNotifier,
|
||||
name: r'selectedTabSessionNotifierProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$selectedTabSessionNotifierHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$selectedTabSessionNotifierHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
@@ -100,10 +99,9 @@ class TabSessionProvider
|
||||
() => TabSession()..tabId = tabId,
|
||||
from: tabSessionProvider,
|
||||
name: r'tabSessionProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$tabSessionHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$tabSessionHash,
|
||||
dependencies: TabSessionFamily._dependencies,
|
||||
allTransitiveDependencies: TabSessionFamily._allTransitiveDependencies,
|
||||
tabId: tabId,
|
||||
|
||||
@@ -26,10 +26,9 @@ class TabStates extends _$TabStates {
|
||||
..[contentState.id] = current.copyWith(
|
||||
contextId: contentState.contextId,
|
||||
url: Uri.parse(contentState.url),
|
||||
title:
|
||||
(contentState.title.isNotEmpty)
|
||||
? contentState.title
|
||||
: current.title,
|
||||
title: (contentState.title.isNotEmpty)
|
||||
? contentState.title
|
||||
: current.title,
|
||||
progress: contentState.progress,
|
||||
isPrivate: contentState.isPrivate,
|
||||
isFullScreen: contentState.isFullScreen,
|
||||
@@ -76,15 +75,12 @@ class TabStates extends _$TabStates {
|
||||
state = {...state}
|
||||
..[tabId] = current.copyWith.historyState(
|
||||
HistoryState(
|
||||
items:
|
||||
history.items.nonNulls
|
||||
.map(
|
||||
(item) => HistoryItem(
|
||||
url: Uri.parse(item.url),
|
||||
title: item.title,
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
items: history.items.nonNulls
|
||||
.map(
|
||||
(item) =>
|
||||
HistoryItem(url: Uri.parse(item.url), title: item.title),
|
||||
)
|
||||
.toList(),
|
||||
currentIndex: history.currentIndex,
|
||||
canGoBack: history.canGoBack,
|
||||
canGoForward: history.canGoForward,
|
||||
|
||||
@@ -71,10 +71,9 @@ class TabStateProvider extends AutoDisposeProvider<TabState?> {
|
||||
(ref) => tabState(ref as TabStateRef, tabId),
|
||||
from: tabStateProvider,
|
||||
name: r'tabStateProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$tabStateHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$tabStateHash,
|
||||
dependencies: TabStateFamily._dependencies,
|
||||
allTransitiveDependencies: TabStateFamily._allTransitiveDependencies,
|
||||
tabId: tabId,
|
||||
@@ -149,10 +148,9 @@ 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,
|
||||
);
|
||||
@@ -168,10 +166,9 @@ final tabStatesProvider =
|
||||
NotifierProvider<TabStates, Map<String, TabState>>.internal(
|
||||
TabStates.new,
|
||||
name: r'tabStatesProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$tabStatesHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$tabStatesHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@@ -86,10 +86,9 @@ class WebExtensionsStateProvider
|
||||
() => WebExtensionsState()..actionType = actionType,
|
||||
from: webExtensionsStateProvider,
|
||||
name: r'webExtensionsStateProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$webExtensionsStateHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$webExtensionsStateHash,
|
||||
dependencies: WebExtensionsStateFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
WebExtensionsStateFamily._allTransitiveDependencies,
|
||||
|
||||
@@ -49,8 +49,9 @@ class TabRepository extends _$TabRepository {
|
||||
HistoryMetadataKey? historyMetadata,
|
||||
Map<String, String>? additionalHeaders,
|
||||
}) async {
|
||||
final selectedContainer =
|
||||
await ref.read(selectedContainerProvider.notifier).fetchData();
|
||||
final selectedContainer = await ref
|
||||
.read(selectedContainerProvider.notifier)
|
||||
.fetchData();
|
||||
|
||||
return ref.read(tabDatabaseProvider).tabDao.upsertContainerTabTransactional(
|
||||
() {
|
||||
@@ -124,8 +125,8 @@ class TabRepository extends _$TabRepository {
|
||||
}
|
||||
|
||||
if (containerData.metadata.useProxy) {
|
||||
final proxyPluginHealthy =
|
||||
await GeckoContainerProxyService().healthcheck();
|
||||
final proxyPluginHealthy = await GeckoContainerProxyService()
|
||||
.healthcheck();
|
||||
|
||||
if (!proxyPluginHealthy) {
|
||||
logger.w(
|
||||
@@ -170,10 +171,9 @@ class TabRepository extends _$TabRepository {
|
||||
}
|
||||
|
||||
//We only take containers without authentication!
|
||||
final availableContainers =
|
||||
await ref
|
||||
.read(containerRepositoryProvider.notifier)
|
||||
.getAllContainersWithCount();
|
||||
final availableContainers = await ref
|
||||
.read(containerRepositoryProvider.notifier)
|
||||
.getAllContainersWithCount();
|
||||
|
||||
final nextAvailableContainerUnauthenticated = availableContainers
|
||||
.firstWhereOrNull(
|
||||
|
||||
@@ -13,10 +13,9 @@ String _$tabRepositoryHash() => r'9b7ef03bec41f149b3cb456b73d7ee0e1b2804df';
|
||||
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,
|
||||
);
|
||||
|
||||
@@ -92,16 +92,14 @@ EquatableValue<List<String>> seamlessFilteredTabIds(
|
||||
TabSearchPartition searchPartition,
|
||||
ContainerFilter containerFilter,
|
||||
) {
|
||||
final tabSearchResults =
|
||||
ref
|
||||
.watch(
|
||||
tabSearchRepositoryProvider(searchPartition).select(
|
||||
(value) => EquatableValue(
|
||||
value.valueOrNull?.map((tab) => tab.id).toList(),
|
||||
),
|
||||
),
|
||||
)
|
||||
.value;
|
||||
final tabSearchResults = ref
|
||||
.watch(
|
||||
tabSearchRepositoryProvider(searchPartition).select(
|
||||
(value) =>
|
||||
EquatableValue(value.valueOrNull?.map((tab) => tab.id).toList()),
|
||||
),
|
||||
)
|
||||
.value;
|
||||
|
||||
final availableTabs = ref.watch(availableTabIdsProvider(containerFilter));
|
||||
|
||||
@@ -120,14 +118,13 @@ EquatableValue<List<TabPreview>> seamlessFilteredTabPreviews(
|
||||
TabSearchPartition searchPartition,
|
||||
ContainerFilter containerFilter,
|
||||
) {
|
||||
final tabSearchResults =
|
||||
ref
|
||||
.watch(
|
||||
tabSearchRepositoryProvider(
|
||||
searchPartition,
|
||||
).select((value) => EquatableValue(value.valueOrNull)),
|
||||
)
|
||||
.value;
|
||||
final tabSearchResults = ref
|
||||
.watch(
|
||||
tabSearchRepositoryProvider(
|
||||
searchPartition,
|
||||
).select((value) => EquatableValue(value.valueOrNull)),
|
||||
)
|
||||
.value;
|
||||
|
||||
final availableTabStates = ref.watch(
|
||||
availableTabStatesProvider(containerFilter),
|
||||
|
||||
@@ -74,10 +74,9 @@ class AvailableTabIdsProvider
|
||||
(ref) => availableTabIds(ref as AvailableTabIdsRef, containerFilter),
|
||||
from: availableTabIdsProvider,
|
||||
name: r'availableTabIdsProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$availableTabIdsHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$availableTabIdsHash,
|
||||
dependencies: AvailableTabIdsFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
AvailableTabIdsFamily._allTransitiveDependencies,
|
||||
@@ -202,10 +201,9 @@ class AvailableTabStatesProvider
|
||||
availableTabStates(ref as AvailableTabStatesRef, containerFilter),
|
||||
from: availableTabStatesProvider,
|
||||
name: r'availableTabStatesProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$availableTabStatesHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$availableTabStatesHash,
|
||||
dependencies: AvailableTabStatesFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
AvailableTabStatesFamily._allTransitiveDependencies,
|
||||
@@ -342,10 +340,9 @@ class SeamlessFilteredTabIdsProvider
|
||||
),
|
||||
from: seamlessFilteredTabIdsProvider,
|
||||
name: r'seamlessFilteredTabIdsProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$seamlessFilteredTabIdsHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$seamlessFilteredTabIdsHash,
|
||||
dependencies: SeamlessFilteredTabIdsFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
SeamlessFilteredTabIdsFamily._allTransitiveDependencies,
|
||||
@@ -494,10 +491,9 @@ class SeamlessFilteredTabPreviewsProvider
|
||||
),
|
||||
from: seamlessFilteredTabPreviewsProvider,
|
||||
name: r'seamlessFilteredTabPreviewsProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$seamlessFilteredTabPreviewsHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$seamlessFilteredTabPreviewsHash,
|
||||
dependencies: SeamlessFilteredTabPreviewsFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
SeamlessFilteredTabPreviewsFamily._allTransitiveDependencies,
|
||||
@@ -641,10 +637,9 @@ class SelectedBangTriggerProvider
|
||||
() => SelectedBangTrigger()..domain = domain,
|
||||
from: selectedBangTriggerProvider,
|
||||
name: r'selectedBangTriggerProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$selectedBangTriggerHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$selectedBangTriggerHash,
|
||||
dependencies: SelectedBangTriggerFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
SelectedBangTriggerFamily._allTransitiveDependencies,
|
||||
@@ -773,10 +768,9 @@ class SelectedBangDataProvider
|
||||
() => SelectedBangData()..domain = domain,
|
||||
from: selectedBangDataProvider,
|
||||
name: r'selectedBangDataProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$selectedBangDataHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$selectedBangDataHash,
|
||||
dependencies: SelectedBangDataFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
SelectedBangDataFamily._allTransitiveDependencies,
|
||||
|
||||
@@ -11,19 +11,19 @@ String _$engineBoundIntentStreamHash() =>
|
||||
|
||||
/// See also [EngineBoundIntentStream].
|
||||
@ProviderFor(EngineBoundIntentStream)
|
||||
final engineBoundIntentStreamProvider = AutoDisposeStreamNotifierProvider<
|
||||
EngineBoundIntentStream,
|
||||
SharedContent
|
||||
>.internal(
|
||||
EngineBoundIntentStream.new,
|
||||
name: r'engineBoundIntentStreamProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
final engineBoundIntentStreamProvider =
|
||||
AutoDisposeStreamNotifierProvider<
|
||||
EngineBoundIntentStream,
|
||||
SharedContent
|
||||
>.internal(
|
||||
EngineBoundIntentStream.new,
|
||||
name: r'engineBoundIntentStreamProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$engineBoundIntentStreamHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$EngineBoundIntentStream = AutoDisposeStreamNotifier<SharedContent>;
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
@@ -15,10 +15,9 @@ final browserViewLifecycleProvider =
|
||||
NotifierProvider<BrowserViewLifecycle, AppLifecycleState?>.internal(
|
||||
BrowserViewLifecycle.new,
|
||||
name: r'browserViewLifecycleProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$browserViewLifecycleHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$browserViewLifecycleHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@@ -15,10 +15,9 @@ final browserAddonServiceProvider =
|
||||
AutoDisposeNotifierProvider<BrowserAddonService, void>.internal(
|
||||
BrowserAddonService.new,
|
||||
name: r'browserAddonServiceProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$browserAddonServiceHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$browserAddonServiceHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@@ -15,10 +15,9 @@ final browserDataServiceProvider =
|
||||
NotifierProvider<BrowserDataService, void>.internal(
|
||||
BrowserDataService.new,
|
||||
name: r'browserDataServiceProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$browserDataServiceHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$browserDataServiceHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
+3
-4
@@ -15,10 +15,9 @@ final engineSettingsReplicationServiceProvider =
|
||||
NotifierProvider<EngineSettingsReplicationService, void>.internal(
|
||||
EngineSettingsReplicationService.new,
|
||||
name: r'engineSettingsReplicationServiceProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$engineSettingsReplicationServiceHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$engineSettingsReplicationServiceHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
+3
-4
@@ -15,10 +15,9 @@ final proxySettingsReplicationProvider =
|
||||
NotifierProvider<ProxySettingsReplication, void>.internal(
|
||||
ProxySettingsReplication.new,
|
||||
name: r'proxySettingsReplicationProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$proxySettingsReplicationHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$proxySettingsReplicationHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
+18
-21
@@ -89,23 +89,21 @@ class WebPageDialog extends HookConsumerWidget {
|
||||
searchInNewTab: false,
|
||||
);
|
||||
},
|
||||
error:
|
||||
(error, stackTrace) => FailureWidget(
|
||||
title: 'Could not load bangs',
|
||||
exception: error,
|
||||
),
|
||||
loading:
|
||||
() => SiteSearch(
|
||||
domain: url.host,
|
||||
availableBangs: const [
|
||||
// BangData(
|
||||
// websiteName: 'websiteName',
|
||||
// domain: 'domain',
|
||||
// trigger: 'trigger',
|
||||
// urlTemplate: 'urlTemplate',
|
||||
// ),
|
||||
],
|
||||
),
|
||||
error: (error, stackTrace) => FailureWidget(
|
||||
title: 'Could not load bangs',
|
||||
exception: error,
|
||||
),
|
||||
loading: () => SiteSearch(
|
||||
domain: url.host,
|
||||
availableBangs: const [
|
||||
// BangData(
|
||||
// websiteName: 'websiteName',
|
||||
// domain: 'domain',
|
||||
// trigger: 'trigger',
|
||||
// urlTemplate: 'urlTemplate',
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
if (availableBangsAsync.isLoading ||
|
||||
@@ -200,10 +198,9 @@ class WebPageDialog extends HookConsumerWidget {
|
||||
leading: const Icon(Icons.mobile_screen_share),
|
||||
title: const Text('Share screenshot'),
|
||||
onTap: () async {
|
||||
final screenshot =
|
||||
await ref
|
||||
.read(selectedTabSessionNotifierProvider)
|
||||
.requestScreenshot();
|
||||
final screenshot = await ref
|
||||
.read(selectedTabSessionNotifierProvider)
|
||||
.requestScreenshot();
|
||||
|
||||
if (screenshot != null) {
|
||||
ui.decodeImageFromList(screenshot, (
|
||||
|
||||
@@ -111,14 +111,13 @@ class BrowserScreen extends HookConsumerWidget {
|
||||
return displayedOverlay!;
|
||||
},
|
||||
child: Listener(
|
||||
onPointerDown:
|
||||
(displayedSheet != null)
|
||||
? (_) {
|
||||
ref
|
||||
.read(bottomSheetControllerProvider.notifier)
|
||||
.dismiss();
|
||||
}
|
||||
: null,
|
||||
onPointerDown: (displayedSheet != null)
|
||||
? (_) {
|
||||
ref
|
||||
.read(bottomSheetControllerProvider.notifier)
|
||||
.dismiss();
|
||||
}
|
||||
: null,
|
||||
child: BackButtonListener(
|
||||
onBackButtonPressed: () async {
|
||||
final tabState = ref.read(selectedTabStateProvider);
|
||||
@@ -220,36 +219,35 @@ class BrowserScreen extends HookConsumerWidget {
|
||||
},
|
||||
),
|
||||
floatingActionButton: ReaderAppearanceButton(),
|
||||
bottomSheet:
|
||||
(displayedSheet != null)
|
||||
? NotificationListener<DraggableScrollableNotification>(
|
||||
onNotification: (notification) {
|
||||
if (notification.extent <= 0.1) {
|
||||
ref
|
||||
.read(bottomSheetControllerProvider.notifier)
|
||||
.dismiss();
|
||||
return true;
|
||||
} else {
|
||||
ref
|
||||
.read(bottomSheetExtendProvider.notifier)
|
||||
.add(notification.extent);
|
||||
}
|
||||
bottomSheet: (displayedSheet != null)
|
||||
? NotificationListener<DraggableScrollableNotification>(
|
||||
onNotification: (notification) {
|
||||
if (notification.extent <= 0.1) {
|
||||
ref
|
||||
.read(bottomSheetControllerProvider.notifier)
|
||||
.dismiss();
|
||||
return true;
|
||||
} else {
|
||||
ref
|
||||
.read(bottomSheetExtendProvider.notifier)
|
||||
.add(notification.extent);
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
child: switch (displayedSheet) {
|
||||
ViewTabsSheet() => _ViewTabsSheet(
|
||||
key: ValueKey(displayedSheet),
|
||||
maxChildSize: MediaQuery.of(context).relativeSafeArea(),
|
||||
),
|
||||
final TabQaChatSheet parameter => _QaSheet(
|
||||
key: ValueKey(displayedSheet),
|
||||
maxChildSize: MediaQuery.of(context).relativeSafeArea(),
|
||||
chatId: parameter.chatId,
|
||||
),
|
||||
},
|
||||
)
|
||||
: null,
|
||||
return false;
|
||||
},
|
||||
child: switch (displayedSheet) {
|
||||
ViewTabsSheet() => _ViewTabsSheet(
|
||||
key: ValueKey(displayedSheet),
|
||||
maxChildSize: MediaQuery.of(context).relativeSafeArea(),
|
||||
),
|
||||
final TabQaChatSheet parameter => _QaSheet(
|
||||
key: ValueKey(displayedSheet),
|
||||
maxChildSize: MediaQuery.of(context).relativeSafeArea(),
|
||||
chatId: parameter.chatId,
|
||||
),
|
||||
},
|
||||
)
|
||||
: null,
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -304,10 +302,10 @@ class _BrowserView extends StatelessWidget {
|
||||
(state) => EdgeInsets.only(
|
||||
bottom:
|
||||
(state?.isLoading == true &&
|
||||
state?.progress != null &&
|
||||
state!.progress < 100)
|
||||
? 4.0
|
||||
: 0.0,
|
||||
state?.progress != null &&
|
||||
state!.progress < 100)
|
||||
? 4.0
|
||||
: 0.0,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
+43
-49
@@ -86,14 +86,12 @@ class BrowserBottomAppBar extends HookConsumerWidget {
|
||||
child: AppBar(
|
||||
automaticallyImplyLeading: false,
|
||||
titleSpacing: 8.0,
|
||||
backgroundColor:
|
||||
(isPrivateTab && displayedSheet is! ViewTabsSheet)
|
||||
? const Color(0x648000D7)
|
||||
: null,
|
||||
title:
|
||||
(selectedTabId != null && displayedSheet is! ViewTabsSheet)
|
||||
? const AppBarTitle()
|
||||
: null,
|
||||
backgroundColor: (isPrivateTab && displayedSheet is! ViewTabsSheet)
|
||||
? const Color(0x648000D7)
|
||||
: null,
|
||||
title: (selectedTabId != null && displayedSheet is! ViewTabsSheet)
|
||||
? const AppBarTitle()
|
||||
: null,
|
||||
actions: [
|
||||
if (selectedTabId != null && displayedSheet is! ViewTabsSheet)
|
||||
ReaderButton(),
|
||||
@@ -349,54 +347,50 @@ class BrowserBottomAppBar extends HookConsumerWidget {
|
||||
return Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child:
|
||||
(history?.canGoBack == true || isLoading)
|
||||
? IconButton(
|
||||
onPressed: () async {
|
||||
final controller = ref.read(
|
||||
tabSessionProvider(
|
||||
tabId: selectedTabId,
|
||||
).notifier,
|
||||
);
|
||||
child: (history?.canGoBack == true || isLoading)
|
||||
? IconButton(
|
||||
onPressed: () async {
|
||||
final controller = ref.read(
|
||||
tabSessionProvider(
|
||||
tabId: selectedTabId,
|
||||
).notifier,
|
||||
);
|
||||
|
||||
if (isLoading) {
|
||||
await controller.stopLoading();
|
||||
} else {
|
||||
await controller.goBack();
|
||||
}
|
||||
if (isLoading) {
|
||||
await controller.stopLoading();
|
||||
} else {
|
||||
await controller.goBack();
|
||||
}
|
||||
|
||||
trippleDotMenuController.close();
|
||||
},
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
)
|
||||
: IconButton(
|
||||
onPressed: () async {
|
||||
await ref
|
||||
.read(
|
||||
tabRepositoryProvider.notifier,
|
||||
)
|
||||
.closeTab(selectedTabId);
|
||||
trippleDotMenuController.close();
|
||||
},
|
||||
icon: const Icon(Icons.close),
|
||||
),
|
||||
trippleDotMenuController.close();
|
||||
},
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
)
|
||||
: IconButton(
|
||||
onPressed: () async {
|
||||
await ref
|
||||
.read(tabRepositoryProvider.notifier)
|
||||
.closeTab(selectedTabId);
|
||||
trippleDotMenuController.close();
|
||||
},
|
||||
icon: const Icon(Icons.close),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 48, child: VerticalDivider()),
|
||||
Expanded(
|
||||
child: IconButton(
|
||||
onPressed:
|
||||
(history?.canGoForward == true)
|
||||
? () async {
|
||||
final controller = ref.read(
|
||||
tabSessionProvider(
|
||||
tabId: selectedTabId,
|
||||
).notifier,
|
||||
);
|
||||
onPressed: (history?.canGoForward == true)
|
||||
? () async {
|
||||
final controller = ref.read(
|
||||
tabSessionProvider(
|
||||
tabId: selectedTabId,
|
||||
).notifier,
|
||||
);
|
||||
|
||||
await controller.goForward();
|
||||
trippleDotMenuController.close();
|
||||
}
|
||||
: null,
|
||||
await controller.goForward();
|
||||
trippleDotMenuController.close();
|
||||
}
|
||||
: null,
|
||||
icon: const Icon(Icons.arrow_forward),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -43,10 +43,9 @@ class TabPreview extends HookWidget {
|
||||
borderRadius: const BorderRadius.all(Radius.circular(16.0)),
|
||||
),
|
||||
child: Material(
|
||||
color:
|
||||
tab.isPrivate
|
||||
? const Color(0xFF25003E)
|
||||
: colorScheme.surfaceContainerHighest,
|
||||
color: tab.isPrivate
|
||||
? const Color(0xFF25003E)
|
||||
: colorScheme.surfaceContainerHighest,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(14.0)),
|
||||
child: InkWell(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(14.0)),
|
||||
@@ -63,10 +62,9 @@ class TabPreview extends HookWidget {
|
||||
overflow: TextOverflow.ellipsis,
|
||||
tab.title,
|
||||
maxLines: 2,
|
||||
style:
|
||||
tab.isPrivate
|
||||
? const TextStyle(color: Colors.white)
|
||||
: null,
|
||||
style: tab.isPrivate
|
||||
? const TextStyle(color: Colors.white)
|
||||
: null,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
+3
-4
@@ -34,10 +34,9 @@ class TabsActionButton extends HookConsumerWidget {
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
width: 2.0,
|
||||
color:
|
||||
isActive
|
||||
? theme.colorScheme.primary
|
||||
: DefaultTextStyle.of(context).style.color!,
|
||||
color: isActive
|
||||
? theme.colorScheme.primary
|
||||
: DefaultTextStyle.of(context).style.color!,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(5.0),
|
||||
),
|
||||
|
||||
+8
-10
@@ -45,16 +45,14 @@ class _$FindInPageStateCWProxyImpl implements _$FindInPageStateCWProxy {
|
||||
Object? lastSearchText = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return FindInPageState(
|
||||
visible:
|
||||
visible == const $CopyWithPlaceholder()
|
||||
? _value.visible
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: visible as bool,
|
||||
lastSearchText:
|
||||
lastSearchText == const $CopyWithPlaceholder()
|
||||
? _value.lastSearchText
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: lastSearchText as String?,
|
||||
visible: visible == const $CopyWithPlaceholder()
|
||||
? _value.visible
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: visible as bool,
|
||||
lastSearchText: lastSearchText == const $CopyWithPlaceholder()
|
||||
? _value.lastSearchText
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: lastSearchText as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
+3
-4
@@ -81,10 +81,9 @@ class FindInPageRepositoryProvider
|
||||
() => FindInPageRepository()..tabId = tabId,
|
||||
from: findInPageRepositoryProvider,
|
||||
name: r'findInPageRepositoryProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$findInPageRepositoryHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$findInPageRepositoryHash,
|
||||
dependencies: FindInPageRepositoryFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
FindInPageRepositoryFamily._allTransitiveDependencies,
|
||||
|
||||
+3
-4
@@ -15,10 +15,9 @@ final findInPageControllerProvider =
|
||||
AutoDisposeNotifierProvider<FindInPageController, FindInPageState>.internal(
|
||||
FindInPageController.new,
|
||||
name: r'findInPageControllerProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$findInPageControllerHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$findInPageControllerHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
+32
-40
@@ -50,16 +50,14 @@ 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>,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -144,36 +142,30 @@ 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,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-5
@@ -107,11 +107,10 @@ class UnifiedPreferenceSettingsRepository
|
||||
_preferenceSettingGroupsProvider(partition).future,
|
||||
);
|
||||
|
||||
final prefs =
|
||||
_statelessGroups!.values
|
||||
.map((group) => group.settings.keys)
|
||||
.flattened
|
||||
.toList();
|
||||
final prefs = _statelessGroups!.values
|
||||
.map((group) => group.settings.keys)
|
||||
.flattened
|
||||
.toList();
|
||||
|
||||
await ref.read(_preferenceRepositoryProvider.notifier).resetPrefs(prefs);
|
||||
}
|
||||
|
||||
+34
-42
@@ -15,10 +15,9 @@ final _preferenceSettingContentProvider =
|
||||
FutureProvider<Map<String, dynamic>>.internal(
|
||||
_preferenceSettingContent,
|
||||
name: r'_preferenceSettingContentProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$preferenceSettingContentHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$preferenceSettingContentHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
@@ -99,10 +98,9 @@ class _PreferenceSettingGroupsProvider
|
||||
),
|
||||
from: _preferenceSettingGroupsProvider,
|
||||
name: r'_preferenceSettingGroupsProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$preferenceSettingGroupsHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$preferenceSettingGroupsHash,
|
||||
dependencies: _PreferenceSettingGroupsFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
_PreferenceSettingGroupsFamily._allTransitiveDependencies,
|
||||
@@ -238,10 +236,9 @@ class _PreferenceSettingGroupProvider
|
||||
),
|
||||
from: _preferenceSettingGroupProvider,
|
||||
name: r'_preferenceSettingGroupProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$preferenceSettingGroupHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$preferenceSettingGroupHash,
|
||||
dependencies: _PreferenceSettingGroupFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
_PreferenceSettingGroupFamily._allTransitiveDependencies,
|
||||
@@ -334,19 +331,19 @@ String _$preferenceRepositoryHash() =>
|
||||
|
||||
/// See also [_PreferenceRepository].
|
||||
@ProviderFor(_PreferenceRepository)
|
||||
final _preferenceRepositoryProvider = AutoDisposeNotifierProvider<
|
||||
_PreferenceRepository,
|
||||
Raw<Stream<Map<String, Object>>>
|
||||
>.internal(
|
||||
_PreferenceRepository.new,
|
||||
name: r'_preferenceRepositoryProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
final _preferenceRepositoryProvider =
|
||||
AutoDisposeNotifierProvider<
|
||||
_PreferenceRepository,
|
||||
Raw<Stream<Map<String, Object>>>
|
||||
>.internal(
|
||||
_PreferenceRepository.new,
|
||||
name: r'_preferenceRepositoryProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$preferenceRepositoryHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$PreferenceRepository =
|
||||
AutoDisposeNotifier<Raw<Stream<Map<String, Object>>>>;
|
||||
@@ -418,14 +415,12 @@ class UnifiedPreferenceSettingsRepositoryProvider
|
||||
() => UnifiedPreferenceSettingsRepository()..partition = partition,
|
||||
from: unifiedPreferenceSettingsRepositoryProvider,
|
||||
name: r'unifiedPreferenceSettingsRepositoryProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$unifiedPreferenceSettingsRepositoryHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$unifiedPreferenceSettingsRepositoryHash,
|
||||
dependencies: UnifiedPreferenceSettingsRepositoryFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
UnifiedPreferenceSettingsRepositoryFamily
|
||||
._allTransitiveDependencies,
|
||||
allTransitiveDependencies: UnifiedPreferenceSettingsRepositoryFamily
|
||||
._allTransitiveDependencies,
|
||||
partition: partition,
|
||||
);
|
||||
|
||||
@@ -580,16 +575,14 @@ class PreferenceSettingsGroupRepositoryProvider
|
||||
PreferencePartition partition,
|
||||
String groupName,
|
||||
) : this._internal(
|
||||
() =>
|
||||
PreferenceSettingsGroupRepository()
|
||||
..partition = partition
|
||||
..groupName = groupName,
|
||||
() => PreferenceSettingsGroupRepository()
|
||||
..partition = partition
|
||||
..groupName = groupName,
|
||||
from: preferenceSettingsGroupRepositoryProvider,
|
||||
name: r'preferenceSettingsGroupRepositoryProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$preferenceSettingsGroupRepositoryHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$preferenceSettingsGroupRepositoryHash,
|
||||
dependencies: PreferenceSettingsGroupRepositoryFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
PreferenceSettingsGroupRepositoryFamily._allTransitiveDependencies,
|
||||
@@ -623,10 +616,9 @@ 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,
|
||||
|
||||
@@ -13,10 +13,9 @@ 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,
|
||||
);
|
||||
@@ -33,10 +32,9 @@ final appearanceButtonVisibilityProvider =
|
||||
AutoDisposeStreamProvider<bool>.internal(
|
||||
appearanceButtonVisibility,
|
||||
name: r'appearanceButtonVisibilityProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$appearanceButtonVisibilityHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$appearanceButtonVisibilityHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
+3
-4
@@ -15,10 +15,9 @@ final readerableScreenControllerProvider =
|
||||
AsyncNotifierProvider<ReaderableScreenController, void>.internal(
|
||||
ReaderableScreenController.new,
|
||||
name: r'readerableScreenControllerProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$readerableScreenControllerHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$readerableScreenControllerHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
+37
-47
@@ -32,16 +32,12 @@ class ReaderButton extends HookConsumerWidget {
|
||||
),
|
||||
);
|
||||
|
||||
final icon =
|
||||
readerabilityState.active
|
||||
? Icon(
|
||||
MdiIcons.bookOpen,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
)
|
||||
: Icon(
|
||||
MdiIcons.bookOpenOutline,
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
);
|
||||
final icon = readerabilityState.active
|
||||
? Icon(MdiIcons.bookOpen, color: Theme.of(context).colorScheme.primary)
|
||||
: Icon(
|
||||
MdiIcons.bookOpenOutline,
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
);
|
||||
|
||||
return Visibility(
|
||||
visible:
|
||||
@@ -50,46 +46,40 @@ class ReaderButton extends HookConsumerWidget {
|
||||
(enforceReadability && enableReadability),
|
||||
child: readerChanging.when(
|
||||
skipLoadingOnReload: true,
|
||||
data:
|
||||
(_) => InkWell(
|
||||
onTap:
|
||||
readerChanging.isLoading
|
||||
? null
|
||||
: () async {
|
||||
await ref
|
||||
.read(readerableScreenControllerProvider.notifier)
|
||||
.toggleReaderView(!readerabilityState.active);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 15.0,
|
||||
horizontal: 8.0,
|
||||
),
|
||||
child: icon,
|
||||
),
|
||||
data: (_) => InkWell(
|
||||
onTap: readerChanging.isLoading
|
||||
? null
|
||||
: () async {
|
||||
await ref
|
||||
.read(readerableScreenControllerProvider.notifier)
|
||||
.toggleReaderView(!readerabilityState.active);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 15.0,
|
||||
horizontal: 8.0,
|
||||
),
|
||||
child: icon,
|
||||
),
|
||||
),
|
||||
error: (error, stackTrace) => SizedBox.shrink(),
|
||||
loading:
|
||||
() => AnimateGradientShader(
|
||||
duration: const Duration(milliseconds: 500),
|
||||
primaryEnd: Alignment.bottomLeft,
|
||||
secondaryEnd: Alignment.topRight,
|
||||
primaryColors: [
|
||||
colorScheme.primary,
|
||||
colorScheme.primaryContainer,
|
||||
],
|
||||
secondaryColors: [
|
||||
colorScheme.secondary,
|
||||
colorScheme.secondaryContainer,
|
||||
],
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 15.0,
|
||||
horizontal: 8.0,
|
||||
),
|
||||
child: icon,
|
||||
),
|
||||
loading: () => AnimateGradientShader(
|
||||
duration: const Duration(milliseconds: 500),
|
||||
primaryEnd: Alignment.bottomLeft,
|
||||
secondaryEnd: Alignment.topRight,
|
||||
primaryColors: [colorScheme.primary, colorScheme.primaryContainer],
|
||||
secondaryColors: [
|
||||
colorScheme.secondary,
|
||||
colorScheme.secondaryContainer,
|
||||
],
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 15.0,
|
||||
horizontal: 8.0,
|
||||
),
|
||||
child: icon,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
+11
-12
@@ -37,18 +37,17 @@ AsyncValue<List<GeckoSuggestion>> engineHistorySuggestions(Ref ref) {
|
||||
return ref.watch(
|
||||
engineSuggestionsProvider.select(
|
||||
(suggestions) => suggestions.whenData(
|
||||
(suggestions) =>
|
||||
suggestions
|
||||
.where(
|
||||
(suggestion) =>
|
||||
suggestion.type == GeckoSuggestionType.history &&
|
||||
(suggestion.title.isNotEmpty) &&
|
||||
(suggestion.description.mapNotNull(
|
||||
(url) => Uri.tryParse(url),
|
||||
) !=
|
||||
null),
|
||||
)
|
||||
.toList(),
|
||||
(suggestions) => suggestions
|
||||
.where(
|
||||
(suggestion) =>
|
||||
suggestion.type == GeckoSuggestionType.history &&
|
||||
(suggestion.title.isNotEmpty) &&
|
||||
(suggestion.description.mapNotNull(
|
||||
(url) => Uri.tryParse(url),
|
||||
) !=
|
||||
null),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
+14
-15
@@ -15,10 +15,9 @@ final engineHistorySuggestionsProvider =
|
||||
AutoDisposeProvider<AsyncValue<List<GeckoSuggestion>>>.internal(
|
||||
engineHistorySuggestions,
|
||||
name: r'engineHistorySuggestionsProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$engineHistorySuggestionsHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$engineHistorySuggestionsHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
@@ -31,19 +30,19 @@ String _$engineSuggestionsHash() => r'ba2c2d7f0a5e99fd9e639acd020b8cf3016c6126';
|
||||
|
||||
/// See also [EngineSuggestions].
|
||||
@ProviderFor(EngineSuggestions)
|
||||
final engineSuggestionsProvider = AutoDisposeStreamNotifierProvider<
|
||||
EngineSuggestions,
|
||||
List<GeckoSuggestion>
|
||||
>.internal(
|
||||
EngineSuggestions.new,
|
||||
name: r'engineSuggestionsProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
final engineSuggestionsProvider =
|
||||
AutoDisposeStreamNotifierProvider<
|
||||
EngineSuggestions,
|
||||
List<GeckoSuggestion>
|
||||
>.internal(
|
||||
EngineSuggestions.new,
|
||||
name: r'engineSuggestionsProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$engineSuggestionsHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$EngineSuggestions = AutoDisposeStreamNotifier<List<GeckoSuggestion>>;
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
@@ -22,12 +22,9 @@ class SearchSuggestions extends _$SearchSuggestions {
|
||||
final defaultProvider = ref.watch(defaultSearchSuggestionsProvider);
|
||||
final resolvedProvider = suggestionsProvider ?? defaultProvider;
|
||||
|
||||
_addQueryBinding =
|
||||
ref
|
||||
.watch(
|
||||
searchSuggestionsRepositoryProvider(resolvedProvider).notifier,
|
||||
)
|
||||
.addQuery;
|
||||
_addQueryBinding = ref
|
||||
.watch(searchSuggestionsRepositoryProvider(resolvedProvider).notifier)
|
||||
.addQuery;
|
||||
|
||||
return ref.watch(searchSuggestionsRepositoryProvider(resolvedProvider));
|
||||
}
|
||||
|
||||
+6
-8
@@ -15,10 +15,9 @@ final defaultSearchSuggestionsProvider =
|
||||
Provider<ISearchSuggestionProvider>.internal(
|
||||
defaultSearchSuggestions,
|
||||
name: r'defaultSearchSuggestionsProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$defaultSearchSuggestionsHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$defaultSearchSuggestionsHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
@@ -104,10 +103,9 @@ class SearchSuggestionsProvider
|
||||
() => SearchSuggestions()..suggestionsProvider = suggestionsProvider,
|
||||
from: searchSuggestionsProvider,
|
||||
name: r'searchSuggestionsProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$searchSuggestionsHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$searchSuggestionsHash,
|
||||
dependencies: SearchSuggestionsFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
SearchSuggestionsFamily._allTransitiveDependencies,
|
||||
|
||||
+3
-4
@@ -94,10 +94,9 @@ class SearchSuggestionsRepositoryProvider
|
||||
..suggestionsProvider = suggestionsProvider,
|
||||
from: searchSuggestionsRepositoryProvider,
|
||||
name: r'searchSuggestionsRepositoryProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$searchSuggestionsRepositoryHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$searchSuggestionsRepositoryHash,
|
||||
dependencies: SearchSuggestionsRepositoryFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
SearchSuggestionsRepositoryFamily._allTransitiveDependencies,
|
||||
|
||||
@@ -32,21 +32,20 @@ class BangChips extends HookConsumerWidget {
|
||||
) {
|
||||
return showDialog<bool>(
|
||||
context: context,
|
||||
builder:
|
||||
(context) => AlertDialog(
|
||||
title: Text('Reset usage frequency of $triggerName?'),
|
||||
content: const Text('This will remove the Bang from quick select.'),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context, false),
|
||||
child: const Text('Cancel'),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context, true),
|
||||
child: const Text('Reset'),
|
||||
),
|
||||
],
|
||||
builder: (context) => AlertDialog(
|
||||
title: Text('Reset usage frequency of $triggerName?'),
|
||||
content: const Text('This will remove the Bang from quick select.'),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context, false),
|
||||
child: const Text('Cancel'),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context, true),
|
||||
child: const Text('Reset'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -71,9 +70,8 @@ class BangChips extends HookConsumerWidget {
|
||||
Expanded(
|
||||
child: SelectableChips(
|
||||
itemId: (bang) => bang.trigger,
|
||||
itemAvatar:
|
||||
(bang) =>
|
||||
UrlIcon([bang.getTemplateUrl('')], iconSize: 20),
|
||||
itemAvatar: (bang) =>
|
||||
UrlIcon([bang.getTemplateUrl('')], iconSize: 20),
|
||||
itemLabel: (bang) => Text(bang.websiteName),
|
||||
availableItems: availableBangs,
|
||||
selectedItem: activeBang,
|
||||
@@ -100,10 +98,9 @@ class BangChips extends HookConsumerWidget {
|
||||
final searchText = searchTextController?.text.trim();
|
||||
|
||||
final trigger = await BangSearchRoute(
|
||||
searchText:
|
||||
(searchText.isEmpty)
|
||||
? BangSearchRoute.emptySearchText
|
||||
: searchText!,
|
||||
searchText: (searchText.isEmpty)
|
||||
? BangSearchRoute.emptySearchText
|
||||
: searchText!,
|
||||
).push<String?>(context);
|
||||
|
||||
if (trigger != null) {
|
||||
|
||||
@@ -77,31 +77,29 @@ class SearchField extends HookConsumerWidget {
|
||||
autofocus: autofocus,
|
||||
decoration: InputDecoration(
|
||||
border: InputBorder.none,
|
||||
prefixIcon:
|
||||
(showBangIcon && activeBang != null)
|
||||
? Padding(
|
||||
padding: const EdgeInsetsDirectional.all(12.0),
|
||||
child: UrlIcon([
|
||||
activeBang!.getTemplateUrl(''),
|
||||
], iconSize: 24.0),
|
||||
)
|
||||
: null,
|
||||
prefixIcon: (showBangIcon && activeBang != null)
|
||||
? Padding(
|
||||
padding: const EdgeInsetsDirectional.all(12.0),
|
||||
child: UrlIcon([
|
||||
activeBang!.getTemplateUrl(''),
|
||||
], iconSize: 24.0),
|
||||
)
|
||||
: null,
|
||||
label: label ?? const Text('Search'),
|
||||
// hintText: 'Ask anything...',
|
||||
floatingLabelBehavior: FloatingLabelBehavior.always,
|
||||
suffixIcon:
|
||||
hasText
|
||||
? IconButton(
|
||||
onPressed: () {
|
||||
textEditingController.clear();
|
||||
},
|
||||
icon: const Icon(Icons.clear),
|
||||
)
|
||||
: SpeechToTextButton(
|
||||
onTextReceived: (data) {
|
||||
textEditingController.text = data.toString();
|
||||
},
|
||||
),
|
||||
suffixIcon: hasText
|
||||
? IconButton(
|
||||
onPressed: () {
|
||||
textEditingController.clear();
|
||||
},
|
||||
icon: const Icon(Icons.clear),
|
||||
)
|
||||
: SpeechToTextButton(
|
||||
onTextReceived: (data) {
|
||||
textEditingController.text = data.toString();
|
||||
},
|
||||
),
|
||||
),
|
||||
onTapOutside: (event) {
|
||||
safeFocusNode.unfocus();
|
||||
|
||||
+96
-105
@@ -64,112 +64,104 @@ class FeedSearch extends HookConsumerWidget {
|
||||
SliverSkeletonizer(
|
||||
enabled: articlesAsync.isLoading,
|
||||
child: articlesAsync.when(
|
||||
data:
|
||||
(articles) => SliverList.builder(
|
||||
itemCount: articles.length,
|
||||
itemBuilder: (context, index) {
|
||||
final article = articles[index];
|
||||
data: (articles) => SliverList.builder(
|
||||
itemCount: articles.length,
|
||||
itemBuilder: (context, index) {
|
||||
final article = articles[index];
|
||||
|
||||
final titleHighlight = switch (article) {
|
||||
final FeedArticleQueryResult result =>
|
||||
result.titleHighlight.whenNotEmpty,
|
||||
_ => null,
|
||||
};
|
||||
final titleHighlight = switch (article) {
|
||||
final FeedArticleQueryResult result =>
|
||||
result.titleHighlight.whenNotEmpty,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
final searchSnippet = switch (article) {
|
||||
final FeedArticleQueryResult result =>
|
||||
result.summarySnippet.whenNotEmpty ??
|
||||
result.contentSnippet.whenNotEmpty,
|
||||
_ => null,
|
||||
};
|
||||
final searchSnippet = switch (article) {
|
||||
final FeedArticleQueryResult result =>
|
||||
result.summarySnippet.whenNotEmpty ??
|
||||
result.contentSnippet.whenNotEmpty,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
final articleDate = article.updated ?? article.created;
|
||||
final articleDate = article.updated ?? article.created;
|
||||
|
||||
return ListTile(
|
||||
leading: RepaintBoundary(
|
||||
child: UrlIcon([
|
||||
article.icon ??
|
||||
article.links
|
||||
?.getRelation(FeedLinkRelation.alternate)
|
||||
?.uri ??
|
||||
article.siteLink ??
|
||||
article.feedId.base,
|
||||
], iconSize: 24.0),
|
||||
),
|
||||
title:
|
||||
(titleHighlight.isNotEmpty)
|
||||
? MarkdownBody(
|
||||
data: titleHighlight!,
|
||||
styleSheet: MarkdownStyleSheet(
|
||||
p: Theme.of(
|
||||
return ListTile(
|
||||
leading: RepaintBoundary(
|
||||
child: UrlIcon([
|
||||
article.icon ??
|
||||
article.links
|
||||
?.getRelation(FeedLinkRelation.alternate)
|
||||
?.uri ??
|
||||
article.siteLink ??
|
||||
article.feedId.base,
|
||||
], iconSize: 24.0),
|
||||
),
|
||||
title: (titleHighlight.isNotEmpty)
|
||||
? MarkdownBody(
|
||||
data: titleHighlight!,
|
||||
styleSheet: MarkdownStyleSheet(
|
||||
p: Theme.of(context).textTheme.titleMedium
|
||||
?.copyWith(
|
||||
color: Theme.of(
|
||||
context,
|
||||
).textTheme.titleMedium?.copyWith(
|
||||
color:
|
||||
Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
).colorScheme.onSurface,
|
||||
),
|
||||
)
|
||||
: Text(
|
||||
article.displayTitle,
|
||||
style: theme.textTheme.titleMedium,
|
||||
),
|
||||
subtitle: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (searchSnippet.isNotEmpty)
|
||||
MarkdownBody(
|
||||
data: searchSnippet!,
|
||||
styleSheet: MarkdownStyleSheet(
|
||||
p: Theme.of(
|
||||
context,
|
||||
).textTheme.bodyMedium?.copyWith(
|
||||
color:
|
||||
Theme.of(
|
||||
context,
|
||||
).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
a: Theme.of(
|
||||
context,
|
||||
).textTheme.bodyMedium?.copyWith(
|
||||
color:
|
||||
Theme.of(
|
||||
context,
|
||||
).colorScheme.onSurfaceVariant,
|
||||
decoration: TextDecoration.none,
|
||||
),
|
||||
),
|
||||
)
|
||||
else
|
||||
(article.summaryPlain != null)
|
||||
? Text(
|
||||
article.summaryPlain!,
|
||||
style: theme.textTheme.bodySmall,
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
)
|
||||
: const SizedBox.shrink(),
|
||||
if (articleDate != null)
|
||||
Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: Text(
|
||||
ref
|
||||
.read(formatProvider.notifier)
|
||||
.fullDateTimeWithTimezone(articleDate),
|
||||
style: theme.textTheme.bodySmall?.copyWith(
|
||||
fontStyle: FontStyle.italic,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: Text(
|
||||
article.displayTitle,
|
||||
style: theme.textTheme.titleMedium,
|
||||
),
|
||||
subtitle: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (searchSnippet.isNotEmpty)
|
||||
MarkdownBody(
|
||||
data: searchSnippet!,
|
||||
styleSheet: MarkdownStyleSheet(
|
||||
p: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||
color: Theme.of(
|
||||
context,
|
||||
).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
],
|
||||
),
|
||||
onTap: () {
|
||||
FeedArticleRoute(
|
||||
articleId: article.id,
|
||||
).pushReplacement(context);
|
||||
},
|
||||
);
|
||||
a: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||
color: Theme.of(
|
||||
context,
|
||||
).colorScheme.onSurfaceVariant,
|
||||
decoration: TextDecoration.none,
|
||||
),
|
||||
),
|
||||
)
|
||||
else
|
||||
(article.summaryPlain != null)
|
||||
? Text(
|
||||
article.summaryPlain!,
|
||||
style: theme.textTheme.bodySmall,
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
)
|
||||
: const SizedBox.shrink(),
|
||||
if (articleDate != null)
|
||||
Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: Text(
|
||||
ref
|
||||
.read(formatProvider.notifier)
|
||||
.fullDateTimeWithTimezone(articleDate),
|
||||
style: theme.textTheme.bodySmall?.copyWith(
|
||||
fontStyle: FontStyle.italic,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
onTap: () {
|
||||
FeedArticleRoute(
|
||||
articleId: article.id,
|
||||
).pushReplacement(context);
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
error: (error, stackTrace) {
|
||||
return SliverToBoxAdapter(
|
||||
child: FailureWidget(
|
||||
@@ -178,13 +170,12 @@ class FeedSearch extends HookConsumerWidget {
|
||||
),
|
||||
);
|
||||
},
|
||||
loading:
|
||||
() => SliverList.builder(
|
||||
itemCount: articlesAsync.valueOrNull?.length ?? 3,
|
||||
itemBuilder: (context, index) {
|
||||
return const ListTile(title: Bone.text());
|
||||
},
|
||||
),
|
||||
loading: () => SliverList.builder(
|
||||
itemCount: articlesAsync.valueOrNull?.length ?? 3,
|
||||
itemBuilder: (context, index) {
|
||||
return const ListTile(title: Bone.text());
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
+6
-7
@@ -122,13 +122,12 @@ class HistorySuggestions extends HookConsumerWidget {
|
||||
),
|
||||
);
|
||||
},
|
||||
loading:
|
||||
() => SliverList.builder(
|
||||
itemCount: historySuggestionsAsync.valueOrNull?.length ?? 3,
|
||||
itemBuilder: (context, index) {
|
||||
return const ListTile(title: Bone.text());
|
||||
},
|
||||
),
|
||||
loading: () => SliverList.builder(
|
||||
itemCount: historySuggestionsAsync.valueOrNull?.length ?? 3,
|
||||
itemBuilder: (context, index) {
|
||||
return const ListTile(title: Bone.text());
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
+28
-35
@@ -33,19 +33,16 @@ class TabSearch extends HookConsumerWidget {
|
||||
),
|
||||
);
|
||||
|
||||
final tabs =
|
||||
ref
|
||||
.watch(
|
||||
seamlessFilteredTabPreviewsProvider(
|
||||
TabSearchPartition.search,
|
||||
(selectedContainer.value != null)
|
||||
? ContainerFilterById(
|
||||
containerId: selectedContainer.value!.id,
|
||||
)
|
||||
: ContainerFilterDisabled(),
|
||||
),
|
||||
)
|
||||
.value;
|
||||
final tabs = ref
|
||||
.watch(
|
||||
seamlessFilteredTabPreviewsProvider(
|
||||
TabSearchPartition.search,
|
||||
(selectedContainer.value != null)
|
||||
? ContainerFilterById(containerId: selectedContainer.value!.id)
|
||||
: ContainerFilterDisabled(),
|
||||
),
|
||||
)
|
||||
.value;
|
||||
|
||||
useListenableCallback(searchTextListenable, () async {
|
||||
await ref
|
||||
@@ -118,30 +115,26 @@ class TabSearch extends HookConsumerWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
subtitle:
|
||||
(bodyHasMatch || urlHasMatch)
|
||||
? MarkdownBody(
|
||||
data:
|
||||
bodyHasMatch
|
||||
? result.content!
|
||||
: result.highlightedUrl!,
|
||||
styleSheet: MarkdownStyleSheet(
|
||||
p: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||
color:
|
||||
Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
a: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||
color:
|
||||
Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
decoration: TextDecoration.none,
|
||||
),
|
||||
subtitle: (bodyHasMatch || urlHasMatch)
|
||||
? MarkdownBody(
|
||||
data: bodyHasMatch
|
||||
? result.content!
|
||||
: result.highlightedUrl!,
|
||||
styleSheet: MarkdownStyleSheet(
|
||||
p: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
a: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
decoration: TextDecoration.none,
|
||||
),
|
||||
)
|
||||
: Text(
|
||||
result.url.toString(),
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
)
|
||||
: Text(
|
||||
result.url.toString(),
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
onTap: () async {
|
||||
await ref
|
||||
.read(tabRepositoryProvider.notifier)
|
||||
|
||||
@@ -42,10 +42,9 @@ class ContainerDao extends DatabaseAccessor<TabDatabase>
|
||||
}
|
||||
|
||||
Selectable<Color> getDistinctColors() {
|
||||
final query =
|
||||
db.selectOnly(db.container, distinct: true)
|
||||
..addColumns([db.container.color])
|
||||
..where(db.container.color.isNotNull());
|
||||
final query = db.selectOnly(db.container, distinct: true)
|
||||
..addColumns([db.container.color])
|
||||
..where(db.container.color.isNotNull());
|
||||
|
||||
return query.map(
|
||||
(row) => row.readWithConverter<Color?, int>(db.container.color)!,
|
||||
@@ -53,29 +52,26 @@ class ContainerDao extends DatabaseAccessor<TabDatabase>
|
||||
}
|
||||
|
||||
Selectable<String> getContainerTabIds(String? containerId) {
|
||||
final query =
|
||||
selectOnly(db.tab)
|
||||
..addColumns([db.tab.id])
|
||||
..where(
|
||||
(containerId != null)
|
||||
? db.tab.containerId.equals(containerId)
|
||||
: db.tab.containerId.isNull(),
|
||||
)
|
||||
..orderBy([OrderingTerm.asc(db.tab.orderKey)]);
|
||||
final query = selectOnly(db.tab)
|
||||
..addColumns([db.tab.id])
|
||||
..where(
|
||||
(containerId != null)
|
||||
? db.tab.containerId.equals(containerId)
|
||||
: db.tab.containerId.isNull(),
|
||||
)
|
||||
..orderBy([OrderingTerm.asc(db.tab.orderKey)]);
|
||||
|
||||
return query.map((row) => row.read(db.tab.id)!);
|
||||
}
|
||||
|
||||
Selectable<TabData> getContainerTabsData(String? containerId) {
|
||||
final query =
|
||||
db.tab.select()
|
||||
..where(
|
||||
(t) =>
|
||||
(containerId != null)
|
||||
? t.containerId.equals(containerId)
|
||||
: t.containerId.isNull(),
|
||||
)
|
||||
..orderBy([(t) => OrderingTerm.asc(t.orderKey)]);
|
||||
final query = db.tab.select()
|
||||
..where(
|
||||
(t) => (containerId != null)
|
||||
? t.containerId.equals(containerId)
|
||||
: t.containerId.isNull(),
|
||||
)
|
||||
..orderBy([(t) => OrderingTerm.asc(t.orderKey)]);
|
||||
|
||||
return query;
|
||||
}
|
||||
|
||||
@@ -21,19 +21,17 @@ class TabDao extends DatabaseAccessor<TabDatabase> with _$TabDaoMixin {
|
||||
db.tab.select()..where((t) => t.id.equals(id));
|
||||
|
||||
Selectable<String> getAllTabIds() {
|
||||
final query =
|
||||
selectOnly(db.tab)
|
||||
..addColumns([db.tab.id])
|
||||
..orderBy([OrderingTerm.asc(db.tab.orderKey)]);
|
||||
final query = selectOnly(db.tab)
|
||||
..addColumns([db.tab.id])
|
||||
..orderBy([OrderingTerm.asc(db.tab.orderKey)]);
|
||||
|
||||
return query.map((row) => row.read(db.tab.id)!);
|
||||
}
|
||||
|
||||
SingleOrNullSelectable<String?> getTabContainerId(String tabId) {
|
||||
final query =
|
||||
selectOnly(db.tab)
|
||||
..addColumns([db.tab.containerId])
|
||||
..where(db.tab.id.equals(tabId));
|
||||
final query = selectOnly(db.tab)
|
||||
..addColumns([db.tab.containerId])
|
||||
..where(db.tab.id.equals(tabId));
|
||||
|
||||
return query.map((row) => row.read(db.tab.containerId));
|
||||
}
|
||||
@@ -154,14 +152,12 @@ class TabDao extends DatabaseAccessor<TabDatabase> with _$TabDaoMixin {
|
||||
batch.update(
|
||||
db.tab,
|
||||
TabCompanion(
|
||||
url:
|
||||
(previousState?.url != state.url)
|
||||
? Value(state.url)
|
||||
: const Value.absent(),
|
||||
title:
|
||||
(previousState?.title != state.title)
|
||||
? Value(state.title)
|
||||
: const Value.absent(),
|
||||
url: (previousState?.url != state.url)
|
||||
? Value(state.url)
|
||||
: const Value.absent(),
|
||||
title: (previousState?.title != state.title)
|
||||
? Value(state.title)
|
||||
: const Value.absent(),
|
||||
),
|
||||
where: (t) => t.id.equals(state.id),
|
||||
);
|
||||
@@ -174,8 +170,9 @@ class TabDao extends DatabaseAccessor<TabDatabase> with _$TabDaoMixin {
|
||||
return db.transaction(() async {
|
||||
await (db.tab.delete()..where((t) => t.id.isNotIn(retainTabIds))).go();
|
||||
|
||||
var currentOrderKey =
|
||||
await db.containerDao.generateLeadingOrderKey(null).getSingle();
|
||||
var currentOrderKey = await db.containerDao
|
||||
.generateLeadingOrderKey(null)
|
||||
.getSingle();
|
||||
|
||||
await db.tab.insertAll(
|
||||
retainTabIds.map((id) {
|
||||
|
||||
@@ -55,11 +55,10 @@ class Container extends Table with TableInfo<Container, ContainerData> {
|
||||
ContainerData map(Map<String, dynamic> data, {String? tablePrefix}) {
|
||||
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
||||
return ContainerData(
|
||||
id:
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}id'],
|
||||
)!,
|
||||
id: attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}id'],
|
||||
)!,
|
||||
name: attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}name'],
|
||||
@@ -306,20 +305,18 @@ class Tab extends Table with TableInfo<Tab, TabData> {
|
||||
TabData map(Map<String, dynamic> data, {String? tablePrefix}) {
|
||||
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
||||
return TabData(
|
||||
id:
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}id'],
|
||||
)!,
|
||||
id: attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}id'],
|
||||
)!,
|
||||
containerId: attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}container_id'],
|
||||
),
|
||||
orderKey:
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}order_key'],
|
||||
)!,
|
||||
orderKey: attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}order_key'],
|
||||
)!,
|
||||
url: Tab.$converterurln.fromSql(
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
@@ -350,11 +347,10 @@ class Tab extends Table with TableInfo<Tab, TabData> {
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}full_content_plain'],
|
||||
),
|
||||
timestamp:
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.dateTime,
|
||||
data['${effectivePrefix}timestamp'],
|
||||
)!,
|
||||
timestamp: attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.dateTime,
|
||||
data['${effectivePrefix}timestamp'],
|
||||
)!,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -499,56 +495,47 @@ class TabData extends DataClass implements Insertable<TabData> {
|
||||
orderKey: orderKey ?? this.orderKey,
|
||||
url: url.present ? url.value : this.url,
|
||||
title: title.present ? title.value : this.title,
|
||||
isProbablyReaderable:
|
||||
isProbablyReaderable.present
|
||||
? isProbablyReaderable.value
|
||||
: this.isProbablyReaderable,
|
||||
extractedContentMarkdown:
|
||||
extractedContentMarkdown.present
|
||||
? extractedContentMarkdown.value
|
||||
: this.extractedContentMarkdown,
|
||||
extractedContentPlain:
|
||||
extractedContentPlain.present
|
||||
? extractedContentPlain.value
|
||||
: this.extractedContentPlain,
|
||||
fullContentMarkdown:
|
||||
fullContentMarkdown.present
|
||||
? fullContentMarkdown.value
|
||||
: this.fullContentMarkdown,
|
||||
fullContentPlain:
|
||||
fullContentPlain.present
|
||||
? fullContentPlain.value
|
||||
: this.fullContentPlain,
|
||||
isProbablyReaderable: isProbablyReaderable.present
|
||||
? isProbablyReaderable.value
|
||||
: this.isProbablyReaderable,
|
||||
extractedContentMarkdown: extractedContentMarkdown.present
|
||||
? extractedContentMarkdown.value
|
||||
: this.extractedContentMarkdown,
|
||||
extractedContentPlain: extractedContentPlain.present
|
||||
? extractedContentPlain.value
|
||||
: this.extractedContentPlain,
|
||||
fullContentMarkdown: fullContentMarkdown.present
|
||||
? fullContentMarkdown.value
|
||||
: this.fullContentMarkdown,
|
||||
fullContentPlain: fullContentPlain.present
|
||||
? fullContentPlain.value
|
||||
: this.fullContentPlain,
|
||||
timestamp: timestamp ?? this.timestamp,
|
||||
);
|
||||
TabData copyWithCompanion(TabCompanion data) {
|
||||
return TabData(
|
||||
id: data.id.present ? data.id.value : this.id,
|
||||
containerId:
|
||||
data.containerId.present ? data.containerId.value : this.containerId,
|
||||
containerId: data.containerId.present
|
||||
? data.containerId.value
|
||||
: this.containerId,
|
||||
orderKey: data.orderKey.present ? data.orderKey.value : this.orderKey,
|
||||
url: data.url.present ? data.url.value : this.url,
|
||||
title: data.title.present ? data.title.value : this.title,
|
||||
isProbablyReaderable:
|
||||
data.isProbablyReaderable.present
|
||||
? data.isProbablyReaderable.value
|
||||
: this.isProbablyReaderable,
|
||||
extractedContentMarkdown:
|
||||
data.extractedContentMarkdown.present
|
||||
? data.extractedContentMarkdown.value
|
||||
: this.extractedContentMarkdown,
|
||||
extractedContentPlain:
|
||||
data.extractedContentPlain.present
|
||||
? data.extractedContentPlain.value
|
||||
: this.extractedContentPlain,
|
||||
fullContentMarkdown:
|
||||
data.fullContentMarkdown.present
|
||||
? data.fullContentMarkdown.value
|
||||
: this.fullContentMarkdown,
|
||||
fullContentPlain:
|
||||
data.fullContentPlain.present
|
||||
? data.fullContentPlain.value
|
||||
: this.fullContentPlain,
|
||||
isProbablyReaderable: data.isProbablyReaderable.present
|
||||
? data.isProbablyReaderable.value
|
||||
: this.isProbablyReaderable,
|
||||
extractedContentMarkdown: data.extractedContentMarkdown.present
|
||||
? data.extractedContentMarkdown.value
|
||||
: this.extractedContentMarkdown,
|
||||
extractedContentPlain: data.extractedContentPlain.present
|
||||
? data.extractedContentPlain.value
|
||||
: this.extractedContentPlain,
|
||||
fullContentMarkdown: data.fullContentMarkdown.present
|
||||
? data.fullContentMarkdown.value
|
||||
: this.fullContentMarkdown,
|
||||
fullContentPlain: data.fullContentPlain.present
|
||||
? data.fullContentPlain.value
|
||||
: this.fullContentPlain,
|
||||
timestamp: data.timestamp.present ? data.timestamp.value : this.timestamp,
|
||||
);
|
||||
}
|
||||
@@ -838,26 +825,22 @@ class TabFts extends Table
|
||||
TabFt map(Map<String, dynamic> data, {String? tablePrefix}) {
|
||||
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
||||
return TabFt(
|
||||
title:
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}title'],
|
||||
)!,
|
||||
url:
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}url'],
|
||||
)!,
|
||||
extractedContentPlain:
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}extracted_content_plain'],
|
||||
)!,
|
||||
fullContentPlain:
|
||||
attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}full_content_plain'],
|
||||
)!,
|
||||
title: attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}title'],
|
||||
)!,
|
||||
url: attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}url'],
|
||||
)!,
|
||||
extractedContentPlain: attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}extracted_content_plain'],
|
||||
)!,
|
||||
fullContentPlain: attachedDatabase.typeMapping.read(
|
||||
DriftSqlType.string,
|
||||
data['${effectivePrefix}full_content_plain'],
|
||||
)!,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -936,14 +919,12 @@ class TabFt extends DataClass implements Insertable<TabFt> {
|
||||
return TabFt(
|
||||
title: data.title.present ? data.title.value : this.title,
|
||||
url: data.url.present ? data.url.value : this.url,
|
||||
extractedContentPlain:
|
||||
data.extractedContentPlain.present
|
||||
? data.extractedContentPlain.value
|
||||
: this.extractedContentPlain,
|
||||
fullContentPlain:
|
||||
data.fullContentPlain.present
|
||||
? data.fullContentPlain.value
|
||||
: this.fullContentPlain,
|
||||
extractedContentPlain: data.extractedContentPlain.present
|
||||
? data.extractedContentPlain.value
|
||||
: this.extractedContentPlain,
|
||||
fullContentPlain: data.fullContentPlain.present
|
||||
? data.fullContentPlain.value
|
||||
: this.fullContentPlain,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1431,12 +1412,12 @@ class $ContainerTableManager
|
||||
TableManagerState(
|
||||
db: db,
|
||||
table: table,
|
||||
createFilteringComposer:
|
||||
() => $ContainerFilterComposer($db: db, $table: table),
|
||||
createOrderingComposer:
|
||||
() => $ContainerOrderingComposer($db: db, $table: table),
|
||||
createComputedFieldComposer:
|
||||
() => $ContainerAnnotationComposer($db: db, $table: table),
|
||||
createFilteringComposer: () =>
|
||||
$ContainerFilterComposer($db: db, $table: table),
|
||||
createOrderingComposer: () =>
|
||||
$ContainerOrderingComposer($db: db, $table: table),
|
||||
createComputedFieldComposer: () =>
|
||||
$ContainerAnnotationComposer($db: db, $table: table),
|
||||
updateCompanionCallback:
|
||||
({
|
||||
Value<String> id = const Value.absent(),
|
||||
@@ -1465,16 +1446,11 @@ class $ContainerTableManager
|
||||
metadata: metadata,
|
||||
rowid: rowid,
|
||||
),
|
||||
withReferenceMapper:
|
||||
(p0) =>
|
||||
p0
|
||||
.map(
|
||||
(e) => (
|
||||
e.readTable(table),
|
||||
$ContainerReferences(db, table, e),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
withReferenceMapper: (p0) => p0
|
||||
.map(
|
||||
(e) => (e.readTable(table), $ContainerReferences(db, table, e)),
|
||||
)
|
||||
.toList(),
|
||||
prefetchHooksCallback: ({tabRefs = false}) {
|
||||
return PrefetchHooks(
|
||||
db: db,
|
||||
@@ -1490,10 +1466,10 @@ class $ContainerTableManager
|
||||
>(
|
||||
currentTable: table,
|
||||
referencedTable: $ContainerReferences._tabRefsTable(db),
|
||||
managerFromTypedResult:
|
||||
(p0) => $ContainerReferences(db, table, p0).tabRefs,
|
||||
referencedItemsForCurrentItem:
|
||||
(item, referencedItems) => referencedItems.where(
|
||||
managerFromTypedResult: (p0) =>
|
||||
$ContainerReferences(db, table, p0).tabRefs,
|
||||
referencedItemsForCurrentItem: (item, referencedItems) =>
|
||||
referencedItems.where(
|
||||
(e) => e.containerId == item.id,
|
||||
),
|
||||
typedResults: items,
|
||||
@@ -1829,12 +1805,12 @@ class $TabTableManager
|
||||
TableManagerState(
|
||||
db: db,
|
||||
table: table,
|
||||
createFilteringComposer:
|
||||
() => $TabFilterComposer($db: db, $table: table),
|
||||
createOrderingComposer:
|
||||
() => $TabOrderingComposer($db: db, $table: table),
|
||||
createComputedFieldComposer:
|
||||
() => $TabAnnotationComposer($db: db, $table: table),
|
||||
createFilteringComposer: () =>
|
||||
$TabFilterComposer($db: db, $table: table),
|
||||
createOrderingComposer: () =>
|
||||
$TabOrderingComposer($db: db, $table: table),
|
||||
createComputedFieldComposer: () =>
|
||||
$TabAnnotationComposer($db: db, $table: table),
|
||||
updateCompanionCallback:
|
||||
({
|
||||
Value<String> id = const Value.absent(),
|
||||
@@ -1891,51 +1867,45 @@ class $TabTableManager
|
||||
timestamp: timestamp,
|
||||
rowid: rowid,
|
||||
),
|
||||
withReferenceMapper:
|
||||
(p0) =>
|
||||
p0
|
||||
.map(
|
||||
(e) => (
|
||||
e.readTable(table),
|
||||
$TabReferences(db, table, e),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
withReferenceMapper: (p0) => p0
|
||||
.map((e) => (e.readTable(table), $TabReferences(db, table, e)))
|
||||
.toList(),
|
||||
prefetchHooksCallback: ({containerId = false}) {
|
||||
return PrefetchHooks(
|
||||
db: db,
|
||||
explicitlyWatchedTables: [],
|
||||
addJoins: <
|
||||
T extends TableManagerState<
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic
|
||||
>
|
||||
>(state) {
|
||||
if (containerId) {
|
||||
state =
|
||||
state.withJoin(
|
||||
currentTable: table,
|
||||
currentColumn: table.containerId,
|
||||
referencedTable: $TabReferences._containerIdTable(
|
||||
db,
|
||||
),
|
||||
referencedColumn:
|
||||
$TabReferences._containerIdTable(db).id,
|
||||
)
|
||||
as T;
|
||||
}
|
||||
addJoins:
|
||||
<
|
||||
T extends TableManagerState<
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic,
|
||||
dynamic
|
||||
>
|
||||
>(state) {
|
||||
if (containerId) {
|
||||
state =
|
||||
state.withJoin(
|
||||
currentTable: table,
|
||||
currentColumn: table.containerId,
|
||||
referencedTable: $TabReferences
|
||||
._containerIdTable(db),
|
||||
referencedColumn: $TabReferences
|
||||
._containerIdTable(db)
|
||||
.id,
|
||||
)
|
||||
as T;
|
||||
}
|
||||
|
||||
return state;
|
||||
},
|
||||
return state;
|
||||
},
|
||||
getPrefetchedDataCallback: (items) async {
|
||||
return [];
|
||||
},
|
||||
@@ -2079,12 +2049,12 @@ class $TabFtsTableManager
|
||||
TableManagerState(
|
||||
db: db,
|
||||
table: table,
|
||||
createFilteringComposer:
|
||||
() => $TabFtsFilterComposer($db: db, $table: table),
|
||||
createOrderingComposer:
|
||||
() => $TabFtsOrderingComposer($db: db, $table: table),
|
||||
createComputedFieldComposer:
|
||||
() => $TabFtsAnnotationComposer($db: db, $table: table),
|
||||
createFilteringComposer: () =>
|
||||
$TabFtsFilterComposer($db: db, $table: table),
|
||||
createOrderingComposer: () =>
|
||||
$TabFtsOrderingComposer($db: db, $table: table),
|
||||
createComputedFieldComposer: () =>
|
||||
$TabFtsAnnotationComposer($db: db, $table: table),
|
||||
updateCompanionCallback:
|
||||
({
|
||||
Value<String> title = const Value.absent(),
|
||||
@@ -2113,16 +2083,9 @@ class $TabFtsTableManager
|
||||
fullContentPlain: fullContentPlain,
|
||||
rowid: rowid,
|
||||
),
|
||||
withReferenceMapper:
|
||||
(p0) =>
|
||||
p0
|
||||
.map(
|
||||
(e) => (
|
||||
e.readTable(table),
|
||||
BaseReferences(db, table, e),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
withReferenceMapper: (p0) => p0
|
||||
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
||||
.toList(),
|
||||
prefetchHooksCallback: null,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -60,19 +60,17 @@ class _$ContainerAuthSettingsCWProxyImpl
|
||||
return ContainerAuthSettings(
|
||||
authenticationRequired:
|
||||
authenticationRequired == const $CopyWithPlaceholder()
|
||||
? _value.authenticationRequired
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: authenticationRequired as bool,
|
||||
lockOnAppBackground:
|
||||
lockOnAppBackground == const $CopyWithPlaceholder()
|
||||
? _value.lockOnAppBackground
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: lockOnAppBackground as bool,
|
||||
lockTimeout:
|
||||
lockTimeout == const $CopyWithPlaceholder()
|
||||
? _value.lockTimeout
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: lockTimeout as Duration?,
|
||||
? _value.authenticationRequired
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: authenticationRequired as bool,
|
||||
lockOnAppBackground: lockOnAppBackground == const $CopyWithPlaceholder()
|
||||
? _value.lockOnAppBackground
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: lockOnAppBackground as bool,
|
||||
lockTimeout: lockTimeout == const $CopyWithPlaceholder()
|
||||
? _value.lockTimeout
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: lockTimeout as Duration?,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -141,26 +139,22 @@ class _$ContainerMetadataCWProxyImpl implements _$ContainerMetadataCWProxy {
|
||||
Object? useProxy = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return ContainerMetadata(
|
||||
iconData:
|
||||
iconData == const $CopyWithPlaceholder()
|
||||
? _value.iconData
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: iconData as IconData?,
|
||||
contextualIdentity:
|
||||
contextualIdentity == const $CopyWithPlaceholder()
|
||||
? _value.contextualIdentity
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: contextualIdentity as String?,
|
||||
authSettings:
|
||||
authSettings == const $CopyWithPlaceholder()
|
||||
? _value.authSettings
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: authSettings as ContainerAuthSettings,
|
||||
useProxy:
|
||||
useProxy == const $CopyWithPlaceholder()
|
||||
? _value.useProxy
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: useProxy as bool,
|
||||
iconData: iconData == const $CopyWithPlaceholder()
|
||||
? _value.iconData
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: iconData as IconData?,
|
||||
contextualIdentity: contextualIdentity == const $CopyWithPlaceholder()
|
||||
? _value.contextualIdentity
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: contextualIdentity as String?,
|
||||
authSettings: authSettings == const $CopyWithPlaceholder()
|
||||
? _value.authSettings
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: authSettings as ContainerAuthSettings,
|
||||
useProxy: useProxy == const $CopyWithPlaceholder()
|
||||
? _value.useProxy
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: useProxy as bool,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -228,26 +222,22 @@ class _$ContainerDataCWProxyImpl implements _$ContainerDataCWProxy {
|
||||
Object? metadata = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return ContainerData(
|
||||
id:
|
||||
id == const $CopyWithPlaceholder()
|
||||
? _value.id
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: id as String,
|
||||
name:
|
||||
name == const $CopyWithPlaceholder()
|
||||
? _value.name
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: name as String?,
|
||||
color:
|
||||
color == const $CopyWithPlaceholder()
|
||||
? _value.color
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: color as Color,
|
||||
metadata:
|
||||
metadata == const $CopyWithPlaceholder()
|
||||
? _value.metadata
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: metadata as ContainerMetadata?,
|
||||
id: id == const $CopyWithPlaceholder()
|
||||
? _value.id
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: id as String,
|
||||
name: name == const $CopyWithPlaceholder()
|
||||
? _value.name
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: name as String?,
|
||||
color: color == const $CopyWithPlaceholder()
|
||||
? _value.color
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: color as Color,
|
||||
metadata: metadata == const $CopyWithPlaceholder()
|
||||
? _value.metadata
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: metadata as ContainerMetadata?,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -267,10 +257,9 @@ ContainerAuthSettings _$ContainerAuthSettingsFromJson(
|
||||
) => ContainerAuthSettings(
|
||||
authenticationRequired: json['authenticationRequired'] as bool,
|
||||
lockOnAppBackground: json['lockOnAppBackground'] as bool,
|
||||
lockTimeout:
|
||||
json['lockTimeout'] == null
|
||||
? null
|
||||
: Duration(microseconds: (json['lockTimeout'] as num).toInt()),
|
||||
lockTimeout: json['lockTimeout'] == null
|
||||
? null
|
||||
: Duration(microseconds: (json['lockTimeout'] as num).toInt()),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ContainerAuthSettingsToJson(
|
||||
@@ -288,12 +277,11 @@ ContainerMetadata _$ContainerMetadataFromJson(Map<String, dynamic> json) =>
|
||||
const IconDataJsonConverter().fromJson,
|
||||
),
|
||||
contextualIdentity: json['contextualIdentity'] as String?,
|
||||
authSettings:
|
||||
json['authSettings'] == null
|
||||
? null
|
||||
: ContainerAuthSettings.fromJson(
|
||||
json['authSettings'] as Map<String, dynamic>,
|
||||
),
|
||||
authSettings: json['authSettings'] == null
|
||||
? null
|
||||
: ContainerAuthSettings.fromJson(
|
||||
json['authSettings'] as Map<String, dynamic>,
|
||||
),
|
||||
useProxy: json['useProxy'] as bool? ?? false,
|
||||
);
|
||||
|
||||
|
||||
@@ -13,8 +13,9 @@ String _$tabDatabaseHash() => r'422bd4789296dc271fabbd5906f2e2ab16bccaa3';
|
||||
final tabDatabaseProvider = Provider<TabDatabase>.internal(
|
||||
tabDatabase,
|
||||
name: r'tabDatabaseProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product') ? null : _$tabDatabaseHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$tabDatabaseHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@@ -26,12 +26,11 @@ AsyncValue<List<ContainerDataWithCount>> matchSortedContainersWithCount(
|
||||
}
|
||||
|
||||
return value.whenData(
|
||||
(cb) =>
|
||||
TokenizedFilter.sort(
|
||||
items: cb,
|
||||
toString: (item) => item.name,
|
||||
query: searchText!,
|
||||
).filtered,
|
||||
(cb) => TokenizedFilter.sort(
|
||||
items: cb,
|
||||
toString: (item) => item.name,
|
||||
query: searchText!,
|
||||
).filtered,
|
||||
);
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -15,10 +15,9 @@ final containersWithCountProvider =
|
||||
AutoDisposeStreamProvider<List<ContainerDataWithCount>>.internal(
|
||||
containersWithCount,
|
||||
name: r'containersWithCountProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$containersWithCountHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$containersWithCountHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
@@ -101,10 +100,9 @@ class MatchSortedContainersWithCountProvider
|
||||
),
|
||||
from: matchSortedContainersWithCountProvider,
|
||||
name: r'matchSortedContainersWithCountProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$matchSortedContainersWithCountHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$matchSortedContainersWithCountHash,
|
||||
dependencies: MatchSortedContainersWithCountFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
MatchSortedContainersWithCountFamily._allTransitiveDependencies,
|
||||
@@ -229,10 +227,9 @@ class ContainerTabIdsProvider extends AutoDisposeStreamProvider<List<String>> {
|
||||
(ref) => containerTabIds(ref as ContainerTabIdsRef, containerFilter),
|
||||
from: containerTabIdsProvider,
|
||||
name: r'containerTabIdsProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$containerTabIdsHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$containerTabIdsHash,
|
||||
dependencies: ContainerTabIdsFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
ContainerTabIdsFamily._allTransitiveDependencies,
|
||||
|
||||
@@ -52,8 +52,8 @@ class SelectedContainer extends _$SelectedContainer {
|
||||
|
||||
if (passAuth) {
|
||||
if (container.metadata.useProxy) {
|
||||
final proxyPluginHealthy =
|
||||
await GeckoContainerProxyService().healthcheck();
|
||||
final proxyPluginHealthy = await GeckoContainerProxyService()
|
||||
.healthcheck();
|
||||
|
||||
if (proxyPluginHealthy) {
|
||||
state = id;
|
||||
|
||||
@@ -15,10 +15,9 @@ final selectedContainerDataProvider =
|
||||
AutoDisposeStreamProvider<ContainerData?>.internal(
|
||||
selectedContainerData,
|
||||
name: r'selectedContainerDataProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$selectedContainerDataHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$selectedContainerDataHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
@@ -34,10 +33,9 @@ final selectedContainerProvider =
|
||||
NotifierProvider<SelectedContainer, String?>.internal(
|
||||
SelectedContainer.new,
|
||||
name: r'selectedContainerProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$selectedContainerHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$selectedContainerHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@@ -15,10 +15,9 @@ final containerRepositoryProvider =
|
||||
NotifierProvider<ContainerRepository, void>.internal(
|
||||
ContainerRepository.new,
|
||||
name: r'containerRepositoryProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$containerRepositoryHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$containerRepositoryHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@@ -21,12 +21,11 @@ class TabDataRepository extends _$TabDataRepository {
|
||||
}
|
||||
|
||||
Future<void> closeAllTabsByContainer(String? containerId) async {
|
||||
final tabIds =
|
||||
await ref
|
||||
.read(tabDatabaseProvider)
|
||||
.containerDao
|
||||
.getContainerTabIds(containerId)
|
||||
.get();
|
||||
final tabIds = await ref
|
||||
.read(tabDatabaseProvider)
|
||||
.containerDao
|
||||
.getContainerTabIds(containerId)
|
||||
.get();
|
||||
|
||||
if (tabIds.isNotEmpty) {
|
||||
await ref.read(tabRepositoryProvider.notifier).closeTabs(tabIds);
|
||||
@@ -34,18 +33,16 @@ class TabDataRepository extends _$TabDataRepository {
|
||||
}
|
||||
|
||||
Future<void> closeAllTabsByHost(String? containerId, String host) async {
|
||||
final tabs =
|
||||
await ref
|
||||
.read(tabDatabaseProvider)
|
||||
.containerDao
|
||||
.getContainerTabsData(containerId)
|
||||
.get();
|
||||
final tabs = await ref
|
||||
.read(tabDatabaseProvider)
|
||||
.containerDao
|
||||
.getContainerTabsData(containerId)
|
||||
.get();
|
||||
|
||||
final filtered =
|
||||
tabs
|
||||
.where((tab) => tab.url?.host == host)
|
||||
.map((tab) => tab.id)
|
||||
.toList();
|
||||
final filtered = tabs
|
||||
.where((tab) => tab.url?.host == host)
|
||||
.map((tab) => tab.id)
|
||||
.toList();
|
||||
|
||||
if (filtered.isNotEmpty) {
|
||||
await ref.read(tabRepositoryProvider.notifier).closeTabs(filtered);
|
||||
|
||||
@@ -14,10 +14,9 @@ final tabDataRepositoryProvider =
|
||||
NotifierProvider<TabDataRepository, void>.internal(
|
||||
TabDataRepository.new,
|
||||
name: r'tabDataRepositoryProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$tabDataRepositoryHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$tabDataRepositoryHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@@ -19,18 +19,17 @@ class TabSearchRepository extends _$TabSearchRepository {
|
||||
}) async {
|
||||
if (input.isNotEmpty) {
|
||||
state = await AsyncValue.guard(
|
||||
() =>
|
||||
ref
|
||||
.read(tabDatabaseProvider)
|
||||
.tabDao
|
||||
.queryTabs(
|
||||
matchPrefix: matchPrefix,
|
||||
matchSuffix: matchSuffix,
|
||||
ellipsis: ellipsis,
|
||||
snippetLength: snippetLength,
|
||||
searchString: input,
|
||||
)
|
||||
.get(),
|
||||
() => ref
|
||||
.read(tabDatabaseProvider)
|
||||
.tabDao
|
||||
.queryTabs(
|
||||
matchPrefix: matchPrefix,
|
||||
matchSuffix: matchSuffix,
|
||||
ellipsis: ellipsis,
|
||||
snippetLength: snippetLength,
|
||||
searchString: input,
|
||||
)
|
||||
.get(),
|
||||
);
|
||||
} else {
|
||||
state = const AsyncValue.data(null);
|
||||
|
||||
@@ -87,10 +87,9 @@ class TabSearchRepositoryProvider
|
||||
() => TabSearchRepository()..partition = partition,
|
||||
from: tabSearchRepositoryProvider,
|
||||
name: r'tabSearchRepositoryProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$tabSearchRepositoryHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$tabSearchRepositoryHash,
|
||||
dependencies: TabSearchRepositoryFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
TabSearchRepositoryFamily._allTransitiveDependencies,
|
||||
|
||||
@@ -149,9 +149,8 @@ class ContainerEditScreen extends HookConsumerWidget {
|
||||
onPressed: () async {
|
||||
final color = await showDialog<Color?>(
|
||||
context: context,
|
||||
builder:
|
||||
(context) =>
|
||||
ColorPickerDialog(selectedColor.value),
|
||||
builder: (context) =>
|
||||
ColorPickerDialog(selectedColor.value),
|
||||
);
|
||||
|
||||
if (color != null) {
|
||||
@@ -164,22 +163,20 @@ class ContainerEditScreen extends HookConsumerWidget {
|
||||
title: const Text('Cookie Isolation'),
|
||||
secondary: const Icon(MdiIcons.cookieLock),
|
||||
contentPadding: EdgeInsets.zero,
|
||||
onChanged:
|
||||
(_mode == _DialogMode.create)
|
||||
? (value) {
|
||||
contextualIdentity.value =
|
||||
value
|
||||
? initialContainer
|
||||
.metadata
|
||||
.contextualIdentity ??
|
||||
uuid.v4()
|
||||
: null;
|
||||
onChanged: (_mode == _DialogMode.create)
|
||||
? (value) {
|
||||
contextualIdentity.value = value
|
||||
? initialContainer
|
||||
.metadata
|
||||
.contextualIdentity ??
|
||||
uuid.v4()
|
||||
: null;
|
||||
|
||||
if (!value && useProxy.value) {
|
||||
useProxy.value = false;
|
||||
}
|
||||
if (!value && useProxy.value) {
|
||||
useProxy.value = false;
|
||||
}
|
||||
: null,
|
||||
}
|
||||
: null,
|
||||
),
|
||||
SwitchListTile.adaptive(
|
||||
value: useProxy.value,
|
||||
@@ -199,8 +196,8 @@ class ContainerEditScreen extends HookConsumerWidget {
|
||||
_DialogMode.edit =>
|
||||
(contextualIdentity.value != null)
|
||||
? (value) {
|
||||
useProxy.value = value;
|
||||
}
|
||||
useProxy.value = value;
|
||||
}
|
||||
: null,
|
||||
},
|
||||
),
|
||||
@@ -230,8 +227,9 @@ class ContainerEditScreen extends HookConsumerWidget {
|
||||
title: const Text('Timeout'),
|
||||
controlAffinity: ListTileControlAffinity.leading,
|
||||
onChanged: (value) {
|
||||
final newValue =
|
||||
value! ? _timeoutOptions[1].value : null;
|
||||
final newValue = value!
|
||||
? _timeoutOptions[1].value
|
||||
: null;
|
||||
|
||||
authSettings.value = authSettings.value.copyWith
|
||||
.lockTimeout(newValue);
|
||||
|
||||
+89
-107
@@ -28,127 +28,109 @@ class ContainerListScreen extends HookConsumerWidget {
|
||||
enabled: containersAsync.isLoading,
|
||||
child: containersAsync.when(
|
||||
skipLoadingOnReload: true,
|
||||
data:
|
||||
(containers) => FadingScroll(
|
||||
fadingSize: 25,
|
||||
builder: (context, controller) {
|
||||
return ListView.builder(
|
||||
controller: controller,
|
||||
itemCount: containers.length,
|
||||
itemBuilder: (context, index) {
|
||||
final container = containers[index];
|
||||
return Slidable(
|
||||
key: ValueKey(container.id),
|
||||
startActionPane: ActionPane(
|
||||
motion: const ScrollMotion(),
|
||||
children: [
|
||||
if (container.id != selectedContainer)
|
||||
SlidableAction(
|
||||
onPressed: (context) async {
|
||||
final result = await ref
|
||||
.read(
|
||||
selectedContainerProvider.notifier,
|
||||
)
|
||||
.setContainerId(container.id);
|
||||
data: (containers) => FadingScroll(
|
||||
fadingSize: 25,
|
||||
builder: (context, controller) {
|
||||
return ListView.builder(
|
||||
controller: controller,
|
||||
itemCount: containers.length,
|
||||
itemBuilder: (context, index) {
|
||||
final container = containers[index];
|
||||
return Slidable(
|
||||
key: ValueKey(container.id),
|
||||
startActionPane: ActionPane(
|
||||
motion: const ScrollMotion(),
|
||||
children: [
|
||||
if (container.id != selectedContainer)
|
||||
SlidableAction(
|
||||
onPressed: (context) async {
|
||||
final result = await ref
|
||||
.read(selectedContainerProvider.notifier)
|
||||
.setContainerId(container.id);
|
||||
|
||||
if (context.mounted &&
|
||||
result ==
|
||||
SetContainerResult
|
||||
.successHasProxy) {
|
||||
await ref
|
||||
.read(
|
||||
startProxyControllerProvider
|
||||
.notifier,
|
||||
)
|
||||
.maybeStartProxy(context);
|
||||
}
|
||||
},
|
||||
foregroundColor:
|
||||
Theme.of(
|
||||
context,
|
||||
).colorScheme.onPrimaryContainer,
|
||||
backgroundColor:
|
||||
Theme.of(
|
||||
context,
|
||||
).colorScheme.primaryContainer,
|
||||
icon: Icons.check,
|
||||
label: 'Select',
|
||||
)
|
||||
else
|
||||
SlidableAction(
|
||||
onPressed: (context) {
|
||||
ref
|
||||
.read(
|
||||
selectedContainerProvider.notifier,
|
||||
)
|
||||
.clearContainer();
|
||||
},
|
||||
foregroundColor:
|
||||
Theme.of(
|
||||
context,
|
||||
).colorScheme.onPrimaryContainer,
|
||||
backgroundColor:
|
||||
Theme.of(
|
||||
context,
|
||||
).colorScheme.primaryContainer,
|
||||
icon: Icons.close,
|
||||
label: 'Unselect',
|
||||
),
|
||||
],
|
||||
),
|
||||
endActionPane: ActionPane(
|
||||
motion: const ScrollMotion(),
|
||||
children: [
|
||||
SlidableAction(
|
||||
onPressed: (context) async {
|
||||
if (context.mounted &&
|
||||
result ==
|
||||
SetContainerResult.successHasProxy) {
|
||||
await ref
|
||||
.read(
|
||||
containerRepositoryProvider.notifier,
|
||||
startProxyControllerProvider.notifier,
|
||||
)
|
||||
.deleteContainer(container.id);
|
||||
},
|
||||
backgroundColor:
|
||||
Theme.of(
|
||||
context,
|
||||
).colorScheme.errorContainer,
|
||||
foregroundColor:
|
||||
Theme.of(
|
||||
context,
|
||||
).colorScheme.onErrorContainer,
|
||||
icon: Icons.delete,
|
||||
label: 'Delete',
|
||||
),
|
||||
],
|
||||
.maybeStartProxy(context);
|
||||
}
|
||||
},
|
||||
foregroundColor: Theme.of(
|
||||
context,
|
||||
).colorScheme.onPrimaryContainer,
|
||||
backgroundColor: Theme.of(
|
||||
context,
|
||||
).colorScheme.primaryContainer,
|
||||
icon: Icons.check,
|
||||
label: 'Select',
|
||||
)
|
||||
else
|
||||
SlidableAction(
|
||||
onPressed: (context) {
|
||||
ref
|
||||
.read(selectedContainerProvider.notifier)
|
||||
.clearContainer();
|
||||
},
|
||||
foregroundColor: Theme.of(
|
||||
context,
|
||||
).colorScheme.onPrimaryContainer,
|
||||
backgroundColor: Theme.of(
|
||||
context,
|
||||
).colorScheme.primaryContainer,
|
||||
icon: Icons.close,
|
||||
label: 'Unselect',
|
||||
),
|
||||
],
|
||||
),
|
||||
endActionPane: ActionPane(
|
||||
motion: const ScrollMotion(),
|
||||
children: [
|
||||
SlidableAction(
|
||||
onPressed: (context) async {
|
||||
await ref
|
||||
.read(containerRepositoryProvider.notifier)
|
||||
.deleteContainer(container.id);
|
||||
},
|
||||
backgroundColor: Theme.of(
|
||||
context,
|
||||
).colorScheme.errorContainer,
|
||||
foregroundColor: Theme.of(
|
||||
context,
|
||||
).colorScheme.onErrorContainer,
|
||||
icon: Icons.delete,
|
||||
label: 'Delete',
|
||||
),
|
||||
child: ContainerListTile(
|
||||
container,
|
||||
isSelected: container.id == selectedContainer,
|
||||
),
|
||||
);
|
||||
},
|
||||
],
|
||||
),
|
||||
child: ContainerListTile(
|
||||
container,
|
||||
isSelected: container.id == selectedContainer,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
error: (error, stackTrace) => SizedBox.shrink(),
|
||||
loading:
|
||||
() => ListView.builder(
|
||||
itemCount: 3,
|
||||
itemBuilder:
|
||||
(context, index) => ContainerListTile(
|
||||
ContainerData(id: 'null', color: Colors.transparent),
|
||||
isSelected: false,
|
||||
),
|
||||
),
|
||||
loading: () => ListView.builder(
|
||||
itemCount: 3,
|
||||
itemBuilder: (context, index) => ContainerListTile(
|
||||
ContainerData(id: 'null', color: Colors.transparent),
|
||||
isSelected: false,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
onPressed: () async {
|
||||
final initialColor =
|
||||
await ref
|
||||
.read(containerRepositoryProvider.notifier)
|
||||
.unusedRandomContainerColor();
|
||||
final initialColor = await ref
|
||||
.read(containerRepositoryProvider.notifier)
|
||||
.unusedRandomContainerColor();
|
||||
|
||||
if (context.mounted) {
|
||||
final result = await ContainerCreateRoute(
|
||||
|
||||
+19
-21
@@ -68,17 +68,16 @@ class ContainerChips extends HookConsumerWidget {
|
||||
child: SelectableChips(
|
||||
deleteIcon: false,
|
||||
itemId: (container) => container.id,
|
||||
itemAvatar:
|
||||
(container) => Container(
|
||||
width: 20.0,
|
||||
height: 20.0,
|
||||
decoration: BoxDecoration(
|
||||
color: container.color,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
),
|
||||
itemLabel:
|
||||
(container) => Text(container.name ?? 'New Container'),
|
||||
itemAvatar: (container) => Container(
|
||||
width: 20.0,
|
||||
height: 20.0,
|
||||
decoration: BoxDecoration(
|
||||
color: container.color,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
),
|
||||
itemLabel: (container) =>
|
||||
Text(container.name ?? 'New Container'),
|
||||
itemBadgeCount: (container) => container.tabCount,
|
||||
itemWrap: (child, container) {
|
||||
return HookBuilder(
|
||||
@@ -150,17 +149,16 @@ class ContainerChips extends HookConsumerWidget {
|
||||
|
||||
return OverlayPortal(
|
||||
controller: overlayController,
|
||||
overlayChildBuilder:
|
||||
(context) => Positioned(
|
||||
top: position.dy,
|
||||
left: position.dx,
|
||||
child: IgnorePointer(
|
||||
child: Transform.scale(
|
||||
scale: 1.1,
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
overlayChildBuilder: (context) => Positioned(
|
||||
top: position.dy,
|
||||
left: position.dx,
|
||||
child: IgnorePointer(
|
||||
child: Transform.scale(
|
||||
scale: 1.1,
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: HookBuilder(
|
||||
builder: (context) {
|
||||
final dragTabId = useValueListenable(
|
||||
|
||||
+103
-119
@@ -54,43 +54,38 @@ class _MaterialPickerState extends State<MaterialPicker> {
|
||||
clipBehavior: Clip.hardEdge,
|
||||
decoration: const BoxDecoration(),
|
||||
child: Container(
|
||||
margin:
|
||||
isPortrait
|
||||
? const EdgeInsets.only(right: 10)
|
||||
: const EdgeInsets.only(bottom: 10),
|
||||
margin: isPortrait
|
||||
? const EdgeInsets.only(right: 10)
|
||||
: const EdgeInsets.only(bottom: 10),
|
||||
width: isPortrait ? 60 : null,
|
||||
height: isPortrait ? null : 60,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).cardColor,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color:
|
||||
(Theme.of(context).brightness == Brightness.light)
|
||||
? (Theme.of(context).brightness == Brightness.light)
|
||||
? Colors.grey[300]!
|
||||
: Colors.black38
|
||||
: Colors.black38,
|
||||
color: (Theme.of(context).brightness == Brightness.light)
|
||||
? (Theme.of(context).brightness == Brightness.light)
|
||||
? Colors.grey[300]!
|
||||
: Colors.black38
|
||||
: Colors.black38,
|
||||
blurRadius: 10,
|
||||
),
|
||||
],
|
||||
border:
|
||||
isPortrait
|
||||
? Border(
|
||||
right: BorderSide(
|
||||
color:
|
||||
(Theme.of(context).brightness == Brightness.light)
|
||||
? Colors.grey[300]!
|
||||
: Colors.black38,
|
||||
),
|
||||
)
|
||||
: Border(
|
||||
top: BorderSide(
|
||||
color:
|
||||
(Theme.of(context).brightness == Brightness.light)
|
||||
? Colors.grey[300]!
|
||||
: Colors.black38,
|
||||
),
|
||||
border: isPortrait
|
||||
? Border(
|
||||
right: BorderSide(
|
||||
color: (Theme.of(context).brightness == Brightness.light)
|
||||
? Colors.grey[300]!
|
||||
: Colors.black38,
|
||||
),
|
||||
)
|
||||
: Border(
|
||||
top: BorderSide(
|
||||
color: (Theme.of(context).brightness == Brightness.light)
|
||||
? Colors.grey[300]!
|
||||
: Colors.black38,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: ScrollConfiguration(
|
||||
behavior: ScrollConfiguration.of(
|
||||
@@ -118,10 +113,9 @@ class _MaterialPickerState extends State<MaterialPicker> {
|
||||
},
|
||||
child: Container(
|
||||
color: const Color(0x00000000),
|
||||
padding:
|
||||
isPortrait
|
||||
? const EdgeInsets.fromLTRB(0, 7, 0, 7)
|
||||
: const EdgeInsets.fromLTRB(7, 0, 7, 0),
|
||||
padding: isPortrait
|
||||
? const EdgeInsets.fromLTRB(0, 7, 0, 7)
|
||||
: const EdgeInsets.fromLTRB(7, 0, 7, 0),
|
||||
child: Align(
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
@@ -130,38 +124,34 @@ class _MaterialPickerState extends State<MaterialPicker> {
|
||||
decoration: BoxDecoration(
|
||||
color: colorType,
|
||||
shape: BoxShape.circle,
|
||||
boxShadow:
|
||||
_currentColorType == colors
|
||||
? [
|
||||
if (colorType ==
|
||||
Theme.of(context).cardColor)
|
||||
BoxShadow(
|
||||
color:
|
||||
(Theme.of(
|
||||
context,
|
||||
).brightness ==
|
||||
Brightness.light)
|
||||
? Colors.grey[300]!
|
||||
: Colors.black38,
|
||||
blurRadius: 10,
|
||||
)
|
||||
else
|
||||
BoxShadow(
|
||||
color: colorType,
|
||||
blurRadius: 10,
|
||||
),
|
||||
]
|
||||
: null,
|
||||
border:
|
||||
colorType == Theme.of(context).cardColor
|
||||
? Border.all(
|
||||
color:
|
||||
(Theme.of(context).brightness ==
|
||||
Brightness.light)
|
||||
? Colors.grey[300]!
|
||||
: Colors.black38,
|
||||
)
|
||||
: null,
|
||||
boxShadow: _currentColorType == colors
|
||||
? [
|
||||
if (colorType ==
|
||||
Theme.of(context).cardColor)
|
||||
BoxShadow(
|
||||
color:
|
||||
(Theme.of(context).brightness ==
|
||||
Brightness.light)
|
||||
? Colors.grey[300]!
|
||||
: Colors.black38,
|
||||
blurRadius: 10,
|
||||
)
|
||||
else
|
||||
BoxShadow(
|
||||
color: colorType,
|
||||
blurRadius: 10,
|
||||
),
|
||||
]
|
||||
: null,
|
||||
border: colorType == Theme.of(context).cardColor
|
||||
? Border.all(
|
||||
color:
|
||||
(Theme.of(context).brightness ==
|
||||
Brightness.light)
|
||||
? Colors.grey[300]!
|
||||
: Colors.black38,
|
||||
)
|
||||
: null,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -208,66 +198,60 @@ class _MaterialPickerState extends State<MaterialPicker> {
|
||||
},
|
||||
child: Container(
|
||||
color: const Color(0x00000000),
|
||||
margin:
|
||||
isPortrait
|
||||
? const EdgeInsets.only(right: 10)
|
||||
: const EdgeInsets.only(bottom: 10),
|
||||
padding:
|
||||
isPortrait
|
||||
? const EdgeInsets.fromLTRB(0, 7, 0, 7)
|
||||
: const EdgeInsets.fromLTRB(7, 0, 7, 0),
|
||||
margin: isPortrait
|
||||
? const EdgeInsets.only(right: 10)
|
||||
: const EdgeInsets.only(bottom: 10),
|
||||
padding: isPortrait
|
||||
? const EdgeInsets.fromLTRB(0, 7, 0, 7)
|
||||
: const EdgeInsets.fromLTRB(7, 0, 7, 0),
|
||||
child: Align(
|
||||
child: AnimatedContainer(
|
||||
curve: Curves.fastOutSlowIn,
|
||||
duration: const Duration(milliseconds: 500),
|
||||
width:
|
||||
isPortrait
|
||||
? (_currentShading == color ? 250 : 230)
|
||||
: (_currentShading == color ? 50 : 30),
|
||||
width: isPortrait
|
||||
? (_currentShading == color ? 250 : 230)
|
||||
: (_currentShading == color ? 50 : 30),
|
||||
height: isPortrait ? 50 : 220,
|
||||
decoration: BoxDecoration(
|
||||
color: color,
|
||||
boxShadow:
|
||||
_currentShading == color
|
||||
? [
|
||||
if ((color == Colors.white) ||
|
||||
(color == Colors.black))
|
||||
BoxShadow(
|
||||
color:
|
||||
(Theme.of(context).brightness ==
|
||||
Brightness.light)
|
||||
? Colors.grey[300]!
|
||||
: Colors.black38,
|
||||
blurRadius: 10,
|
||||
)
|
||||
else
|
||||
BoxShadow(color: color, blurRadius: 10),
|
||||
]
|
||||
: null,
|
||||
boxShadow: _currentShading == color
|
||||
? [
|
||||
if ((color == Colors.white) ||
|
||||
(color == Colors.black))
|
||||
BoxShadow(
|
||||
color:
|
||||
(Theme.of(context).brightness ==
|
||||
Brightness.light)
|
||||
? Colors.grey[300]!
|
||||
: Colors.black38,
|
||||
blurRadius: 10,
|
||||
)
|
||||
else
|
||||
BoxShadow(color: color, blurRadius: 10),
|
||||
]
|
||||
: null,
|
||||
border:
|
||||
(color == Colors.white) ||
|
||||
(color == Colors.black)
|
||||
? Border.all(
|
||||
color:
|
||||
(Theme.of(context).brightness ==
|
||||
Brightness.light)
|
||||
? Colors.grey[300]!
|
||||
: Colors.black38,
|
||||
)
|
||||
: null,
|
||||
(color == Colors.black)
|
||||
? Border.all(
|
||||
color:
|
||||
(Theme.of(context).brightness ==
|
||||
Brightness.light)
|
||||
? Colors.grey[300]!
|
||||
: Colors.black38,
|
||||
)
|
||||
: null,
|
||||
),
|
||||
child:
|
||||
widget.enableLabel
|
||||
? isPortrait
|
||||
? Row(
|
||||
child: widget.enableLabel
|
||||
? isPortrait
|
||||
? Row(
|
||||
children: [
|
||||
Text(
|
||||
' ${colors.values.first}',
|
||||
style: TextStyle(
|
||||
color:
|
||||
useWhiteForeground(color)
|
||||
? Colors.white
|
||||
: Colors.black,
|
||||
color: useWhiteForeground(color)
|
||||
? Colors.white
|
||||
: Colors.black,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
@@ -278,8 +262,8 @@ class _MaterialPickerState extends State<MaterialPicker> {
|
||||
style: TextStyle(
|
||||
color:
|
||||
useWhiteForeground(color)
|
||||
? Colors.white
|
||||
: Colors.black,
|
||||
? Colors.white
|
||||
: Colors.black,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
@@ -287,12 +271,13 @@ class _MaterialPickerState extends State<MaterialPicker> {
|
||||
),
|
||||
],
|
||||
)
|
||||
: AnimatedOpacity(
|
||||
: AnimatedOpacity(
|
||||
duration: const Duration(
|
||||
milliseconds: 300,
|
||||
),
|
||||
opacity:
|
||||
_currentShading == color ? 1 : 0,
|
||||
opacity: _currentShading == color
|
||||
? 1
|
||||
: 0,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 16,
|
||||
@@ -301,10 +286,9 @@ class _MaterialPickerState extends State<MaterialPicker> {
|
||||
child: Text(
|
||||
colors.values.first,
|
||||
style: TextStyle(
|
||||
color:
|
||||
useWhiteForeground(color)
|
||||
? Colors.white
|
||||
: Colors.black,
|
||||
color: useWhiteForeground(color)
|
||||
? Colors.white
|
||||
: Colors.black,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14,
|
||||
),
|
||||
@@ -312,7 +296,7 @@ class _MaterialPickerState extends State<MaterialPicker> {
|
||||
),
|
||||
),
|
||||
)
|
||||
: const SizedBox(),
|
||||
: const SizedBox(),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -17,12 +17,11 @@ bool useWhiteForeground(Color backgroundColor, {double bias = 0.0}) {
|
||||
// return 1.05 / (color.computeLuminance() + 0.05) > 4.5;
|
||||
|
||||
// New:
|
||||
final v =
|
||||
sqrt(
|
||||
pow(backgroundColor.r, 2) * 0.299 +
|
||||
pow(backgroundColor.g, 2) * 0.587 +
|
||||
pow(backgroundColor.b, 2) * 0.114,
|
||||
).round();
|
||||
final v = sqrt(
|
||||
pow(backgroundColor.r, 2) * 0.299 +
|
||||
pow(backgroundColor.g, 2) * 0.587 +
|
||||
pow(backgroundColor.b, 2) * 0.114,
|
||||
).round();
|
||||
return v < (130 + bias);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,10 +15,9 @@ final kagiAutosuggestServiceProvider =
|
||||
NotifierProvider<KagiAutosuggestService, void>.internal(
|
||||
KagiAutosuggestService.new,
|
||||
name: r'kagiAutosuggestServiceProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$kagiAutosuggestServiceHash,
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$kagiAutosuggestServiceHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@@ -37,29 +37,27 @@ sealed class FtsQueryBuilder {
|
||||
}) {
|
||||
final matches = _tokenizePattern.allMatches(input);
|
||||
|
||||
final barewords =
|
||||
matches
|
||||
.map((match) {
|
||||
if (match.group(1) != null) {
|
||||
return EnclosedBareword(match.group(1)!);
|
||||
} else if (_barewordPattern.hasMatch(match.group(2)!)) {
|
||||
return SimpleBareword(match.group(2)!);
|
||||
} else {
|
||||
return EnclosedBareword(match.group(2)!);
|
||||
}
|
||||
})
|
||||
.where((token) => token.word.isNotEmpty)
|
||||
.whereNot(_isReservedBareword)
|
||||
.toList();
|
||||
final barewords = matches
|
||||
.map((match) {
|
||||
if (match.group(1) != null) {
|
||||
return EnclosedBareword(match.group(1)!);
|
||||
} else if (_barewordPattern.hasMatch(match.group(2)!)) {
|
||||
return SimpleBareword(match.group(2)!);
|
||||
} else {
|
||||
return EnclosedBareword(match.group(2)!);
|
||||
}
|
||||
})
|
||||
.where((token) => token.word.isNotEmpty)
|
||||
.whereNot(_isReservedBareword)
|
||||
.toList();
|
||||
|
||||
//Merge short tokens
|
||||
_mergeShortBarewords(barewords, minTokenLength);
|
||||
|
||||
_tokens =
|
||||
barewords
|
||||
.where((bareword) => bareword.word.length >= minTokenLength)
|
||||
.take(tokenLimit)
|
||||
.toList();
|
||||
_tokens = barewords
|
||||
.where((bareword) => bareword.word.length >= minTokenLength)
|
||||
.take(tokenLimit)
|
||||
.toList();
|
||||
}
|
||||
|
||||
static void _mergeShortBarewords(
|
||||
|
||||
@@ -33,17 +33,16 @@ sealed class UnixTokenizer {
|
||||
}) {
|
||||
final matches = _tokenizePattern.allMatches(input);
|
||||
|
||||
final barewords =
|
||||
matches
|
||||
.map((match) {
|
||||
if (match.group(1) != null) {
|
||||
return EnclosedBareword(match.group(1)!);
|
||||
} else {
|
||||
return SimpleBareword(match.group(2)!);
|
||||
}
|
||||
})
|
||||
.where((token) => token.word.isNotEmpty)
|
||||
.toList();
|
||||
final barewords = matches
|
||||
.map((match) {
|
||||
if (match.group(1) != null) {
|
||||
return EnclosedBareword(match.group(1)!);
|
||||
} else {
|
||||
return SimpleBareword(match.group(2)!);
|
||||
}
|
||||
})
|
||||
.where((token) => token.word.isNotEmpty)
|
||||
.toList();
|
||||
|
||||
//Merge short tokens
|
||||
_mergeShortBarewords(barewords, minTokenLength);
|
||||
|
||||
@@ -80,17 +80,16 @@ class TokenizedFilter<T> {
|
||||
}) {
|
||||
final queryTokens = _tokenize(query);
|
||||
|
||||
final scoredItems =
|
||||
items.map((item) {
|
||||
final itemString = toString(item);
|
||||
if (itemString == null || itemString.isEmpty) {
|
||||
return (item, 0.0);
|
||||
}
|
||||
final scoredItems = items.map((item) {
|
||||
final itemString = toString(item);
|
||||
if (itemString == null || itemString.isEmpty) {
|
||||
return (item, 0.0);
|
||||
}
|
||||
|
||||
final itemTokens = _tokenize(itemString);
|
||||
final score = _calculateScore(queryTokens, itemTokens);
|
||||
return (item, score);
|
||||
}).toList();
|
||||
final itemTokens = _tokenize(itemString);
|
||||
final score = _calculateScore(queryTokens, itemTokens);
|
||||
return (item, score);
|
||||
}).toList();
|
||||
|
||||
// Sort by score in descending order
|
||||
scoredItems.sort((a, b) => b.$2.compareTo(a.$2));
|
||||
@@ -108,16 +107,15 @@ class TokenizedFilter<T> {
|
||||
}) {
|
||||
final queryTokens = _tokenize(query);
|
||||
|
||||
final filtered =
|
||||
items.where((item) {
|
||||
final itemString = toString(item);
|
||||
if (itemString == null || itemString.isEmpty) {
|
||||
return false;
|
||||
}
|
||||
final filtered = items.where((item) {
|
||||
final itemString = toString(item);
|
||||
if (itemString == null || itemString.isEmpty) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final itemTokens = _tokenize(itemString);
|
||||
return _matchTokens(queryTokens, itemTokens);
|
||||
}).toList();
|
||||
final itemTokens = _tokenize(itemString);
|
||||
return _matchTokens(queryTokens, itemTokens);
|
||||
}).toList();
|
||||
|
||||
return TokenizedFilter._(items, filtered);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user