I would like to know the index of the top visible widget in my ListViewBuilder
======================================
At this point I should get index 12
At this point I should get index 21
class XXX extends StatelessWidget {
const XXX({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Test')),
body: ListView.builder(
reverse: true,
itemCount: 50,
itemBuilder: (context, index) {
return Container(
color: index.isEven ? Colors.amber : Colors.yellow,
padding: EdgeInsets.all(12),
child: Text("HELLO $index"),
);
}),
);
}
}