flutterdartflutter-change-notifier

Builder widget for ChangeNotifier in Flutter


Background

Question

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