flutter_navigator_v2 icon indicating copy to clipboard operation
flutter_navigator_v2 copied to clipboard

navigator 2.0 下 push 和 pop 都会重新rebuild

Open AlanJN opened this issue 3 years ago • 2 comments

您好,看了文章还有代码,自己也基于navigator2.0 实现一个路由管理。发现每次push和 pop都会rebuild ,用了router_expample代码也发现是这样 ,请问这个是合理的么?如果不合理,您是否有方案去避免这个?我看了官方issue 有人也问了这个问题, https://github.com/flutter/flutter/issues/72487

下面j截图是代码 image

下面是log image

AlanJN avatar Sep 29 '21 03:09 AlanJN

有同样的疑问,是系统bug还是用法不对?

xujinping avatar Oct 12 '21 03:10 xujinping

这是因为代码中pages属性,每次跳转都会for循环重新new MyPage()

AWarmHug avatar Jan 18 '22 13:01 AWarmHug