ZuraffaContainer class
Lightweight dependency-injection container for zuraffa.
Replaces manual get_it setup. Populated by the generated
zuraffa_injection.g.dart file.
final container = ZuraffaContainer.instance;
final repo = container.resolve<ProductRepository>();
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
isRegistered<
T> () → bool -
Whether type
Tis registered. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerFactory<
T> (T factory()) → void -
Register a factory for type
T. -
registerInstance<
T> (T instance) → void - Register an instance directly (useful for testing/mocking).
-
registerLazySingleton<
T> (T factory()) → void -
Register a lazy singleton for type
T. -
registerSingleton<
T> (T factory()) → void -
Register a singleton for type
T. -
reset(
) → void - Clear all registrations. Primarily for testing.
-
resolve<
T> () → T -
Resolve a dependency of type
T. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → ZuraffaContainer
-
final