[英]Flutter auto_route, getter 'key' was called on null
import 'package:myapp/core/routes/router.gr.dart' as app_router;
child: MaterialApp(
title: 'MyApp',
debugShowCheckedModeBanner: false,
builder: ExtendedNavigator.builder<app_router.Router>(
router: app_router.Router()
),
I have implememented autoroute however I get an error here that the getter key was called on null我已经实现了自动路由,但是我在这里收到一个错误,即在 null 上调用了 getter 键
As Masnun pointed out, commenting out the line 37 solves the issue.正如 Masnun 所指出的,注释掉第 37 行可以解决这个问题。 However, there is a different solution that doesn't involve touching the source of the auto_route.
但是,有一种不同的解决方案不涉及接触 auto_route 的源。
I fixed this issue by removing .builder
from:我通过从以下位置删除
.builder
解决了这个问题:
builder: ExtendedNavigator.builder(
router: Router(),
...
),
and changed to并改为
builder: ExtendedNavigator(
router: Router(),
...
),
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.