Skip to content
This repository has been archived by the owner on Feb 25, 2022. It is now read-only.

Add pkg:go_router_builder #216

Merged
merged 6 commits into from
Dec 15, 2021
Merged

Add pkg:go_router_builder #216

merged 6 commits into from
Dec 15, 2021

Conversation

kevmoo
Copy link
Collaborator

@kevmoo kevmoo commented Dec 3, 2021

Closes #66

Migrated the existing named_routes example to the builder
Updated the related example data model to use int and enum

@csells
Copy link
Owner

csells commented Dec 3, 2021

this is working on my side

@kevmoo
Copy link
Collaborator Author

kevmoo commented Dec 3, 2021

this is working on my side

awesome!

path: 'details/:details',
factory: $PersonDetailsRouteExtension._fromState,
)
])
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missed a trailing comma in my hand-written bits!

'/family/${Uri.encodeComponent(fid)}'
'/person/${Uri.encodeComponent(pid.toString())}'
'/details/${Uri.encodeComponent(_$PersonDetailsEnumMap[details]!)}',
'/family/${Uri.encodeComponent(fid)}/person/${Uri.encodeComponent(pid.toString())}/details/${Uri.encodeComponent(_$PersonDetailsEnumMap[details]!)}',
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to see if there is a smart way to force wrapper on these long ones

void go(BuildContext buildContext) => buildContext.go(location);
}

const _$PersonDetailsEnumMap = {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just moved around!

@@ -66,7 +66,7 @@ class App extends StatelessWidget {
RouteDef<PersonRoute>(
path: 'person/:pid',
children: [
RouteDef(path: 'details/:details'),
RouteDef<PersonDetailsRoute>(path: 'details/:details'),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops! Generator caught this – not me!

@kevmoo kevmoo marked this pull request as ready for review December 7, 2021 19:26
@kevmoo kevmoo changed the title WIP https://github.com/csells/go_router/issues/66 Add pkg:go_router_builder Dec 7, 2021
@kevmoo kevmoo requested a review from csells December 7, 2021 19:29
Closes #66

Migrated the existing named_routes example to the builder
Updated the related example data model to use int and enum
Will make it easier to support other types later
@csells csells merged commit dbf172a into csells:main Dec 15, 2021
csells added a commit that referenced this pull request Dec 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generated extension methods for goNamed and pushNamed
2 participants