segmentedControlBuilder<T> function
A FormFieldBuilder that is the default FastSegmentedControl.builder.
Returns a CupertinoFormRow that contains a CupertinoSlidingSegmentedControl on any TargetPlatform.
Implementation
Widget segmentedControlBuilder<T>(FormFieldState<T> field) {
field as FastSegmentedControlState<T>;
final FastSegmentedControlState<T>(:didChange, :value, :widget) = field;
return CupertinoFormRow(
padding: widget.contentPadding,
prefix: widget.cupertinoPrefixBuilder(field),
helper: widget.cupertinoHelperBuilder(field),
error: widget.cupertinoErrorBuilder(field),
child: CupertinoSlidingSegmentedControl<T>(
backgroundColor: widget.backgroundColor,
children: widget.children,
groupValue: value,
onValueChanged: didChange,
padding: widget.padding,
thumbColor: widget.thumbColor ??
const CupertinoDynamicColor.withBrightness(
color: Color(0xFFFFFFFF),
darkColor: Color(0xFF636366),
),
),
);
}