Flutter I';“我得到了错误”;引发了另一个异常:您正在尝试使用无上下文导航而不使用;当我运行我的应用程序时

Flutter I';“我得到了错误”;引发了另一个异常:您正在尝试使用无上下文导航而不使用;当我运行我的应用程序时,flutter,build,Flutter,Build,这是我的密码 Spacer(), // 1/6 InkWell( onTap: () => Get.to(QuizScreen()), child: Container( width: double.infinity, alignment: Alignment.center,

这是我的密码

              Spacer(), // 1/6
              InkWell(
                onTap: () => Get.to(QuizScreen()),
                child: Container(
                  width: double.infinity,
                  alignment: Alignment.center,
                  padding: EdgeInsets.all(kDefaultPadding * 0.75), // 15
                  decoration: BoxDecoration(
                    gradient: kPrimaryGradient,
                    borderRadius: BorderRadius.all(Radius.circular(12)),
                  ),
                  child: Text(
                    "Lets Start Quiz",
                    style: Theme.of(context)
                        .textTheme
                        .button
                        .copyWith(color: Colors.black),
                  ),
                ),
              ),
              Spacer(flex: 2), // it will take 2/6 spaces
            ],
          ),
        ),
      ),
    ],
  ),
);
} }

请找个人帮我检查一下这个r=错误的原因。当我点击按钮时,我得到了错误信息。该项目建设良好,但我没有得到反馈,当我点击按钮


错误:引发了另一个异常:您正在尝试使用无上下文导航而不使用。

因为问题缺少使用Get包处理导航等信息, 似乎缺少Get.Key,因此您必须添加

get.testmode=true
在您的
GetMaterialApp()中