fix lints
This commit is contained in:
@@ -1033,7 +1033,7 @@ EquatableValue<List<TabListItemEntity>> groupedTabListItems(
|
||||
final unpinned = children
|
||||
.where((c) => !pinnedTabIds.contains(c.row.id))
|
||||
.toList();
|
||||
final cmp = (_GroupedRow a, _GroupedRow b) =>
|
||||
int cmp(_GroupedRow a, _GroupedRow b) =>
|
||||
a.row.orderKey.compareTo(b.row.orderKey);
|
||||
final directionCmp = tabListDirection == TabDirection.newestFirst
|
||||
? (_GroupedRow a, _GroupedRow b) => -cmp(a, b)
|
||||
|
||||
-2
@@ -85,12 +85,10 @@ class TabViewFilterController extends _$TabViewFilterController {
|
||||
}
|
||||
|
||||
void setDateRange(DateTimeRange<DateTime>? range) {
|
||||
// ignore: avoid_redundant_argument_values
|
||||
state = state.copyWith(dateRange: range, quickInterval: null);
|
||||
}
|
||||
|
||||
void setQuickInterval(TabQuickInterval? interval) {
|
||||
// ignore: avoid_redundant_argument_values
|
||||
state = state.copyWith(quickInterval: interval, dateRange: null);
|
||||
}
|
||||
|
||||
|
||||
-2
@@ -1194,13 +1194,11 @@ class _Browser extends HookConsumerWidget {
|
||||
switch (promptOnBackBehavior) {
|
||||
case BackgroundAppTabBackPromptBehavior():
|
||||
await moveToBackground();
|
||||
break;
|
||||
case ReturnToSearchTabBackPromptBehavior(:final tabType):
|
||||
ref
|
||||
.read(searchAutofocusSuppressionProvider.notifier)
|
||||
.suppressNext();
|
||||
await SearchRoute(tabType: tabType).push(context);
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
+1
-1
@@ -219,7 +219,7 @@ List<String> _orderedIdsForStorageAnchors(
|
||||
required String movingPartitionRootId,
|
||||
required bool sortPinnedFirst,
|
||||
}) {
|
||||
var storageOrderedIds = tabListDirection == TabDirection.newestFirst
|
||||
final storageOrderedIds = tabListDirection == TabDirection.newestFirst
|
||||
// Rendering flips root group order for newest-first; convert the
|
||||
// display order back to storage order before choosing anchors.
|
||||
? orderedTabIds.reversed.toList()
|
||||
|
||||
+14
-12
@@ -580,11 +580,13 @@ class QuickTabSwitcher extends HookConsumerWidget {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
final context = activeItemKey.value.currentContext;
|
||||
if (context != null) {
|
||||
Scrollable.ensureVisible(
|
||||
context,
|
||||
alignment: 0.5,
|
||||
duration: const Duration(milliseconds: 200),
|
||||
curve: Curves.easeInOut,
|
||||
unawaited(
|
||||
Scrollable.ensureVisible(
|
||||
context,
|
||||
alignment: 0.5,
|
||||
duration: const Duration(milliseconds: 200),
|
||||
curve: Curves.easeInOut,
|
||||
),
|
||||
);
|
||||
} else if (chipScrollController.hasClients) {
|
||||
final activeIndex = availableItems.indexWhere(
|
||||
@@ -602,11 +604,13 @@ class QuickTabSwitcher extends HookConsumerWidget {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
final retryContext = activeItemKey.value.currentContext;
|
||||
if (retryContext != null) {
|
||||
Scrollable.ensureVisible(
|
||||
retryContext,
|
||||
alignment: 0.5,
|
||||
duration: const Duration(milliseconds: 200),
|
||||
curve: Curves.easeInOut,
|
||||
unawaited(
|
||||
Scrollable.ensureVisible(
|
||||
retryContext,
|
||||
alignment: 0.5,
|
||||
duration: const Duration(milliseconds: 200),
|
||||
curve: Curves.easeInOut,
|
||||
),
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -717,8 +721,6 @@ class QuickTabSwitcherView extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final appColors = AppColors.of(context);
|
||||
final colorScheme = Theme.of(context).colorScheme;
|
||||
|
||||
if (availableItems.isEmpty) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
|
||||
+1
-1
@@ -27,8 +27,8 @@ import 'package:flutter_mozilla_components/flutter_mozilla_components.dart';
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
import 'package:rxdart/rxdart.dart';
|
||||
import 'package:weblibre/core/logger.dart';
|
||||
import 'package:weblibre/features/geckoview/features/preferences/data/repositories/preference_migrations.dart';
|
||||
import 'package:weblibre/features/geckoview/features/preferences/data/models/preference_setting.dart';
|
||||
import 'package:weblibre/features/geckoview/features/preferences/data/repositories/preference_migrations.dart';
|
||||
import 'package:weblibre/features/geckoview/features/tabs/utils/setting_groups_serializer.dart';
|
||||
import 'package:weblibre/features/user/data/providers.dart';
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ Future<bool> installCurrentWebApp(
|
||||
Ref ref, {
|
||||
String? overrideName,
|
||||
String? contextId,
|
||||
}) async {
|
||||
}) {
|
||||
final selectedTabId = ref.read(selectedTabProvider);
|
||||
|
||||
if (selectedTabId == null) {
|
||||
@@ -156,7 +156,7 @@ Future<bool> installBasicShortcut(
|
||||
Ref ref, {
|
||||
String? overrideName,
|
||||
String? contextId,
|
||||
}) async {
|
||||
}) {
|
||||
final selectedTabId = ref.read(selectedTabProvider);
|
||||
|
||||
if (selectedTabId == null) {
|
||||
|
||||
+2
-2
@@ -801,8 +801,8 @@ class _WebSearchOptionsRow extends StatelessWidget {
|
||||
controller: controller,
|
||||
scrollDirection: Axis.horizontal,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
child: Row(
|
||||
children: const [
|
||||
child: const Row(
|
||||
children: [
|
||||
WebSearchStatusChip(),
|
||||
RouteThroughTorToggle(),
|
||||
SizedBox(width: 8),
|
||||
|
||||
-2
@@ -60,9 +60,7 @@ class FeedSearch extends HookConsumerWidget {
|
||||
.read(articleSearchProvider(null).notifier)
|
||||
.search(
|
||||
searchTextNotifier.value.text,
|
||||
// ignore: avoid_redundant_argument_values dont break things
|
||||
matchPrefix: _matchPrefix,
|
||||
// ignore: avoid_redundant_argument_values dont break things
|
||||
matchSuffix: _matchSuffix,
|
||||
);
|
||||
},
|
||||
|
||||
-2
@@ -123,9 +123,7 @@ class TabSearch extends HookConsumerWidget {
|
||||
)
|
||||
.addQuery(
|
||||
searchTextListenable.value.text,
|
||||
// ignore: avoid_redundant_argument_values dont break things
|
||||
matchPrefix: _matchPrefix,
|
||||
// ignore: avoid_redundant_argument_values dont break things
|
||||
matchSuffix: _matchSuffix,
|
||||
);
|
||||
}
|
||||
|
||||
+4
-2
@@ -18,6 +18,8 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
import 'package:flutter_material_design_icons/flutter_material_design_icons.dart';
|
||||
@@ -181,7 +183,7 @@ class ContainerEditScreen extends HookConsumerWidget {
|
||||
title: const Text('Change Color'),
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
openColorPicker();
|
||||
unawaited(openColorPicker());
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
@@ -189,7 +191,7 @@ class ContainerEditScreen extends HookConsumerWidget {
|
||||
title: const Text('Change Icon'),
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
openIconPicker();
|
||||
unawaited(openIconPicker());
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
|
||||
-12
@@ -105,7 +105,6 @@ class ContainerListScreen extends HookConsumerWidget {
|
||||
.read(selectedContainerProvider.notifier)
|
||||
.clearContainer()
|
||||
: () => setSelectedContainer(container),
|
||||
// onDelete: () => repository.deleteContainer(container.id),
|
||||
),
|
||||
);
|
||||
},
|
||||
@@ -168,7 +167,6 @@ class _ContainerCard extends HookConsumerWidget {
|
||||
required this.isSelected,
|
||||
required this.onTap,
|
||||
required this.onSelect,
|
||||
this.onDelete,
|
||||
});
|
||||
|
||||
final ContainerDataWithCount container;
|
||||
@@ -176,7 +174,6 @@ class _ContainerCard extends HookConsumerWidget {
|
||||
final bool isSelected;
|
||||
final VoidCallback onTap;
|
||||
final VoidCallback onSelect;
|
||||
final VoidCallback? onDelete;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
@@ -299,15 +296,6 @@ class _ContainerCard extends HookConsumerWidget {
|
||||
else
|
||||
const SizedBox.shrink(),
|
||||
const Spacer(),
|
||||
if (onDelete != null) ...[
|
||||
IconButton(
|
||||
tooltip: 'Delete',
|
||||
color: colorScheme.error,
|
||||
onPressed: onDelete,
|
||||
icon: const Icon(Icons.delete_outline),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
],
|
||||
FilledButton.tonalIcon(
|
||||
onPressed: onSelect,
|
||||
icon: Icon(isSelected ? Icons.close : Icons.check),
|
||||
|
||||
-2
@@ -20,9 +20,7 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_material_design_icons/flutter_material_design_icons.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:nullability/nullability.dart';
|
||||
import 'package:weblibre/core/routing/routes.dart';
|
||||
import 'package:weblibre/features/geckoview/features/tabs/data/models/container_data.dart';
|
||||
import 'package:weblibre/features/geckoview/features/tabs/domain/entities/container_selection_result.dart';
|
||||
|
||||
+14
-11
@@ -35,7 +35,6 @@ import 'package:weblibre/features/geckoview/features/tabs/data/models/container_
|
||||
import 'package:weblibre/features/geckoview/features/tabs/domain/providers.dart';
|
||||
import 'package:weblibre/features/geckoview/features/tabs/domain/repositories/gecko_inference.dart';
|
||||
import 'package:weblibre/features/geckoview/features/tabs/presentation/widgets/container_chip_content.dart';
|
||||
import 'package:weblibre/features/geckoview/features/tabs/presentation/widgets/container_title.dart';
|
||||
import 'package:weblibre/features/geckoview/features/tabs/presentation/widgets/tab_drag_container_target.dart';
|
||||
import 'package:weblibre/features/geckoview/features/tabs/utils/container_colors.dart';
|
||||
import 'package:weblibre/features/user/domain/repositories/general_settings.dart';
|
||||
@@ -303,11 +302,13 @@ class ContainerChips extends HookConsumerWidget {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
final activeContext = activeItemKey.value.currentContext;
|
||||
if (activeContext != null) {
|
||||
Scrollable.ensureVisible(
|
||||
activeContext,
|
||||
alignment: 0.5,
|
||||
duration: const Duration(milliseconds: 200),
|
||||
curve: Curves.easeInOut,
|
||||
unawaited(
|
||||
Scrollable.ensureVisible(
|
||||
activeContext,
|
||||
alignment: 0.5,
|
||||
duration: const Duration(milliseconds: 200),
|
||||
curve: Curves.easeInOut,
|
||||
),
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -336,11 +337,13 @@ class ContainerChips extends HookConsumerWidget {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
final retryContext = activeItemKey.value.currentContext;
|
||||
if (retryContext != null) {
|
||||
Scrollable.ensureVisible(
|
||||
retryContext,
|
||||
alignment: 0.5,
|
||||
duration: const Duration(milliseconds: 200),
|
||||
curve: Curves.easeInOut,
|
||||
unawaited(
|
||||
Scrollable.ensureVisible(
|
||||
retryContext,
|
||||
alignment: 0.5,
|
||||
duration: const Duration(milliseconds: 200),
|
||||
curve: Curves.easeInOut,
|
||||
),
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user