因为RouterDelegate不是widget,所以无法直接调用setStatus触发build方法,通过with ChangeNotifier使其获得数据改变时rebuild的能力
注意: 如果重写addListener 和removeListener方法,必须要调用super的实现,否则,页面调用notifyListeners()后,不会重新执行build方法

因为RouterDelegate不是widget,所以无法直接调用setStatus触发build方法,通过with ChangeNotifier使其获得数据改变时rebuild的能力
注意: 如果重写addListener 和removeListener方法,必须要调用super的实现,否则,页面调用notifyListeners()后,不会重新执行build方法
本文标题:使用RouterDelegate时遇到的问题
本文链接:https://www.haomeiwen.com/subject/qogccdtx.html
网友评论