I have a list of string which is a Text and each of this List should move me to a specific screen or action, at the momnent I am stuck into this issue, how to assign to each of the list a different route? this is the code:
List<String> items = [
'Spedizioni',
'I Tuoi ordini',
'Aggiungi un Prodotto',
'Contattaci'
];
child: Row(
children: [
Text(
items[i],
style: TextStyle(
color: _isHovering[i]
? Theme.of(context).primaryTextTheme.button.decorationColor
: Theme.of(context).primaryTextTheme.button.color,
),
),
SizedBox(width: 5,),
Icon(icons[i]),
]
),
);
and until here all ok because it show different item into the list but now I want each of this item in the list navigate to a route as now I defined just one, but I need to define different route for different item in the List
onTap: () {
showDialog(
context: context,
builder: (context) => AddingProductsPopup(),
);
},
Please help me to go out from this stuck
based on your full code https://codeshare.io/an0jpv you can achieve that by like following :
now let's define our alert widget
now when the popup shows and based on the received text from
items[i]
the dialog can have deferent titles , and you can add deferent conditions to adjust the content based on the text received from the press item;