Form field group
Related payment or identity fields under one legend.






PaymentFormFieldGroup( legend: 'Disabled group', disabled: true, children: [ PaymentTextField(label: 'Name'), PaymentTextArea(label: 'Notes'), ], );Behavior
Section titled “Behavior”Vertical or horizontal. Horizontal stays side by side while each field gets 140 dp (Month / Year fit a 329 dp phone card) and stacks below that or at large text. Put 24 dp (PaymentSpace.section) between groups; fields inside a group sit 16 apart (#65). A disabled group keeps its fields disabled, even if one sets itself enabled. Mixed required and optional fields add an optional mark. Group errors belong in a PaymentBanner above the group.
Variants
Section titled “Variants”Variants: legend, legend with description or error.
Which variant when
Section titled “Which variant when”| Situation | Variant / composition | Payment example |
|---|---|---|
| KYC identity groups | legend | Group Personal details separately from Work and address, preserving reading order. |
Use Section for non-form content.
States
Section titled “States”Default, focused, disabled and error. Errors include an icon, text and an edge. Selection controls support hardware keyboards.
Spacing
Section titled “Spacing”The legend sits 16 dp (group) above the first control’s visible top: a field’s edge, or the label of a checkbox, radio or switch row. A row’s 48 dp target reaches into that gap instead of pushing the label down, but never onto the legend, so a settings group of switches starts as close to its legend as a group of fields. Fields and rows inside the group sit 16 dp apart; hosts put 24 dp between groups.
Do and don’t
Section titled “Do and don’t”Do: Group Personal details separately from Work and address, preserving reading order.
Don’t: Use a visual heading without field-group semantics.
Content guidelines
Section titled “Content guidelines”Use short, specific labels and explain how to correct an error.
Accessibility
Section titled “Accessibility”Input text is 16 dp. Legends precede fields in reading order. Labels and errors stay in semantics when visually hidden. Pickers restore focus.
In the example app
Section titled “In the example app”

PaymentFormFieldGroup
class PaymentFormFieldGroup extends StatelessWidget · lib/src/forms/field_group.dart
Related fields under a legend. A horizontal group stacks when its fields would be narrower than 140 dp each, or at large text. Hosts put 24 dp (PaymentSpace.section) between groups; fields inside sit 16 apart. The legend sits 16 dp (group) above the first control's visible top: a field's edge, or a checkbox, radio or switch row's label (#66). A row's 48 dp target reaches into that gap but never onto the legend.
| Parameter | Type | Default | Description |
|---|---|---|---|
legend:required | String | — | legend for this field. |
children:required | List<Widget> | — | children for this field. |
description: | String? | — | description for this field. |
disabled: | bool | false | disabled for this field. |
layout: | Axis | Axis.vertical | layout for this field. |