title: How to pass data from an api to another page and receive them to later render on screen?
body: <p>I didn't know how to put a better title to the question..... I have a carousel of images of the rick and morty api, this is the url <a href="https://rickandmortyapi.com/api/character" rel="nofollow noreferrer">https://rickandmortyapi.com/api/character</a>. I want that when clicking on one of those images it takes me to a page where the rest of the information is shown, here is the model to be more specific.</p>
  <pre><code>class DataApi {
    String image;
    String name;
    String state;
    String gender;
  
    DataApi({
      required this.image,
      required this.name,
      required this.state,
      required this.gender,
    });
  
    factory DataApi.fromJson(Map&lt;String, dynamic&gt; json) {
      return DataApi(
        image: json['image'],
        name: json['name'],
        state: json['status'],
        gender: json['species'],
      );
      /*name: json[&quot;name&quot;],
        state: json[&quot;status&quot;],
        gender: json[&quot;species&quot;]*/
  
      //List? get results =&gt; null;
    }
  }
  </code></pre>
  <p>So what I did was wrap the image container with a GestureDetector.</p>
  <pre><code>return GestureDetector(
            onTap: () {
              Navigator.pushNamed(
                context,
                '/details',
                arguments: snapshot.data![index],
              );
            },
            child: Container(
              margin: const EdgeInsets.all(3.0),
              decoration: BoxDecoration(
                borderRadius: const BorderRadius.all(Radius.circular(9.0)),
                image: DecorationImage(
                  image: NetworkImage(snapshot.data![index].image),
                  fit: BoxFit.cover,
                ),
              ),
            ),
          );
  </code></pre>
  <p>I don't know if I'm doing it right (or how to do it) because I have to pass the rest of the information as an argument and then receive it in another screen and render it. In this case, they would be inside text widgets</p>