This error happens if you call setState() on a State object for a widget that no longer appears in the widget tree (e.g., whose parent widget no longer includes the widget in its build). This error can occur when code calls setState() from a timer or an animation callback.
我的原因:使用eventBus监听,但是没有在widgt 销毁的时候在dispose()中取消监听
@override void dispose() { super.dispose(); if(eventBus!=null||subscription!=null){ subscription.cancel(); } }