mirror of
https://github.com/RxReader/tencent_kit.git
synced 2025-05-21 09:16:31 +08:00
format
This commit is contained in:
@ -1,10 +1,10 @@
|
|||||||
name: Build test
|
name: build
|
||||||
|
|
||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test_iOS:
|
build_ios:
|
||||||
name: Test iOS on ${{ matrix.os }}
|
name: Build iOS on ${{ matrix.os }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@ -20,12 +20,13 @@ jobs:
|
|||||||
- run: dart --version
|
- run: dart --version
|
||||||
- run: flutter --version
|
- run: flutter --version
|
||||||
- run: flutter pub get
|
- run: flutter pub get
|
||||||
|
- run: flutter format --dry-run --set-exit-if-changed .
|
||||||
- run: flutter pub publish --dry-run
|
- run: flutter pub publish --dry-run
|
||||||
- run: flutter analyze lib example/lib
|
- run: flutter analyze lib example/lib
|
||||||
- run: cd example; flutter build ios --no-codesign
|
- run: cd example; flutter build ios --no-codesign
|
||||||
|
|
||||||
test_android:
|
build_android:
|
||||||
name: Test android on ${{ matrix.os }}
|
name: Build Android on ${{ matrix.os }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@ -41,6 +42,7 @@ jobs:
|
|||||||
- run: dart --version
|
- run: dart --version
|
||||||
- run: flutter --version
|
- run: flutter --version
|
||||||
- run: flutter pub get
|
- run: flutter pub get
|
||||||
|
- run: flutter format --dry-run --set-exit-if-changed .
|
||||||
- run: flutter pub publish --dry-run
|
- run: flutter pub publish --dry-run
|
||||||
- run: flutter analyze lib example/lib
|
- run: flutter analyze lib example/lib
|
||||||
- run: sudo echo "y" | sudo $ANDROID_HOME/tools/bin/sdkmanager "ndk;20.0.5594570"
|
- run: sudo echo "y" | sudo $ANDROID_HOME/tools/bin/sdkmanager "ndk;20.0.5594570"
|
@ -1,4 +1,4 @@
|
|||||||
name: Publish on release
|
name: publish
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
@ -6,14 +6,11 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
|
name: Publish
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- uses: actions/checkout@v1
|
||||||
uses: actions/checkout@v1
|
- uses: sakebook/actions-flutter-pub-publisher@v1.3.0
|
||||||
- name: Publish
|
|
||||||
uses: sakebook/actions-flutter-pub-publisher@v1.3.0
|
|
||||||
with:
|
with:
|
||||||
credential: ${{ secrets.CREDENTIAL_JSON }}
|
credential: ${{ secrets.CREDENTIAL_JSON }}
|
||||||
flutter_package: true
|
flutter_package: true
|
11
.github/workflows/publish_manually.yml
vendored
11
.github/workflows/publish_manually.yml
vendored
@ -1,15 +1,14 @@
|
|||||||
name: Pub Publish manually
|
name: publish manually
|
||||||
|
|
||||||
on: workflow_dispatch
|
on: workflow_dispatch
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish_manually:
|
||||||
|
name: Publish Manually
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- uses: actions/checkout@v1
|
||||||
uses: actions/checkout@v1
|
- uses: sakebook/actions-flutter-pub-publisher@v1.3.0
|
||||||
- name: Publish
|
|
||||||
uses: sakebook/actions-flutter-pub-publisher@v1.3.0
|
|
||||||
with:
|
with:
|
||||||
credential: ${{ secrets.CREDENTIAL_JSON }}
|
credential: ${{ secrets.CREDENTIAL_JSON }}
|
||||||
flutter_package: true
|
flutter_package: true
|
||||||
|
@ -1 +0,0 @@
|
|||||||
cd43188ccf238126b61f5732044f6a6b
|
|
@ -43,17 +43,22 @@ class Tencent {
|
|||||||
|
|
||||||
static const String _SCHEME_FILE = 'file';
|
static const String _SCHEME_FILE = 'file';
|
||||||
|
|
||||||
late final MethodChannel _channel = const MethodChannel('v7lin.github.io/tencent_kit')..setMethodCallHandler(_handleMethod);
|
late final MethodChannel _channel =
|
||||||
|
const MethodChannel('v7lin.github.io/tencent_kit')
|
||||||
|
..setMethodCallHandler(_handleMethod);
|
||||||
|
|
||||||
final StreamController<BaseResp> _respStreamController = StreamController<BaseResp>.broadcast();
|
final StreamController<BaseResp> _respStreamController =
|
||||||
|
StreamController<BaseResp>.broadcast();
|
||||||
|
|
||||||
Future<dynamic> _handleMethod(MethodCall call) async {
|
Future<dynamic> _handleMethod(MethodCall call) async {
|
||||||
switch (call.method) {
|
switch (call.method) {
|
||||||
case _METHOD_ONLOGINRESP:
|
case _METHOD_ONLOGINRESP:
|
||||||
_respStreamController.add(LoginResp.fromJson((call.arguments as Map<dynamic, dynamic>).cast<String, dynamic>()));
|
_respStreamController.add(LoginResp.fromJson(
|
||||||
|
(call.arguments as Map<dynamic, dynamic>).cast<String, dynamic>()));
|
||||||
break;
|
break;
|
||||||
case _METHOD_ONSHARERESP:
|
case _METHOD_ONSHARERESP:
|
||||||
_respStreamController.add(ShareMsgResp.fromJson((call.arguments as Map<dynamic, dynamic>).cast<String, dynamic>()));
|
_respStreamController.add(ShareMsgResp.fromJson(
|
||||||
|
(call.arguments as Map<dynamic, dynamic>).cast<String, dynamic>()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -81,7 +86,8 @@ class Tencent {
|
|||||||
_METHOD_REGISTERAPP,
|
_METHOD_REGISTERAPP,
|
||||||
<String, dynamic>{
|
<String, dynamic>{
|
||||||
_ARGUMENT_KEY_APPID: appId,
|
_ARGUMENT_KEY_APPID: appId,
|
||||||
if (universalLink?.isNotEmpty ?? false) _ARGUMENT_KEY_UNIVERSALLINK: universalLink,
|
if (universalLink?.isNotEmpty ?? false)
|
||||||
|
_ARGUMENT_KEY_UNIVERSALLINK: universalLink,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -127,14 +133,18 @@ class Tencent {
|
|||||||
}) {
|
}) {
|
||||||
assert(scene == TencentScene.SCENE_QZONE);
|
assert(scene == TencentScene.SCENE_QZONE);
|
||||||
assert((summary?.isNotEmpty ?? false) ||
|
assert((summary?.isNotEmpty ?? false) ||
|
||||||
((imageUris?.isNotEmpty ?? false) && imageUris!.every((Uri element) => element.isScheme(_SCHEME_FILE))) ||
|
((imageUris?.isNotEmpty ?? false) &&
|
||||||
|
imageUris!
|
||||||
|
.every((Uri element) => element.isScheme(_SCHEME_FILE))) ||
|
||||||
(videoUri != null && videoUri.isScheme(_SCHEME_FILE)));
|
(videoUri != null && videoUri.isScheme(_SCHEME_FILE)));
|
||||||
return _channel.invokeMethod<void>(
|
return _channel.invokeMethod<void>(
|
||||||
_METHOD_SHAREMOOD,
|
_METHOD_SHAREMOOD,
|
||||||
<String, dynamic>{
|
<String, dynamic>{
|
||||||
_ARGUMENT_KEY_SCENE: scene,
|
_ARGUMENT_KEY_SCENE: scene,
|
||||||
if (summary?.isNotEmpty ?? false) _ARGUMENT_KEY_SUMMARY: summary,
|
if (summary?.isNotEmpty ?? false) _ARGUMENT_KEY_SUMMARY: summary,
|
||||||
if (imageUris?.isNotEmpty ?? false) _ARGUMENT_KEY_IMAGEURIS: imageUris!.map((Uri imageUri) => imageUri.toString()).toList(),
|
if (imageUris?.isNotEmpty ?? false)
|
||||||
|
_ARGUMENT_KEY_IMAGEURIS:
|
||||||
|
imageUris!.map((Uri imageUri) => imageUri.toString()).toList(),
|
||||||
if (videoUri != null) _ARGUMENT_KEY_VIDEOURI: videoUri.toString(),
|
if (videoUri != null) _ARGUMENT_KEY_VIDEOURI: videoUri.toString(),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user