-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[various] Migrate example Radio groups to new RadioGroup API #10155
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
[various] Migrate example Radio groups to new RadioGroup API #10155
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Refactors the `shared_axis_transition.dart` example to use a new `RadioGroup` widget. This removes the deprecated `groupValue` and `onChanged` properties from each individual `Radio` button
Refactors the camera example to use a new `RadioGroup` widget. This removes deprecated `groupValue` and `onChanged` properties from each individual `RadioListTile` and moves them to the parent `RadioGroup`.
Refactors the camera example to use a new `RadioGroup` widget. This removes deprecated `groupValue` and `onChanged` properties from each individual `RadioListTile` and moves them to the parent `RadioGroup`.
Refactors the `camera_android_camerax` example to use a new `RadioGroup` widget. This removes the deprecated `groupValue` and `onChanged` properties from each individual `RadioListTile` and moves them to the parent `RadioGroup`.
Refactors the `camera_avfoundation` example to use a new `RadioGroup` widget. This removes deprecated `onChanged` logic from each `RadioListTile` and moves it to the parent `RadioGroup`.
Refactors the `google_sign_in_web` example to use a new `RadioGroup` widget. This removes the deprecated `groupValue` and `onChanged` properties from each individual `RadioListTile` and moves them to the parent `RadioGroup`.
Refactors the `two_dimensional_scrollables` example to use a new `RadioGroup` widget. This removes the deprecated `groupValue` and `onChanged` properties from each individual `Radio` button and moves them to the parent `RadioGroup`.
4053511 to
57f7be9
Compare
Removes `const` from `Text` widgets inside a `Row` that was not itself `const`, and adds `const` to the `Row` itself.
Adds `const` to constructors and curly braces to control flow statements to fix new lint warnings in the `table_explorer.dart` and `tree_explorer.dart` examples.
Formats the `main.dart` file in the example application to align with current project standards. This change primarily involves code formatting and does not alter any functionality.
… is if non null instead of lambda
…' into handle_deprecated_radio_examples
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
(There's a version mismatch from the last merge, but this will still need a second review, so feel free to wait to resolve that until it has the second approval.)
# Conflicts: # packages/camera/camera_android/CHANGELOG.md # packages/camera/camera_android_camerax/CHANGELOG.md
# Conflicts: # packages/camera/camera_android/CHANGELOG.md # packages/camera/camera_android_camerax/CHANGELOG.md
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, feel free to update the changelog/version conflicts and we can get this landed.
|
@alexskobozev Sorry, this has gotten a merge conflict due to another PR landing, could you update it? |
updated! |
flutter/packages@d113bbc...9ec29b6 2025-10-22 [email protected] [go_router] Support for top level `onEnter` callback. (flutter/packages#8339) 2025-10-22 [email protected] [go_router_builder] Ignore experimental features (flutter/packages#10275) 2025-10-22 [email protected] Roll Flutter from 2d34167 to 75004a6 (39 revisions) (flutter/packages#10279) 2025-10-22 [email protected] [ci]Adds mechanism for packages to opt in to batched release (flutter/packages#10237) 2025-10-22 [email protected] [tool] Change gradle-check logic to enforce alignment of java versions and a minimum (17) (flutter/packages#10206) 2025-10-22 [email protected] [various] Migrate example Radio groups to new RadioGroup API (flutter/packages#10155) 2025-10-22 [email protected] [mustache_template] Emoji support (flutter/packages#10110) 2025-10-22 [email protected] [image_picker] Fix typos in error messages for android (flutter/packages#10188) 2025-10-22 [email protected] [image_picker] Fix typos in error messages for platform interface (flutter/packages#10211) 2025-10-21 [email protected] [camera_avfoundation] Wrappers swift migration - part 1 (flutter/packages#10119) 2025-10-21 [email protected] [go_router_builder] expand supported versions of analyzer, build and source_gen (flutter/packages#10078) 2025-10-20 [email protected] Roll Flutter from 891d7d5 to 2d34167 (18 revisions) (flutter/packages#10268) 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
flutter/packages@d113bbc...9ec29b6 2025-10-22 [email protected] [go_router] Support for top level `onEnter` callback. (flutter/packages#8339) 2025-10-22 [email protected] [go_router_builder] Ignore experimental features (flutter/packages#10275) 2025-10-22 [email protected] Roll Flutter from 2d34167 to 75004a6 (39 revisions) (flutter/packages#10279) 2025-10-22 [email protected] [ci]Adds mechanism for packages to opt in to batched release (flutter/packages#10237) 2025-10-22 [email protected] [tool] Change gradle-check logic to enforce alignment of java versions and a minimum (17) (flutter/packages#10206) 2025-10-22 [email protected] [various] Migrate example Radio groups to new RadioGroup API (flutter/packages#10155) 2025-10-22 [email protected] [mustache_template] Emoji support (flutter/packages#10110) 2025-10-22 [email protected] [image_picker] Fix typos in error messages for android (flutter/packages#10188) 2025-10-22 [email protected] [image_picker] Fix typos in error messages for platform interface (flutter/packages#10211) 2025-10-21 [email protected] [camera_avfoundation] Wrappers swift migration - part 1 (flutter/packages#10119) 2025-10-21 [email protected] [go_router_builder] expand supported versions of analyzer, build and source_gen (flutter/packages#10078) 2025-10-20 [email protected] Roll Flutter from 891d7d5 to 2d34167 (18 revisions) (flutter/packages#10268) 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
|
|
||
| * Updates examples to use the new RadioGroup API instead of deprecated Radio parameters. | ||
| * Updates minimum supported SDK version to Flutter 3.29/Dart 3.7. | ||
| * Updates README to reflect that only Android API 24+ is 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.
@alexskobozev @stuartmorgan-g this note in the changelog and updated readme seems to be out of sync with the sdk: ^3.7.0 constraint in the camera/pubspec.yaml.
This camera 0.11.2+1 plugin release shows up as Upgradable in a Flutter project that has sdk: 3.8.1 constraint (i.e. requires to support Android 21).
If the camera plugin dropped support for Android 21 - it should not be upgradable and maybe plugin's sdk constraint need to be bumped to Dart 3.9?
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.
If you are going to comment on PRs instead of filing issues when you believe there's an issue, please use the relevant PR (which is #9851 here, not this one).
Your concern is addressed in the description of that PR:
people on older versions of Flutter, and supporting older versions of Android in their apps, will still get compatible versions, they just aren't the versions we are supporting now
This camera
0.11.2+1plugin release shows up asUpgradablein a Flutter project that hassdk: 3.8.1constraint (i.e. requires to support Android 21).
Yes, that is correct. 0.11.2+1 will work correctly in a project that supports Android 21.
If the
cameraplugin dropped support for Android 21 - it should not be upgradable
"Support" here refers to the camera plugin holistically, not the camera package specifically, and is not the same thing as "runs on". If someone files an issue today about an issue that happens when using camera* only on Android 21-23, we would close that issue saying that we no longer support Android <24, and thus, Android <24 is not supported.
We deliberately do not go into a lot of details about the specific runtime support matrix of each sub-package, because that's way to much information for the README, and the resolver will ensure that the right thing happens regardless. If someone really wants that level of detail, they can read the individual pubspecs.
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.
@stuartmorgan-g I commented on this PR because it triggered the plugin release.
I realize that older platform plugins are pulled instead. Though for consistency with federated platform plugins the camera plugin might be better use the same sdk constraint because this note in the changelog is misleading about Android 21 support. The camera example project also has sdk 3.9 constraint.
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.
@stuartmorgan-g I commented on this PR because it triggered the plugin release.
And I'm asking you to please not do that. The only reason I—the person who this comment was relevant to—saw this question is because I happened to have reviewed this PR. Meanwhile it's spamming a random contributor who has nothing to do with the thing you are asking about.
In general, it is a much better idea to report issues or potential issues via the issue tracker. There is a system for routing them to the right people, instead of just hoping that the right person sees the comment.
Though for consistency with federated platform plugins the
cameraplugin might be better use the same sdk constraint
Anyone maintaining a federated plugin is welcome to manage their constraints however they choose to. For our plugins, we follow our documented policy of not adding artificial restrictions.
This PR updates multiple package example apps to stop using deprecated
groupValueandonChangedon individualRadiowidgets and instead use the newRadioGroup<T>ancestor to manage the selected value and change handling.Why
Flutter deprecated
Radio.groupValueandRadio.onChangedin favor ofRadioGroup, which centralizes selection state for related radios. The deprecation is currently reported across several examples in this repo (see linked issue for examples and affected packages). This PR resolves those warnings.What changed (pattern applied across examples)
Radio<T>widgets in aRadioGroup<T>(groupValue: ..., onChanged: ...).groupValue/onChangedfrom eachRadio, leaving onlyvalue(+ its label UI).animationsdemo): old threeRadiowidgets each hadgroupValue/onChanged; now they are enclosed in a singleRadioGroup<SharedAxisTransitionType>and theRadiochildren keep just theirvalue.Packages (examples) updated
animationscameracamera_androidcamera_android_cameraxcamera_avfoundationgoogle_sign_in_webtwo_dimensional_scrollables(bothtable_viewandtree_view)Screenshots
N/A (UI unchanged; only wiring of radios changed).
Links
Fixes: flutter/flutter#170915
Pre-Review Checklist