Flutter DateTimePicker size is too small | Resize Flutter DateTimePicker size

Issue

screenshot

I’m trying to maximize the DatePicker size due to user feedback (too small on other devices). I’ve tried adding a builder but it didn’t make any difference.

The following is my current code:

_datePicker() {
return showDatePicker(
  context: context,
  initialDate: DateTime.now(),
  firstDate: DateTime(DateTime.now().year),
  lastDate: DateTime.now(),
  initialDatePickerMode: DatePickerMode.day,
  builder: (context, child) {
    return Container(
      height: 555,
      width: 500,
      child: child,
    );
  },
);

}

I’d like to refrain using a library and stick to the stock widgets as much as possible.

Let me know if I missed anything. TIA

Solution

showDatePicker "Shows a dialog containing a Material Design date picker." as per the documentation.

My initial solution came from this question but it doesn’t seem to work.

Due to time constraints, I’ll use SfDateRangePicker for now which solves the width issue I have and will try to find another way in the future.

enter image description here

Answered By – Kent

Answer Checked By – Robin (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *