upgrade flutter

This commit is contained in:
Fabian Freund
2026-05-24 14:59:09 +02:00
parent 46a3b250c2
commit f3d1fb604d
47 changed files with 2882 additions and 4111 deletions
@@ -56,11 +56,7 @@ TabViewReorderResult? buildTabViewReorderResult({
final reordered = visibleItems.toList();
final movingItem = reordered.removeAt(oldIndex);
var insertIndex = newIndex;
if (insertIndex > oldIndex) {
insertIndex -= 1;
}
insertIndex = insertIndex.clamp(0, reordered.length);
final insertIndex = newIndex.clamp(0, reordered.length);
reordered.insert(insertIndex, movingItem);
if (!hierarchical) {
@@ -432,7 +432,7 @@ class _TabListView extends HookConsumerWidget {
onReorderStart: (index) {
ref.read(willAcceptDropProvider.notifier).clear();
},
onReorder: (oldIndex, newIndex) async {
onReorderItem: (oldIndex, newIndex) async {
//Suggestions are at the end and not reorderable, so skip
if (oldIndex >= primaryRows.length) {
return;
@@ -77,8 +77,7 @@ class SearchModuleOrder extends _$SearchModuleOrder {
void reorder(int oldIndex, int newIndex) {
final list = [...state];
final item = list.removeAt(oldIndex);
final insertIndex = newIndex > oldIndex ? newIndex - 1 : newIndex;
list.insert(insertIndex, item);
list.insert(newIndex, item);
state = list;
}
@@ -93,7 +93,7 @@ final class SearchModuleOrderProvider
}
}
String _$searchModuleOrderHash() => r'245c933174b1808b2cb27c4c375fac4edd12d727';
String _$searchModuleOrderHash() => r'fde46e0a0998152340801cb323335a2f4a0f3557';
final class SearchModuleOrderFamily extends $Family
with
@@ -56,7 +56,7 @@ class SearchModuleReorderView extends ConsumerWidget {
),
SliverReorderableList(
itemCount: entries.length,
onReorder: (oldIndex, newIndex) {
onReorderItem: (oldIndex, newIndex) {
ref
.read(searchModuleOrderProvider(group).notifier)
.reorder(oldIndex, newIndex);
@@ -23,7 +23,6 @@ import 'package:drift/drift.dart';
import 'package:drift/native.dart';
import 'package:path/path.dart' as p;
import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'package:sqlite3_flutter_libs/sqlite3_flutter_libs.dart';
import 'package:weblibre/core/database_registry.dart';
import 'package:weblibre/core/filesystem.dart';
import 'package:weblibre/data/database/functions/lexo_rank_functions.dart';
@@ -35,14 +34,9 @@ part 'providers.g.dart';
@Riverpod(keepAlive: true)
TabDatabase tabDatabase(Ref ref) {
final db = TabDatabase(
LazyDatabase(() async {
LazyDatabase(() {
final file = File(p.join(filesystem.profileDatabasesDir.path, 'tab.db'));
// Also work around limitations on old Android versions
if (Platform.isAndroid) {
await applyWorkaroundToOpenSqlite3OnOldAndroidVersions();
}
return NativeDatabase.createInBackground(
file,
setup: (database) {
@@ -48,4 +48,4 @@ final class TabDatabaseProvider
}
}
String _$tabDatabaseHash() => r'983f15b87d8d8bdd52b45d79fe78a1cb4b241f6e';
String _$tabDatabaseHash() => r'f850fbe52b2c68c801040c89cf48cadc04a9a6cc';
@@ -216,11 +216,7 @@ class ContainerRepository extends _$ContainerRepository {
) async {
if (containers.isEmpty || oldIndex == newIndex) return;
var targetIndex = newIndex;
if (targetIndex > oldIndex) {
targetIndex -= 1;
}
targetIndex = targetIndex.clamp(0, containers.length - 1);
final targetIndex = newIndex.clamp(0, containers.length - 1);
if (targetIndex == oldIndex) return;
final movingContainer = containers[oldIndex];
@@ -42,7 +42,7 @@ final class ContainerRepositoryProvider
}
String _$containerRepositoryHash() =>
r'8db0f2a08ee5a67123f9c110ef7edf4c574992c4';
r'14c77b4f3ed21d9511d5bf507db013b02a122595';
abstract class _$ContainerRepository extends $Notifier<void> {
void build();
@@ -85,7 +85,7 @@ class ContainerListScreen extends HookConsumerWidget {
padding: const EdgeInsets.fromLTRB(16, 8, 16, 96),
sliver: SliverReorderableList(
itemCount: containers.length,
onReorder: (oldIndex, newIndex) {
onReorderItem: (oldIndex, newIndex) {
unawaited(
repository.reorderContainer(containers, oldIndex, newIndex),
);
@@ -23,7 +23,6 @@ import 'package:drift/drift.dart';
import 'package:drift/native.dart';
import 'package:path/path.dart' as p;
import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'package:sqlite3_flutter_libs/sqlite3_flutter_libs.dart';
import 'package:weblibre/core/database_registry.dart';
import 'package:weblibre/core/filesystem.dart';
import 'package:weblibre/data/database/functions/lexo_rank_functions.dart';
@@ -34,15 +33,11 @@ part 'providers.g.dart';
@Riverpod(keepAlive: true)
TopSiteDatabase topSiteDatabase(Ref ref) {
final db = TopSiteDatabase(
LazyDatabase(() async {
LazyDatabase(() {
final file = File(
p.join(filesystem.profileDatabasesDir.path, 'top_site.db'),
);
if (Platform.isAndroid) {
await applyWorkaroundToOpenSqlite3OnOldAndroidVersions();
}
return NativeDatabase.createInBackground(
file,
setup: (database) {
@@ -49,4 +49,4 @@ final class TopSiteDatabaseProvider
}
}
String _$topSiteDatabaseHash() => r'a5afe9a807174ae3382931612b25f959efccdded';
String _$topSiteDatabaseHash() => r'1bba4ea77ccd1e5f32717ac9875796216db77706';