I use a ListView.builder in my class to add dynamically contents to the list. I use a controller to keep the bottom focus with controller.jumpTo(controller.position.maxScrollExtent); But I dont know why, it doesn't focus the last item but the one before the last...
here is my fonction that add an item to the list
if(numTeam == 1){
_listAnnonceTeam1.add(nbrPoints);
_controllerAnnonceT1.jumpTo(_controllerAnnonceT1.position.maxScrollExtent);
}
and here is my ListView.builder :
child: ListView.builder(
controller: _controllerAnnonceT2,
itemCount: _listAnnonceTeam2.length,
itemBuilder: (BuildContext context, int index){
return new Text(_listAnnonceTeam2[index].toString(), textAlign: TextAlign.center, style:
TextStyle(color: textColor),);
},
),
do you have any idea why ?