Closed sokarcreative closed 4 years ago
I'll try to give you some general advice:
1) Redux will know when to rebuild a widget when the view model changes. For this to work, the view model's ==
must return false when it compares the current view model to the previous one and they are different. If the view model's ==
is not working as it should, it may not rebuild the widgets.
2) The view model's ==
will compare some state. This means the state's ==
must also be working as it should. For example, your ViewState
class and your Sheet
class must be immutable, and they must actually return false when you compare different objects.
Question: Are you sure your ViewState
class and your Sheet
class are immutable? Your actions must create new objects, and not mutate the existing ones.
If you can't find the problem by yourself, it's really difficult for me to help unless you provide a minimum runnable code, in a single file, with a main method.
Hi,
I'm new in Flutter and I really like this library, very intuitive and easy to use indeed. However I'm facing an issue when I'm using a StoreConnector for each view of a GridView which is himself affected by a StoreConnector when data list changed.
I have in my flutter app a tab for favorites and his screen shows a gridView of items (Sheets)
favorites_view_model.dart
For each view inside my GridView, I'm using this SheetViewModel :
sheet_view_model.dart
The widgets (I'm using this file in favorites screen and list screen) :
gridview_sheets_widget.dart
Some sheets (items) are not showing the correct sheet view when updating the GridView. It's like StoreConnector of each view was cached and not refreshed with the new sheet (item). I'm using GridView Builder.
Any help would be appreciated.