-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flutter Plugin/Package: publish a package + reuse native libs #245
Comments
flutter 开发+发布一个库/插件:
1. 创建包目录:1.1 package:
flutter create --template=package hello
1.2 plugin:
# Android:
flutter create --org com.example --template=plugin --platforms=android,ios -a kotlin hello
flutter create --org com.example --template=plugin --platforms=android,ios -a java hello
# iOS:
flutter create --org com.example --template=plugin --platforms=android,ios -i objc hello
flutter create --org com.example --template=plugin --platforms=android,ios -i swift hello
flutter create --template=plugin --platforms=web . 2. 发布包:
# 测试:
flutter pub publish --dry-run
# 发布:
flutter pub publish 3. 原生依赖处理: |
flutter platform channels: 编写平台相关代码数据类型 - 映射表:MethodChannel:Pigeon:测试: |
hhstore
changed the title
Flutter Plugin: reuse native libs
Flutter Plugin: publish a package + reuse native libs
Jan 14, 2021
hhstore
changed the title
Flutter Plugin: publish a package + reuse native libs
Flutter Plugin/Package: publish a package + reuse native libs
Jan 14, 2021
flutter plugin:
参考示例 1:
参考示例 2:
示例3:
package eu.simonbinder.sqlite3_flutter_libs;
|
1 |
android aar 包平台:ios/macos 包平台: |
iOS + ffi:
MacOS + ffi:
Android + ffi:Windows + ffi :
|
Mono Repo for Dart:
工具:mono repo:
# 激活工具:
dart pub global activate melos
注意事项:
function set.proxy.flutter.cn(){
# mirror: https://mirrors.tuna.tsinghua.edu.cn/help/flutter/
# 社区:
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
# 清华大学:
#export FLUTTER_STORAGE_BASE_URL="https://mirrors.tuna.tsinghua.edu.cn/flutter"
#export PUB_HOSTED_URL="https://mirrors.tuna.tsinghua.edu.cn/dart-pub"
}
# defalut use cn mirror:
set.proxy.flutter.cn
# unset:
function unset.proxy.flutter() {
unset PUB_HOSTED_URL
unset FLUTTER_STORAGE_BASE_URL
export PUB_HOSTED_URL=""
export FLUTTER_STORAGE_BASE_URL=""
echo "unset flutter proxy"
}
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
related:
The text was updated successfully, but these errors were encountered: