dispose method

  1. @override
void dispose()
override

Implementation

@override
void dispose() {
  super.dispose();
  child?.dispose();
  if (onDispose != null) {
    final handlers = onDispose!;
    for (var i = 0; i < handlers.length; i++) {
      final listener = handlers[i];
      try {
        listener();
      } catch (e, s) {
        throw WrappedException(
            "An error occurred while executing the handler 'dispose' for '$this'",
            e,
            s);
      }
    }
  }
}