jifalops / datetime_picker_formfield

A Flutter widget that wraps a TextFormField and integrates the date and/or time picker dialogs.
MIT License
186 stars 101 forks source link

Cant close a cupertino date time #79

Open gogreen42 opened 4 years ago

gogreen42 commented 4 years ago

Hi! It is impossible to close a cupertino date picker on Android by tap on a date.

ndrdmarshmallow commented 4 years ago

I have same issue I am not able to close the cupertino date picker.

DateTimeField(
            initialValue: initialValue,
            format: format,
            onShowPicker: (context, currentValue) async {
              await showCupertinoModalPopup(
                  context: context,
                  useRootNavigator: false,
                  builder: (context) {
                    return CupertinoDatePicker(
                      onDateTimeChanged: (DateTime date) {
                        initialValue = date;
                      },
                    );
                  });
              setState(() {});
              return initialValue;
            },
          );