1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Widget build(BuildContext context) { final items = List<String>.generate(50, (i) => "Item $i");
ScrollController _controller = ScrollController();
SchedulerBinding.instance.addPostFrameCallback((_) { _controller.jumpTo(_controller.position.maxScrollExtent); });
return Scaffold( body: SafeArea( child: ListView.builder( controller: _controller, itemCount: items.length, itemBuilder: (context, index) { return ListTile( title: Text('${items[index]}'), ); }, ), )); }
|