美文网首页
Getx报错处理

Getx报错处理

作者: 4VZhang | 来源:发表于2023-04-13 10:49 被阅读0次

报错如下:

It is necessary to start route name [./splash] with a slash: /./splash
'package:get/get_navigation/src/routes/get_route.dart':
Failed assertion: line 70 pos 16: 'name.startsWith('/')'

解决方案:

选择Getx作为路由管理的工具,使用命名跳转的方式,需要注意路由命名需要以"/"开头,例如:

abstract class AppRoutes {
  #错误写法
  #static const splash = 'splash';
  static const splash = '/splash';
}

相关文章

网友评论

      本文标题:Getx报错处理

      本文链接:https://www.haomeiwen.com/subject/nfyrddtx.html