3 Comments

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.

Expand full comment

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

Expand full comment

Thanks! I'll look into this. Once again, great article!

Expand full comment