OnLeaveScope class

Annotation used to mark a method that should be called when leaving a scope.

The method should be inside a class annotated with WeaverScope or WeaverSwitchScope.

Single scope: If you omit OnLeaveScope, the generated handler unregisters dependencies you registered in OnEnterScope. If you add OnLeaveScope, you must unregister (or dispose) those yourself; NamedDependency fields are still cleaned up unless NamedDependency.autoDispose is false.

Switch scope: Same idea per child; omit OnLeaveScope for automatic cleanup when switching away from that child.

Constructors

OnLeaveScope({String? name})
Creates an OnLeaveScope annotation.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
name String?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited