Skip to content

[go_router_builder]: Fix The argument type 'String?' can't be assigned to the parameter type 'String' because 'String?' on path and query params - #8737

Merged
auto-submit[bot] merged 15 commits into
flutter:mainfrom
CaoGiaHieu-dev:main
Mar 4, 2025

Conversation

@CaoGiaHieu-dev

@CaoGiaHieu-devCaoGiaHieu-dev commented Feb 28, 2025

Copy link
Copy Markdown
Contributor

Impact of this pr #8405 , params with required enum cannot parse

Fixed : flutter/flutter#164354

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@CaoGiaHieu-devCaoGiaHieu-dev changed the title [go_router_builder]: allow nullable String where try parse to enum[go_router_builder]: allow nullable String when try parse to enumFeb 28, 2025
@CaoGiaHieu-devCaoGiaHieu-dev changed the title [go_router_builder]: allow nullable String when try parse to enum[go_router_builder]: Fix The argument type 'String?' can't be assigned to the parameter type 'String' because 'String?' on path and query paramsFeb 28, 2025
HotdogRouteWithEverything(
_$boolConverter(state.pathParameters['ketchup']!)!,
state.uri.queryParameters['mustard'],
state.uri.queryParameters['mustard']!,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since mustard is optional, I believe it should not be asserted as non-null.
This issue is caused by the fact that the _stateValueAccess function uses element.isRequired as the condition for non-null assertion.
As in the PR I submitted, the condition should be !element.type.isNullableType && !element.hasDefaultValue.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Karibash you right . im gonna update this . thanks for your comment

@chunhtaichunhtai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just one minor comment

Comment threadpackages/go_router_builder/CHANGELOG.md Outdated
@chunhtai
chunhtai requested review from hannah-hyj and removed request for KaribashMarch 3, 2025 19:33
CaoGiaHieu-devand others added 3 commits March 4, 2025 07:11
Co-authored-by: chunhtai <47866232+chunhtai@users.noreply.github.com>

@hannah-hyjhannah-hyj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hannah-hyjhannah-hyj added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 4, 2025
@auto-submit
auto-submitBot merged commit f246137 into flutter:mainMar 4, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 5, 2025
…e assigned to the parameter type 'String' because 'String?' ` on path and query params (flutter/packages#8737)
github-merge-queueBot pushed a commit to flutter/flutter that referenced this pull request Mar 5, 2025
flutter/packages@9e4684e...abba683
2025-03-05 robert.odrowaz@leancode.pl [camera_avfoundation] Tests
backfilling - part 1 (flutter/packages#8698)
2025-03-04 57854043+CaoGiaHieu-dev@users.noreply.github.com
[go_router_builder]: Fix `The argument type 'String?' can't be assigned
to the parameter type 'String' because 'String?' ` on path and query
params (flutter/packages#8737)
2025-03-04 pawel.jakubowski@leancode.pl [video_player_android] Platform
view support (flutter/packages#8466)
2025-03-04 10687576+bparrishMines@users.noreply.github.com
[webview_flutter_wkwebview] Fixes crash with nil `WKFrameInfo.request`
(flutter/packages#8766)
2025-03-03 engine-flutter-autoroll@skia.org Manual roll Flutter from
842db35 to 04d3934 (4 revisions) (flutter/packages#8775)
2025-03-03 engine-flutter-autoroll@skia.org Roll Flutter from
842db35 to 04d3934 (4 revisions) (flutter/packages#8774)
2025-03-03 reidbaker@google.com [flutter_plugin_android_lifecycle] Uses
flutter.compileSdkVersion, bumps minimum flutter version to 3.27
(flutter/packages#8760)
2025-03-03 neilself@gmail.com [google_sign_in] Add Android account name
field as optional (platform interface changes) (flutter/packages#8735)
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.
To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose
To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
androidseb pushed a commit to androidseb/packages that referenced this pull request Jun 8, 2025
…ed to the parameter type 'String' because 'String?' ` on path and query params (flutter#8737)
Impact of this pr flutter#8405 , params with required enum cannot parse
Fixed : flutter/flutter#164354
FMorschel pushed a commit to FMorschel/packages that referenced this pull request Jun 9, 2025
…ed to the parameter type 'String' because 'String?' ` on path and query params (flutter#8737)
Impact of this pr flutter#8405 , params with required enum cannot parse
Fixed : flutter/flutter#164354
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
…ed to the parameter type 'String' because 'String?' ` on path and query params (flutter#8737)
Impact of this pr flutter#8405 , params with required enum cannot parse
Fixed : flutter/flutter#164354
bisor0627 pushed a commit to bisor0627/packages that referenced this pull request Jun 19, 2026
…ed to the parameter type 'String' because 'String?' ` on path and query params (flutter#8737)
Impact of this pr flutter#8405 , params with required enum cannot parse
Fixed : flutter/flutter#164354
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmitMerge PR when tree becomes green via auto submit Appp: go_router_builder

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[go_router_builder]: After mirgate to version 2.8.1 , the queryParams with required enum cause error

4 participants

@CaoGiaHieu-dev@Karibash@chunhtai@hannah-hyj