New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getx update not trigger ui refresh in time #3077
Comments
should not be a problem onSelectedPetak(String petak) async {
columns = [];
rows = [];
update(); // << update getbuilder, remove listview to 0
List<PetakModel> data = await storageController.getDataPetak(
selectedDatabase, petak, selectedRph);
Map json = data[0].toJson();
for (var e in json.entries) {
if (disableColumns.contains(e.key)) continue;
columns.add(DataColumn(label: Text(e.key)));
}
for (int i = 0; i < data.length; i++) {
var d = data[i];
Map j = d.toJson();
var cell = <DataCell>[];
for (var e in j.entries) {
if (disableColumns.contains(e.key)) continue;
cell.add(DataCell(Text(e.value)));
}
rows.add(
DataRow(
selected: i.isEven,
cells: cell,
),
);
}
update(); // << update getbuilder listview is now have a length
} this code work good |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As code below, ui will refresh after about 5 seconds. But it should refresh immediately. When comment out those heavy work linnes, refresh is normal.
example demo: https://github.com/86chenjie/getx_update_issue
The text was updated successfully, but these errors were encountered: