Repository navigation
feat: add list_section control for grouped lists - #32
Merged
Merged
Conversation
Add ListSectionControl (wire ListSection) with header, footer, variant, row/background/separator colors, divider margins, has_leading, top_margin, border_radius, clip_behavior and the common layout keywords. The list_section/listsection helpers take children positionally, as children: or controls:, or from a block like column. variant defaults to insetGrouped.
2 tasks
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.
Engine counterpart: AdamMusa/ruflet-engine#16
Adds the
list_sectioncontrol (SPEC B1, P0) for iOS settings-style grouped lists. It renders asCupertinoListSectionon Apple platforms and as a Material card of rows elsewhere.Usage
Children can be passed positionally, as
children:orcontrols:, or from a block, the same way ascolumn.listsectionis the compact alias.Schema
controls/shared/listsection_control.rb,ListSectionControl,TYPE = "listsection",WIRE = "ListSection". It is registered aslist_sectionandlistsectionin the shared and top-level CLASS_MAPs. DSL helpers are added inmaterial_control_methods.rb,shared_control_forwarders.rbanddsl.rb.additional_divider_margin bgcolor border_radius clip_behavior controls divider_margin footer has_leading header rows_bgcolor separator_color top_margin variant, plus the common layout set (align animate_* aspect_ratio badge bottom col data disabled expand expand_loose height key left margin offset opacity right rotate rtl scale size_change_interval tooltip top visible width).on_animation_endandon_size_changeonly, both from the common layout set.variant: "insetGrouped", the D-8 deviation from Flutter's base constructor. It is sent explicitly so every renderer sees the intended variant.headerandfootertake a String or any control.The engine PR describes how each key renders on Material and Cupertino.
Tests
test/list_section_compatibility_test.rb(new): 10 runs, 45 assertions. It checks the wire typeListSection, every key's serialization (with colors lowercased), theinsetGroupeddefault, control-valued header and footer, block/positional/children:/controls:children, thelistsectionalias, theRuflet::DSL::Apphelper, the common layout keywords and thehas_handler?events. It also checks that unknown keywords and events raiseArgumentError, and that both spellings resolve to the same class in both CLASS_MAPs.verify_pr.sh:Template conformance counts (386/348/205) are left for the integrator to regenerate, per D-5/R12.