Home > Enterprise >  How to preserve then action for route pop when replacing routes?
How to preserve then action for route pop when replacing routes?

Time:03-24

So question is a little strange, but I'll try my best to make it clear.

So we have 3 pages:

  1. page with list of customers
  2. customer info page
  3. customer edit page

The flow is you tap on customer in list -> router.push(CustomerInfo).then(_refreshList()) and on Customer Info page we have Edit Customer button which goes to CustomerEdit page like -> router.replace(CustomerEdit)

how can I specify that after poping the CustomerEdit screen and returning to CustomersList Page refresh function goes off?

CodePudding user response:

Executing a function after popping works like so:

Navigator.push().then(functiontThatShouldBeExecuted);
  • Related