用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/rodydavis/signals.dart --skill signals-hooks命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| 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.