Closed 5Gears0Chill closed 2 years ago
Good day, when setting the initial date, i am stuck with the date being set internally but not showing up on the UI
DateTimeFormField( initialDate: _initialDate, decoration: const InputDecoration( hintStyle: TextStyle(color: Colors.black45), errorStyle: TextStyle(color: Colors.redAccent), border: OutlineInputBorder(), suffixIcon: Icon(Icons.event_note), labelText: 'Date Of Birth', ), mode: DateTimeFieldPickerMode.date, autovalidateMode: AutovalidateMode.always, firstDate: DateTime(DateTime.now().year - 120), lastDate: DateTime.now(), validator: (e) => (e) == DateTime.now() ? 'Choose a valid Birthday' : null, onDateSelected: (DateTime value) { _selectedDate = value; }, )
Hello,
The initial date value is only used by the calendar dialogue when there is no value selected.
You probably want to use the initial value parameter instead!
Good day, when setting the initial date, i am stuck with the date being set internally but not showing up on the UI