@@ -35,6 +35,7 @@ import 'slider_theme.dart';
35
35
import 'snack_bar_theme.dart' ;
36
36
import 'tab_bar_theme.dart' ;
37
37
import 'text_theme.dart' ;
38
+ import 'time_picker_theme.dart' ;
38
39
import 'toggle_buttons_theme.dart' ;
39
40
import 'tooltip_theme.dart' ;
40
41
import 'typography.dart' ;
@@ -269,6 +270,7 @@ class ThemeData with Diagnosticable {
269
270
DividerThemeData dividerTheme,
270
271
ButtonBarThemeData buttonBarTheme,
271
272
BottomNavigationBarThemeData bottomNavigationBarTheme,
273
+ TimePickerThemeData timePickerTheme,
272
274
bool fixTextFieldOutlineLabel,
273
275
}) {
274
276
assert (colorScheme? .brightness == null || brightness == null || colorScheme.brightness == brightness);
@@ -380,6 +382,7 @@ class ThemeData with Diagnosticable {
380
382
dividerTheme ?? = const DividerThemeData ();
381
383
buttonBarTheme ?? = const ButtonBarThemeData ();
382
384
bottomNavigationBarTheme ?? = const BottomNavigationBarThemeData ();
385
+ timePickerTheme ?? = const TimePickerThemeData ();
383
386
384
387
fixTextFieldOutlineLabel ?? = false ;
385
388
@@ -448,6 +451,7 @@ class ThemeData with Diagnosticable {
448
451
dividerTheme: dividerTheme,
449
452
buttonBarTheme: buttonBarTheme,
450
453
bottomNavigationBarTheme: bottomNavigationBarTheme,
454
+ timePickerTheme: timePickerTheme,
451
455
fixTextFieldOutlineLabel: fixTextFieldOutlineLabel,
452
456
);
453
457
}
@@ -527,6 +531,7 @@ class ThemeData with Diagnosticable {
527
531
@required this .dividerTheme,
528
532
@required this .buttonBarTheme,
529
533
@required this .bottomNavigationBarTheme,
534
+ @required this .timePickerTheme,
530
535
@required this .fixTextFieldOutlineLabel,
531
536
}) : assert (visualDensity != null ),
532
537
assert (primaryColor != null ),
@@ -589,6 +594,7 @@ class ThemeData with Diagnosticable {
589
594
assert (dividerTheme != null ),
590
595
assert (buttonBarTheme != null ),
591
596
assert (bottomNavigationBarTheme != null ),
597
+ assert (timePickerTheme != null ),
592
598
assert (fixTextFieldOutlineLabel != null );
593
599
594
600
/// Create a [ThemeData] based on the colors in the given [colorScheme] and
@@ -1036,6 +1042,9 @@ class ThemeData with Diagnosticable {
1036
1042
/// widgets.
1037
1043
final BottomNavigationBarThemeData bottomNavigationBarTheme;
1038
1044
1045
+ /// A theme for customizing the appearance and layout of time picker widgets.
1046
+ final TimePickerThemeData timePickerTheme;
1047
+
1039
1048
/// A temporary flag to allow apps to opt-in to a
1040
1049
/// [small fix] (https://github.com/flutter/flutter/issues/54028) for the Y
1041
1050
/// coordinate of the floating label in a [TextField] [OutlineInputBorder] .
@@ -1117,6 +1126,7 @@ class ThemeData with Diagnosticable {
1117
1126
DividerThemeData dividerTheme,
1118
1127
ButtonBarThemeData buttonBarTheme,
1119
1128
BottomNavigationBarThemeData bottomNavigationBarTheme,
1129
+ TimePickerThemeData timePickerTheme,
1120
1130
bool fixTextFieldOutlineLabel,
1121
1131
}) {
1122
1132
cupertinoOverrideTheme = cupertinoOverrideTheme? .noDefault ();
@@ -1185,6 +1195,7 @@ class ThemeData with Diagnosticable {
1185
1195
dividerTheme: dividerTheme ?? this .dividerTheme,
1186
1196
buttonBarTheme: buttonBarTheme ?? this .buttonBarTheme,
1187
1197
bottomNavigationBarTheme: bottomNavigationBarTheme ?? this .bottomNavigationBarTheme,
1198
+ timePickerTheme: timePickerTheme ?? this .timePickerTheme,
1188
1199
fixTextFieldOutlineLabel: fixTextFieldOutlineLabel ?? this .fixTextFieldOutlineLabel,
1189
1200
);
1190
1201
}
@@ -1331,6 +1342,7 @@ class ThemeData with Diagnosticable {
1331
1342
dividerTheme: DividerThemeData .lerp (a.dividerTheme, b.dividerTheme, t),
1332
1343
buttonBarTheme: ButtonBarThemeData .lerp (a.buttonBarTheme, b.buttonBarTheme, t),
1333
1344
bottomNavigationBarTheme: BottomNavigationBarThemeData .lerp (a.bottomNavigationBarTheme, b.bottomNavigationBarTheme, t),
1345
+ timePickerTheme: TimePickerThemeData .lerp (a.timePickerTheme, b.timePickerTheme, t),
1334
1346
fixTextFieldOutlineLabel: t < 0.5 ? a.fixTextFieldOutlineLabel : b.fixTextFieldOutlineLabel,
1335
1347
);
1336
1348
}
@@ -1405,6 +1417,7 @@ class ThemeData with Diagnosticable {
1405
1417
&& other.dividerTheme == dividerTheme
1406
1418
&& other.buttonBarTheme == buttonBarTheme
1407
1419
&& other.bottomNavigationBarTheme == bottomNavigationBarTheme
1420
+ && other.timePickerTheme == timePickerTheme
1408
1421
&& other.fixTextFieldOutlineLabel == fixTextFieldOutlineLabel;
1409
1422
}
1410
1423
@@ -1478,6 +1491,7 @@ class ThemeData with Diagnosticable {
1478
1491
dividerTheme,
1479
1492
buttonBarTheme,
1480
1493
bottomNavigationBarTheme,
1494
+ timePickerTheme,
1481
1495
fixTextFieldOutlineLabel,
1482
1496
];
1483
1497
return hashList (values);
@@ -1547,6 +1561,7 @@ class ThemeData with Diagnosticable {
1547
1561
properties.add (DiagnosticsProperty <MaterialBannerThemeData >('bannerTheme' , bannerTheme, defaultValue: defaultData.bannerTheme, level: DiagnosticLevel .debug));
1548
1562
properties.add (DiagnosticsProperty <DividerThemeData >('dividerTheme' , dividerTheme, defaultValue: defaultData.dividerTheme, level: DiagnosticLevel .debug));
1549
1563
properties.add (DiagnosticsProperty <ButtonBarThemeData >('buttonBarTheme' , buttonBarTheme, defaultValue: defaultData.buttonBarTheme, level: DiagnosticLevel .debug));
1564
+ properties.add (DiagnosticsProperty <TimePickerThemeData >('timePickerTheme' , timePickerTheme, defaultValue: defaultData.timePickerTheme, level: DiagnosticLevel .debug));
1550
1565
properties.add (DiagnosticsProperty <BottomNavigationBarThemeData >('bottomNavigationBarTheme' , bottomNavigationBarTheme, defaultValue: defaultData.bottomNavigationBarTheme, level: DiagnosticLevel .debug));
1551
1566
}
1552
1567
}
0 commit comments