title: How to get value from map on another page in flutter
body: <p>So I have a listview with which I used Future to fetch data and it displays fine. Now am trying to parse the value on the clicked item from the listview page to another page that will show details of the item click. Please how do I achieve this?</p>
  <p>The Future</p>
  <pre><code>List dealData = List();
    Future&lt;String&gt; _fetchComment() async {
      setState(() {
        isLoading = true;
        debugPrint(&quot;emirate state&quot;);
      });
      try {
        debugPrint(&quot;emirate try&quot;);
  
        final result = await InternetAddress.lookup('google.com');
        if (result.isNotEmpty &amp;&amp; result[0].rawAddress.isNotEmpty) {
          print('connected');
          debugPrint(&quot;emirate connect&quot;);
  
          String url;
  
          debugPrint(&quot;my select:$_mySelection&quot;);
  
          if (_mySelection == null &amp;&amp; _myFeatureSelection == null) {
            url = &quot;my rest api&quot;;
            
          } else if (_myFeatureSelection != null) {
            url =
                &quot;my rest api&quot;;
            _mySelection = null;
          } else if (_mySelection != null &amp;&amp; _myFeatureSelection == null) {
            url = &quot;my rest api&quot;;
  
          }
  
          print(&quot;our url:$url&quot;);
  
          var res = await http
              .get(Uri.encodeFull(url), headers: {&quot;Accept&quot;: &quot;application/json&quot;});
          var resBody = json.decode(res.body);
  
          debugPrint(&quot;emirate url:$url&quot;);
  
          setState(() {
            dealData = resBody;
            isLoading = false;
          });
  
          print(resBody);
          debugPrint(&quot;emirate:$resBody&quot;);
  
          return &quot;Sucess&quot;;
        } else {
          throw Exception('Failed to load profile');
        }
      } on SocketException catch (_) {
        print('not connected');
        setState(() =&gt; isLoading = false);
  
        Navigator.popUntil(
            context, (_) =&gt; !Navigator.canPop(context));
  
  
        Navigator.pushReplacement(
            context,
            new MaterialPageRoute(
                builder: (BuildContext context) =&gt; NoInternet()));
  
  
      }
    }
  </code></pre>
  <p>My listview and onclick</p>
  <pre><code>
  dealData
           .map(
     
             (position) =&gt; FutureBuilder&lt;String&gt;(
                 future: getDistance(
                     position[&quot;lat&quot;],
                     position[&quot;lng&quot;])
                     .then((value) =&gt;
                     value.toString()),
  
         builder: (context, snapshot) {
  
  
           double myrate = double.parse(
               position[&quot;ratings&quot;] ==
                   null
                   ? &quot;0&quot;
                   : position[&quot;ratings&quot;]);
  
           return Container(
               child:Card(child:
               GestureDetector(
                   onTap: () {
  
                     print(position); // position printed here
  
                     Navigator.push(
                         context,
                         MaterialPageRoute(
                             builder: (BuildContext ctx) =&gt; Maps(position)));
  
  
                   },
       ).toList(),
  
  </code></pre>
  <p>My Map Class</p>
  <pre><code>class mapsFinal extends StatefulWidget {
   final int position;
  
   const mapsFinal(this.position);
  
   @override
   _MapsState createState() =&gt; _MapsState ();
  }
  
  class _MapsState extends State&lt;mapsFinal&gt; {
   Widget build(BuildContext context) {
     return Text(&quot;title&quot; + widget.position.toString());
   }
  }
  
  
  
  </code></pre>
  <p>Please I need a second page that will display the item I clicked on here.</p>