removeStateHandlers method

void removeStateHandlers (
  1. Object target
)

Remove any state handlers which have been attached by target.

Implementation

void removeStateHandlers(Object target) {
  if (_stateHandlerMap.containsKey(target.runtimeType)) {
    final handlers = _stateHandlerMap[target.runtimeType];
    for (var handler in handlers) {
      handler.cancel();
    }
  } else {
    throw Exception('No handlers registered for ${target.runtimeType}');
  }
}