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.
Asked
Active
Viewed 157 times
0
-
Please provide enough code so others can better understand or reproduce the problem. – Community Dec 15 '21 at 04:59
1 Answers
0
Use ignoreChange
.
Demo code:
StoreConnector<AppState, MyViewModel>(
distinct: true,
ignoreChange: (state) {
return state.someVariable == theValueYouDontCare;
},
...
),

聂超群
- 1,659
- 6
- 14