Comments (7)
I also think there should be an optional way to name routes via the annotations.
@MaterialRoute(name = `/foo/bar`)
MyFancyRoute foo;
from auto_route_library.
@kuhnroyal @rebaz94 until now I didn't consider flutter web as I haven't had the chance to temper with it yet. So thanks for bringing that to my attention.
so the idea I have in mind right now is to first make auto-generated route names URL-friendly (kabab cased) by default and also add an optional route name in all route annotations as @kuhnroyal suggested.
@MaterialRoute(name: 'my-route-name')
Thank you both for taking the time to help make auto_route better.
from auto_route_library.
Hey @rebaz94. I'm not sure I understand your question.
You can actually name your route anything you want.
HomeScreen myWhateverHomeScreenRouteName;
from auto_route_library.
Hey @kuhnroyal, can you explain where is that useful?
I'm generally aiming for less boilerplate code.
I'm planning to add a global optional prefix/suffix, would that satisfy what you have in mind?
@AutoRouter(namePrefix: 'myPrefix', nameSuffix: 'mySuffix')
class $MyRouter{}
from auto_route_library.
I am think about flutter web and readable URL like route names.
from auto_route_library.
@Milad-Akarie Yes I know this way, but there should be an option to set custom name.
For example if I want to set route name to be /edit-screen
thats not possible now because we can't do EditScreen edit-screen
, and as @kuhnroyal suggested for readability name of web routes
from auto_route_library.
@rebaz94 @kuhnroyal
added in v0.2.2
Auto-generated route names are now url-friendly
homePage => '/home-page'
you can also pass custom names for all route types as follows
@MaterialRoute(name: 'your-custom-path-name')
Thanks for your time.
from auto_route_library.
Related Issues (20)
- How to scope a Same and Specific Bloc to some of the Routes using Auto Route? HOT 2
- Bloc Provider Duplicating issue using Sub router HOT 10
- [support] How to you pass arguments when not on web HOT 13
- AutoTabsRouterTabBarState was disposed with active Ticker HOT 2
- customRouteBuilder's completion result type has broken in the 8.0.3 version HOT 4
- Wildcards explanation is wrong HOT 2
- Allow empty paths without making them initial? HOT 4
- Missing Back Button after refresh on web HOT 9
- Issue with Global Constants as Default Values in Route Generation HOT 1
- Unable to access ` tabsRouter` from Tab's child to navigate to desired index
- Severe bug: Query parameters are not being encoded HOT 2
- inconsistent back button in app bar when using child routes HOT 1
- AutoRouterDelegate.declarative is deprecated - use guards instead - no docs? HOT 8
- Explicit Type Casting for Route Assignments HOT 1
- context.router.pushNamed is not working HOT 7
- Issue with screen going blank after navigating back from nested routes with wrappers in version 8.0.0 HOT 2
- Can not swipe back on iOS when using nested navigation HOT 10
- Question: Access BuildContext from within AutoRouteGuard HOT 1
- Redirect on arg parsing fail HOT 5
- Back button on Android closes App on Sub route
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from auto_route_library.