Skip to content
Get started
Menu
Get started

Section

PaymentSection groups related content under a title. Sections are flat: they sit on the page surface and are separated by space, never boxed, so they nest inside your own cards and sheets without stacking borders.

Payment sections with titles, supporting content and header actions.Payment sections with titles, supporting content and header actions.
Light and dark variants
example/lib/screens/flow_screen.dart
PaymentSection(child: LoadingSkeleton(rows: 3, leading: false));

Variants: titled, untitled, trailing action.

trailing puts an action beside the title, such as “Edit”. Keeping a section’s action in its header saves a row and ties the action to the content.

PaymentSection(
title: 'Identity',
trailing: TextButton(onPressed: editIdentity, child: const Text('Edit')),
child: identityRows,
);

The header is one 36 dp band whether or not it has a trailing action, so sections line up on a page. A trailing small button centres on the title’s first line; its 48 dp target overhangs the band into the section’s padding.

title is optional. Without it the section is only vertical padding around its child, which keeps spacing consistent with titled sections.

Situation Variant / composition Payment example
Group checkout content titled Use one short heading for a related block and a secondary trailing action.

Use Form field group for controls with a legend.

The section groups its children. Loading, empty and error presentations belong to the content inside it.

Do: Use one short heading for a related block and a secondary trailing action.

Don’t: Wrap already titled page modules just to add another heading.

  • Titles are short nouns in sentence case: “Order summary”, “Pay with”.
  • Use a section per topic. If a section needs a sub-section, consider an expandable section or a separate screen.
  • Use a divider between sections only when space alone does not separate them.
  • The title is marked as a header, so screen-reader users can jump between sections.

PaymentSection

class PaymentSection extends StatelessWidget · lib/src/foundation/primitives.dart

A titled group of content. Sections are flat: they sit on the page surface and are separated by space, never boxed, so they nest inside a host's own cards and sheets without stacking borders.

ParameterTypeDefaultDescription
title:String?——
trailing:Widget?—Optional action beside the title, such as an "Edit" button. Keeping a section's action in its header saves a row and ties it to the content.
child:requiredWidget——

Use Property list for grouped payment facts and Table for fee schedules.