Skip to content

Commit

Permalink
Merge branch 'main' into misc/move-flutter-new-to-firebase-redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
parlough committed Nov 19, 2024
2 parents 999ae83 + 2ce90bf commit 8cd48dc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkgs/dartpad_ui/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ class _DartPadAppState extends State<DartPadApp> {
path: '/',
builder: _homePageBuilder,
),
GoRoute(
path: '/:gistId',
builder: (context, state) => _homePageBuilder(context, state,
gist: state.pathParameters['gistId']),
),
],
);

Expand Down Expand Up @@ -112,8 +117,9 @@ class _DartPadAppState extends State<DartPadApp> {
});
}

Widget _homePageBuilder(BuildContext context, GoRouterState state) {
final gistId = state.uri.queryParameters['id'];
Widget _homePageBuilder(BuildContext context, GoRouterState state,
{String? gist}) {
final gistId = gist ?? state.uri.queryParameters['id'];
final builtinSampleId = state.uri.queryParameters['sample'];
final flutterSampleId = state.uri.queryParameters['sample_id'];
final channelParam = state.uri.queryParameters['channel'];
Expand Down

0 comments on commit 8cd48dc

Please sign in to comment.