I have a variable named "prodCol" that it is in item builder ...how can I use it in another page?
GridView.builder(
itemBuilder: (BuildContext context, index) {
final varProd = snapshot.data![index];
final prodCol = varProd.get('colo');
}
)
CodePudding user response:
You can give it any other global variable and send the global variable to another page as a paramather. But I don't know whether this is useful or not.
CodePudding user response:
Si quieres pasar ese dato en otra vista, mandalo como parámetro por el router. Googlea como pasar parámetros por el router y ahí encontrarás mucha informacion.
