is there a way to prevent setState to rebuild? because I have to show my state inside widget Text
but whenever I click another tab and back again to my main screen... the state always re-build and I am getting null
Asked
Active
Viewed 814 times
1

wahyu
- 1,679
- 5
- 35
- 73
-
no, it is not possible – pskink Apr 22 '20 at 09:46
-
is there another method, so that whenever I click another tab... I can still access my last data – wahyu Apr 22 '20 at 09:50
-
i have no idea what tab you mean – pskink Apr 22 '20 at 09:54
-
I have bottom tab navigator in my screen.. so I am doing setState in my first tab screen, and whenever I click my bottom tab... setState always rebuild and I can not get my data – wahyu Apr 22 '20 at 09:59
-
1Sounds like you want to read https://stackoverflow.com/questions/52249578/how-to-deal-with-unwanted-widget-build – Rémi Rousselet Apr 22 '20 at 11:21
-
Are you using a PageView by any chance? Could we see your widget tree to get some context? – Apps 247 Jun 02 '21 at 06:47