title: How to get index from key or key value pair in dart flutter
body: <p>I have a list of key value pair</p>
  <p>I want to search for the index from key like (get index in list where key == 0) and then from that Index I want to change the value.</p>
  <p>or change the value to something where key == 1</p>
  <pre><code>void main() {
    var listAnswers = [];
    var keyPair = {
      'Key': 0,
      'value': false,
    };
  
    listAnswers.add(keyPair);
  
    keyPair = {
      'Key': 1,
      'value': 1,
    };
  
    listAnswers.add(keyPair);
  
    keyPair = {
      'Key': 2,
      'value': DateTime.now(),
    };
  
    listAnswers.add(keyPair);
  
    print(listAnswers);
  
    var index = listAnswers.getIndex('key', 0)
    // got the index 1 (where key = 0, and value = false)
  
    listAnswers[i].value = true; // then I want to do something like this.
  
  }
  
  </code></pre>