Search code examples
flutterdartflutter-change-notifier

Builder widget for ChangeNotifier in Flutter


Background

  • A ValueNotifier has a ValueListenableBuilder widget.
  • A Stream has a StreamBuilder widget.
  • A Future has a FutureBuilder widget.

Question

  • What is the builder for ChangeNotifier?

What I tried

I tried using a ValueListenableBuilder with ChangeNotifier but ChangeNotifier doesn't implement ValueListenable.

I know I could use ChangeNotifierProvider from the Provider package, but I'd like to know if there is a solution that doesn't require a third-party package.


Solution

  • As of today, AnimatedBuilder is renamed and update as ListenableBuilder

    Hope documents will be updated soon but you can see related issue and examples here https://github.com/flutter/flutter/pull/116543/files