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) The problem is with the input format, I want that text editor input follow this format yyyy-mm-dd. The problem is that in the begning it show me the date like yyyy-mm-dd, but when the I try to remove the first number it changes automaticly to this format mm/dd/yyyy.
How to set the input format to yyyy-mm-dd. If showDatePicker dont support that with the swedish language, so how to hide the edit icon for ever from the top right. Help me thanks
Here is my code
DateTime selectedDate = DateTime.now();
String date = DateFormat("yyyy-MM-dd").format(DateTime.now());
...
FlatButton(
onPressed: ()async {
final DateTime picked = await showDatePicker(
locale: const Locale('sv'), // Swedish calander
context: context,
initialDate: selectedDate,
firstDate: DateTime(1970, 8),
lastDate: DateTime(2101));
if (picked != null && picked != selectedDate) {
setState(() {
selectedDate = picked;
String Onlydate = new DateFormat("yyyy-MM-dd").format(picked);
date = '$Onlydate';
});
}
},
child: Row(
children: <Widget>[
Text(' * $date'),
],
),
);`

