androidiosfluttervisual-studio-code

Display specific widget on flutter in debug mode


Is it possible to display a specific widget or a screen on a device or an emulator on debug mode without passing through previous screens in flutter ? for instance as a simple example, moving directly to a timeline screen without passing through the login/register screen ?


Solution

  • You can use kReleaseMode constant to do such thing:

    MaterialApp(
      initialRoute: kReleaseMode == false ? '/some-dev-route' : '/',
    )