ScopeType enum

Enumeration of bean scope types

Defines the lifecycle and sharing behavior of beans in the DI container.

Inheritance
Available extensions

Values

singleton → const ScopeType

Singleton scope - only one instance is created and shared

The same instance is returned for every injection request. This is the default scope for most use cases.

prototype → const ScopeType

Prototype scope - a new instance is created for each injection

A new instance is created every time the bean is requested. Useful for stateful beans or when you need fresh instances.

request → const ScopeType

Request scope - one instance per request (web applications)

A new instance is created for each HTTP request and shared within that request context. Requires web context support.

session → const ScopeType

Session scope - one instance per session (web applications)

A new instance is created for each user session and shared within that session context. Requires web context support.

application → const ScopeType

Application scope - similar to singleton but explicitly scoped to application

Similar to singleton but with explicit application-level lifecycle.

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
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

Constants

values → const List<ScopeType>
A constant List of the values in this enum, in order of their declaration.