From 926007c0b519dd41b1bc2eedc77df8139efd2fe5 Mon Sep 17 00:00:00 2001 From: Alessandro Liparoti Date: Mon, 22 Jan 2024 15:51:44 -0600 Subject: [PATCH] fix open from link --- lib/screens/Launch.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/screens/Launch.dart b/lib/screens/Launch.dart index ca38418..250dd1a 100644 --- a/lib/screens/Launch.dart +++ b/lib/screens/Launch.dart @@ -19,6 +19,7 @@ import 'package:nutmeg/screens/admin/AvailableMatchesAdmin.dart'; import 'package:nutmeg/utils/UiUtils.dart'; import 'package:provider/provider.dart'; import 'package:skeletons/skeletons.dart'; +import 'package:flutter_web_plugins/url_strategy.dart'; import '../Exceptions.dart'; import '../firebase_options.dart'; @@ -40,7 +41,7 @@ final appRouter = GoRouter( GoRoute( path: '/launch', builder: (context, state) => - LaunchWidget(from: state.pathParameters["from"]), + LaunchWidget(from: state.uri.queryParameters["from"]), ), GoRoute( path: '/', @@ -112,6 +113,8 @@ final appRouter = GoRouter( redirectUrl = "/"; } + print("redirecting from ${state.matchedLocation} to $redirectUrl"); + return redirectUrl; }, ); @@ -139,6 +142,7 @@ void main() async { ErrorWidget.builder = (errorDetails) => Container(); + usePathUrlStrategy(); runApp(MultiProvider( providers: [ ChangeNotifierProvider(create: (context) => UserState()),