SignalProvider<T extends FlutterReadonlySignal> constructor

const SignalProvider<T extends FlutterReadonlySignal>({
  1. Key? key,
  2. required T create(),
  3. Widget? child,
  4. void dispose(
    1. T
    )?,
})

Creates a SignalProvider that manages the lifecycle of a created signal.

The create callback is invoked once to instantiate the signal. When this provider is unmounted, it automatically calls dispose() on the signal.

Implementation

const SignalProvider({
  super.key,
  required T Function() create,
  this.child,
  this.dispose,
}) : _create = create,
     _value = null;