title: Assign value to a null value with Flutter
body: <p>I am having a weird problem.</p>
  <p>I am using a JSON (Map&lt;String, dynamic&gt;) object type in order to answer questions in a dynamic way, since there are a lot of questions with different types.</p>
  <p>Example: I have a list of questions where the answers can be numbers, strings or booleans.</p>
  <p>Here is my problem...</p>
  <p>When I have questions where I expect an &quot;int&quot;, I get an error saying.</p>
  <blockquote>
  <p>type 'int' is not a subtype of type 'Null' of 'value'</p>
  </blockquote>
  <p>This is basically because I initialize the JSON with the question equal to &quot;null&quot;.</p>
  <blockquote>
  <p>List&lt;Map&lt;String, dynamic&gt;&gt; questions = [{  question: 'How old are
  you?',  answer: null }];</p>
  </blockquote>
  <p>But when they answer the question I do something like this:</p>
  <blockquote>
  <p>questions[questionIndex]['answer'] = 20;</p>
  </blockquote>
  <p>For some reason, when I do this, I get the error, saying that the JSON was expecting an Null valuable since I initizlied the answer with &quot;null&quot;. How can I change this behaviour in order to be able to assign String, int or Boolean variables in a JSON object that is has been initialized to null?</p>
  <p>Thanks friends!</p>