Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Size of the Date Picker in Flutter

I am making an ipad in flutter. I have a date picker. But in landscape it is showing pretty big.

Is there any way to resize the date picker dialogenter image description here

like image 798
Debanjan Chakraborty Avatar asked Dec 31 '22 10:12

Debanjan Chakraborty


1 Answers

Yes, you can resize date picker dialog by Container(), SizedBox() etc. using it in builder, but only if you put it in something like Column(), for example:

return showDatePicker(
  context: context,
  initialDate: DateTime.now(),
  firstDate: DateTime.now(),
  lastDate: DateTime.now().add(Duration(days: 356)),
  builder: (context, child) {
    return Column(
      children: <Widget>[
        Padding(
          padding: const EdgeInsets.only(top: 50.0),
          child: Container(
            height: 450,
            width: 700,
            child: child,
          ),
        ),
      ],
    );
  },
);
like image 73
Dmitry Shiryhalov Avatar answered Jan 02 '23 22:01

Dmitry Shiryhalov