How to Change Entry Point to Some Other Page In Flutter?

· 4 min read
How to Change Entry Point to Some Other Page In Flutter
How to Change Entry Point to Some Other Page In Flutter

When the user creates a new flutter application user will default code in a main.dart. So in this article, we will go through How to Change Entry Point to Some Other Page In Flutter.

How to Change Entry Point to Some Other Page In Flutter?

In your main.dart you can specify the first screen that your app opens to:

runApp(new MaterialApp(
  debugShowCheckedModeBanner: false,
  theme: //theme
  title: "Title",
  home: new Login(), //Here you can specify the screen the app starts on.
  routes: <String, WidgetBuilder>{
    //routes
  },
));

You can change your Dart entry point from edit configurations.

Entry point in application
The entry point in the application

Change your main.dart file to some other file.

Change Entry Point of a Application
Change Entry Point of an Application

You can also consider a code snippet like the below:

  • Go to test> widget.test.dart
  • Change import package:flutter_async/main.dart to package:flutter_async/your_file_name.dart

If you are a Visual Studio Code user then you can follow the below steps:

Entry point of a application
Entry point of an application

 

Application entry point
Application entry point

 

be sure you write the right path:

Entry point in a app
Entry point in a app

 

To test your new entry point:

start point of a application
the start point of an application

 

Conclusion:

Thanks for being with us on the flutter journey!!!

So in this article, we have been through how to change the entry point to some other page in flutter.

Keep Learning !!! Keep Fluttering !!!

Do let us know in the comments if you have any doubts regarding flutter development !! We would be happy to assist you.

Flutter Agency is our portal Platform dedicated to Flutter Technology and Flutter Developers. The portal is full of cool resources from Flutter like Flutter Widget GuideFlutter ProjectsCode libs and etc.

Flutter Agency is one of the most popular online portals dedicated to Flutter Technology and daily thousands of unique visitors come to this portal to enhance their knowledge of Flutter.

Leave a Reply