2

I have an application where I display a list of cards that represent a model (Let's say a Person). These are stateless widgets as they cannot be changed directly. These instances are obtained from an API and, since the amount of items is large, I am using AutomaticKeepAliveClientMixin to keep them from reloading and triggering more API calls.

When clicked, these cards lead to the Person's page where there we can edit some information on them. Using a StatefullWidget here with setState takes care of all issues related to the page. However, when I pop the individual page the card that was clicked does not reflect the changes made.

I was thinking of writing a ChangeNotifier wrapper for each Person but from what I've read this is a bad idea. Using more powerful state management tools like BLoC or Redux seems like overkill too. How can I implement this properly?

Richard Wilson
  • 297
  • 4
  • 17
Dpac99
  • 21
  • 2

1 Answers1

0

I think you should try:

ontap: () async {
  
 await Navigator.push ....);
 
 ref
}
Nitish
  • 3,075
  • 3
  • 13
  • 28