flutter_brick

这是一个 mason brick,您可以使用它来生成代码,从而快速启动一个 flutter 项目

Powered by Mason

一个用 Mason CLI 创建的 flutter brick。

由 [mason][1] 生成?

入门?

步骤

  1. 运行 dart pub global activate mason_cli 来安装 mason。
  2. 转到新 flutter 应用程序的根目录。
  3. 运行 mason add -g flutter_brick 将 brick 添加到本地。
  4. 从应用程序根目录运行 mason make flutter_brick
  5. 进行必要的更改。

自定义

  • 该 brick 不包含 riverpod 或 bloc,因为它为您提供了选择是否包含它们的灵活性
  • 该 brick 旨在紧跟 flutter create 之后运行
  • 将包名更改为您自己的
  • 覆盖 main.dart 此外,还包括 msix、native_splash、icons 等包,并将如下运行

    1. 图标 图标位于 icon/icon.png,用您自己的替换并运行以下命令 参见 flutter_launcher_icons 获取更多信息

      • flutter pub run flutter_launcher_icons:main
    2. 启动屏 图片位于 assets/icon.png,用您自己的替换并运行以下命令 参见 flutter_native_splash

      • flutter pub run flutter_native_splash:create
    3. Msix 创建 msix Windows 安装程序 参见 msix

      • flutter pub run msix:create
    4. Build runner 创建 fromJson 和 ToJson 参见 build_runner

      • flutter packages pub run build_runner build –delete-conflicting-outputs

非常感谢您的反馈

GitHub

查看 Github