Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 Flutter 中运行任何一个模块而无需运行 main.dart?
如果你想运行任何模块,那么它必须定义 main 函数,因为它是任何 dart 或 Flutter 应用程序的入口点。只需右键单击要运行的任何 dart 文件,然后选择在 Android Studio 中运行。如果 dart 文件未定义 run 方法,则不会显示 run 选项。在 VS Code 中,您可以创建指向特定文件的运行配置。