Quizzler getter requires positional argument

48 views Asked by At

I am doing "The Complete Flutter Development Bootcamp with Dart", and when I am getting the error below:

lib/main.dart:47:42: Error: Too few positional arguments: 1 required, 0 given. quizBrain.getQuestionText(),

I have copied and pasted the relevant widget below:

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,
            ),
          ),
        ),
      ),
    ),

I have looked online for a solution but can't find anything.

2

There are 2 answers

0
Shahed Emon On

Your quizBrain.getQuestionText() requires a arguments to be passed. Check it's definition and provide the argument.

0
Mohammad Bilal Akbar On

1 positional argument is required and you are passing no argument.

            quizBrain.getQuestionText(yourArgument),