When I click the raised button, the timepicker is showing up. Now if I wait like 5 seconds and then confirm the time this error will occur setState() called after d
If it is an expected behavior that the Future completes when the widget already got disposed you can use
Future
if (mounted) { setState(() { selectedDate = new DateTime(selectedDate.year, selectedDate.month, selectedDate.day, picked.hour, picked.minute); }); }