Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to pass data thought routes? Like an ID... #3

Closed
darlantc opened this issue Dec 2, 2019 · 1 comment
Closed

How to pass data thought routes? Like an ID... #3

darlantc opened this issue Dec 2, 2019 · 1 comment

Comments

@darlantc
Copy link

darlantc commented Dec 2, 2019

Like:
Get.toNamed("/article/:articleID");

@jonataslaw
Copy link
Owner

Like:
Get.toNamed("/article/:articleID");

You can easily pass data between named routes using arguments. The implementation of named URL segments ": articleID" is nice, but for now not possible due to Dart limitations, version 2.6 will bring extensions, which is a kickoff for this to be possible. However, you can be sure that as soon as you can create this, I will.

While this is not possible, you can do the following:

Get.toNamed('/profile', arguments: {"user_id:"1"})

on Router class:

GetRoute(settings: settings, builder: (_) => Profile(data: settings.arguments));

on Profile class:
class Profile extends StatelessWidget{
final data;
(...)

jonataslaw pushed a commit that referenced this issue Nov 9, 2020
kamazoun added a commit to kamazoundevz/getx that referenced this issue Jan 12, 2021
kamazoun added a commit to kamazoundevz/getx that referenced this issue Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants