'how to change showDatePicker input format flutter

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

img 1 img 1

img 2 img 2

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'),
           ],
         ),
       );`


Solution 1:[1]

There is no option to remove the edit icon as of now. You can try some packages on building your own custom date picker from here. This package supports swedish language too.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Poujhit