Adding the possibility to specify the initial date selected in the date picker dialog.

This commit is contained in:
Gaspard Merten 2021-09-25 18:08:03 +02:00
parent d3fe446cdc
commit bf47b6c6c6
6 changed files with 27 additions and 3 deletions

View file

@ -73,6 +73,8 @@ class _MyHomePageState extends State<MyHomePage> {
suffixIcon: Icon(Icons.event_note),
labelText: 'My Super Date Time Field',
),
firstDate: DateTime.now().add(const Duration(days: 10)),
initialDate: DateTime.now().add(const Duration(days: 10)),
autovalidateMode: AutovalidateMode.always,
validator: (DateTime? e) =>
(e?.day ?? 0) == 1 ? 'Please not the first day' : null,