Skip to content

refactor: split material_picker_controls.dart per control - #92

Merged
AdamMusa merged 1 commit into
codex/engine-initializationfrom
refactor/split-material-picker-controls
Nov 2, 2026
Merged

AdamMusa merged 1 commit into
codex/engine-initializationfrom
refactor/split-material-picker-controls

Conversation

@AdamMusa

Copy link
Copy Markdown
Owner

What

Item 7 (first half) of the decoupling plan: a pure-move split of the shared material_picker_controls.dart into one library per control, so the Picker, TimerPicker, DatePicker, ActionSheet and ContextMenuAction migrations no longer share a file.

New library Classes (moved unchanged) Imported by
material_action_sheet.dart MaterialActionSheetControl, MaterialActionSheetActionControl adaptive_action_sheet.dart
material_context_menu_action.dart MaterialContextMenuActionControl adaptive_context_menu_action.dart
material_date_picker.dart MaterialDatePickerRenderer, MaterialInlineDatePickerControl adaptive_date_picker.dart
material_picker.dart MaterialPickerControl adaptive_picker.dart
material_timer_picker.dart MaterialTimerPickerControl adaptive_timer_picker.dart
  • The class bodies are byte-identical to the original file (checked line by line, ignoring blank lines: 218 = 218).
  • Each new library keeps only the imports it uses. Each adaptive_* entry swaps its one material_picker_controls.dart import for its own renderer's file.
  • material_picker_controls.dart is deleted. The registry, control_type.dart and every test are untouched. No dependency on the control-core stack: this PR is based directly on codex/engine-initialization.

Audit note (no behaviour change)

wire_key_audit.rb reports 3 findings as "new". They predate this PR and become visible only because each renderer now has its own file:

  • ContextMenuAction dart_reads_not_in_ruby icon: the Material ContextMenuAction has always read icon; Ruby's ContextMenuAction does not declare it. The shared file was used by five wire types, which hid the attribution.
  • ContextMenuAction prop_not_read badge / layout_key_without_wrapper badge: the Material ContextMenuAction never wrapped LayoutControl. The shared file's unused base_controls.dart import made the audit assume it did.

Both belong to the ContextMenuAction migration (spec item 15), not to this move.

Tests

team/verify_pr.sh on head 9432b8e (base 20e8185) with ruflet origin/main: PASS: engine flutter test +1084 all passed (renderer matrix and architecture boundary tests included), flutter analyze lib test no issues, ruflet_core 161/161 files.

Gate

No open PR touches material_picker_controls.dart, the five adaptive_* entries or the new file names; checked before starting and before opening.

Move each Material renderer out of the shared material_picker_controls.dart
into its own library: material_action_sheet.dart (ActionSheet and its
action), material_context_menu_action.dart, material_date_picker.dart,
material_picker.dart and material_timer_picker.dart. Class bodies are
unchanged; each library keeps only the imports it uses and each adaptive
entry imports only its own renderer, so the Picker, TimerPicker, DatePicker,
ActionSheet and ContextMenuAction migrations no longer share a file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant