Skip to content
Get started
Menu
Get started

Form field group

Related payment or identity fields under one legend.

Birthplace and date, month and year, and name and notes grouped under shared labels.Birthplace and date, month and year, and name and notes grouped under shared labels.
Form field group
Birthplace, date of birth, card expiry and disabled name and notes fields at 200 percent text. Part 1 of 2.Continued: Birthplace, date of birth, card expiry and disabled name and notes fields at 200 percent text. Part 2 of 2.
200% text Shown in 2 images, top to bottom; each repeats the last few lines of the one before.
Birthplace, date of birth, card expiry and disabled name and notes fields at 200 percent text in Indonesian. Part 1 of 2.Continued: Birthplace, date of birth, card expiry and disabled name and notes fields at 200 percent text in Indonesian. Part 2 of 2.
200% text, Indonesian Shown in 2 images, top to bottom; each repeats the last few lines of the one before.
example/lib/screens/gallery_forms.dart
PaymentFormFieldGroup(
legend: 'Disabled group',
disabled: true,
children: [
PaymentTextField(label: 'Name'),
PaymentTextArea(label: 'Notes'),
],
);

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: legend, legend with description or error.

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.

Default, focused, disabled and error. Errors include an icon, text and an edge. Selection controls support hardware keyboards.

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: Group Personal details separately from Work and address, preserving reading order.

Don’t: Use a visual heading without field-group semantics.

Use short, specific labels and explain how to correct an error.

Input text is 16 dp. Legends precede fields in reading order. Labels and errors stay in semantics when visually hidden. Pickers restore focus.

Example kyc onboarding screen with synthetic dataExample kyc onboarding screen with synthetic data
Example: kyc onboarding

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.

ParameterTypeDefaultDescription
legend:requiredString—legend for this field.
children:requiredList<Widget>—children for this field.
description:String?—description for this field.
disabled:boolfalsedisabled for this field.
layout:AxisAxis.verticallayout for this field.