defaultRouteName property

String defaultRouteName

The route or path that the embedder requested when the application was launched.

Accessing this value returns the value contained in the PlatformDispatcher singleton, so instead of getting it from here, you should consider getting it from WidgetsBinding.instance.platformDispatcher instead (or, when WidgetsBinding isn't available, from PlatformDispatcher.instance). The reason this value forwards to the PlatformDispatcher is to provide convenience for applications that only use a single main window.

This will be the string "/" if no particular route was requested.


On Android, the initial route can be set on the initialRoute method of the FlutterActivity's intent builder.

On a standalone engine, see


On iOS, the initial route can be set with the FlutterViewController.setInitialRoute initializer.

On a standalone engine, see

See also:


String get defaultRouteName => platformDispatcher.defaultRouteName;