FlutterSignal<T>.lazy constructor

FlutterSignal<T>.lazy({
  1. SignalOptions<T>? options,
  2. @Deprecated('Use options: SignalOptions(autoDispose: ...) instead') bool? autoDispose,
  3. @Deprecated('Use options: SignalOptions(name: ...) instead') String? debugLabel,
  4. bool runCallbackOnListen = false,
})

Lazy signal that can be created with type T that the value will be assigned later.

final db = FlutterSignal.lazy<DatabaseConnection>();
...
db.value = DatabaseConnect(...);

Implementation

FlutterSignal.lazy({
  super.options,
  @Deprecated('Use options: SignalOptions(autoDispose: ...) instead')
  super.autoDispose,
  @Deprecated('Use options: SignalOptions(name: ...) instead')
  super.debugLabel,
  this.runCallbackOnListen = false,
}) : super.lazy();