title: Bad state: No element flutter
body: <p>I am developing a small project based on contact management in which I integrated the 'contact service' flutter plugin
  and when I browse the contacts from my physical device there are display errors here is my code</p>
  <pre><code> for (int i=0;i&lt;ccl.contacts.length;i++){
        if(ccl.contacts[i].phones.first.value.toString() != null &amp;&amp; ccl.contacts[i].phones.first.value.toString().length&gt;0){
  
        print(ccl.contacts[i].phones.first.value.toString().trim());
        print(ccl.contacts[i].displayName);
  </code></pre>
  <p>this is my error</p>
  <pre><code> Exception caught by gesture ═══════════════════════════════════════════════════════════════
  The following StateError was thrown while handling a gesture:
  Bad state: No element
  
  When the exception was thrown, this was the stack: 
  #0      ListIterable.first (dart:_internal/iterable.dart:51:22)
  #1      _MyHomePageState.changedContact (package:contactchanged/main.dart:74:33)
  #2      _MyHomePageState.build.&lt;anonymous closure&gt;.&lt;anonymous closure&gt; (package:contactchanged/main.dart:114:36)
  #3      State.setState (package:flutter/src/widgets/framework.dart:1233:30)
  #4      _MyHomePageState.build.&lt;anonymous closure&gt; (package:contactchanged/main.dart:114:23)
  ...
  Handler: &quot;onTap&quot;
  Recognizer: TapGestureRecognizer#70bc3
    debugOwner: GestureDetector
    state: possible
    won arena
    finalPosition: Offset(188.6, 115.4)
    finalLocalPosition: Offset(188.6, 29.1)
    button: 1
    sent tap down
  </code></pre>