convertState method

void convertState(
  1. Map<String, dynamic> doc
)

This method is used to set the state of the cards containing the questions and answers.

It accepts a parameter doc of type Map<String,String> which essentially contains an unordered list of question:answer key:value pairs typically fetched from a database. This method sets the state and arranges the questions according to the order specified by the _questionStructure variable.

Implementation

void convertState(Map<String, dynamic> doc) {
  var questionProvider =
      Provider.of<QuestionProvider>(context, listen: false);
  questionProvider.setState(doc);
}