load method

Future<Quiz?> load()

Implementation

Future<Quiz?> load() async {
  var quizData = await rf.db
      .get(quiz!, 'select * from Quiz where QuizId = ?', ['${quizId}']);
  quiz = quizData.first;

  Question question = Question();
  var questionData = await rf.db.get(
      question, 'select * from Question where QuizId = ?', ['${quizId}']);
  for (Question q in questionData) {
    Options option = Options();
    List<Options> ops = [];
    var OptionData = await rf.db.get(option,
        'select * from Options where QuestionId = ?', ['${q.QuestionId}']);
    for (Options option in OptionData) {
      ops.add(option);
    }
    q.Options = ops;
    questions.add(q);
  }
  return quiz;
}