Want to display datepicker when textformfield is clicked in flutter Below is the simple way to Wrap your TextFormField with IgnorePointer & wrap IgnorePointer with InkWell.
1 2 3 4 5 6 7 8 9 10 11 12 13 | InkWell( onTap: () { _selectDate(); // Call Function that has showDatePicker() }, child: IgnorePointer( child: new TextFormField( decoration: new InputDecoration(hintText: 'DOB'), maxLength: 10, // validator: validateDob, onSaved: (String val) {}, ), ), ), |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.