GithubHelp home page GithubHelp logo

Comments (7)

kuhnroyal avatar kuhnroyal commented on May 22, 2024 1

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.

Milad-Akarie avatar Milad-Akarie commented on May 22, 2024 1

@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.

Milad-Akarie avatar Milad-Akarie commented on May 22, 2024

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.

Milad-Akarie avatar Milad-Akarie commented on May 22, 2024

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.

kuhnroyal avatar kuhnroyal commented on May 22, 2024

I am think about flutter web and readable URL like route names.

from auto_route_library.

rebaz94 avatar rebaz94 commented on May 22, 2024

@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.

Milad-Akarie avatar Milad-Akarie commented on May 22, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.