0

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 ?

1
  • you can use hot reload option after going to that page for every changes. Commented Aug 5, 2019 at 13:56

2 Answers 2

1

You can use kReleaseMode constant to do such thing:

MaterialApp(
  initialRoute: kReleaseMode == false ? '/some-dev-route' : '/',
)
Sign up to request clarification or add additional context in comments.

Comments

0

You can hardcode the screen to show up using kDebugMode:

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: kDebugMode ? TimelineScreen() : LoginScreen(),
    );
  }
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.