You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
class MyHomePageController extends GetxController {
int count = 0;
increment() {
count += 1;
update();
// some heavy work
for (int i=0;i<5;i++) {
final pair = generateRSAkeyPair(exampleSecureRandom());
final public = pair.publicKey;
final private = pair.privateKey;
}
}
}
onSelectedPetak(String petak) async {
columns = [];
rows = [];
update(); // << update getbuilder, remove listview to 0List<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
}
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: