Closed Aayush-310 closed 1 year ago
It is most probably because you're using named parameters in Question({required String qN, required bool ans})
but you are passing values as if they were positional parameters in Question( 'hello',false)
Write Question( qN : 'hello', ans : false)
instead and try
Let me know if some problem comes up
//questio_n.dart class Question { late String questionText; late bool questionAns; Question({required String qN, required bool ans}) { questionText = qN; questionAns = ans; } } //quiz_brain.dart import 'package:quizzler/questio_n.dart';
import 'questio_n.dart';
class QuizBrain { List listofquestions = [
Question( 'hello',false)
];
}
//why cant the class object be initialized without specifying qN='hello'