-1
hello guys I’m trying to get data from a site api(own server) and so show the new data in the application as soon as the site makes an update with new information, thus adding a new line and keeping the data old, I tried to use the listview
, but I couldn’t because only the new line appears and the others disappear.
if (snapshot.data != null && snapshot.data != oldSnapshot) {
oldSnapshot = snapshot.data;
return ListView.separated(itemBuilder: (_, index) => Text('Volta :' +
snapshot.data.lap.toString() +
' Velocidade :' +
snapshot.data.vel.toString() +
' Tempo :' +
snapshot.data.datetime.toString()),
separatorBuilder: (_, int i) => Divider(),
itemCount: 28,
controller: controller,
);
Show more of your code, just with this part we can’t help you in much... How are you getting the data from the API? Does the API use Socketio or something so you can listen to changes in real time? Your API returns record by record or all at once? Edita your question and give us more information expensive.
– Matheus Ribeiro