원클릭으로
signals-dart
// Advanced reactive state primitives, collections, mixins, and utilities of signals_core.
// Advanced reactive state primitives, collections, mixins, and utilities of signals_core.
| name | signals-dart |
| description | Advanced reactive state primitives, collections, mixins, and utilities of signals_core. |
This skill details advanced state management primitives, reactive collections, async features, and value options semantics in signals_core.
| Related File | Description |
|---|---|
| signal.md | Standard writeable reactive state primitive containing value accessors, mutation mechanics, and basic custom options. |
| computed.md | Lazy, memoized read-only derived state signal tracking reactive dependencies dynamically. |
| effect.md | Synchronous observer managing active subscription loops, dynamic dependency updates, and lifecycle teardown. |
| readonly.md | Read-only signal views ensuring unidirectional data access flows. |
| batch.md | Transactional state mutation blocks optimizing reactive computations and preventing rendering/recompute churn. |
| Related File | Description |
|---|---|
| future_signal.md | Single-evaluation asynchronous future state representation resolving the double-evaluation issue. |
| stream_signal.md | Dynamic, lifecycle-safe, self-disposing stream listener mapping to async loading/data/error states. |
| async_signal.md | Unifying async state container mapping loading, success data, and failure error states cleanly. |
| computed_async.md | Composable asynchronous operations built over reactive signals with active race condition protection. |
| computed_from.md | State aggregator signal merging multiple async signals into a single unified result. |
| Related File | Description |
|---|---|
| list_signal.md | Optimized list wrapper proxying standard operations to support element-level reactivity. |
| set_signal.md | Custom set wrapper ignoring duplicates and notifying on unique mutations. |
| map_signal.md | Granular map wrapper supporting isolated dictionary element lookup triggers. |
| iterable_signal.md | Iterable wrapper mapping custom lazy traversals to dynamic subscription layers. |
| queue_signal.md | Double-ended queue wrapper supporting optimized reactive pipeline structures. |
| Related File | Description |
|---|---|
| linked_signal.md | Writable computed signals supporting manual override resets and custom equivalence checks. |
| tracked_signal.md | State history wrapper enabling clean out-of-the-box undo/redo mechanisms. |
| timer_signal.md | Periodically emitting stopwatch signal with built-in pause, resume, and reset. |
| connect.md | Dynamic event connector feeding multiple external data pipelines into single targets. |
The signals library exposes five core functions which are the building blocks to model any reactive business logic.
signal(initialValue)Creates a new mutable signal container. You read a signal's value or subscribe to updates by accessing .value.
final counter = signal(0);
print(counter.value); // 0
counter.value = 1; // Mutates value and schedules dependent updates
.peek()Reads a signal's current value without subscribing to its mutations.
final counter = signal(0);
final logCount = signal(0);
effect(() {
print(counter.value);
// Read using peek to avoid subscribing/triggering loop
logCount.value = logCount.peek() + 1;
});
untracked(fn)Executes a callback that reads signals without subscribing to any of them.
final counter = signal(0);
final count = signal(0);
effect(() {
print(counter.value);
count.value = untracked(() => count.value + 1);
});
computed(fn)Combines the values of multiple signals into a lazy, memoized derived signal.
final first = signal('John');
final last = signal('Doe');
final fullName = computed(() => '${first.value} ${last.value}');
print(fullName.value); // John Doe
effect(fn)Orchestrates immediate synchronous side effects by running a callback and subscribing to any signals read within it.
final name = signal('Jane');
final dispose = effect(() => print('Hello $name'));
dispose(); // Clean up subscription
batch(fn)Groups multiple signal writes into a single transaction, executing all dependent computed evaluations and effects exactly once at the end.
final a = signal(0);
final b = signal(0);
batch(() {
a.value = 1;
b.value = 2;
});
linkedSignal)A writable computed signal (LinkedSignal) provides a derived default value that can be overridden manually, resetting back to the derived default whenever its upstream dependencies mutate.
// Basic reset shorthand:
final size = signal('M');
final selection = linkedSignal(() => size.value);
// Advanced structural comparison:
final user = signal((id: 1, name: 'Alice'));
final name = linkedSignal<String, ({int id, String name})>(
() => user.value,
options: LinkedSignalOptions(
computation: (u, prev) {
if (prev != null && prev.source.id == u.id) {
return prev.value; // Retain manual override
}
return u.name; // Reset on ID changes
},
),
);
Always use specialized collections (listSignal, setSignal, mapSignal, etc.) to wrap collections to ensure optimized mutations (only triggering updates when elements actually change).
final list = listSignal([1, 2], options: ListSignalOptions(autoDispose: true));
list.add(3); // Reacts to changes
FutureSignal inherits directly from AsyncSignal to bypass Stream subscription overhead and tracks its dependencies manually via computed execution, executing future computations exactly once (avoiding double-evaluation loops).
final search = signal('');
final results = futureSignal(() => fetchResults(search.value));
All signal option objects support full value semantics (copyWith, custom equality, and hashCode overrides) for flexible copying and accurate comparisons:
SignalOptionsComputedOptionsAsyncSignalOptionsLinkedSignalOptionsListSignalOptions / SetSignalOptions / MapSignalOptionsHighly optimized Flutter UI bindings and GPU rendering for reactive signals.
Comprehensive hook utility functions integrating reactive signals seamlessly with flutter_hooks.
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.