
# Flutter构建
使用Flutter可以构建安卓应用。
- [图形化构建]
  在[配置构建步骤](https://support.huaweicloud.com/usermanual-codeci/codeci_ug_0059.html)中，添加"Flutter构建"构建步骤，参考[表1]配置参数。
   表1Flutter构建参数说明 
  | **参数**    | **说明**                                                                                                                                                                                                                                                                                                                                                              |
  |:---|:---|
  | 步骤显示名称    | 构建步骤的名称，可自定义修改。 - 支持中文、英文、数字、"-"、"_"、英文逗号、英文分号、英文冒号、"."、"/"、圆括号（中英文）。  - 字符长度范围为1\~128。   |
  | Flutter   | 根据用户实际开发环境的需要，选择对应的Flutter版本。 CodeArts Build支持的工具版本，可查看[构建工具版本](https://support.huaweicloud.com/productdesc-codeci/cloudbuild_07_0004.html)。若当前的工具版本不满足您的使用要求，您可以[制作镜像并推送到SWR仓库](https://support.huaweicloud.com/usermanual-codeci/codeci_ug_0013.html)。                                                                           |
  | JDK       | 根据用户实际开发环境的需要，选择对应的JDK版本。 CodeArts Build支持的工具版本，可查看[构建工具版本](https://support.huaweicloud.com/productdesc-codeci/cloudbuild_07_0004.html)。若当前的工具版本不满足您的使用要求，您可以[制作镜像并推送到SWR仓库](https://support.huaweicloud.com/usermanual-codeci/codeci_ug_0013.html)。                                                                               |
  | NDK       | 根据用户实际开发环境的需要，选择对应的NDK版本。 CodeArts Build支持的工具版本，可查看[构建工具版本](https://support.huaweicloud.com/productdesc-codeci/cloudbuild_07_0004.html)。若当前的工具版本不满足您的使用要求，您可以[制作镜像并推送到SWR仓库](https://support.huaweicloud.com/usermanual-codeci/codeci_ug_0013.html)。                                                                                |
  | 命令        | 配置Flutter命令，一般使用系统默认生成的命令即可。如有特殊构建要求，可以在文本域中输入自定义的构建脚本。更多命令使用方法可参考[Flutter官网](https://flutter.dev/)。                                                                                                                                                                                                                                                                |
  | 失败后是否继续运行 | 当前步骤执行失败后是否继续执行下一个步骤，根据实际使用场景选择是或否。                                                                                                                                                                                                                                                                                                                                 |
     
- [代码化构建]
  参考以下代码示例，修改在[创建代码化构建使用的YAML文件](https://support.huaweicloud.com/usermanual-codeci/codeci_ug_0058.html#codeci_ug_0058__section72391847131511)中的BUILD部分代码信息。
  ```
  version: 2.0 # 必须是2.0
  steps:
    BUILD:
      - flutter:
         inputs:
            flutter: '1.17.5'
            jdk: '3333'
            ndk: '23.1.7779620'
            command: ./instrumented.apk
            ignore_fail: true
  ```
  表2代码示例参数说明 
  | **参数**      | **类型** | **说明**                                                                                                                                                                                                                                                                                                |
  |:---|:---|:---|
  | flutter     | string | 根据用户实际开发环境的需要，选择对应的Flutter版本。 CodeArts Build支持的工具版本，可查看[构建工具版本](https://support.huaweicloud.com/productdesc-codeci/cloudbuild_07_0004.html)。若当前的工具版本不满足您的使用要求，您可以[制作镜像并推送到SWR仓库](https://support.huaweicloud.com/usermanual-codeci/codeci_ug_0013.html)。             |
  | jdk         | string | 根据用户实际开发环境的需要，选择对应的JDK版本。 CodeArts Build支持的工具版本，可查看[构建工具版本](https://support.huaweicloud.com/productdesc-codeci/cloudbuild_07_0004.html)。若当前的工具版本不满足您的使用要求，您可以[制作镜像并推送到SWR仓库](https://support.huaweicloud.com/usermanual-codeci/codeci_ug_0013.html)。                 |
  | ndk         | string | 根据用户实际开发环境的需要，选择对应的NDK版本。 CodeArts Build支持的工具版本，可查看[构建工具版本](https://support.huaweicloud.com/productdesc-codeci/cloudbuild_07_0004.html)。若当前的工具版本不满足您的使用要求，您可以[制作镜像并推送到SWR仓库](https://support.huaweicloud.com/usermanual-codeci/codeci_ug_0013.html)。                |
  | command     | string | 配置Flutter命令。更多命令使用方法可参考[Flutter官网](https://flutter.dev/)。                                                                                                                                                                                                                                             |
  | ignore_fail | string | 用于控制当前步骤执行失败后是否继续执行下一个步骤。 - true：是。  - 为空：否。   |
     
