Repository navigation
feat: add FormRow control for labeled form rows - #21
Merged
Merged
Conversation
Render Ruby form_row as CupertinoFormRow on Apple platforms and as a Material row elsewhere: a leading label, the field aligned to the end, and optional helper and error lines (destructiveRed / colorScheme.error). CupertinoFormRow is accepted as an alias.
This was referenced Oct 28, 2026
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.
Ruby counterpart: AdamMusa/ruflet#37
Adds the
FormRowcontrol (SPEC B2): an iOS form row with a leading label, an end-aligned field, and optional helper and error lines.Ruby usage
Wire
{"_c": "FormRow", "content": {...}, "prefix": ..., "helper": ..., "error": ..., "padding": ...}. The aliasCupertinoFormRowmaps toFormRowincontrol_type.dart.content(control, required)CupertinoFormRow.child, end-alignedExpanded(Align(centerEnd, content))prefix(string or control)prefix, the row labelbodyLarge, then a 16 px gaphelper(string or control)helperbodySmall/onSurfaceVarianterror(string or control)error(SDKdestructiveRed, w500)bodySmall/colorScheme.errorpaddingpadding(SDK default STEB 20, 6, 6, 6)Events: none, apart from the common
on_animation_endandon_size_change. The common layout keywords go throughLayoutControl. Ifcontentis missing or invisible, the row rendersErrorControl("FormRow.content must be provided and visible")on both designs. Ruby already rejects a missingcontent.Tests
test/widgets/ruby_form_row_test.dart(new, 7 tests):CupertinoFormRow. The prefix is at x=20 (SDK padding) and the content lies right of the prefix, ends at 800-6 and is vertically centered with it. Helper and error sit below, in order. The error text color isCupertinoColors.destructiveRed. Rubypaddingreplaces the SDK default (label x, row top and content end all move). A missingcontentgives ErrorControl. TheCupertinoFormRowalias renders. No Material widget is used.CupertinoFormRow. The prefix is at x=16 and the row top at 8. The content starts at least 16 px after the label and ends at 800-16. Error color iscolorScheme.errorand helper color isonSurfaceVariant. Rubypaddingapplies. Without a prefix the content still ends the row. A missingcontentgives ErrorControl. No Cupertino widgets.control_renderer_matrix_test.dart: adds aFormRowfixture with aprefix. The type renders on all 5 platforms with no exception, no ErrorControl and no opposite-design widgets.verify_pr.sh(Flutter 3.41.2):Notes
ListSection(engine feat: add ListSection control for grouped lists #16 / ruflet fix: fire Ruby on_focus and on_blur on Cupertino Chip #32) for settings and checkout forms, but does not depend on it.text_field(border: "none")still draws the SDK's rounded border.cupertino_textfield.dartbuilds its decoration withdefaultDecoration.copyWith(border: null), andcopyWithkeeps the existing border when given null. A FormRow with a text field therefore shows a boxed field on iOS until that is fixed. The fix belongs to the owner ofcupertino_textfield.dart(Package C) and is reported to the lead.Merge note
This PR and #16 (ListSection) both add lines in alphabetical order to the same spots: the
adaptive_*imports inruflet_core_extension.dart, and theCupertino* -> canonicalaliases just above"CupertinoListTile"incontrol_type.dart. Each merges cleanly on its own. Whichever merges second needs a one-minute rebase that keeps both lines. The Ruby PRs (#32, #37) merge cleanly together.