I'm learning flutter by following an online course. I'm at the lesson of creating classes. So we have to create a class that has a string and a bool property. Below is this class:
class Question {
String questionText;
bool questionAnswer;
Question({required String q, required bool a}) {
questionText = q;
questionAnswer = a;
}
}
And the error is showing like this:
Non-nullable instance field 'questionText' must be initialized.
Non-nullable instance field 'questionAnswer' must be initialized.
Someone please help