flutter插件发布到私有仓库

本文介绍了如何创建并发布Flutter插件到私有仓库,包括使用命令行或Android Studio创建插件,配置pubspec.yaml,以及解决Google验证问题。此外,还详细讲解了搭建pub私服的步骤,包括下载私服源码、启动服务,并跳过Google验证。最后,展示了如何在其他项目中依赖已发布的私有仓库插件。
摘要由CSDN通过智能技术生成

1. 创建要发布的插件

创建项目一般有2中方法

1) 用命令创建

flutter create -t plugin helloworld

你也可以通过 flutter create -h 命令来查看flutter支持的所有命令:

-h, --help                     Print this usage information.
    --[no-]pub                 Whether to run "flutter pub get" after the project has been created.
                               (defaults to on)

    --[no-]offline             When "flutter pub get" is run by the create command, this indicates
                               whether to run it in offline mode or not. In offline mode, it will need
                               to have all dependencies already available in the pub cache to succeed.

    --[no-]with-driver-test    Also add a flutter_driver dependency and generate a sample 'flutter
                               drive' test.

-t, --template=<type>          Specify the type of project to create.

          [app]                (default) Generate a Flutter application.
          [module]             Generate a project to add a Flutter module to an existing Android or iOS
                               application.
          [package]            Generate a shareable Flutter project containing modular Dart code.
          [plugin]             Generate a shareable Flutter project containing an API in Dart code with
                               a platform-specific implementation for Android, for iOS code, or for
                               both.

-s, --sample=<id>              Specifies the Flutter code sample to use as the main.dart for an
                               application. Implies --template=app. The value should be the sample ID
                               of the desired sample from the API documentation website
                               (http://docs.flutter.dev). An example can be found at
                               https://master-api.flutter.dev/flutter/widgets/SingleChildScrollView-cla
                            
  • 4
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值