Unable to customise data and time picker

55 Views Asked by At

enter image description here

I am trying to achieve this into my application

But I am not able to customise my code.

I just wanted to change

  1. Header color
  2. Pencil colour
  3. Selected date colour

And in time picker enter image description here

  1. Background of time
  2. Background of clock dial

Also I am unable to display selected date and time dilogue

enter image description here

I used this code to work this

    `IconButton(

          onPressed: () {

            showDatePicker(

              context: context,

              initialDate: selectedDate,

              firstDate: selectedDate.subtract(const Duration(days: 0)),

              lastDate: DateTime.now().add(

                const Duration(days: 7),

              ),

              builder: (context, child) {

                return Theme(

                    data: ThemeData.light().copyWith(

                      colorScheme: const ColorScheme.light(

                        primary: Colors.white,

                        onPrimary: Colors.black,

                        //onSurface: Colors.green,

                      ),

                      textButtonTheme: TextButtonThemeData(

                        style: TextButton.styleFrom(

                          foregroundColor: Colors.blue, // button text color

                        ),

                      ),

                    ),

                    child: child!);

              },

            ).then((value) {

              if (value != null) {

                onPickUp(value);

                showTimePicker(

                  context: context,

                  initialTime: TimeOfDay.now(),

                  helpText: 'Pick-up Time',

                ).then((value) {

                  if (value != null) {}

                });

              }

            });

          },

          icon: const Icon(Icons.calendar_today),

        ),

`

To customise date and time picker in flutter

0

There are 0 best solutions below