notifyObservers method

dynamic notifyObservers(
  1. List<String> stateNames, {
  2. String? notifyName,
  3. Map? map,
})

Used in the page that sent the notification stateNames state name to update Map notification data, can be null

Implementation

notifyObservers(List<String> stateNames, {String? notifyName,Map? map}) {
  if (stateNames.length == 0) {
    for (int i = observers.length - 1; i >= 0; i--) {
      observers[i].update(this, notifyName,map);
    }
  } else {
    stateNames.forEach((stateName) {
      for (int i = observers.length - 1; i >= 0; i--) {
        if (stateName == observers[i].runtimeType.toString()) {
          observers[i].update(this,notifyName, map);
        }
      }
    });
  }
}