TimeIndicatorStyle constructor
TimeIndicatorStyle(
- BuildContext context,
- Duration time, {
- TextStyle? textStyle,
- String? label,
- bool alwaysUse24HourFormat = false,
Implementation
factory TimeIndicatorStyle(
BuildContext context,
Duration time, {
TextStyle? textStyle,
String? label,
bool alwaysUse24HourFormat = false,
}) {
assert(time.debugCheckIsValidTimetableTimeOfDay());
final theme = context.theme;
final bodySmall = theme.textTheme.bodySmall!;
final proportionalFiguresFeature = const FontFeature.proportionalFigures().value;
return TimeIndicatorStyle.raw(
textStyle: textStyle ??
bodySmall.copyWith(
color: theme.colorScheme.background.disabledOnColor,
fontFeatures: [
...?bodySmall.fontFeatures?.where((it) => it.value != proportionalFiguresFeature),
const FontFeature.tabularFigures(),
],
),
label: label ??
() {
context.dependOnTimetableLocalizations();
return alwaysUse24HourFormat ? TimeIndicator.formatHour24(time) : TimeIndicator.formatHour(time);
}(),
);
}