简体   繁体   English

flutter 项目中的根文件(main.dart)在哪里?

[英]Where is the root file(main.dart) in a flutter project located?

I just bought a flutter UI from online.我刚从网上买了一个 Flutter UI。 Now I couldn't find the root file where all the package and classes imported.现在我找不到所有包和类导入的根文件。

Is there any solution to find the root class?有没有办法找到根类?

If you have purchased a commercial Flutter Widget, then usually the documentation will ask you to add an entry to the pubspec.yaml file.如果您购买了商业 Flutter Widget,那么通常文档会要求您在pubspec.yaml文件中添加一个条目。 After that flutter will download the dependencies and will merge them with your project.之后,flutter 将下载依赖项并将它们与您的项目合并。

All you have to do is to reference the package in your source code through a simple import function.您所要做的就是通过一个简单的导入函数在源代码中引用该包。

Take a look at an example here: https://pub.dev/packages/mobx/install看看这里的一个例子: https : //pub.dev/packages/mobx/install

You add a pubspec entry, save, your IDE will download the dependencies, then import the package into your source code.您添加一个 pubspec 条目,保存,您的 IDE 将下载依赖项,然后将包导入到您的源代码中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM