timePickerThemeData static method
TimePickerThemeData
timePickerThemeData(
- Palette colors,
- TextTheme textTheme, [
- double scale = 1.0,
- MonetShapes? shapes,
Implementation
static TimePickerThemeData timePickerThemeData(
Palette colors,
TextTheme textTheme, [
double scale = 1.0,
MonetShapes? shapes,
]) {
shapes ??= const MonetShapeTheme().resolve(scale);
final buttonShape = shapes.border();
return TimePickerThemeData(
backgroundColor: colors.background,
cancelButtonStyle: outlineButtonStyle(
colors,
scale: scale,
shape: buttonShape,
),
confirmButtonStyle: outlineButtonStyle(
colors,
scale: scale,
shape: buttonShape,
),
dayPeriodBorderSide: BorderSide(color: colors.fill, width: 2),
dayPeriodShape: shapes.border(
side: BorderSide(color: colors.fill, width: 2),
),
dayPeriodTextColor: WidgetStateColor.resolveWith((states) {
if (states.contains(WidgetState.selected)) {
return colors.fillText;
} else {
return colors.backgroundText;
}
}),
dayPeriodTextStyle: textTheme.labelLarge,
dialBackgroundColor: colors.fill,
dialHandColor: colors.fillText.withOpacityNeue(0.4),
dialTextColor: colors.fillText,
dialTextStyle: textTheme.labelLarge!.copyWith(color: colors.fillText),
elevation: modalElevation,
entryModeIconColor: colors.fill,
helpTextStyle: textTheme.headlineSmall,
dayPeriodColor: WidgetStateColor.resolveWith((states) {
if (states.contains(WidgetState.selected)) {
return colors.fill;
} else {
return colors.background;
}
}),
hourMinuteColor: WidgetStateColor.resolveWith((states) {
if (states.contains(WidgetState.hovered)) {
return colors.fillHovered;
} else if (states.contains(WidgetState.pressed)) {
return colors.fillSplashed;
} else if (states.contains(WidgetState.selected)) {
return colors.fill;
} else {
return colors.background;
}
}),
hourMinuteShape: shapes.border(
side: BorderSide(color: colors.fill, width: 2),
),
hourMinuteTextColor: WidgetStateColor.resolveWith((states) {
if (states.contains(WidgetState.hovered)) {
return colors.fillHoveredText;
} else if (states.contains(WidgetState.pressed)) {
return colors.fillSplashedText;
} else if (states.contains(WidgetState.selected)) {
return colors.fillText;
} else {
return colors.backgroundText;
}
}),
inputDecorationTheme: null, // let picker use its defaults
padding: const EdgeInsets.all(24), // match default in time_picker.dart
shape: shapes.border(side: BorderSide(color: colors.fill, width: 2)),
);
}