# BootstrapInstanceSupplier<T> class abstract

A supplier that can create instances based on a BootstrapContext, with optional scoping support.

This abstraction supports two main use cases:

- Supplying constant instances via of
- Supplying dynamic instances via a factory from

The default scope is ScopeType.SINGLETON.

Example:

    final supplier = InstanceSupplier.from(() => MyService());
    final instance = supplier.get(context);

Annotations
  - @Generic(BootstrapInstanceSupplier)

## Constructors

BootstrapInstanceSupplier.new()
  A supplier that can create instances based on a BootstrapContext, with optional scoping support.
  const

## Properties

hashCode → int
  The hash code for this object.
  no setter inherited
runtimeType → Type
  A representation of the runtime type of the object.
  no setter inherited
scope → ScopeType
  The scope of the supplied instance.
  no setter

## Methods

get(BootstrapContext context) → T
  Factory method used to create the instance.
noSuchMethod(Invocation invocation) → dynamic
  Invoked when a nonexistent method or property is accessed.
  inherited
toString() → String
  A string representation of this object.
  inherited
withScope(ScopeType newScope) → BootstrapInstanceSupplier<T>
  Returns a new BootstrapInstanceSupplier with a different scope.

## Operators

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

## Static Methods

from<T>(T supplier()) → BootstrapInstanceSupplier<T>
  Creates a supplier from a function that returns a new instance.
of<T>(T instance) → BootstrapInstanceSupplier<T>
  Creates a supplier that always returns the same `instance`.