Skip to content

[go_router_builder] Adds support for required $extra parameter - #3627

Merged
auto-submit[bot] merged 11 commits into
flutter:mainfrom
App-and-Up:feature/required-extra
Apr 11, 2023
Merged

[go_router_builder] Adds support for required $extra parameter#3627
auto-submit[bot] merged 11 commits into
flutter:mainfrom
App-and-Up:feature/required-extra

Conversation

@dancamdev

@dancamdevdancamdev commented Apr 3, 2023

Copy link
Copy Markdown
Contributor

This PR includes support for having type-safe non-nullable $extra parameters when working with TypedGoRoutes. Optional $extra is still supported so this isn't a breaking change.

@TypedGoRoute<RequiredExtraRoute>(path:'/requiredExtra')
classRequiredExtraRouteextendsGoRouteData {
constRequiredExtraRoute({requiredthis.$extra});
finalExtra $extra;
@overrideWidgetbuild(BuildContext context, GoRouterState state) =>RequiredExtraScreen(extra: $extra);
}

List which issues are fixed by this PR. You must list at least one issue.
#117261

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

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

@chunhtai
chunhtai requested a review from hannah-hyjApril 3, 2023 16:52
@chunhtai

Copy link
Copy Markdown
Contributor

Hi @Hangyujin Can you take a look at this PR?

@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

@dancamdev

Copy link
Copy Markdown
ContributorAuthor

Fixed the merge conflicts with 1.2.0

Comment threadpackages/go_router_builder/CHANGELOG.md Outdated
Comment threadpackages/go_router_builder/example/lib/extra_example.dart Outdated
@dancamdev

Copy link
Copy Markdown
ContributorAuthor

Thanks @Michele-x98 for the fix!

@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, once the ci failure are fixed

@dancamdev

Copy link
Copy Markdown
ContributorAuthor

@chunhtai should be good to go

@dancamdev
dancamdev requested a review from chunhtaiApril 7, 2023 16:13
@chunhtai

Copy link
Copy Markdown
Contributor

It looks like there are still some failures

@dancamdev

dancamdev commented Apr 7, 2023

Copy link
Copy Markdown
ContributorAuthor

It looks like there are still some failures

Due to the following:

info - lib/src/route_config.dart:99:57 - 'element' is deprecated and shouldn't be used. Use element2 instead. Try replacing the use of the deprecated member with the replacement. - deprecated_member_use

But this is a CI issue because element2 is deprecated and element should be used instead - the go_router_builder codebase is using element across the board.

If that's not it, mind pointing me to the issue you're seeing? Thanks

Comment threadpackages/go_router_builder/lib/src/route_config.dart
Comment threadpackages/go_router_builder/lib/src/route_config.dart
Comment threadpackages/go_router_builder/lib/src/type_helpers.dart
@dancamdev

Copy link
Copy Markdown
ContributorAuthor

@chunhtai Got it working!

@hannah-hyjhannah-hyj added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 11, 2023
@auto-submit
auto-submitBot merged commit 1ddd2d9 into flutter:mainApr 11, 2023
@dancamdev
dancamdev deleted the feature/required-extra branch April 13, 2023 15:01
nploi pushed a commit to nploi/packages that referenced this pull request Jul 16, 2023
…er#3627)
[go_router_builder] Adds support for required $extra parameter
@dancamdevdancamdev mentioned this pull request Jul 20, 2023
11 tasks
auto-submitBot pushed a commit that referenced this pull request Jul 21, 2023
As per title, because of contributing to the following PRs:
[#3702](#3702)
[#3665](#3665)
[#3627](#3627)
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
…er#3627)
[go_router_builder] Adds support for required $extra parameter
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
bisor0627 pushed a commit to bisor0627/packages that referenced this pull request Jun 19, 2026
…er#3627)
[go_router_builder] Adds support for required $extra parameter
bisor0627 pushed a commit to bisor0627/packages that referenced this pull request Jun 19, 2026
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.

4 participants

@dancamdev@chunhtai@hannah-hyj@Michele-x98