Whenever I open the page which has my DateTime function on it, the default time that it shows is the current time, which then I have to change. How do I change it so that the default time is 2 hours ahead of the current time? This is not a timezone issue, I have looked at that.
DateTime _time = DateTime.now();
_selectTime() async {
DatePicker.showDateTimePicker(
context,
showTitleActions: true,
onConfirm: (dateTime) {
if (dateTime != null) {
_time = dateTime;
setState(() {});
}
},
);
}
I would like the default time to be 2 hours ahead of the current time. So the current time is 07:30, I would like it to rather be 09:30.