I'm using showDatePicker function to pick a date from the dialog Calendar. It shows an edit icon at the top right (see img 1) to change to input mode where the user can enter the date as a text (see img 2)
How to block/disable the edit button/input mode from showing at the top right? I want to remove this icon, because I dont want to use it.
Help me thanks
img 1
img 2
Use initialEntryMode
final DateTime? picked = await showDatePicker(
context: context,
initialDatePickerMode: DatePickerMode.day,
initialDate: DateTime.now(),
firstDate: DateTime(2015),
lastDate: DateTime(2101),
initialEntryMode: DatePickerEntryMode.calendarOnly, // <- this
);
For disabling the Edit icon, all you have to set is:
initialEntryMode: DatePickerEntryMode.calendarOnly,
There is no option to disable that feature. it is the newest feature in flutter 1.17 on datePicker.
You can set initialEntryMode
to DatePickerEntryMode.calendar
or DatePickerEntryMode.input
but cannot disable it. For example:
var picked = await showDatePicker(
initialEntryMode: DatePickerEntryMode.input,
context: context,
...
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With