setState() called after dispose()

后端 未结 6 1935
迷失自我
迷失自我 2020-12-24 04:35

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

6条回答
  •  孤独总比滥情好
    2020-12-24 05:02

    Try this

    Widget build(BuildContext context) {
        return new RaisedButton(
            child: new Text("${selectedDate.hour} ${selectedDate.minute}"),
            onPressed: () async {
                await initTimePicker();
            }
        );
    }
    

提交回复
热议问题