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
Try this
Widget build(BuildContext context) { return new RaisedButton( child: new Text("${selectedDate.hour} ${selectedDate.minute}"), onPressed: () async { await initTimePicker(); } ); }