DEV Community

Cover image for Flutter tip (#4): run a Flutter app to a specific route
Pedro Massango
Pedro Massango

Posted on • Edited on

6 2

Flutter tip (#4): run a Flutter app to a specific route

Few days ago I found an hidden gem in the main Flutter repository and shared it on my Twitter account and today I tought its better to share on my blogpost.

Have you ever wanted to run your Flutter app straight to a specific named route? yes it is possible.

This is helpful when you:

  • Want to test a specific page in your app and you don't want to run the whole app and navigate to that page by yourself.
  • Want to test deep link in your Flutter app.
  • (other) you may need it for many other use-cases :)

Show me the code

All you need to do is to run the flutter command with the --route parameter:

pedromassago$ flutter run --route /routeName

The --route parameter expect a string that is the route name that will be used to start your application with. In the case above the app will start with the /routeName page in your screen.

Notes

This feature is only available for Android devices at the time this post was written. There is a open issue to bring support for other platform like iOS at flutter/flutter/issues/4703. If you wan this feature on iOS you can thumbs up the issue to get it fixed sooner.

Thanks for you time! 😉

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up