segmentedControlBuilder<T> function

Widget segmentedControlBuilder<T>(
  1. FormFieldState<T> field
)

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),
          ),
    ),
  );
}