context_watch_getx 3.0.2 copy "context_watch_getx: ^3.0.2" to clipboard
context_watch_getx: ^3.0.2 copied to clipboard

context_watch adapter for 'get' package

See https://pub.dev/packages/context_watch

Usage #

Add GetxContextWatcher.instance to additionalWatchers of ContextPlus.root:

ContextPlus.root(
  additionalWatchers: [
    GetxContextWatcher.instance,
  ],
  child: ...,
);
copied to clipboard

Observe GetX's Rx values with Rx.watch(context) or Rx.watchOnly(context, () => ...), without wrapping anything with Obx:

final _counter = Rx(0);

class Example extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    final counter = _counter.watch(context);
    return Text('Counter: $counter');
  }
}
copied to clipboard
1
likes
150
points
211
downloads

Publisher

verified publishersonerik.dev

Weekly Downloads

2024.10.03 - 2025.04.17

context_watch adapter for 'get' package

Repository (GitHub)

Topics

#context-watch #get #integration #reactive #state-management

Documentation

API reference

License

MIT (license)

Dependencies

context_watch_base, flutter, get

More

Packages that depend on context_watch_getx