Flutter : How do i change main.dart(entry point) to some other page in Flutter?

前端 未结 7 662
故里飘歌
故里飘歌 2020-12-16 15:08
  • I started working on the \"home page\" of the application in main.dart.
  • Then I created \"Login.dart\" page, and now i want my application t
7条回答
  •  一向
    一向 (楼主)
    2020-12-16 15:52

    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: {
        //routes
      },
    ));
    

    I'm not sure if this is any better than Günter's answer, but mine will mean you don't have to always specify the file name when building or running.

提交回复
热议问题