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-c