0

I'm facing a problem that I can't solve. There are two StoreConnectors on different screens, which are tied to 1 state. How can I make it so that when the second StoreConnector is rendered, the first one is not rebuilt? In Bloc this could be done using the buildWhen property of BlocBuilder.

1 Answers1

0

Use ignoreChange.

Demo code:

StoreConnector<AppState, MyViewModel>(
     distinct: true,
     ignoreChange: (state) {      
         return state.someVariable == theValueYouDontCare;
     },
     ...
 ),
聂超群
  • 1,659
  • 6
  • 14