How to change value of variable without using setState

I want to listen input value from textFieldForm. i have used to change value if input is greater than 1. i am using controller. and with controller checking condition. but i want to change value without setState

Hello, could you share the relevant part of your code, and add more information about how are you using that variable you want to change, and why? From what you wrote I can hardly figure all that out, and understand if and how I could help.

2 Likes

Use BLoC pattern to update the variable without setState

One other possible solution could be to use Provider package.
It provides the ability to re-build a widget without using setState and you can choose which widget / which part of the widget tree to re-build based on your changes.
This video explains the usage of Provider package in its basic form, it can be extended to meet your requirements and use cases.