CupertinoFormSection class

An iOS-style form section.

The base constructor for CupertinoFormSection constructs an edge-to-edge style section which includes an iOS-style header, rows, the dividers between rows, and borders on top and bottom of the rows.

The CupertinoFormSection.insetGrouped constructor creates a round-edged and padded section that is commonly seen in notched-displays like iPhone X and beyond. Creates an iOS-style header, rows, and the dividers between rows. Does not create borders on top and bottom of the rows.

The header parameter sets the form section header. The section header lies above the children rows, with margins that match the iOS style.

The footer parameter sets the form section footer. The section footer lies below the children rows.

The children parameter is required and sets the list of rows shown in the section. The children parameter takes a list, as opposed to a more efficient builder function that lazy builds, because forms are intended to be short in row count. It is recommended that only CupertinoFormRow and CupertinoTextFormFieldRow widgets be included in the children list in order to retain the iOS look.

The margin parameter sets the spacing around the content area of the section encapsulating children.

The decoration parameter sets the decoration around children. If null, defaults to CupertinoColors.secondarySystemGroupedBackground. If null, defaults to 10.0 circular radius when constructing with CupertinoFormSection.insetGrouped. Defaults to zero radius for the standard CupertinoFormSection constructor.

The backgroundColor parameter sets the background color behind the section. If null, defaults to CupertinoColors.systemGroupedBackground.

The content will be clipped (or not) according to this option.

See the enum Clip for details of all possible options and their common use cases.

See also:

Inheritance

Constructors

CupertinoFormSection({Key? key, required List<Widget> children, Widget? header, Widget? footer, EdgeInsetsGeometry margin = EdgeInsets.zero, Color backgroundColor = CupertinoColors.systemGroupedBackground, BoxDecoration? decoration, Clip clipBehavior = Clip.none})
Creates a section that mimics standard iOS forms.
const
CupertinoFormSection.insetGrouped({Key? key, required List<Widget> children, Widget? header, Widget? footer, EdgeInsetsGeometry margin = _kFormDefaultInsetGroupedRowsMargin, Color backgroundColor = CupertinoColors.systemGroupedBackground, BoxDecoration? decoration, Clip clipBehavior = Clip.none})
Creates a section that mimics standard "Inset Grouped" iOS forms.
const

Properties

backgroundColor Color
Sets the background color behind the section.
final
children List<Widget>
The list of rows in the section.
final
clipBehavior Clip
The content will be clipped (or not) according to this option.
final
decoration BoxDecoration?
Sets the decoration around children.
final
Sets the form section footer. The section footer lies below the children rows.
final
hashCode int
The hash code for this object.
no setterinherited
Sets the form section header. The section header lies above the children rows.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
margin EdgeInsetsGeometry
Margin around the content area of the section encapsulating children.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited