Page state vs Page parameters and when to use what?

Actions & Logic

I have a Users page where a list of users are shown and upon clicking on a user it navigates to UserDetails page where all the details of corresponding user are displayed.

I'm using a page parameter to pass the user object from Users to UserDetails page.

In the UserDetails page we can edit the info on click of a FAB, which brings up a bottom sheet component where the user details from page parameter are populated by passing it a as a component parameter.

I could update the user info and make a API call to update the user details in the backend.

However, when the bottomsheet is closed, updated user info is not reflecting in the UserDetails page.

I know that bottomsheet can return a value and page state on UserDetais can be set with the returned object. But not sure how to efficiently use it.

Could someone please explain,

a) should we use page state in this usecase? also explain why?

b) please give other appropriate usecases of using page state?

c) if I have to show the user info from page state, it would be null when the page is loaded. how to handle it?

d) any better/efficient way to implement this?

Thanks in advance.

What have you tried so far?

Not sure how to fix this?

Did you check FlutterFlow's Documentation for this topic?
Yes
1
9 replies