timePickerTextBuilder function

Text timePickerTextBuilder(
  1. FastTimePickerState field
)

A FastTimePickerTextBuilder that is the default FastTimePicker.textBuilder.

Returns a Text widget that shows the localized representation of the current FastTimePickerState.value.

Implementation

Text timePickerTextBuilder(FastTimePickerState field) {
  final FastTimePickerState(:context, :enabled, :value, :widget) = field;
  final theme = Theme.of(context);
  final style = widget.textStyle ?? theme.textTheme.titleMedium;

  return Text(
    value?.format(context) ?? '',
    style: enabled ? style : style?.copyWith(color: theme.disabledColor),
    textAlign: TextAlign.left,
  );
}