option to unassign container
This commit is contained in:
@@ -17,6 +17,7 @@ import 'package:weblibre/features/geckoview/domain/repositories/tab.dart';
|
|||||||
import 'package:weblibre/features/geckoview/features/browser/presentation/dialogs/qr_code.dart';
|
import 'package:weblibre/features/geckoview/features/browser/presentation/dialogs/qr_code.dart';
|
||||||
import 'package:weblibre/features/geckoview/features/browser/presentation/widgets/browser_modules/address_with_suggestions_field.dart';
|
import 'package:weblibre/features/geckoview/features/browser/presentation/widgets/browser_modules/address_with_suggestions_field.dart';
|
||||||
import 'package:weblibre/features/geckoview/features/browser/presentation/widgets/certificate_tile.dart';
|
import 'package:weblibre/features/geckoview/features/browser/presentation/widgets/certificate_tile.dart';
|
||||||
|
import 'package:weblibre/features/geckoview/features/tabs/domain/providers/selected_container.dart';
|
||||||
import 'package:weblibre/features/geckoview/features/tabs/domain/repositories/container.dart';
|
import 'package:weblibre/features/geckoview/features/tabs/domain/repositories/container.dart';
|
||||||
import 'package:weblibre/features/geckoview/features/tabs/domain/repositories/tab.dart';
|
import 'package:weblibre/features/geckoview/features/tabs/domain/repositories/tab.dart';
|
||||||
import 'package:weblibre/features/user/domain/providers.dart';
|
import 'package:weblibre/features/user/domain/providers.dart';
|
||||||
@@ -213,6 +214,32 @@ class WebPageDialog extends HookConsumerWidget {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
Consumer(
|
||||||
|
child: ListTile(
|
||||||
|
leading: const Icon(MdiIcons.folderCancel),
|
||||||
|
title: const Text('Unassign container'),
|
||||||
|
onTap: () async {
|
||||||
|
final selectedTabId = ref.read(
|
||||||
|
selectedTabProvider,
|
||||||
|
);
|
||||||
|
if (selectedTabId != null) {
|
||||||
|
await ref
|
||||||
|
.read(tabDataRepositoryProvider.notifier)
|
||||||
|
.unassignContainer(selectedTabId);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
builder: (context, ref, child) {
|
||||||
|
final containerId = ref.watch(
|
||||||
|
selectedContainerProvider,
|
||||||
|
);
|
||||||
|
|
||||||
|
return Visibility(
|
||||||
|
visible: containerId != null,
|
||||||
|
child: child!,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
ShareTile(
|
ShareTile(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
await SharePlus.instance.share(
|
await SharePlus.instance.share(
|
||||||
|
|||||||
@@ -38,6 +38,13 @@ class TabDataRepository extends _$TabDataRepository {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> unassignContainer(String tabId) {
|
||||||
|
return ref
|
||||||
|
.read(tabDatabaseProvider)
|
||||||
|
.tabDao
|
||||||
|
.assignContainer(tabId, containerId: null);
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> assignOrderKey(String tabId, String orderKey) {
|
Future<void> assignOrderKey(String tabId, String orderKey) {
|
||||||
return ref
|
return ref
|
||||||
.read(tabDatabaseProvider)
|
.read(tabDatabaseProvider)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ part of 'tab.dart';
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
String _$tabDataRepositoryHash() => r'15be3ca749b329c293e8e18c61d6ed92e4979072';
|
String _$tabDataRepositoryHash() => r'c9a551adc4eff3b6680fee90be141e10a161db81';
|
||||||
|
|
||||||
/// See also [TabDataRepository].
|
/// See also [TabDataRepository].
|
||||||
@ProviderFor(TabDataRepository)
|
@ProviderFor(TabDataRepository)
|
||||||
|
|||||||
Reference in New Issue
Block a user