1

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

wahyu
  • 1,679
  • 5
  • 35
  • 73

1 Answers1

0

you can use AutomaticKeepAliveClientMixin to save the state of app.

@override // TODO: implement wantKeepAlive bool get wantKeepAlive => true;

using this constuctor.