answerControllers = new Map<String, dynamic>(); List<dynamic> answersToQuestion = getAnswersOfQuestion(answers, question["id"]); if (!answerControllers.containsKey(question["id"])) { answerControllers[question["id"]] = new Map<dynamic, dynamic>(); if (previousValue == null) { for (dynamic answer in answersToQuestion){ answerControllers[question["id"]][answer["libelle"]]['checked'] = false; } And I got this error :
The following NoSuchMethodError was thrown building CreateDemandView(dirty, state: _CreateDemandViewState#d56fe): The method '[]=' was called on null. Receiver: null Tried calling: []=("checked", false)