removeListener static method

void removeListener(
  1. String key,
  2. VoidCallback listener
)

Removes a listener for a specific state key.

key is the identifier for the state. listener is the callback function to be removed.

Implementation

static void removeListener(String key, VoidCallback listener) {
  _listeners[key]?.remove(listener);
}