From c24a6df8b7b5da1f31a1da960de40ffa60cdbedb Mon Sep 17 00:00:00 2001 From: Alexander Dischberg Date: Thu, 14 Dec 2023 01:43:19 +0800 Subject: [PATCH 1/8] feat(android): support widget provider with diff androidPackageName --- README.md | 2 +- app_widget/.fvm/fvm_config.json | 2 +- app_widget_android/CHANGELOG.md | 5 + app_widget_android/android/build.gradle | 2 +- .../app_widget/AppWidgetMethodCallHandler.kt | 4 +- app_widget_android/example/pubspec.lock | 104 +++++++++++------- .../lib/src/app_widget_android_plugin.dart | 14 ++- app_widget_android/pubspec.yaml | 5 +- 8 files changed, 91 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index 85218f7..941b9f7 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ plugin. in `app_widget/example/integration_test/app_widget_test.dart` ```sh +cd app_widget/example # this will require a connected device for android flutter test integration_test/app_widget_test.dart ``` - diff --git a/app_widget/.fvm/fvm_config.json b/app_widget/.fvm/fvm_config.json index 5d1bc03..f000541 100644 --- a/app_widget/.fvm/fvm_config.json +++ b/app_widget/.fvm/fvm_config.json @@ -1,4 +1,4 @@ { - "flutterSdkVersion": "3.0.5", + "flutterSdkVersion": "3.13.8", "flavors": {} } \ No newline at end of file diff --git a/app_widget_android/CHANGELOG.md b/app_widget_android/CHANGELOG.md index fd607a6..0fbd738 100644 --- a/app_widget_android/CHANGELOG.md +++ b/app_widget_android/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.3.0 + +*feat(android): support widget provider with different package name +*fix(android): fix MainActivity not using application package name + ## 0.2.1 * fix(android): onClickWidget callback should be independent on each widget diff --git a/app_widget_android/android/build.gradle b/app_widget_android/android/build.gradle index 4b1d11e..98592d7 100644 --- a/app_widget_android/android/build.gradle +++ b/app_widget_android/android/build.gradle @@ -25,7 +25,7 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { - compileSdkVersion 31 + compileSdkVersion 33 compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 diff --git a/app_widget_android/android/src/main/kotlin/tech/noxasch/app_widget/AppWidgetMethodCallHandler.kt b/app_widget_android/android/src/main/kotlin/tech/noxasch/app_widget/AppWidgetMethodCallHandler.kt index 3f2cc34..4aef26a 100644 --- a/app_widget_android/android/src/main/kotlin/tech/noxasch/app_widget/AppWidgetMethodCallHandler.kt +++ b/app_widget_android/android/src/main/kotlin/tech/noxasch/app_widget/AppWidgetMethodCallHandler.kt @@ -114,7 +114,7 @@ class AppWidgetMethodCallHandler(private val context: Context, ) val widgetLayoutId: Int = context.resources.getIdentifier(widgetLayout, "layout", context.packageName) val payload = call.argument("payload") val url = call.argument("url") - val activityClass = Class.forName("$androidPackageName.MainActivity") + val activityClass = Class.forName("${context.packageName}.MainActivity") val appWidgetManager = AppWidgetManager.getInstance(context) val pendingIntent = createPendingClickIntent(activityClass, widgetId, payload, url) val textViewsMap = call.argument>("textViews") @@ -170,7 +170,7 @@ class AppWidgetMethodCallHandler(private val context: Context, ) context.resources.getIdentifier(widgetLayout, "layout", context.packageName) val payload = call.argument("payload") val url = call.argument("url") - val activityClass = Class.forName("$androidPackageName.MainActivity") + val activityClass = Class.forName("${context.packageName}.MainActivity") val appWidgetManager = AppWidgetManager.getInstance(context) val pendingIntent = createPendingClickIntent(activityClass, widgetId, payload, url) val textViewsMap = call.argument>("textViews") diff --git a/app_widget_android/example/pubspec.lock b/app_widget_android/example/pubspec.lock index d6c5eae..9b6fe92 100644 --- a/app_widget_android/example/pubspec.lock +++ b/app_widget_android/example/pubspec.lock @@ -12,56 +12,64 @@ packages: dependency: transitive description: name: app_widget_platform_interface - url: "https://pub.dartlang.org" + sha256: "75583ff13e5b01f7204397990e7d885a7c3d261f68c570b09c58581fd30518d7" + url: "https://pub.dev" source: hosted version: "0.2.0" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.9.0" + version: "2.11.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.3.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.17.2" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.dartlang.org" + sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be + url: "https://pub.dev" source: hosted version: "1.0.5" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted version: "1.3.1" flutter: @@ -73,7 +81,8 @@ packages: dependency: "direct dev" description: name: flutter_lints - url: "https://pub.dartlang.org" + sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c + url: "https://pub.dev" source: hosted version: "2.0.1" flutter_test: @@ -85,42 +94,48 @@ packages: dependency: transitive description: name: lints - url: "https://pub.dartlang.org" + sha256: "5cfd6509652ff5e7fe149b6df4859e687fca9048437857cb2e65c8d780f396e3" + url: "https://pub.dev" source: hosted version: "2.0.0" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + url: "https://pub.dev" source: hosted - version: "0.12.12" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + url: "https://pub.dev" source: hosted - version: "0.1.5" + version: "0.5.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.1" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.3" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.dartlang.org" + sha256: "075f927ebbab4262ace8d0b283929ac5410c0ac4e7fc123c76429564facfb757" + url: "https://pub.dev" source: hosted version: "2.1.2" sky_engine: @@ -132,51 +147,66 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + url: "https://pub.dev" source: hosted - version: "0.4.12" + version: "0.6.0" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" + web: + dependency: transitive + description: + name: web + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + url: "https://pub.dev" + source: hosted + version: "0.1.4-beta" sdks: - dart: ">=2.17.6 <3.0.0" + dart: ">=3.1.0-185.0.dev <4.0.0" flutter: ">=2.5.0" diff --git a/app_widget_android/lib/src/app_widget_android_plugin.dart b/app_widget_android/lib/src/app_widget_android_plugin.dart index e929a7b..a5f3dc1 100644 --- a/app_widget_android/lib/src/app_widget_android_plugin.dart +++ b/app_widget_android/lib/src/app_widget_android_plugin.dart @@ -72,6 +72,9 @@ class AppWidgetAndroidPlugin extends AppWidgetAndroid { final widgetIds = await _methodChannel.invokeMethod?>('getWidgetIds', { + if (androidPackageName != null) ...{ + 'androidPackageName': androidPackageName, + }, 'androidProviderName': androidProviderName, }); @@ -90,7 +93,12 @@ class AppWidgetAndroidPlugin extends AppWidgetAndroid { return _methodChannel.invokeMethod( 'reloadWidgets', - {'androidProviderName': androidProviderName}, + { + if (androidPackageName != null) ...{ + 'androidPackageName': androidPackageName, + }, + 'androidProviderName': androidProviderName, + }, ); } @@ -107,7 +115,9 @@ class AppWidgetAndroidPlugin extends AppWidgetAndroid { assert(widgetLayout != null, 'widgetLayout is required for android!'); return _methodChannel.invokeMethod('updateWidget', { - 'androidPackageName': androidPackageName, + if (androidPackageName != null) ...{ + 'androidPackageName': androidPackageName, + }, 'widgetLayout': widgetLayout, 'widgetId': widgetId, 'textViews': textViews, diff --git a/app_widget_android/pubspec.yaml b/app_widget_android/pubspec.yaml index 9dac7c3..4d27355 100644 --- a/app_widget_android/pubspec.yaml +++ b/app_widget_android/pubspec.yaml @@ -1,12 +1,12 @@ name: app_widget_android description: Android implementation for app_widget plugin -version: 0.2.1 +version: 0.3.0 homepage: https://noxasch.tech/ repository: https://github.com/noxasch/flutter_app_widget/tree/master/app_widget_android issue_tracker: https://github.com/noxasch/flutter_app_widget/issues environment: - sdk: ">=2.17.6 <3.0.0" + sdk: ">=2.17.6 <4.0.0" flutter: ">=2.5.0" dependencies: @@ -30,4 +30,3 @@ flutter: package: tech.noxasch.app_widget pluginClass: AppWidgetPlugin dartPluginClass: AppWidgetAndroid - From 747b95589777e47617427f9effb1a92a9e6067a0 Mon Sep 17 00:00:00 2001 From: Alexander Dischberg Date: Thu, 14 Dec 2023 02:02:10 +0800 Subject: [PATCH 2/8] feat(android): support androidPackageName input test: update widget test test(android): update integration test --- .../android/app/src/main/AndroidManifest.xml | 8 + .../AppWidgetExampleDiffProvider.kt | 41 +++++ app_widget/example/android/build.gradle | 2 +- .../android_test_diff_package.dart | 68 ++++++++ app_widget/example/pubspec.lock | 156 ++++++++++-------- app_widget/lib/src/app_widget_plugin.dart | 12 +- app_widget/pubspec.yaml | 5 +- app_widget/test/app_widget_test.dart | 108 +++++++++++- app_widget_android/example/pubspec.lock | 2 +- 9 files changed, 322 insertions(+), 80 deletions(-) create mode 100644 app_widget/example/android/app/src/main/kotlin/tech/noxasch/app_widget_example/AppWidgetExampleDiffProvider.kt create mode 100644 app_widget/example/integration_test/android_test_diff_package.dart diff --git a/app_widget/example/android/app/src/main/AndroidManifest.xml b/app_widget/example/android/app/src/main/AndroidManifest.xml index 6ebf580..c4c3283 100644 --- a/app_widget/example/android/app/src/main/AndroidManifest.xml +++ b/app_widget/example/android/app/src/main/AndroidManifest.xml @@ -37,6 +37,14 @@ + + + + + + + =2.17.6 <3.0.0" + dart: ">=3.1.0-185.0.dev <4.0.0" flutter: ">=2.5.0" diff --git a/app_widget/lib/src/app_widget_plugin.dart b/app_widget/lib/src/app_widget_plugin.dart index dd862bc..ee9065c 100644 --- a/app_widget/lib/src/app_widget_plugin.dart +++ b/app_widget/lib/src/app_widget_plugin.dart @@ -104,9 +104,10 @@ class AppWidgetPlugin { Map? textViews = const {}, String? payload, String? url, + String? androidPackageName, }) async { return AppWidgetPlatform.instance.configureWidget( - androidPackageName: _androidPackageName, + androidPackageName: androidPackageName ?? _androidPackageName, widgetId: widgetId, widgetLayout: widgetLayout, textViews: textViews, @@ -123,9 +124,10 @@ class AppWidgetPlugin { /// Future?> getWidgetIds({ required String androidProviderName, + String? androidPackageName, }) { return AppWidgetPlatform.instance.getWidgetIds( - androidPackageName: _androidPackageName, + androidPackageName: androidPackageName ?? _androidPackageName, androidProviderName: androidProviderName, ); } @@ -143,9 +145,10 @@ class AppWidgetPlugin { /// Future reloadWidgets({ String? androidProviderName, + String? androidPackageName, }) async { return AppWidgetPlatform.instance.reloadWidgets( - androidPackageName: _androidPackageName, + androidPackageName: androidPackageName ?? _androidPackageName, androidProviderName: androidProviderName, ); } @@ -178,9 +181,10 @@ class AppWidgetPlugin { Map? textViews = const {}, String? payload, String? url, + String? androidPackageName, }) async { return AppWidgetPlatform.instance.updateWidget( - androidPackageName: _androidPackageName, + androidPackageName: androidPackageName ?? _androidPackageName, widgetId: widgetId, widgetLayout: widgetLayout, textViews: textViews, diff --git a/app_widget/pubspec.yaml b/app_widget/pubspec.yaml index 9e4803c..d3f727f 100644 --- a/app_widget/pubspec.yaml +++ b/app_widget/pubspec.yaml @@ -1,6 +1,6 @@ name: app_widget description: Flutter plugin to manage app widget / home screen widget from within flutter app. -version: 0.2.2 +version: 0.3.0 homepage: https://noxasch.tech/ repository: https://github.com/noxasch/flutter_app_widget/tree/master/app_widget issue_tracker: https://github.com/noxasch/flutter_app_widget/issues @@ -14,7 +14,7 @@ dependencies: sdk: flutter plugin_platform_interface: ^2.0.2 app_widget_platform_interface: ^0.2.0 - app_widget_android: ^0.2.1 + app_widget_android: ^0.3.0 # app_widget_platform_interface: # local dev # path: ../app_widget_platform_interface # app_widget_android: # local dev @@ -30,4 +30,3 @@ flutter: platforms: android: default_package: app_widget_android - diff --git a/app_widget/test/app_widget_test.dart b/app_widget/test/app_widget_test.dart index 3ee77d1..5338117 100644 --- a/app_widget/test/app_widget_test.dart +++ b/app_widget/test/app_widget_test.dart @@ -75,6 +75,37 @@ void main() { ]); }); + test('configureWidget diff package name', () async { + final appWidgetPlugin = AppWidgetPlugin( + androidPackageName: 'appname', + ); + + expect( + appWidgetPlugin.configureWidget( + widgetId: 1, + widgetLayout: 'layoutname', + payload: '{"itemId": 1, "stringUid": "uid"}', + url: 'https://google.come', + androidPackageName: 'appname2', + ), + completion(true), + ); + + expect(log, [ + isMethodCall( + 'configureWidget', + arguments: { + 'androidPackageName': 'appname2', + 'widgetId': 1, + 'widgetLayout': 'layoutname', + 'textViews': {}, + 'payload': '{"itemId": 1, "stringUid": "uid"}', + 'url': 'https://google.come', + }, + ) + ]); + }); + test('updateWidget', () async { final appWidgetPlugin = AppWidgetPlugin( androidPackageName: 'appname', @@ -105,11 +136,40 @@ void main() { ]); }); - test('cancelConfigureWidget', () async { + test('updateWidget different widget package name', () async { final appWidgetPlugin = AppWidgetPlugin( androidPackageName: 'appname', ); + expect( + appWidgetPlugin.updateWidget( + androidPackageName: 'appname2', + widgetId: 1, + widgetLayout: 'layoutname', + payload: '{"itemId": 1, "stringUid": "uid"}', + url: 'https://google.come', + ), + completion(true), + ); + + expect(log, [ + isMethodCall( + 'updateWidget', + arguments: { + 'androidPackageName': 'appname2', + 'widgetId': 1, + 'widgetLayout': 'layoutname', + 'textViews': {}, + 'payload': '{"itemId": 1, "stringUid": "uid"}', + 'url': 'https://google.come', + }, + ) + ]); + }); + + test('cancelConfigureWidget', () async { + final appWidgetPlugin = AppWidgetPlugin(); + expect( appWidgetPlugin.cancelConfigureWidget(), completion(true), @@ -138,6 +198,29 @@ void main() { 'getWidgetIds', arguments: { 'androidProviderName': 'TestProvider', + 'androidPackageName': 'appname', + }, + ) + ]); + }); + + test('getWidgetIds diff package name', () async { + final appWidgetPlugin = AppWidgetPlugin(); + + expect( + appWidgetPlugin.getWidgetIds( + androidProviderName: 'TestProvider', + androidPackageName: 'appname2', + ), + completion([42]), + ); + + expect(log, [ + isMethodCall( + 'getWidgetIds', + arguments: { + 'androidProviderName': 'TestProvider', + 'androidPackageName': 'appname2', }, ) ]); @@ -158,6 +241,29 @@ void main() { 'reloadWidgets', arguments: { 'androidProviderName': 'TestProvider', + 'androidPackageName': 'appname', + }, + ) + ]); + }); + + test('reloadWidgets diff package name', () async { + final appWidgetPlugin = AppWidgetPlugin(); + + expect( + appWidgetPlugin.reloadWidgets( + androidProviderName: 'TestProvider', + androidPackageName: 'appname2', + ), + completion(true), + ); + + expect(log, [ + isMethodCall( + 'reloadWidgets', + arguments: { + 'androidProviderName': 'TestProvider', + 'androidPackageName': 'appname2', }, ) ]); diff --git a/app_widget_android/example/pubspec.lock b/app_widget_android/example/pubspec.lock index 9b6fe92..a060d9d 100644 --- a/app_widget_android/example/pubspec.lock +++ b/app_widget_android/example/pubspec.lock @@ -7,7 +7,7 @@ packages: path: ".." relative: true source: path - version: "0.2.1" + version: "0.3.0" app_widget_platform_interface: dependency: transitive description: From ca6e8f51e5245720caf3557031cfc7cf2983fc4b Mon Sep 17 00:00:00 2001 From: Alexander Dischberg Date: Thu, 14 Dec 2023 02:12:02 +0800 Subject: [PATCH 3/8] test: fix static analysis --- app_widget/README.md | 40 +++++++++++++----------- app_widget/test/app_widget_ios_test.dart | 5 +-- app_widget/test/app_widget_test.dart | 25 ++++++++------- 3 files changed, 37 insertions(+), 33 deletions(-) diff --git a/app_widget/README.md b/app_widget/README.md index c138018..07dafda 100644 --- a/app_widget/README.md +++ b/app_widget/README.md @@ -465,25 +465,27 @@ void main() { const MethodChannel channel = MethodChannel(AppWidgetPlatform.channel); final List log = []; - - channel.setMockMethodCallHandler((methodCall) async { - log.add(methodCall); - switch (methodCall.method) { - case 'configureWidget': - return true; - case 'cancelConfigureWidget': - return true; - case 'getWidgetIds': - return [42]; - case 'reloadWidgets': - return true; - case 'updateWidget': - return true; - case 'widgetExist': - return true; - default: - } - }); + + + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger + .setMockMethodCallHandler(channel, (methodCall) async { + log.add(methodCall); + switch (methodCall.method) { + case 'getPlatformVersion': + return '42'; + case 'configureWidget': + return true; + case 'cancelConfigureWidget': + return true; + case 'getWidgetIds': + return []; + case 'reloadWidgets': + return true; + case 'widgetExist': + return true; + default: + return null; + } }); setUp(() { diff --git a/app_widget/test/app_widget_ios_test.dart b/app_widget/test/app_widget_ios_test.dart index 57eb95f..2b8446b 100644 --- a/app_widget/test/app_widget_ios_test.dart +++ b/app_widget/test/app_widget_ios_test.dart @@ -11,8 +11,8 @@ void main() { final List log = []; setUpAll(() { - // ignore: always_specify_types - channel.setMockMethodCallHandler((methodCall) async { + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger + .setMockMethodCallHandler(channel, (methodCall) async { log.add(methodCall); switch (methodCall.method) { case 'getPlatformVersion': @@ -28,6 +28,7 @@ void main() { case 'widgetExist': return true; default: + return null; } }); }); diff --git a/app_widget/test/app_widget_test.dart b/app_widget/test/app_widget_test.dart index 5338117..1da1cfd 100644 --- a/app_widget/test/app_widget_test.dart +++ b/app_widget/test/app_widget_test.dart @@ -13,8 +13,8 @@ void main() { final List log = []; setUpAll(() { - // ignore: always_specify_types - channel.setMockMethodCallHandler((methodCall) async { + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger + .setMockMethodCallHandler(channel, (methodCall) async { log.add(methodCall); switch (methodCall.method) { case 'getPlatformVersion': @@ -32,6 +32,7 @@ void main() { case 'widgetExist': return true; default: + return false; } }); }); @@ -71,7 +72,7 @@ void main() { 'payload': '{"itemId": 1, "stringUid": "uid"}', 'url': 'https://google.come', }, - ) + ), ]); }); @@ -102,7 +103,7 @@ void main() { 'payload': '{"itemId": 1, "stringUid": "uid"}', 'url': 'https://google.come', }, - ) + ), ]); }); @@ -132,7 +133,7 @@ void main() { 'payload': '{"itemId": 1, "stringUid": "uid"}', 'url': 'https://google.come', }, - ) + ), ]); }); @@ -163,7 +164,7 @@ void main() { 'payload': '{"itemId": 1, "stringUid": "uid"}', 'url': 'https://google.come', }, - ) + ), ]); }); @@ -179,7 +180,7 @@ void main() { isMethodCall( 'cancelConfigureWidget', arguments: null, - ) + ), ]); }); @@ -200,7 +201,7 @@ void main() { 'androidProviderName': 'TestProvider', 'androidPackageName': 'appname', }, - ) + ), ]); }); @@ -222,7 +223,7 @@ void main() { 'androidProviderName': 'TestProvider', 'androidPackageName': 'appname2', }, - ) + ), ]); }); @@ -243,7 +244,7 @@ void main() { 'androidProviderName': 'TestProvider', 'androidPackageName': 'appname', }, - ) + ), ]); }); @@ -265,7 +266,7 @@ void main() { 'androidProviderName': 'TestProvider', 'androidPackageName': 'appname2', }, - ) + ), ]); }); @@ -283,7 +284,7 @@ void main() { arguments: { 'widgetId': 12, }, - ) + ), ]); }); }); From cdee13f3c1e3801f50c61c0fb454ea5d26443f8b Mon Sep 17 00:00:00 2001 From: Alexander Dischberg Date: Thu, 14 Dec 2023 02:15:55 +0800 Subject: [PATCH 4/8] chore: fix lint issue --- app_widget/pubspec.yaml | 2 +- app_widget_platform_interface/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app_widget/pubspec.yaml b/app_widget/pubspec.yaml index d3f727f..6c6340b 100644 --- a/app_widget/pubspec.yaml +++ b/app_widget/pubspec.yaml @@ -6,7 +6,7 @@ repository: https://github.com/noxasch/flutter_app_widget/tree/master/app_widget issue_tracker: https://github.com/noxasch/flutter_app_widget/issues environment: - sdk: ">=2.17.6 <3.0.0" + sdk: ">=2.17.6 <4.0.0" flutter: ">=2.5.0" dependencies: diff --git a/app_widget_platform_interface/pubspec.yaml b/app_widget_platform_interface/pubspec.yaml index 405c618..8876e01 100644 --- a/app_widget_platform_interface/pubspec.yaml +++ b/app_widget_platform_interface/pubspec.yaml @@ -6,7 +6,7 @@ repository: https://github.com/noxasch/flutter_app_widget/tree/master/app_widget issue_tracker: https://github.com/noxasch/flutter_app_widget/issues environment: - sdk: ">=2.17.6 <3.0.0" + sdk: ">=2.17.6 <4.0.0" flutter: ">=2.5.0" dependencies: From 3ad10c1e5c014a24c0dc3bb518fd1c3c53d51e2b Mon Sep 17 00:00:00 2001 From: Alexander Dischberg Date: Thu, 14 Dec 2023 02:17:14 +0800 Subject: [PATCH 5/8] chore: add changelogs --- app_widget/CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app_widget/CHANGELOG.md b/app_widget/CHANGELOG.md index 33c2b13..a0f13aa 100644 --- a/app_widget/CHANGELOG.md +++ b/app_widget/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.3.0 +* feat(android): support widget provider with diff androidPackageName +* test: update widget test +* test(android): update integration test + ## 0.2.2 * fix(android): `reloadWidgets` to use initialized `androidPackageName` From 410ce21a2cc6a8682495b67f45d88f0edca25ae4 Mon Sep 17 00:00:00 2001 From: Alexander Dischberg Date: Thu, 14 Dec 2023 02:26:25 +0800 Subject: [PATCH 6/8] chore(android): bump version --- app_widget_android/example/pubspec.lock | 4 ++-- app_widget_android/pubspec.yaml | 2 +- app_widget_platform_interface/CHANGELOG.md | 3 +++ app_widget_platform_interface/pubspec.yaml | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app_widget_android/example/pubspec.lock b/app_widget_android/example/pubspec.lock index a060d9d..9b5cfd6 100644 --- a/app_widget_android/example/pubspec.lock +++ b/app_widget_android/example/pubspec.lock @@ -12,10 +12,10 @@ packages: dependency: transitive description: name: app_widget_platform_interface - sha256: "75583ff13e5b01f7204397990e7d885a7c3d261f68c570b09c58581fd30518d7" + sha256: fcfaaf47627cb4cc28a7dad4cceb692c5b9d7ec3e18fbeee07c178b0fcb9461e url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.3.0" async: dependency: transitive description: diff --git a/app_widget_android/pubspec.yaml b/app_widget_android/pubspec.yaml index 4d27355..9516227 100644 --- a/app_widget_android/pubspec.yaml +++ b/app_widget_android/pubspec.yaml @@ -13,7 +13,7 @@ dependencies: flutter: sdk: flutter plugin_platform_interface: ^2.0.2 - app_widget_platform_interface: ^0.2.0 + app_widget_platform_interface: ^0.3.0 # app_widget_platform_interface: # local dev # path: ../app_widget_platform_interface diff --git a/app_widget_platform_interface/CHANGELOG.md b/app_widget_platform_interface/CHANGELOG.md index b8114a4..3af9cbb 100644 --- a/app_widget_platform_interface/CHANGELOG.md +++ b/app_widget_platform_interface/CHANGELOG.md @@ -1,3 +1,6 @@ +## 0.3.0 +* support dart sdk 4.0 + ## 0.2.0 * breaking changes: `androidAppName` renamed to `androidPackageName` diff --git a/app_widget_platform_interface/pubspec.yaml b/app_widget_platform_interface/pubspec.yaml index 8876e01..0e3937f 100644 --- a/app_widget_platform_interface/pubspec.yaml +++ b/app_widget_platform_interface/pubspec.yaml @@ -1,6 +1,6 @@ name: app_widget_platform_interface description: Common platform interface for app_widget plugin. -version: 0.2.0 +version: 0.3.0 homepage: https://noxasch.tech/ repository: https://github.com/noxasch/flutter_app_widget/tree/master/app_widget_platform_interface issue_tracker: https://github.com/noxasch/flutter_app_widget/issues From e34d38e42cb76901a8ef48d334f50d9c07ded692 Mon Sep 17 00:00:00 2001 From: Alexander Dischberg Date: Thu, 14 Dec 2023 02:27:48 +0800 Subject: [PATCH 7/8] chore(android): bump version --- app_widget_android/CHANGELOG.md | 7 +++++-- app_widget_android/example/pubspec.lock | 2 +- app_widget_android/pubspec.yaml | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app_widget_android/CHANGELOG.md b/app_widget_android/CHANGELOG.md index 0fbd738..a4cf6b4 100644 --- a/app_widget_android/CHANGELOG.md +++ b/app_widget_android/CHANGELOG.md @@ -1,7 +1,10 @@ +## 0.3.1 + +*chore: use latest platform interface ## 0.3.0 -*feat(android): support widget provider with different package name -*fix(android): fix MainActivity not using application package name +*feat: support widget provider with different package name +*fix: fix MainActivity not using application package name ## 0.2.1 diff --git a/app_widget_android/example/pubspec.lock b/app_widget_android/example/pubspec.lock index 9b5cfd6..7ee4ac7 100644 --- a/app_widget_android/example/pubspec.lock +++ b/app_widget_android/example/pubspec.lock @@ -7,7 +7,7 @@ packages: path: ".." relative: true source: path - version: "0.3.0" + version: "0.3.1" app_widget_platform_interface: dependency: transitive description: diff --git a/app_widget_android/pubspec.yaml b/app_widget_android/pubspec.yaml index 9516227..dd3d075 100644 --- a/app_widget_android/pubspec.yaml +++ b/app_widget_android/pubspec.yaml @@ -1,6 +1,6 @@ name: app_widget_android description: Android implementation for app_widget plugin -version: 0.3.0 +version: 0.3.1 homepage: https://noxasch.tech/ repository: https://github.com/noxasch/flutter_app_widget/tree/master/app_widget_android issue_tracker: https://github.com/noxasch/flutter_app_widget/issues From 62c3b9188d6e5dc467a214f8ec859353bdcf93c8 Mon Sep 17 00:00:00 2001 From: Alexander Dischberg Date: Thu, 14 Dec 2023 02:35:10 +0800 Subject: [PATCH 8/8] chore: bump version --- app_widget/example/pubspec.lock | 12 ++++++------ app_widget/pubspec.yaml | 6 +++--- app_widget_android/CHANGELOG.md | 4 ++++ app_widget_android/example/pubspec.lock | 10 +++++----- app_widget_android/pubspec.yaml | 6 +++--- app_widget_platform_interface/CHANGELOG.md | 4 ++++ app_widget_platform_interface/pubspec.yaml | 4 ++-- 7 files changed, 27 insertions(+), 19 deletions(-) diff --git a/app_widget/example/pubspec.lock b/app_widget/example/pubspec.lock index 32f512f..9207818 100644 --- a/app_widget/example/pubspec.lock +++ b/app_widget/example/pubspec.lock @@ -12,18 +12,18 @@ packages: dependency: transitive description: name: app_widget_android - sha256: "2bb58766646b52693d9e67c9062292a4ecb9df9c987fda2db221397eacc64ccb" + sha256: "10985e55599231d694ab073c0677f5707cf1464579990648630133ad04643e27" url: "https://pub.dev" source: hosted - version: "0.3.0" + version: "0.3.1" app_widget_platform_interface: dependency: transitive description: name: app_widget_platform_interface - sha256: "75583ff13e5b01f7204397990e7d885a7c3d261f68c570b09c58581fd30518d7" + sha256: fcfaaf47627cb4cc28a7dad4cceb692c5b9d7ec3e18fbeee07c178b0fcb9461e url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.3.0" async: dependency: transitive description: @@ -173,10 +173,10 @@ packages: dependency: transitive description: name: plugin_platform_interface - sha256: "075f927ebbab4262ace8d0b283929ac5410c0ac4e7fc123c76429564facfb757" + sha256: f4f88d4a900933e7267e2b353594774fc0d07fb072b47eedcd5b54e1ea3269f8 url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.7" process: dependency: transitive description: diff --git a/app_widget/pubspec.yaml b/app_widget/pubspec.yaml index 6c6340b..a3b6399 100644 --- a/app_widget/pubspec.yaml +++ b/app_widget/pubspec.yaml @@ -12,9 +12,9 @@ environment: dependencies: flutter: sdk: flutter - plugin_platform_interface: ^2.0.2 - app_widget_platform_interface: ^0.2.0 - app_widget_android: ^0.3.0 + plugin_platform_interface: ^2.1.7 + app_widget_platform_interface: ^0.3.1 + app_widget_android: ^0.3.2 # app_widget_platform_interface: # local dev # path: ../app_widget_platform_interface # app_widget_android: # local dev diff --git a/app_widget_android/CHANGELOG.md b/app_widget_android/CHANGELOG.md index a4cf6b4..f210d5d 100644 --- a/app_widget_android/CHANGELOG.md +++ b/app_widget_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.3.2 + +*chore: update latest dependencies + ## 0.3.1 *chore: use latest platform interface diff --git a/app_widget_android/example/pubspec.lock b/app_widget_android/example/pubspec.lock index 7ee4ac7..0b263cf 100644 --- a/app_widget_android/example/pubspec.lock +++ b/app_widget_android/example/pubspec.lock @@ -7,15 +7,15 @@ packages: path: ".." relative: true source: path - version: "0.3.1" + version: "0.3.2" app_widget_platform_interface: dependency: transitive description: name: app_widget_platform_interface - sha256: fcfaaf47627cb4cc28a7dad4cceb692c5b9d7ec3e18fbeee07c178b0fcb9461e + sha256: "07c7500e83f86703fdad1aa3480e492a7226b322cbad3e71910f2630df96391e" url: "https://pub.dev" source: hosted - version: "0.3.0" + version: "0.3.1" async: dependency: transitive description: @@ -134,10 +134,10 @@ packages: dependency: transitive description: name: plugin_platform_interface - sha256: "075f927ebbab4262ace8d0b283929ac5410c0ac4e7fc123c76429564facfb757" + sha256: f4f88d4a900933e7267e2b353594774fc0d07fb072b47eedcd5b54e1ea3269f8 url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.7" sky_engine: dependency: transitive description: flutter diff --git a/app_widget_android/pubspec.yaml b/app_widget_android/pubspec.yaml index dd3d075..ceab05f 100644 --- a/app_widget_android/pubspec.yaml +++ b/app_widget_android/pubspec.yaml @@ -1,6 +1,6 @@ name: app_widget_android description: Android implementation for app_widget plugin -version: 0.3.1 +version: 0.3.2 homepage: https://noxasch.tech/ repository: https://github.com/noxasch/flutter_app_widget/tree/master/app_widget_android issue_tracker: https://github.com/noxasch/flutter_app_widget/issues @@ -12,8 +12,8 @@ environment: dependencies: flutter: sdk: flutter - plugin_platform_interface: ^2.0.2 - app_widget_platform_interface: ^0.3.0 + plugin_platform_interface: ^2.1.7 + app_widget_platform_interface: ^0.3.1 # app_widget_platform_interface: # local dev # path: ../app_widget_platform_interface diff --git a/app_widget_platform_interface/CHANGELOG.md b/app_widget_platform_interface/CHANGELOG.md index 3af9cbb..969ae86 100644 --- a/app_widget_platform_interface/CHANGELOG.md +++ b/app_widget_platform_interface/CHANGELOG.md @@ -1,4 +1,8 @@ +## 0.3.1 + +* update platform interface version ## 0.3.0 + * support dart sdk 4.0 ## 0.2.0 diff --git a/app_widget_platform_interface/pubspec.yaml b/app_widget_platform_interface/pubspec.yaml index 0e3937f..b101be4 100644 --- a/app_widget_platform_interface/pubspec.yaml +++ b/app_widget_platform_interface/pubspec.yaml @@ -1,6 +1,6 @@ name: app_widget_platform_interface description: Common platform interface for app_widget plugin. -version: 0.3.0 +version: 0.3.1 homepage: https://noxasch.tech/ repository: https://github.com/noxasch/flutter_app_widget/tree/master/app_widget_platform_interface issue_tracker: https://github.com/noxasch/flutter_app_widget/issues @@ -12,7 +12,7 @@ environment: dependencies: flutter: sdk: flutter - plugin_platform_interface: ^2.0.2 + plugin_platform_interface: ^2.1.7 dev_dependencies: flutter_test: