Repository navigation
refactor: move Radio onto the shared control core - #87
Merged
AdamMusa merged 3 commits intoNov 2, 2026
Merged
Conversation
Record the legacy Radio renderers on iOS and Android as JSON snapshots: geometry, semantics, what the radio and its RadioGroup send to Ruby during scripted taps, label taps, keyboard focus and ListTile toggling, and invoke outcomes, for the defaults, unlabeled, maximal, disabled, child-control label, RTL, nested-theme and toggle_inputs tile fixtures. The migration onto the shared control core may change them only as listed in its parity table.
RadioCore now owns everything Ruby sends or receives for a Radio: one parse of every keyword (radioSpec), its RadioGroup lookup, label and toggle_inputs tile selection, focus and the must-be-in-a-RadioGroup rule. The Material and Cupertino skins only map the core's values onto Radio and CupertinoRadio, and AdaptiveRadioControl hosts the core under the legacy key. The group still owns the value and the change event (radio_group.dart is untouched). Both designs now render child-control labels, iOS honors label_style, fill_color state maps and toggle_inputs tiles, and Android honors disabled on the radio itself. Snapshots change only for those rows.
AdamMusa
force-pushed
the
refactor/radio-control-core
branch
from
October 29, 2026 01:02
cf33c2b to
ffd00a3
Compare
This was referenced Oct 29, 2026
Brings in the PRs merged since, so #87 merges; conflicts take the resolution tested on the full merge of the open PRs. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MqfxcsDiEUZngybe9L72JQ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #81 (control core foundation). Until #81 merges this PR's diff also shows its commit; review the last two commits. Sibling of #84 (Switch) and #86 (Checkbox), also stacked on #81.
What
Item 3 of the decoupling plan: Radio moves onto the shared core. Exactly two commits:
test: snapshot Radio renderer behaviour: JSON snapshots of the legacy renderers (test/widgets/radio_snapshot_test.dart,test/snapshots/Radio/*.json, 9 fixtures x iOS/Android, each inside a RadioGroup: defaults, unlabeled, maximal, disabled, child-control label, RTL, nested theme,toggle_inputstile, disabled in tile). Messages from the radio and its group are recorded.refactor: move Radio onto the shared control core: the migration. Snapshots change only for the rows of the parity table below.Design
controls/radio_core.dart(new)radioSpec(every Ruby keyword of the Radio wire type;hover_color,overlay_color,splash_radius,visual_densityMaterial-only,inactive_color,use_checkmark_styleCupertino-only, with reasons),RadioProps,RadioCore(FocusableCore+TileToggleCore): RadioGroup lookup, label and tile selection (ignored while disabled), sharedstates(selected/disabled/focused),labelled()(oneToggleLabel, full-width row as before) and the "must be enclosed within RadioGroup" error for both designs.controls/radio.dartMaterialRadioSkin->Radio<String>(now withenabled: core.enabled).controls/cupertino_radio.dartCupertinoRadioSkin->CupertinoRadio<String>(fill_colorresolved withcore.states, native primary colour as the active default).controls/adaptive_radio.dartCoreHost<RadioCore>under the legacy key.The RadioGroup still owns the value and fires
change;radio_group.dartis not edited (#60 touches it). Registry,control_type.dartand the renderer matrix are untouched. Manifest: one entry;radio.dart/cupertino_radio.dartleavelegacy_renderers.txt;cupertino_control_independence_test.dartmountsAdaptiveRadioControl(assertions unchanged, passing).Parity changes (DC-5)
disabledon the Radio itself (group enabled) left the native radio selectable and announced as enabledchangefrom a disabled radio{value: Custom})label: text(...)workstoggle_inputsListTile taps ignored (no subscription)changeon iOS tile tapslabel_styleignoredfill_colorread as a plain colour (state maps dropped)fill_color: {selected: ...}works on iOSruby_radio_keys_test.dartpage.invoke(radio, "focus")waited for the invoke timeoutUnsupportedErrortextinvoke focusThe unlabeled fixture is driven with a pointer tap: without a label Flutter merges a radio's semantics into the page node on both designs, so no radio-scoped node exists to act on (unchanged by this PR). The audit's baseline Radio findings (
on_focus/on_blurnot fired) are fixed.Tests
test/widgets/ruby_radio_keys_test.dart(2): iOSfill_colorstate map; Androiddisabledinside an enabled group.team/verify_pr.shon head ffd00a3 (base 81609d0 + #81 @ 02c2d4b) with rufletorigin/main(b5fd1694): PASS: engineflutter test+978 all passed,flutter analyze lib testno issues, ruflet_core 153/153 files, wire-key audit (spec-aware, see #84) 0 new findings.Round 2 (rebased onto #81 @ 02c2d4b after QA review)
Still exactly two own commits. The snapshot commit is unchanged in content and still passes against the legacy renderer on the new #81. In the migration commit:
labelandlabel_positionasconsumer: PropConsumer.core. Every other prop must be referenced by each skin it lists, so the core mentioning a field no longer excuses a skin. C4 passes under the stricter rule.Controltoken or Control imports, and the constructor only forwardssuper.control.Radio<String>/CupertinoRadio<String>). The parity script starts withtap native, a pointer tap on the native widget, so the skin's ownonChangedwiring is compared on both designs, and it ends withunfocus. C7 now proves the script fires every core event:focusandblur(selection is the group'schange, recorded too).Gate
No open PR touches
adaptive_radio.dart,radio.dartorcupertino_radio.dart(checked before starting and before opening);radio_group.dart(#60) is not edited.cupertino_control_independence_test.dart,core_manifest.dartandlegacy_renderers.txtare also edited by siblings #84/#86 (adjacent lines): keep both when merging.