You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When displaying different data on the same page, I was wondering how you usually implement it?
For example, going from user profile page A -> user profile page B -> user profile page C,
Do I need to create a controller for each user, like A ProfileController, B ProfileController, C ProfileController?
Currently I'm trying to create 3 controllers, each with a userId in the Controller's tag, but I'm having some issues.
The problem here is the value that Get.arguments returns.
user profile Page A -> user profile Page B -> user profile Page C -> other Page D
If I change the values on page A in page D, the Get.arguments in the GetView on page A will return the arguments values on page D.
As a result, the GetView on page A will not find the correct ProfileController.
// Routing from Page C to Page D
Get.toNamed("/other", arguments: {"other": "something"})
// Change values from page A on page D
final controller = Get.find<ProfileController>(tag: A);
controller.changeValue();
// GetView on page A
final argument = Get.arguments; // {"other": "something"}
GetInstance().find(tag: Get.arguments); // FAIL
This makes it difficult to separate controllers by tag using arguments. because Get.argument is a global variable.
Please tell me the best case when changing to different data on the same page.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
When displaying different data on the same page, I was wondering how you usually implement it?
For example, going from
user profile page A
->user profile page B
->user profile page C
,Do I need to create a controller for each user, like
A ProfileController
,B ProfileController
,C ProfileController
?Currently I'm trying to create 3 controllers, each with a userId in the Controller's tag, but I'm having some issues.
ex)
Then, I modified GetView to look for a controller that fits the Tag.
The problem here is the value that Get.arguments returns.
user profile Page A
->user profile Page B
->user profile Page C
->other Page D
If I change the values on page A in page D, the Get.arguments in the GetView on page A will return the arguments values on page D.
As a result, the GetView on page A will not find the correct ProfileController.
This makes it difficult to separate controllers by tag using arguments. because Get.argument is a global variable.
Please tell me the best case when changing to different data on the same page.
Thank you
Similar Issue - #939
Beta Was this translation helpful? Give feedback.
All reactions