Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter: IOS style datepicker in flutter

Tags:

flutter

How could i add iosstyle datepicker in flutter and set it into a textfield. I tried few things but failed..getting android style datepicker and setting it up has many solutions but ios style datepicker doesnt have much solutions..Thanks for the help

enter image description here

like image 992
Chinmaay Avatar asked Sep 20 '25 17:09

Chinmaay


1 Answers

use this

      void _showIOS_DatePicker(ctx) {
    showCupertinoModalPopup(
        context: ctx,
        builder: (_) => Container(
              height: 190,
              color: Color.fromARGB(255, 255, 255, 255),
              child: Column(
                children: [
                  Container(
                    height: 180,
                    child: CupertinoDatePicker(
                        initialDateTime: DateTime.now(),
                        onDateTimeChanged: (val) {
                          setState(() {
                            dateSelected = val.toString();
                          });
                        }),
                  ),
                ],
              ),
            ));
  }

enter image description here

like image 148
Sandeep Pareek Avatar answered Sep 22 '25 05:09

Sandeep Pareek