update method

void update([
  1. List<Object>? ids,
  2. bool condition = true
])

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 {
    // Use a Set to avoid duplicate ids and improve lookup time
    final uniqueIds = ids.toSet();
    for (final id in uniqueIds) {
      refreshGroup(id);
    }
  }
}