我正在做“The Complete Flutter Development Bootcamp with Dart”,当我收到以下错误时:
lib/main.dart:47:42:错误:位置参数太少:需要 1 个,给定 0 个。 quizBrain.getQuestionText(),
我已复制并粘贴以下相关小部件:
Expanded(
flex: 5,
child: Padding(
padding: EdgeInsets.all(10.0),
child: Center(
child: Text(
quizBrain.getQuestionText(),
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 25.0,
color: Colors.white,
),
),
),
),
),
我在网上寻找解决方案,但找不到任何东西。
您的
quizBrain.getQuestionText()
需要传递参数。检查它的定义并提供参数。