Skip to content

Commit

Permalink
fix open from link
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlipa91 committed Jan 22, 2024
1 parent 9315c66 commit 926007c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/screens/Launch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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: '/',
Expand Down Expand Up @@ -112,6 +113,8 @@ final appRouter = GoRouter(
redirectUrl = "/";
}

print("redirecting from ${state.matchedLocation} to $redirectUrl");

return redirectUrl;
},
);
Expand Down Expand Up @@ -139,6 +142,7 @@ void main() async {

ErrorWidget.builder = (errorDetails) => Container();

usePathUrlStrategy();
runApp(MultiProvider(
providers: [
ChangeNotifierProvider(create: (context) => UserState()),
Expand Down

0 comments on commit 926007c

Please sign in to comment.