assign container via menu

This commit is contained in:
Fabian Freund
2025-07-07 22:56:07 +02:00
parent 90681fe2e9
commit 905c7dbc68
5 changed files with 156 additions and 1 deletions
+12
View File
@@ -28,6 +28,10 @@ part of 'routes.dart';
),
],
),
TypedGoRoute<ContainerSelectionRoute>(
name: 'ContainerSelectionRoute',
path: 'select_container',
),
TypedGoRoute<TabTreeRoute>(
name: 'TabTreeRoute',
path: 'tab_tree/:rootTabId',
@@ -97,6 +101,14 @@ class ContainerListRoute extends GoRouteData with _$ContainerListRoute {
}
}
class ContainerSelectionRoute extends GoRouteData
with _$ContainerSelectionRoute {
@override
Widget build(BuildContext context, GoRouterState state) {
return const ContainerSelectionScreen();
}
}
class ContainerEditRoute extends GoRouteData with _$ContainerEditRoute {
final ContainerData $extra;
+1
View File
@@ -17,6 +17,7 @@ import 'package:weblibre/features/geckoview/features/search/presentation/screens
import 'package:weblibre/features/geckoview/features/tabs/data/models/container_data.dart';
import 'package:weblibre/features/geckoview/features/tabs/presentation/screens/container_edit.dart';
import 'package:weblibre/features/geckoview/features/tabs/presentation/screens/container_list.dart';
import 'package:weblibre/features/geckoview/features/tabs/presentation/screens/container_selection.dart';
import 'package:weblibre/features/onboarding/presentation/onboarding.dart';
import 'package:weblibre/features/settings/presentation/screens/bang_settings.dart';
import 'package:weblibre/features/settings/presentation/screens/developer_settings.dart';
+27
View File
@@ -327,6 +327,12 @@ RouteBase get $browserRoute => GoRouteData.$route(
),
],
),
GoRouteData.$route(
path: 'select_container',
name: 'ContainerSelectionRoute',
factory: _$ContainerSelectionRoute._fromState,
),
GoRouteData.$route(
path: 'tab_tree/:rootTabId',
name: 'TabTreeRoute',
@@ -534,6 +540,27 @@ mixin _$ContainerEditRoute on GoRouteData {
context.replace(location, extra: _self.$extra);
}
mixin _$ContainerSelectionRoute on GoRouteData {
static ContainerSelectionRoute _fromState(GoRouterState state) =>
ContainerSelectionRoute();
@override
String get location => GoRouteData.$location('/select_container');
@override
void go(BuildContext context) => context.go(location);
@override
Future<T?> push<T>(BuildContext context) => context.push<T>(location);
@override
void pushReplacement(BuildContext context) =>
context.pushReplacement(location);
@override
void replace(BuildContext context) => context.replace(location);
}
mixin _$TabTreeRoute on GoRouteData {
static TabTreeRoute _fromState(GoRouterState state) =>
TabTreeRoute(state.pathParameters['rootTabId']!);