basic history working

This commit is contained in:
Fabian Freund
2025-09-18 12:53:03 +02:00
parent 9676ccae3d
commit 2ff97e226c
12 changed files with 454 additions and 190 deletions
+8
View File
@@ -28,6 +28,7 @@ part of 'routes.dart';
path: 'search/:tabType/:searchText',
),
TypedGoRoute<TorProxyRoute>(name: 'TorProxyRoute', path: 'tor_proxy'),
TypedGoRoute<HistoryRoute>(name: 'HistoryRoute', path: 'history'),
TypedGoRoute<ContextMenuRoute>(
name: 'ContextMenuRoute',
path: 'context_menu',
@@ -178,3 +179,10 @@ class OpenSharedContentRoute extends GoRouteData with _$OpenSharedContentRoute {
return DialogPage(builder: (_) => OpenSharedContent(sharedUrl: $extra));
}
}
class HistoryRoute extends GoRouteData with _$HistoryRoute {
@override
Widget build(BuildContext context, GoRouterState state) {
return const HistoryScreen();
}
}
+1
View File
@@ -31,6 +31,7 @@ import 'package:weblibre/features/geckoview/features/browser/presentation/dialog
import 'package:weblibre/features/geckoview/features/browser/presentation/screens/browser.dart';
import 'package:weblibre/features/geckoview/features/contextmenu/extensions/hit_result.dart';
import 'package:weblibre/features/geckoview/features/contextmenu/presentation/context_menu_dialog.dart';
import 'package:weblibre/features/geckoview/features/history/presentation/screens/history.dart';
import 'package:weblibre/features/geckoview/features/search/presentation/screens/search.dart';
import 'package:weblibre/features/geckoview/features/tabs/data/models/container_data.dart';
import 'package:weblibre/features/geckoview/features/tabs/presentation/screens/container_edit.dart';
+26
View File
@@ -295,6 +295,12 @@ RouteBase get $browserRoute => GoRouteData.$route(
factory: _$TorProxyRoute._fromState,
),
GoRouteData.$route(
path: 'history',
name: 'HistoryRoute',
factory: _$HistoryRoute._fromState,
),
GoRouteData.$route(
path: 'context_menu',
name: 'ContextMenuRoute',
@@ -419,6 +425,26 @@ mixin _$TorProxyRoute on GoRouteData {
void replace(BuildContext context) => context.replace(location);
}
mixin _$HistoryRoute on GoRouteData {
static HistoryRoute _fromState(GoRouterState state) => HistoryRoute();
@override
String get location => GoRouteData.$location('/history');
@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 _$ContextMenuRoute on GoRouteData {
static ContextMenuRoute _fromState(GoRouterState state) =>
ContextMenuRoute(state.extra as String);