Effect
The @SolidEffect() annotation will trigger a side effect whenever the reactive state variables it depends on change.
class EffectExample extends StatelessWidget { EffectExample({super.key});
@SolidState() int counter = 0;
@SolidEffect() void logCounter() { print('Counter changed: $counter'); }
@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: const Text('Effect')), body: Center(child: Text('Counter: $counter')), floatingActionButton: FloatingActionButton( onPressed: () => counter++, child: const Icon(Icons.add), ), ); }}