cubepod_state 0.1.3
cubepod_state: ^0.1.3 copied to clipboard
A core component of the CubePod Application Runtime. Provides cubepod_state functionalities.
cubepod_state #
Fine-grained reactive state for CubePod. Built on Signals — only the widgets that actually read a changed value rebuild.
What's inside #
StateSignal<T>— reactive value that notifies listeners on changeAsyncSignal<T>— signal with loading/error/data states for async opsStreamSignal<T>— wraps aStreaminto a reactive signalTransaction— batch multiple signal changes into a single rebuildFormState— reactive form with field-level validation
Install #
dependencies:
cubepod_state: ^0.1.1
Usage #
import 'package:cubepod_state/cubepod_state.dart';
final count = StateSignal(0);
// Read
print(count.value); // 0
// Write
count.value++;
// Listen
count.listen((val) => print('count changed: $val'));
// Batch updates — only one rebuild fires
transaction(() {
count.value = 10;
name.value = 'Alice';
});
See cubepod for the full docs.