Steps to reproduce
Define a route with required values as follows.
import'package:go_router/go_router.dart';
@TypedGoRoute<NonNullableRequiredParamNotInPath>(path:'bob')
classNonNullableRequiredParamNotInPathextendsGoRouteData {
NonNullableRequiredParamNotInPath({requiredthis.id});
finalint id;
}Expected results
The build should be able to execute normally.
Actual results
A nullable error occurs when building.
Code sample
Code sample
import'package:flutter/material.dart';
import'package:go_router/go_router.dart';
part'app.g.dart';
voidmain() =>runApp(App());
classAppextendsStatelessWidget {
App({super.key});
@overrideWidgetbuild(BuildContext context) =>MaterialApp.router(
routerConfig: _router,
title:'GoRouter Example',
);
finalGoRouter _router =GoRouter(routes: $appRoutes);
}
@TypedGoRoute<HomeRoute>(path:'/')
classHomeRouteextendsGoRouteData {
HomeRoute({requiredthis.id});
finalint id;
@overrideWidgetbuild(BuildContext context, GoRouterState state) {
returnHomeScreen(id: id);
}
}
classHomeScreenextendsStatelessWidget {
constHomeScreen({super.key, requiredthis.id});
finalint id;
@overrideWidgetbuild(BuildContext context) =>Scaffold(
appBar:AppBar(title:constText('GoRouter Example')),
body:Text(id.toString()),
);
}Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
Error: The argument type 'String?' can't be assigned to the parameter type 'String' because 'String?' is nullable and 'String' isn't.
Flutter Doctor output
Doctor output
Doctor summary (to see all details, run flutter doctor -v):[✓] Flutter (Channel stable, 3.29.0, on macOS 15.3 24D60 darwin-arm64, locale ja-JP)[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.1)[✓] Xcode - develop for iOS and macOS (Xcode 15.4)[✓] Chrome - develop for the web[✓] Android Studio (version 2024.2)[✓] IntelliJ IDEA Ultimate Edition (version 2024.3.2.2)[✓] VS Code (version 1.96.4)[✓] Connected device (5 available)[✓] Network resources• No issues found!
Steps to reproduce
Define a route with required values as follows.
Expected results
The build should be able to execute normally.
Actual results
A nullable error occurs when building.
Code sample
Code sample
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
Error: The argument type 'String?' can't be assigned to the parameter type 'String' because 'String?' is nullable and 'String' isn't.Flutter Doctor output
Doctor output