-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[go_router_builder] Support extension types #9458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
return '$stateValue as $castType'; | ||
} | ||
|
||
final String parseTypeName = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we guard against no primitive type? since this is following by a hardcode tryParse, may as well only allow certain numeric types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you are right in pointing this out. I restricted the type and handled it correctly. 61901a3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code lgtm, just need an example
## Type conversions | ||
|
||
The code generator can convert simple types like `int` and `enum` to/from the | ||
The code generator can convert simple types like `int`, `enum`, and `extension type` to/from the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add a new example in example/
folder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you for writing the examples!
@@ -0,0 +1,408 @@ | |||
// Copyright 2013 The Flutter Authors. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo in the file name: typs-> types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry! I fixed. c57f3d0
} | ||
|
||
/// A type helper for extension types. | ||
/// Suppoted extension types are: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Suppoted-> Supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I fixed! c57f3d0
@koji-1009 You had a failure that I just reran. If it still fails, can you take a look? Maybe you just need to push a merge commit / rebase. |
@justinmc
This “NEXT” section was described at #9453. Because of this, go_router_builder is in a difficult situation for minor version upgrades until the I believe that the problem of |
Added examples file. Merged the main branch, and all tests passed 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* main: (56 commits) [go_router_builder] Support extension types (flutter#9458) Roll Flutter from e2a347b14a18 to 34c2a3b158b2 (41 revisions) (flutter#9803) [go_router_builder] Migrate to Element2 API and update dependencies (flutter#9649) [in_app_purchase_storekit] Add support for quantity in consumable product purchases (#171570) (flutter#9698) [pigeon] Improves documentation of `ProxyApi` and moves helper functions to a separate file (flutter#9756) Roll Flutter from 1590543f6794 to e2a347b14a18 (1 revision) (flutter#9784) [camera_avfoundation] Implementation swift migration - part 11 (flutter#9690) [camera_avfoundation] Fix crash when streaming while recording (flutter#9691) Roll Flutter from 38217906e95c to 1590543f6794 (14 revisions) (flutter#9780) Roll Flutter from 92a6bfbfd6ef to 38217906e95c (17 revisions) (flutter#9778) [video_player] Improve KVO handling on iOS (flutter#9718) [dependabot]: Bump the test-dependencies group across 15 directories with 7 updates (flutter#9736) Roll Flutter from 9de63a03428f to 92a6bfbfd6ef (11 revisions) (flutter#9769) [google_maps_flutter_platform_interface] Add Advanced markers support (flutter#9737) [camera_android_camerax] Re-land "Force new Surface for each SurfaceRequest" (flutter#9760) [google_maps_flutter] Add ability to perform Google Maps SDK warmup (flutter#9674) Roll Flutter from 59fc766c6fdf to 9de63a03428f (6 revisions) (flutter#9764) [webview_flutter_wkwebview] Extended Web View API on iOS to add flexibility when working with local HTML content (flutter#8787) [local_auth] Differentiate iOS authentication errors (flutter#9705) manual roll to 59fc766c6fdfd03d0983fc95ce8b76793a300dd5 (flutter#9758) ... # Conflicts: # packages/go_router_builder/lib/src/type_helpers.dart # packages/go_router_builder/pubspec.yaml
flutter/packages@6cb9113...09533b7 2025-08-14 [email protected] Roll Flutter from 34c2a3b to f4334d2 (18 revisions) (flutter/packages#9807) 2025-08-14 [email protected] Add review agent style guidelines to .gemini/styleguide.md (flutter/packages#9805) 2025-08-13 [email protected] [go_router_builder] Support extension types (flutter/packages#9458) 2025-08-13 [email protected] Roll Flutter from e2a347b to 34c2a3b (41 revisions) (flutter/packages#9803) 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 [email protected] 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
…r#173789) flutter/packages@6cb9113...09533b7 2025-08-14 [email protected] Roll Flutter from 34c2a3b to f4334d2 (18 revisions) (flutter/packages#9807) 2025-08-14 [email protected] Add review agent style guidelines to .gemini/styleguide.md (flutter/packages#9805) 2025-08-13 [email protected] [go_router_builder] Support extension types (flutter/packages#9458) 2025-08-13 [email protected] Roll Flutter from e2a347b to 34c2a3b (41 revisions) (flutter/packages#9803) 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 [email protected] 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
…r#173789) flutter/packages@6cb9113...09533b7 2025-08-14 [email protected] Roll Flutter from 34c2a3b to f4334d2 (18 revisions) (flutter/packages#9807) 2025-08-14 [email protected] Add review agent style guidelines to .gemini/styleguide.md (flutter/packages#9805) 2025-08-13 [email protected] [go_router_builder] Support extension types (flutter/packages#9458) 2025-08-13 [email protected] Roll Flutter from e2a347b to 34c2a3b (41 revisions) (flutter/packages#9803) 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 [email protected] 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
…r#173789) flutter/packages@6cb9113...09533b7 2025-08-14 [email protected] Roll Flutter from 34c2a3b to f4334d2 (18 revisions) (flutter/packages#9807) 2025-08-14 [email protected] Add review agent style guidelines to .gemini/styleguide.md (flutter/packages#9805) 2025-08-13 [email protected] [go_router_builder] Support extension types (flutter/packages#9458) 2025-08-13 [email protected] Roll Flutter from e2a347b to 34c2a3b (41 revisions) (flutter/packages#9803) 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 [email protected] 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
…r#173789) flutter/packages@6cb9113...09533b7 2025-08-14 [email protected] Roll Flutter from 34c2a3b to f4334d2 (18 revisions) (flutter/packages#9807) 2025-08-14 [email protected] Add review agent style guidelines to .gemini/styleguide.md (flutter/packages#9805) 2025-08-13 [email protected] [go_router_builder] Support extension types (flutter/packages#9458) 2025-08-13 [email protected] Roll Flutter from e2a347b to 34c2a3b (41 revisions) (flutter/packages#9803) 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 [email protected] 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
fix flutter/flutter#170870
Extended
type_helpers.dart
to support Dart extension types.Pre-Review Checklist
[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2 ↩3