upgrade min sdk; run formatter
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user