Skip to content

Commit ad1248a

Browse files
committed
Date time pickers
1 parent 11f798b commit ad1248a

File tree

1 file changed

+60
-1
lines changed

1 file changed

+60
-1
lines changed

lib/components/navigation/menu.dart

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,66 @@ class _MenuState extends State<Menu> {
337337
final time = await showTimePicker(
338338
context: context,
339339
initialTime: TimeOfDay(
340-
hour: date.hour, minute: date.minute));
340+
hour: date.hour, minute: date.minute),
341+
builder: (BuildContext context, child) {
342+
return Theme(
343+
data: ThemeData.light().copyWith(
344+
timePickerTheme:
345+
TimePickerThemeData(
346+
shape: RoundedRectangleBorder(
347+
side: const BorderSide(
348+
width: 3,
349+
color: Colors.black),
350+
borderRadius: BorderRadius.circular(
351+
16.0), // this is the border radius of the picker
352+
),
353+
backgroundColor:
354+
Color(0xFFE9E9E9),
355+
hourMinuteColor:
356+
MaterialStateColor.resolveWith(
357+
(states) => states
358+
.contains(
359+
MaterialState
360+
.selected)
361+
? Color(0xFFE9E9E9)
362+
: Color(0xFFE9E9E9)),
363+
dialHandColor: Color(0xFFE9E9E9),
364+
dialTextColor: MaterialStateColor
365+
.resolveWith((states) =>
366+
states.contains(
367+
MaterialState
368+
.selected)
369+
? Colors.black
370+
: Colors.black),
371+
hourMinuteTextColor:
372+
MaterialStateColor.resolveWith(
373+
(states) => states
374+
.contains(
375+
MaterialState
376+
.selected)
377+
? Color(0xFF6385C3)
378+
: Colors.black),
379+
dialBackgroundColor:
380+
Color(0xFF6385C3),
381+
),
382+
textButtonTheme:
383+
TextButtonThemeData(
384+
style: ButtonStyle(
385+
foregroundColor:
386+
MaterialStateColor
387+
.resolveWith(
388+
(states) =>
389+
Color(
390+
0xFF6385C3)),
391+
overlayColor:
392+
MaterialStateColor
393+
.resolveWith(
394+
(states) =>
395+
Color(0xFF6385C3),
396+
)))),
397+
child: child!,
398+
);
399+
});
341400

342401
if (time == null) return;
343402

0 commit comments

Comments
 (0)