If I understand your question, for each image clicked, you want to be directed to another page containing information about the image.
One way to go about it is :
For the data being fetched, you could modify to : {"id": 2, "name": "plant2", "urlImage": '', **"urlInfo" :""**}
Since you want to launch a url, you could use the **url_launcher package**
or a suitable package, based on how you want to access the information. Use a WebView package if you want to access the information in-app.
You're using ListTile so you could do : When using url_launcher package
ListTile( onTap: () async{ await launch('${_foundHerbs[index]["urlInfo"]} '); }, ),
Or for something like flutter_webview_plugin, you could do :
ListTile(
onTap: (){
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => WebviewScaffold(
url: '${_foundHerbs[index]["urlInfo"]} ',
appBar: new AppBar(
title: new Text("Image Information"),
withJavascript: true,
),
),
),
);
},
),
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.