datetime_picker_formfield
datetime_picker_formfield copied to clipboard
DateTimeField doesn't update automatically, I have to click on it again for date to change.
DateTimeField(
decoration: InputDecoration(
labelText: 'Date',
),
initialValue: newSubDate,
format: dateFormat,
onShowPicker: (context, currentValue) async {
showModalBottomSheet(
context: context,
builder: (BuildContext builder) {
return Column(
children: <Widget>[
Container(
height: MediaQuery.of(context)
.copyWith()
.size
.height /
4,
child: CupertinoDatePicker(
initialDateTime: DateTime.now(),
onDateTimeChanged: (DateTime newdate) {
newSubDate = newdate;
print('1-$newdate');
},
maximumDate: new DateTime(2080, 12, 30),
minimumYear: 2020,
maximumYear: 2080,
mode: CupertinoDatePickerMode.date,
),
),
FlatButton(
child: Text(
'Done',
style: TextStyle(
color: Colors.pink[100],
),
),
color: Colors.blueGrey,
onPressed: () {
print(newSubDate);
Navigator.pop(context);
},
),
],
);
});
setState(() {
});
return newSubDate;
},
onSaved: (value){
setState(() {
newSubDate = value;
});
},
onChanged: (value){
setState(() {
newSubDate = value;
});
},
),
Im also facing the same issue. any workaround for this?
i only hav this issue on ios