我正在使用beamer flutter 包
我正在尝试实现“未找到页面”
假设用户在网络上并在网址上输入
http://localhost:64132/#/mdn%20vab%20ad,,,,had
我想将用户路由到未找到的页面
你能推荐一种使用投影仪来做到这一点的方法吗?
谢谢
最佳答案
最好使用 SimpleLocationBuilder
或 BeamerLocationBuilder
。这两个将自动检测 not-found
,而完全自定义的 locationBuilder
则不会(在这种情况下,您将只返回自定义的 not-found
BeamLocation
(如果所有其他检查都失败)。
要定义 not-found
页面,您可以在 BeamerDelegate
中使用以下属性之一:
- notFoundPage
- notFoundRedirectNamed
- notFoundRedirect (仅当您不使用
SimpleLocationBuilder
时)
关于flutter - 如何用beamer实现 "not found"页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68032277/