diff --git a/.github/workflows/build_test.yml b/.github/workflows/build.yml similarity index 82% rename from .github/workflows/build_test.yml rename to .github/workflows/build.yml index f274f3b..d285774 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build.yml @@ -1,10 +1,10 @@ -name: Build test +name: build on: [push, pull_request] jobs: - test_iOS: - name: Test iOS on ${{ matrix.os }} + build_ios: + name: Build iOS on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: @@ -20,12 +20,13 @@ jobs: - run: dart --version - run: flutter --version - run: flutter pub get + - run: flutter format --dry-run --set-exit-if-changed . - run: flutter pub publish --dry-run - run: flutter analyze lib example/lib - run: cd example; flutter build ios --no-codesign - test_android: - name: Test android on ${{ matrix.os }} + build_android: + name: Build Android on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: @@ -41,6 +42,7 @@ jobs: - run: dart --version - run: flutter --version - run: flutter pub get + - run: flutter format --dry-run --set-exit-if-changed . - run: flutter pub publish --dry-run - run: flutter analyze lib example/lib - run: sudo echo "y" | sudo $ANDROID_HOME/tools/bin/sdkmanager "ndk;20.0.5594570" diff --git a/.github/workflows/publish_on_release.yml b/.github/workflows/publish.yml similarity index 59% rename from .github/workflows/publish_on_release.yml rename to .github/workflows/publish.yml index 61751c1..eeeadb3 100644 --- a/.github/workflows/publish_on_release.yml +++ b/.github/workflows/publish.yml @@ -1,4 +1,4 @@ -name: Publish on release +name: publish on: release: @@ -6,14 +6,11 @@ on: jobs: publish: - + name: Publish runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v1 - - name: Publish - uses: sakebook/actions-flutter-pub-publisher@v1.3.0 + - uses: actions/checkout@v1 + - uses: sakebook/actions-flutter-pub-publisher@v1.3.0 with: credential: ${{ secrets.CREDENTIAL_JSON }} flutter_package: true diff --git a/.github/workflows/publish_manually.yml b/.github/workflows/publish_manually.yml index 5f44145..1c51463 100644 --- a/.github/workflows/publish_manually.yml +++ b/.github/workflows/publish_manually.yml @@ -1,15 +1,14 @@ -name: Pub Publish manually +name: publish manually on: workflow_dispatch jobs: - publish: + publish_manually: + name: Publish Manually runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v1 - - name: Publish - uses: sakebook/actions-flutter-pub-publisher@v1.3.0 + - uses: actions/checkout@v1 + - uses: sakebook/actions-flutter-pub-publisher@v1.3.0 with: credential: ${{ secrets.CREDENTIAL_JSON }} flutter_package: true diff --git a/example/ios/Flutter/.last_build_id b/example/ios/Flutter/.last_build_id deleted file mode 100644 index c078eb4..0000000 --- a/example/ios/Flutter/.last_build_id +++ /dev/null @@ -1 +0,0 @@ -cd43188ccf238126b61f5732044f6a6b \ No newline at end of file diff --git a/lib/src/tencent.dart b/lib/src/tencent.dart index a39fc64..471256c 100644 --- a/lib/src/tencent.dart +++ b/lib/src/tencent.dart @@ -43,17 +43,22 @@ class Tencent { 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 _respStreamController = StreamController.broadcast(); + final StreamController _respStreamController = + StreamController.broadcast(); Future _handleMethod(MethodCall call) async { switch (call.method) { case _METHOD_ONLOGINRESP: - _respStreamController.add(LoginResp.fromJson((call.arguments as Map).cast())); + _respStreamController.add(LoginResp.fromJson( + (call.arguments as Map).cast())); break; case _METHOD_ONSHARERESP: - _respStreamController.add(ShareMsgResp.fromJson((call.arguments as Map).cast())); + _respStreamController.add(ShareMsgResp.fromJson( + (call.arguments as Map).cast())); break; } } @@ -81,7 +86,8 @@ class Tencent { _METHOD_REGISTERAPP, { _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((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))); return _channel.invokeMethod( _METHOD_SHAREMOOD, { _ARGUMENT_KEY_SCENE: scene, 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(), }, );