40
loading...
This website collects cookies to deliver better user experience
final list = List.generate(20, (index) => 'Item $index');
body: Center(
child: ListView.builder(
itemCount: list.length,
itemBuilder: (context, index) {
return ListTile(
title: Text(list[index]),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => RouteTwo(
item: list[index],
),
),
);
},
);
},
),
),
item: list[index]
.final String item;
RouteTwo({Key? key, required this.item}) : super(key: key);
Text(
'You clicked on: $item',
style: TextStyle(fontSize: 32),
),