Have you ever wanted to run your Flutter app straight to a specifically 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
pedromassago$ flutter run --route /routeName
--route parameter expects 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.
This feature is only available for Android devices at the time this post was written. There is an open issue to bring support for another platform like iOS at flutter/flutter/issues/4703. If you want this feature on iOS you can thumbs up the issue to get it fixed sooner.