title: Flutter how to show single value from List?
body: <p>I am trying to filter data from array and then need to just a single value from data. Its showing filtered data but need to know how can i show a single value from that data ?</p>
  
  <pre><code>class _ViewPostScreenState extends State&lt;ViewPostScreen&gt; {
  List showPost;
  String data;
  
  
    @override
    void initState(){
      super.initState();
      print(widget.id);
      showPost = posts.where((i) =&gt; i.id == widget.id).toList();
      data = showPost.toString();
      print(data);
  
    }
  </code></pre>
  
  <p>The response or print output of data is this <code>I/flutter ( 7374): [{id: 0, authorName: Umaiz Khan, authorImageUrl: assets/images/user0.png, timeAgo: 5 min, imageUrl: assets/images/post0.jpg}]</code></p>
  
  <p>I need to know how can I just show the authorName from this data? </p>
  
  <p>something like this print(data.authorName); try to do like this but not working.</p>
  
  <p>Here my data look like in other file</p>
  
  <pre><code>class Post {
    String authorName;
    String authorImageUrl;
    String timeAgo;
    String imageUrl;
    int id;
  
    Post({
      this.authorName,
      this.authorImageUrl,
      this.timeAgo,
      this.imageUrl,
      this.id,
    });
  
    @override
    String toString() {
      return '{id: $id, authorName: $authorName, authorImageUrl: $authorImageUrl, timeAgo: $timeAgo, imageUrl: $imageUrl}';
    }
  }
  
  final List&lt;Post&gt; posts = [
    Post(
      id: 0,
      authorName: 'Umaiz Khan',
      authorImageUrl: 'assets/images/user0.png',
      timeAgo: '5 min',
      imageUrl: 'assets/images/post0.jpg',
    ),
    Post(
      id: 1,
      authorName: 'Saad ahmed',
      authorImageUrl: 'assets/images/user1.png',
      timeAgo: '10 min',
      imageUrl: 'assets/images/post1.jpg',
    ),
    Post(
      id: 2,
      authorName: 'Hiba',
      authorImageUrl: 'assets/images/user4.png',
      timeAgo: '10 min',
      imageUrl: 'assets/images/post2.jpg',
    ),
  ];
  </code></pre>