title: How can I implement search in this Flutter app
body: <p>I'm trying to add a search feature to this flutter app since the json file it pulls data from has 7000 results.</p>
  
  <p>Mainly I'm trying to do search for "ctry" and "peopnameincountry". This was ripped from <a href="https://www.youtube.com/watch?v=EwHMSxSWIvQ" rel="nofollow noreferrer">https://www.youtube.com/watch?v=EwHMSxSWIvQ</a> </p>
  
  <p>As is .. it works fine in fetching the json list and the tap to show detail page works as well.</p>
  
  <p>I just need to implement the search on the main page so I don't have to scroll through the thousands of results.</p>
  
  <p>Appreciate any help .. thank you all.</p>
  
  <pre><code>import 'package:flutter/foundation.dart';
  import 'package:flutter/material.dart';
  import 'dart:async';
  import 'package:http/http.dart' as http;
  import 'dart:convert';
  
  void main() =&gt; runApp(new UnReached());
  
  class UnReached extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return new MaterialApp(
        title: 'Flutter Demo',
        theme: new ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: new MyHomePage(title: 'Unreached'),
      );
    }
  }
  
  class MyHomePage extends StatefulWidget {
    MyHomePage({Key key, this.title}) : super(key: key);
  
    final String title;
  
    @override
    _MyHomePageState createState() =&gt; new _MyHomePageState();
  }
  
  class _MyHomePageState extends State&lt;MyHomePage&gt; {
  
    Future&lt;List&lt;User&gt;&gt; _getUsers() async {
  
      var data = await http.get("https://cmfiflutterapp.s3-ap-southeast-2.amazonaws.com/UnreachedPeoplesGroup.json");
  
      var jsonData = json.decode(data.body);
  
      List&lt;User&gt; users = [];
  
      for(var u in jsonData){
  
        User user = User(u["ctry"], u["peopnameincountry"], u["population"], u["primarylanguagename"], u["biblestatus"],  u["primaryreligion"],  u["continent"]);
  
        users.add(user);
  
      }
  
      print(users.length);
  
      return users;
  
    }
  
  
  
    @override
    Widget build(BuildContext context) {
      return new Scaffold(
        appBar: new AppBar(
          title: Text(widget.title),
        ),
        body: Container(
          child: FutureBuilder(
            future: _getUsers(),
            builder: (BuildContext context, AsyncSnapshot snapshot){
              print(snapshot.data);
              if(snapshot.data == null){
                return Container(
                    child: Center(
                        child: Text("Loading...")
                    )
                );
              } else {
                return ListView.builder(
                  itemCount: snapshot.data.length,
                  itemBuilder: (BuildContext context, int index) {
                    return ListTile(
                      leading: Icon(Icons.arrow_forward_ios),
  //                    leading: CircleAvatar(
  //                      backgroundImage: NetworkImage(
  //                          snapshot.data[index].picture
  //                      ),
  //                    ),
                      title: Text(snapshot.data[index].peopnameincountry),
                      subtitle: Text(snapshot.data[index].ctry),
                      onTap: (){
  
                        Navigator.push(context,
                            new MaterialPageRoute(builder: (context) =&gt; DetailPage(snapshot.data[index]))
                        );
  
                      },
                    );
                  },
                );
              }
            },
          ),
        ),
      );
    }
  }
  
  
  </code></pre>