In this blog, we are going to take a look at ListenableBuilder, which is available in Flutter 3.10 (master) and we will learn When we should use ListenableBuilder.
What do I use if I want to change the button state based on multiple text controllers? Is there something that can listen to changes from multiple values? For eg. I want the button to be enabled only if both username and password textfields are non-empty.
Maybe you can try Listenable.merge(List<Listenable?> listenables) constructor where you can create list of all controller and whenever something is update you check the logic to enable/disable button.
Very informative article! But I have a doubt.
What do I use if I want to change the button state based on multiple text controllers? Is there something that can listen to changes from multiple values? For eg. I want the button to be enabled only if both username and password textfields are non-empty.
Maybe you can try Listenable.merge(List<Listenable?> listenables) constructor where you can create list of all controller and whenever something is update you check the logic to enable/disable button.
https://api.flutter.dev/flutter/foundation/Listenable/Listenable.merge.html
Thanks! I'll look into this. Once again, great article!