title: Convert time to am/pm flutter
body: <p>How to convert the time to am/pm ?</p>
  
  <p>I have this output</p>
  
  <pre><code>I/flutter (17720): 9:00:00
  I/flutter (17720): 11:00:00
  I/flutter (17720): 12:00:00
  </code></pre>
  
  <p>This is what I have tried</p>
  
  <pre><code> final item = snapshot.data[index];
   print("Time " + item['time'].toString());
  
   DateTime dateTime = DateTime.parse(item['time'].toString());
   print(DateUtil().formattedTime(dateTime));
  </code></pre>
  
  <p><strong>DateUtil</strong></p>
  
  <pre><code> String formattedTime(DateTime dateTime) {
      return DateFormat().add_jm().format(dateTime);
    }
  </code></pre>
  
  <p><strong>Error</strong></p>
  
  <blockquote>
    <p>I/flutter (17720): Time 09:00:00</p>
    
    <p>════════ Exception caught by widgets library
    ═══════════════════════════════════ The following FormatException was
    thrown building Tags(dirty, state: TagsState#b3a2f): Invalid date
    format 09:00:00</p>
  </blockquote>