LogoSignals.dart
Copy Markdown
rodydavis/signals.dart 999999

Type: FlutterSignal

API reference and details for FlutterSignal from signals.dart.

FlutterSignal#

Kind: class  |  Package: package:signals_flutter

Class: FlutterSignal#

A mutable, reactive state cell that exposes both standard Signals and Flutter ValueNotifier interfaces.

FlutterSignal extends the core Signal class and mixes in ValueNotifierSignalMixin, making it completely interoperable with Flutter's build pipelines and widgets that expect a ValueNotifier or ValueListenable.

Example Usage#

final count = signal(0);

// Interoperates with native ValueListenable listeners:
count.addListener(() {
  print('ValueNotifier update: ${count.value}');
});

count.value++; // Mutates the signal and triggers both Signals and ValueNotifier listeners.

Members of FlutterSignal#

Member Type Signature Description
FlutterSignal constructor dart FlutterSignal(super.internalValue, {super.options, @Deprecated('Use options: SignalOptions(autoDispose: ...) instead') super.autoDispose, @Deprecated('Use options: SignalOptions(name: ...) instead') super.debugLabel, this.runCallbackOnListen = false}) Simple writeable signal.
FlutterSignal.lazy constructor dart FlutterSignal.lazy({super.options, @Deprecated('Use options: SignalOptions(autoDispose: ...) instead') super.autoDispose, @Deprecated('Use options: SignalOptions(name: ...) instead') super.debugLabel, this.runCallbackOnListen = false}) Lazy signal that can be created with type T that
runCallbackOnListen field dart bool runCallbackOnListen

References#

The FlutterSignal type is referenced and used in the following pages: