update method
Rebuilds the associated GetBuilder
widgets.
Calling update()
will trigger a rebuild of all associated GetBuilder
widgets unless a list of ids
is provided, in which case only the GetBuilder
widgets with matching ids will be rebuilt.
The condition
parameter determines whether the rebuild should occur.
If condition
is false
, no rebuild will be triggered.
Implementation
void update([List<Object>? ids, bool condition = true]) {
if (!condition) return;
if (ids == null) {
refresh();
} else {
final uniqueIds = ids.toSet(); // Use a Set to avoid duplicate ids
for (final id in uniqueIds) {
refreshGroup(id);
}
}
}