Search packages, repositories and app categories

Package detailsv7.0.3

context_watch

A hassle-free way to watch for observable value changes within the `build` method.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
18.6K
Likes
43
Pub points
150

Install package

flutter pub add context_watch

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

context_watch is a lightweight Flutter package that simplifies observing changes to reactive values directly within the build method. It enables developers to watch for state updates without manually managing listeners or using complex state management solutions. By leveraging context, it provides a clean and intuitive way to react to changes in observable data, improving code readability and reducing boilerplate. Ideal for small to medium-scale apps where minimal setup is preferred.

Use cases

  • Real-time UI updates based on state changes
  • Simplifying state observation in widget trees
  • Reducing boilerplate in stateful widgets
  • Lightweight alternative to full state management
  • Watching reactive values in build methods

Key features

  • Minimal setup with no additional dependencies
  • Automatic listener management
  • Clean syntax within build method
  • Supports all major platforms
  • Integrates seamlessly with existing Flutter code

Suitable for

  • Developers seeking simple state observation
  • Projects avoiding heavy state management
  • Widgets needing reactive updates
  • Prototyping and small applications
  • Those preferring concise, readable code

Considerations

  • Not suitable for large-scale state management
  • Limited to watching values via context
  • Does not replace full state management solutions
  • Requires understanding of Flutter's build context
  • Best used alongside other state management patterns

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

icon.png
context_plus

showcase

A set of packages that provide a convenient way to propagate a value from a parent widget to its descendants and observe changes to any observable value.

Packages

Package Pub Description
context_watch context_watch .watch(context)
.watchOnly(context, () => ...)
.watchEffect(context, () => ...)

for Listenable, Future, Stream
context_ref context_ref Ref.bind(context, () => ...)
Ref.bindLazy(context, () => ...)
Ref.bindValue(context, ...)
Ref.of(context)
context_plus context_plus All of context_watch
All of context_ref

+

.watch(context)
.watchOnly(context, () => ...)
.watchEffect(context, () => ...)

for Ref<Listenable>, Ref<Future>, Ref<Stream>

Integrations

Package Pub Description
context_watch_bloc context_watch_bloc .watch(context)
.watchOnly(context, () => ...)
.watchEffect(context, () => ...)

for Bloc and Cubit
context_watch_mobx context_watch_mobx .watch(context)
.watchOnly(context, () => ...)
.watchEffect(context, () => ...)

for Observable
context_watch_getx context_watch_getx .watch(context)
.watchOnly(context, () => ...)
.watchEffect(context, () => ...)

for Rx
context_watch_signals context_watch_signals .watch(context)
.watchOnly(context, () => ...)
.watchEffect(context, () => ...)

for Signal

Categories

Dependencies

Dependency list 3 items

  • context_plus_core^1.0.2
  • context_watch_base^8.0.3
  • meta^1.9.1

Source repository

Projects using this package

No data available yet.