Scope class

Scope annotation for controlling bean lifecycle

Specifies the scope of a bean, determining when and how many instances are created.

Example:

@Service()
@Scope(ScopeType.singleton)
class ConfigurationService {
  // Single instance shared across the application
}

@Service()
@Scope(ScopeType.prototype)
class RequestProcessor {
  // New instance created for each injection
}
Implementers

Constructors

Scope(ScopeType value)
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value ScopeType
The scope type for the bean
final

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