From 904e909ce1e31af393c3f8616a08a7eb84dd609a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20B=C3=B6sche?= Date: Sun, 25 Jan 2026 18:37:01 +0100 Subject: [PATCH] Set initial location for GoRouter based on web URL hash --- b0esche_cloud/lib/main.dart | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/b0esche_cloud/lib/main.dart b/b0esche_cloud/lib/main.dart index 1dc89ad..4d45645 100644 --- a/b0esche_cloud/lib/main.dart +++ b/b0esche_cloud/lib/main.dart @@ -16,8 +16,15 @@ import 'pages/public_file_viewer.dart'; import 'theme/app_theme.dart'; import 'injection.dart'; +import 'package:flutter/foundation.dart' show kIsWeb; +import 'package:web/web.dart' as web; final GoRouter _router = GoRouter( + initialLocation: kIsWeb + ? (web.window.location.hash.isNotEmpty + ? web.window.location.hash.substring(1) + : '/') + : '/', routes: [ GoRoute(path: '/', builder: (context, state) => const HomePage()), GoRoute(