flutter_boost icon indicating copy to clipboard operation
flutter_boost copied to clipboard

add null check

Open joechan-cq opened this issue 1 year ago • 2 comments

popUtil方法中最后的targetPage进行判空。

related issue: #2141 #2129

joechan-cq avatar Oct 08 '24 09:10 joechan-cq

那我是不是可以理解为,如果使用 withContainer 模式,就必须带有 uniqueId,否则就会报错。这一点在文档和注释上似乎都没有体现出来,是否还需要更新一下相关的文档资料。

yang-lile avatar Oct 13 '24 07:10 yang-lile

并不是,没有uniqueId也是会根据route name来查找需要的container和page。这个PR只是做保护,问题点还是使用时,为什么会出现targetPage找不到的情况,这个就需要知道是怎么用FlutterBoost的了,调用popUntil之前,路由堆栈里是什么样的。

joechan-cq avatar Oct 14 '24 01:10 joechan-cq

@joechan-cq 感谢贡献代码!建议再在BoostNavigator的popUntil函数中对route和uniqueId增加assert断言判断,然后这个问题会更加完善的解决。 截屏2024-10-31 11 26 30

imcjj avatar Oct 31 '24 03:10 imcjj

add assert for route and uniqueId in popUtil

joechan-cq avatar Oct 31 '24 09:10 joechan-cq

LGTM

imcjj avatar Nov 01 '24 09:11 imcjj