Singleton class

Classes annotated with @Singleton will generate registerSingleton function

Inheritance
Annotations
  • @Target.new({TargetKind.classType, TargetKind.method, TargetKind.getter})

Constructors

Singleton({bool? signalsReady, List<Type>? dependsOn, Function? dispose, Type? as, List<String>? env, String? scope, int? order})
default constructor
const

Properties

as Type?
The type to bind your implementation to, typically, an abstract class which is implemented by the annotated class.
finalinherited
cache bool
whether to cache the instance created by this injectable. Only applicable for factory registrations.
finalinherited
dependsOn List<Type>?
passed to dependsOn property in registerSingleton function
final
dispose Function?
a dispose callback function to be passed to GetIt the signature must match FutureOr dispose(T)
final
env List<String>?
an alternative way to pass env keys instead of annotating the element with @Environment
finalinherited
hashCode int
The hash code for this object.
no setterinherited
order int?
an alternative way to pass position order instead of annotating the element with @Order
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scope String?
an alternative way to pass position scope instead of annotating the element with @Scope
finalinherited
signalsReady bool?
passed to singlesReady property in registerSingleton function
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