I can't find a method in the package that allows me to reset the cardBuilder index to zero. The index used in the method's callBack never resets to zero, even if the list is dynamically modified.
This means that the entire @Build view has to be rebuilt, but in the context of my MVVM architecture, this poses a problem.
Describe the solution you'd like
The solution would be to be able to reset this callBack (index) to zero without having to rebuild the widget. We would need a utility method accessible via the object, controller or other, to reset this index to zero.
Describe alternatives you've considered
I've explored the possibility of using the key parameter with a UniqueKey() but this has undesirable side effects. For information, the desire to reset to zero via a method is to adapt to Navigation (go_router) which avoids rebuilding Widgets systematically and thus having stacks of pages.
I've explored the possibility with notifyListeners that rebuild Widgets, but the problem is that the index persists for the lifetime of the component. The callBack, although rebuilt, will not reset to zero.
CodecardsBuilder: (BuildContext context, int index)
Appinio Swiper
I can't find a method in the package that allows me to reset the cardBuilder index to zero. The index used in the method's callBack never resets to zero, even if the list is dynamically modified.
This means that the entire @Build view has to be rebuilt, but in the context of my MVVM architecture, this poses a problem.
Describe the solution you'd like The solution would be to be able to reset this callBack (index) to zero without having to rebuild the widget. We would need a utility method accessible via the object, controller or other, to reset this index to zero.
Describe alternatives you've considered
I've explored the possibility of using the key parameter with a UniqueKey() but this has undesirable side effects. For information, the desire to reset to zero via a method is to adapt to Navigation (go_router) which avoids rebuilding Widgets systematically and thus having stacks of pages.
Code
cardsBuilder: (BuildContext context, int index)