一键导入
signals-hooks
// Comprehensive hook utility functions integrating reactive signals seamlessly with flutter_hooks.
// Comprehensive hook utility functions integrating reactive signals seamlessly with flutter_hooks.
Highly optimized Flutter UI bindings and GPU rendering for reactive signals.
Comprehensive reactive state hooks for integration with flutter_hooks.
Standardized compiler diagnostics, static analysis lints, and automated IDE quick-fixes.
Review the current Jaspr docs, audit source code doc comments, edit the source code, and run the generator script to verify docs updates.
Update all the `./examples` dependencies to the latest repository/third-party versions and fix any compiler or analysis issues.
Detailed guidelines, patterns, and rules for migrating codebases from signals.dart version 6.x to version 7.x.
| name | signals_hooks |
| description | Comprehensive hook utility functions integrating reactive signals seamlessly with flutter_hooks. |
This skill provides comprehensive instructions and reference guidelines for utilizing signals_hooks package in Flutter applications. It integrates signals_flutter reactivity with the dynamic widget-state lifecycles of flutter_hooks.
In signals.dart v7, all hooks have been migrated to use a clean positional Options pattern instead of verbose named parameters. The positional parameters are structured as [keys, options]. To supply options (like name, autoDispose, or equality inside classes like SignalOptions, AsyncSignalOptions, or ListSignalOptions), they must be passed as the second positional optional argument, with the keys dependency list passed as the first positional optional argument (e.g., useSignal(value, const [], SignalOptions(name: 'counter'))).
| Hook Name | Options Type | Description |
|---|---|---|
| useSignal | SignalOptions | Wraps a standard mutable Signal bound to the hook state lifecycle. |
| useComputed | ComputedOptions | Creates a read-only Computed signal that caches computed values and tracks changes. |
| useSignalEffect | - | Registers a side-effect callback that automatically disposes when the hook unmounts. |
| useExistingSignal | - | Safely binds an existing, external signal to automatically rebuild the widget on change. |
| useSignalValue | - | Directly extracts and watches the value of a signal, returning the unwrapped T value. |
| useFutureSignal | AsyncSignalOptions | Triggers an asynchronous callback and returns its result wrapped in a FutureSignal. |
| useStreamSignal | AsyncSignalOptions | Subscribes to a Stream and exposes its events via a StreamSignal. |
| useAsyncSignal | AsyncSignalOptions | Wraps an asynchronous task state inside a manageable AsyncSignal. |
| useAsyncComputed | AsyncSignalOptions | Creates a reactive computed signal driven by an asynchronous callback. |
| useValueNotifierToSignal | SignalOptions | Bridges a standard Flutter ValueNotifier to a mutable reactive Signal. |
| useValueListenableToSignal | SignalOptions | Bridges a standard Flutter ValueListenable to a read-only ReadonlySignal. |
| useListSignal | ListSignalOptions | Creates a reactive ListSignal for list collections. |
| useSetSignal | SetSignalOptions | Creates a reactive SetSignal for set collections. |
| useIterableSignal | IterableSignalOptions | Creates a reactive IterableSignal for iterable collections. |
| useMapSignal | MapSignalOptions | Creates a reactive MapSignal for key-value collections. |
| useTrackedSignal | TrackedSignalOptions | Creates a TrackedSignal that remembers its previous values. |
| useQueueSignal | QueueSignalOptions | Creates a reactive QueueSignal for queue collections. |
| useChangeStackSignal | ChangeStackSignalOptions | Creates a ChangeStackSignal that manages undo/redo history. |
| useLinkedSignal | LinkedSignalOptions | Creates a writable computed LinkedSignal bridging two signals. |
| useLazySignal | SignalOptions | Creates a LazySignal initialized lazily on first access. |
name or autoDispose) directly to hooks. Always wrap them in the positional Options parameter.keys (list of dependencies), and the second positional optional parameter is options (the options configuration object).signals_hooks automatically disposes all created signals and effects when the widget is unmounted, preventing memory leaks.