【flutter项目类型】project type如何区分

通过项目中.metadata内容区分

# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
  revision: 85684f9300908116a78138ea4c6036c35c9a1236
  channel: stable

project_type: module
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled.

version:
  revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4
  channel: stable

project_type: app
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled.

version:
  revision: 62bd79521d8d007524e351747471ba66696fc2d4
  channel: stable

project_type: plugin

目前从项目结构上看

只有plugin项目才会创建example目录
app项目、module项目下是没有的

Flutter开发–新建项目中4种Project Type区别#### 新建项目时会选择不同的项目类型,下面介绍一下这4种类型的区别:

【flutter项目类型】project type如何区分_第1张图片

创建说明

  • Flutter Application(Project):
    Flutter项目,主体是Flutter,其中包含iOS、Android、web等项目。
    目录结构为:

    【flutter项目类型】project type如何区分_第2张图片

    Application

  • Flutter Module:
    主体是原生项目,用于在原生iOS、Android项目中添加Flutter模块,用于原生与Flutter混合开发。
    官方文档:原生项目添加Flutter模块
    中文翻译网站:将 Flutter 集成到现有应用
    目录结构为:

    【flutter项目类型】project type如何区分_第3张图片

    文件结构

【flutter项目类型】project type如何区分_第4张图片

Module

【flutter项目类型】project type如何区分_第5张图片

iOS 项目

  • Plugin:
    Flutter插件:用于Flutter无法实现的功能,使用原生来实现出来,然后通过插件在Flutter项目中使用原生实现的功能。
    目录结构为:

    【flutter项目类型】project type如何区分_第6张图片

    Plugin

  • Package:
    纯Flutter模块,不需要原生代码实现,没有Android iOS目录。
    分包,用于公用的或者特定业务的模块划分
    目录结构为:

    【flutter项目类型】project type如何区分_第7张图片

    Package

你可能感兴趣的:(Flutter,flutter)