AlreadyInitializedError class

An error indicating that an attempt was made to initialize an object that has already been initialized.

This error is typically thrown in singleton or other similar design patterns where an object's initialization is meant to occur only once during the application lifecycle. It prevents multiple initializations which could lead to inconsistent states or overwrite important setup configurations.

Example usage:

if (_isInitialized) {
  throw AlreadyInitializedError();
}
Inheritance

Constructors

AlreadyInitializedError()
Creates an instance of AlreadyInitializedError.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stackTrace StackTrace?
The stack trace at the point where this error was first thrown.
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.
override

Operators

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