From 104e9bfb135e5a0e7bedbf11c611dcdc4494ea05 Mon Sep 17 00:00:00 2001 From: LHLL Date: Mon, 22 Jun 2020 10:50:51 -0700 Subject: [PATCH 001/233] [In_App_Purchase]queryPastPurchases() shouldn't block transaction updates. (#2834) * Allow all transactions except for purchasing ones to be passed back to the Flutter side. * Restore transactions shouldn't block transaction updates --- packages/in_app_purchase/CHANGELOG.md | 5 ++++ .../ios/Classes/FIAPaymentQueueHandler.m | 6 ++--- .../ios/Tests/InAppPurchasePluginTest.m | 1 + .../ios/Tests/PaymentQueueTest.m | 5 ++++ packages/in_app_purchase/ios/Tests/Stubs.m | 12 +++++++-- .../in_app_purchase/app_store_connection.dart | 6 +++-- .../in_app_purchase_connection.dart | 2 +- .../sk_payment_queue_wrapper.dart | 5 ++-- packages/in_app_purchase/pubspec.yaml | 2 +- .../app_store_connection_test.dart | 26 +++++++++++++++++-- .../sk_test_stub_objects.dart | 1 + 11 files changed, 56 insertions(+), 15 deletions(-) diff --git a/packages/in_app_purchase/CHANGELOG.md b/packages/in_app_purchase/CHANGELOG.md index b7b025cbef6f..c159b094fb47 100644 --- a/packages/in_app_purchase/CHANGELOG.md +++ b/packages/in_app_purchase/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.3.4+1 + +* iOS: Fix the bug that `SKPaymentQueueWrapper.transactions` doesn't return all transactions. +* iOS: Fix the app crashes if `InAppPurchaseConnection.instance` is called in the `main()`. + ## 0.3.4 * Expose SKError code to client apps. diff --git a/packages/in_app_purchase/ios/Classes/FIAPaymentQueueHandler.m b/packages/in_app_purchase/ios/Classes/FIAPaymentQueueHandler.m index 8bdb7f25f111..57370e16fcbb 100644 --- a/packages/in_app_purchase/ios/Classes/FIAPaymentQueueHandler.m +++ b/packages/in_app_purchase/ios/Classes/FIAPaymentQueueHandler.m @@ -75,7 +75,7 @@ - (void)restoreTransactions:(nullable NSString *)applicationName { - (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions { for (SKPaymentTransaction *transaction in transactions) { - if (transaction.transactionIdentifier) { + if (transaction.transactionState != SKPaymentTransactionStatePurchasing) { // Use product identifier instead of transaction identifier for few reasons: // 1. Only transactions with purchased state and failed state will have a transaction id, it // will become impossible for clients to finish deferred transactions when needed. @@ -92,9 +92,7 @@ - (void)paymentQueue:(SKPaymentQueue *)queue - (void)paymentQueue:(SKPaymentQueue *)queue removedTransactions:(NSArray *)transactions { for (SKPaymentTransaction *transaction in transactions) { - if (transaction.transactionIdentifier) { - [self.transactionsSetter removeObjectForKey:transaction.payment.productIdentifier]; - } + [self.transactionsSetter removeObjectForKey:transaction.payment.productIdentifier]; } self.transactionsRemoved(transactions); } diff --git a/packages/in_app_purchase/ios/Tests/InAppPurchasePluginTest.m b/packages/in_app_purchase/ios/Tests/InAppPurchasePluginTest.m index e6a18e0acf58..20543a203a97 100644 --- a/packages/in_app_purchase/ios/Tests/InAppPurchasePluginTest.m +++ b/packages/in_app_purchase/ios/Tests/InAppPurchasePluginTest.m @@ -121,6 +121,7 @@ - (void)testAddPaymentWithSameProductIDWillFail { @"simulatesAskToBuyInSandBox" : @YES, }]; SKPaymentQueueStub* queue = [SKPaymentQueueStub new]; + queue.testState = SKPaymentTransactionStatePurchased; self.plugin.paymentQueueHandler = [[FIAPaymentQueueHandler alloc] initWithQueue:queue transactionsUpdated:^(NSArray* _Nonnull transactions) { } diff --git a/packages/in_app_purchase/ios/Tests/PaymentQueueTest.m b/packages/in_app_purchase/ios/Tests/PaymentQueueTest.m index 2085ba328140..8f5b66496f69 100644 --- a/packages/in_app_purchase/ios/Tests/PaymentQueueTest.m +++ b/packages/in_app_purchase/ios/Tests/PaymentQueueTest.m @@ -66,6 +66,7 @@ - (void)testTransactionPurchased { [handler addPayment:payment]; [self waitForExpectations:@[ expectation ] timeout:5]; XCTAssertEqual(tran.transactionState, SKPaymentTransactionStatePurchased); + XCTAssertEqual(tran.transactionIdentifier, @"fakeID"); } - (void)testDuplicateTransactionsWillTriggerAnError { @@ -113,6 +114,7 @@ - (void)testTransactionFailed { [handler addPayment:payment]; [self waitForExpectations:@[ expectation ] timeout:5]; XCTAssertEqual(tran.transactionState, SKPaymentTransactionStateFailed); + XCTAssertEqual(tran.transactionIdentifier, nil); } - (void)testTransactionRestored { @@ -140,6 +142,7 @@ - (void)testTransactionRestored { [handler addPayment:payment]; [self waitForExpectations:@[ expectation ] timeout:5]; XCTAssertEqual(tran.transactionState, SKPaymentTransactionStateRestored); + XCTAssertEqual(tran.transactionIdentifier, @"fakeID"); } - (void)testTransactionPurchasing { @@ -167,6 +170,7 @@ - (void)testTransactionPurchasing { [handler addPayment:payment]; [self waitForExpectations:@[ expectation ] timeout:5]; XCTAssertEqual(tran.transactionState, SKPaymentTransactionStatePurchasing); + XCTAssertEqual(tran.transactionIdentifier, nil); } - (void)testTransactionDeferred { @@ -194,6 +198,7 @@ - (void)testTransactionDeferred { [handler addPayment:payment]; [self waitForExpectations:@[ expectation ] timeout:5]; XCTAssertEqual(tran.transactionState, SKPaymentTransactionStateDeferred); + XCTAssertEqual(tran.transactionIdentifier, nil); } - (void)testFinishTransaction { diff --git a/packages/in_app_purchase/ios/Tests/Stubs.m b/packages/in_app_purchase/ios/Tests/Stubs.m index 2c3460f17f4b..58b77c14127d 100644 --- a/packages/in_app_purchase/ios/Tests/Stubs.m +++ b/packages/in_app_purchase/ios/Tests/Stubs.m @@ -215,7 +215,11 @@ - (instancetype)initWithMap:(NSDictionary *)map { - (instancetype)initWithState:(SKPaymentTransactionState)state { self = [super init]; if (self) { - [self setValue:@"fakeID" forKey:@"transactionIdentifier"]; + // Only purchased and restored transactions have transactionIdentifier: + // https://developer.apple.com/documentation/storekit/skpaymenttransaction/1411288-transactionidentifier?language=objc + if (state == SKPaymentTransactionStatePurchased || state == SKPaymentTransactionStateRestored) { + [self setValue:@"fakeID" forKey:@"transactionIdentifier"]; + } [self setValue:@(state) forKey:@"transactionState"]; } return self; @@ -224,7 +228,11 @@ - (instancetype)initWithState:(SKPaymentTransactionState)state { - (instancetype)initWithState:(SKPaymentTransactionState)state payment:(SKPayment *)payment { self = [super init]; if (self) { - [self setValue:@"fakeID" forKey:@"transactionIdentifier"]; + // Only purchased and restored transactions have transactionIdentifier: + // https://developer.apple.com/documentation/storekit/skpaymenttransaction/1411288-transactionidentifier?language=objc + if (state == SKPaymentTransactionStatePurchased || state == SKPaymentTransactionStateRestored) { + [self setValue:@"fakeID" forKey:@"transactionIdentifier"]; + } [self setValue:@(state) forKey:@"transactionState"]; _payment = payment; } diff --git a/packages/in_app_purchase/lib/src/in_app_purchase/app_store_connection.dart b/packages/in_app_purchase/lib/src/in_app_purchase/app_store_connection.dart index 871879dca08e..da6fc7417585 100644 --- a/packages/in_app_purchase/lib/src/in_app_purchase/app_store_connection.dart +++ b/packages/in_app_purchase/lib/src/in_app_purchase/app_store_connection.dart @@ -208,12 +208,14 @@ class _TransactionObserver implements SKTransactionObserverWrapper { return wrapper.transactionState == SKPaymentTransactionStateWrapper.restored; }).map((SKPaymentTransactionWrapper wrapper) => wrapper)); - return; } String receiptData = await getReceiptData(); purchaseUpdatedController - .add(transactions.map((SKPaymentTransactionWrapper transaction) { + .add(transactions.where((SKPaymentTransactionWrapper wrapper) { + return wrapper.transactionState != + SKPaymentTransactionStateWrapper.restored; + }).map((SKPaymentTransactionWrapper transaction) { PurchaseDetails purchaseDetails = PurchaseDetails.fromSKTransaction(transaction, receiptData); return purchaseDetails; diff --git a/packages/in_app_purchase/lib/src/in_app_purchase/in_app_purchase_connection.dart b/packages/in_app_purchase/lib/src/in_app_purchase/in_app_purchase_connection.dart index 2079f69dce6c..ba3932f73878 100644 --- a/packages/in_app_purchase/lib/src/in_app_purchase/in_app_purchase_connection.dart +++ b/packages/in_app_purchase/lib/src/in_app_purchase/in_app_purchase_connection.dart @@ -71,7 +71,7 @@ abstract class InAppPurchaseConnection { /// Enable the [InAppPurchaseConnection] to handle pending purchases. /// - /// Android Only: This method is required to be called when initialize the application. + /// This method is required to be called when initialize the application. /// It is to acknowledge your application has been updated to support pending purchases. /// See [Support pending transactions](https://developer.android.com/google/play/billing/billing_library_overview#pending) /// for more details. diff --git a/packages/in_app_purchase/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart b/packages/in_app_purchase/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart index 49c438e40231..33d9281d3ce0 100644 --- a/packages/in_app_purchase/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart +++ b/packages/in_app_purchase/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart @@ -37,9 +37,7 @@ class SKPaymentQueueWrapper { static final SKPaymentQueueWrapper _singleton = SKPaymentQueueWrapper._(); - SKPaymentQueueWrapper._() { - callbackChannel.setMethodCallHandler(_handleObserverCallbacks); - } + SKPaymentQueueWrapper._(); /// Calls [`-[SKPaymentQueue transactions]`](https://developer.apple.com/documentation/storekit/skpaymentqueue/1506026-transactions?language=objc) Future> transactions() async { @@ -59,6 +57,7 @@ class SKPaymentQueueWrapper { /// addTransactionObserver:]`](https://developer.apple.com/documentation/storekit/skpaymentqueue/1506042-addtransactionobserver?language=objc). void setTransactionObserver(SKTransactionObserverWrapper observer) { _observer = observer; + callbackChannel.setMethodCallHandler(_handleObserverCallbacks); } /// Posts a payment to the queue. diff --git a/packages/in_app_purchase/pubspec.yaml b/packages/in_app_purchase/pubspec.yaml index 12c7b45f7ddf..58f8e1174618 100644 --- a/packages/in_app_purchase/pubspec.yaml +++ b/packages/in_app_purchase/pubspec.yaml @@ -1,7 +1,7 @@ name: in_app_purchase description: A Flutter plugin for in-app purchases. Exposes APIs for making in-app purchases through the App Store and Google Play. homepage: https://github.com/flutter/plugins/tree/master/packages/in_app_purchase -version: 0.3.4 +version: 0.3.4+1 dependencies: async: ^2.0.8 diff --git a/packages/in_app_purchase/test/in_app_purchase_connection/app_store_connection_test.dart b/packages/in_app_purchase/test/in_app_purchase_connection/app_store_connection_test.dart index cb2e0e7cad56..881e1fcc75b7 100644 --- a/packages/in_app_purchase/test/in_app_purchase_connection/app_store_connection_test.dart +++ b/packages/in_app_purchase/test/in_app_purchase_connection/app_store_connection_test.dart @@ -90,6 +90,28 @@ void main() { expect(response.error, isNull); }); + test('queryPastPurchases should not block transaction updates', () async { + fakeIOSPlatform.transactions + .add(fakeIOSPlatform.createPurchasedTransactionWithProductID('foo')); + Completer completer = Completer(); + Stream> stream = + AppStoreConnection.instance.purchaseUpdatedStream; + + StreamSubscription subscription; + subscription = stream.listen((purchaseDetailsList) { + if (purchaseDetailsList.first.status == PurchaseStatus.purchased) { + completer.complete(purchaseDetailsList); + subscription.cancel(); + } + }); + QueryPurchaseDetailsResponse response = + await AppStoreConnection.instance.queryPastPurchases(); + List result = await completer.future; + expect(result.length, 1); + expect(result.first.productID, 'foo'); + expect(response.error, isNull); + }); + test('should get empty result if there is no restored transactions', () async { fakeIOSPlatform.testRestoredTransactionsNull = true; @@ -328,10 +350,10 @@ class FakeIOSPlatform { SKPaymentTransactionWrapper createPendingTransactionWithProductID(String id) { return SKPaymentTransactionWrapper( + transactionIdentifier: null, payment: SKPaymentWrapper(productIdentifier: id), transactionState: SKPaymentTransactionStateWrapper.purchasing, transactionTimeStamp: 123123.121, - transactionIdentifier: id, error: null, originalTransaction: null); } @@ -349,10 +371,10 @@ class FakeIOSPlatform { SKPaymentTransactionWrapper createFailedTransactionWithProductID(String id) { return SKPaymentTransactionWrapper( + transactionIdentifier: null, payment: SKPaymentWrapper(productIdentifier: id), transactionState: SKPaymentTransactionStateWrapper.failed, transactionTimeStamp: 123123.121, - transactionIdentifier: id, error: SKError( code: 0, domain: 'ios_domain', diff --git a/packages/in_app_purchase/test/store_kit_wrappers/sk_test_stub_objects.dart b/packages/in_app_purchase/test/store_kit_wrappers/sk_test_stub_objects.dart index 1dc70748f1db..c976e80a90a5 100644 --- a/packages/in_app_purchase/test/store_kit_wrappers/sk_test_stub_objects.dart +++ b/packages/in_app_purchase/test/store_kit_wrappers/sk_test_stub_objects.dart @@ -22,6 +22,7 @@ final SKPaymentTransactionWrapper dummyOriginalTransaction = transactionIdentifier: '123123', error: dummyError, ); + final SKPaymentTransactionWrapper dummyTransaction = SKPaymentTransactionWrapper( transactionState: SKPaymentTransactionStateWrapper.purchased, From a0e880653458e27bb4afc988e18bf2e996491067 Mon Sep 17 00:00:00 2001 From: "Ming Lyu (CareF)" Date: Tue, 23 Jun 2020 14:03:15 -0400 Subject: [PATCH 002/233] [e2e] Fix e2e pixel ratio (#2842) * Fix e2e device pixel ratio * Update changelog and version * Formatting --- packages/e2e/CHANGELOG.md | 4 ++++ packages/e2e/lib/e2e.dart | 4 ++-- packages/e2e/pubspec.yaml | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/e2e/CHANGELOG.md b/packages/e2e/CHANGELOG.md index 725b648dc5a5..0d349965371b 100644 --- a/packages/e2e/CHANGELOG.md +++ b/packages/e2e/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.5.0+1 + +* Fixed the device pixel ratio problem. + ## 0.5.0 * **Breaking change** by default, tests will use the device window size. diff --git a/packages/e2e/lib/e2e.dart b/packages/e2e/lib/e2e.dart index c2ddb2d6b801..ec1615e904b4 100644 --- a/packages/e2e/lib/e2e.dart +++ b/packages/e2e/lib/e2e.dart @@ -52,8 +52,8 @@ class E2EWidgetsFlutterBinding extends LiveTestWidgetsFlutterBinding { bool get registerTestTextInput => false; @override - ViewConfiguration createViewConfiguration() => - TestViewConfiguration(size: window.physicalSize); + ViewConfiguration createViewConfiguration() => TestViewConfiguration( + size: window.physicalSize / window.devicePixelRatio); final Completer _allTestsPassed = Completer(); diff --git a/packages/e2e/pubspec.yaml b/packages/e2e/pubspec.yaml index 82de42bd5c66..0d4bc99f64f3 100644 --- a/packages/e2e/pubspec.yaml +++ b/packages/e2e/pubspec.yaml @@ -1,6 +1,6 @@ name: e2e description: Runs tests that use the flutter_test API as integration tests. -version: 0.5.0 +version: 0.5.0+1 homepage: https://github.com/flutter/plugins/tree/master/packages/e2e environment: From 88319a90b5cc07070b68c794d9c09d776ee45fac Mon Sep 17 00:00:00 2001 From: "Ming Lyu (CareF)" Date: Wed, 24 Jun 2020 10:52:58 -0400 Subject: [PATCH 003/233] Update README for plugin list (#2843) --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index aeb03ffa23ac..026dd9d7739b 100644 --- a/README.md +++ b/README.md @@ -44,13 +44,18 @@ These are the available plugins in this repository. | [camera](./packages/camera/) | [![pub package](https://img.shields.io/pub/v/camera.svg)](https://pub.dev/packages/camera) | | [connectivity](./packages/connectivity/) | [![pub package](https://img.shields.io/pub/v/connectivity.svg)](https://pub.dev/packages/connectivity) | | [device_info](./packages/device_info/) | [![pub package](https://img.shields.io/pub/v/device_info.svg)](https://pub.dev/packages/device_info) | +| [e2e](./packages/e2e/) | [![pub package](https://img.shields.io/pub/v/e2e.svg)](https://pub.dev/packages/e2e) | +| [espresso](./packages/espresso/) | [![pub package](https://img.shields.io/pub/v/espresso.svg)](https://pub.dev/packages/espresso) | +| [flutter_plugin_android_lifecycle](./packages/flutter_plugin_android_lifecycle/) | [![pub package](https://img.shields.io/pub/v/flutter_plugin_android_lifecycle.svg)](https://pub.dev/packages/flutter_plugin_android_lifecycle) | | [google_maps_flutter](./packages/google_maps_flutter) | [![pub package](https://img.shields.io/pub/v/google_maps_flutter.svg)](https://pub.dev/packages/google_maps_flutter) | | [google_sign_in](./packages/google_sign_in/) | [![pub package](https://img.shields.io/pub/v/google_sign_in.svg)](https://pub.dev/packages/google_sign_in) | | [image_picker](./packages/image_picker/) | [![pub package](https://img.shields.io/pub/v/image_picker.svg)](https://pub.dev/packages/image_picker) | | [in_app_purchase](./packages/in_app_purchase/) | [![pub package](https://img.shields.io/pub/v/in_app_purchase.svg)](https://pub.dev/packages/in_app_purchase) | +| [ios_platform_images](./packages/ios_platform_images/) | [![pub package](https://img.shields.io/pub/v/ios_platform_images.svg)](https://pub.dev/packages/ios_platform_images) | | [local_auth](./packages/local_auth/) | [![pub package](https://img.shields.io/pub/v/local_auth.svg)](https://pub.dev/packages/local_auth) | | [package_info](./packages/package_info/) | [![pub package](https://img.shields.io/pub/v/package_info.svg)](https://pub.dev/packages/package_info) | | [path_provider](./packages/path_provider/) | [![pub package](https://img.shields.io/pub/v/path_provider.svg)](https://pub.dev/packages/path_provider) | +| [plugin_platform_interface](./packages/plugin_platform_interface/) | [![pub package](https://img.shields.io/pub/v/plugin_platform_interface.svg)](https://pub.dev/packages/plugin_platform_interface) | | [quick_actions](./packages/quick_actions/) | [![pub package](https://img.shields.io/pub/v/quick_actions.svg)](https://pub.dev/packages/quick_actions) | | [sensors](./packages/sensors/) | [![pub package](https://img.shields.io/pub/v/sensors.svg)](https://pub.dev/packages/sensors) | | [share](./packages/share/) | [![pub package](https://img.shields.io/pub/v/share.svg)](https://pub.dev/packages/share) | From 388c66e8e3da7914ba657bcfb9ee6aefc2cf38bd Mon Sep 17 00:00:00 2001 From: David Iglesias Date: Mon, 29 Jun 2020 20:23:26 -0700 Subject: [PATCH 004/233] [connectivity_for_web] Introduce connectivity_for_web package. (#2820) Move the package formerly known as `experimental_connectivity_web` to flutter/plugins master, as `connectivity_for_web`. --- .../connectivity_for_web/.gitignore | 8 ++ .../connectivity_for_web/.metadata | 10 ++ .../connectivity_for_web/CHANGELOG.md | 11 ++ .../connectivity/connectivity_for_web/LICENSE | 26 ++++ .../connectivity_for_web/README.md | 62 ++++++++++ .../ios/connectivity_for_web.podspec | 23 ++++ .../lib/connectivity_for_web.dart | 63 ++++++++++ .../src/dart_html_connectivity_plugin.dart | 34 +++++ .../generated/network_information_types.dart | 78 ++++++++++++ ...k_information_api_connectivity_plugin.dart | 48 +++++++ .../lib/src/utils/connectivity_result.dart | 56 +++++++++ .../connectivity_for_web/pubspec.yaml | 31 +++++ .../connectivity_for_web/test/.gitignore | 8 ++ .../connectivity_for_web/test/lib/main.dart | 74 +++++++++++ .../test/lib/src/connectivity_mocks.dart | 60 +++++++++ .../connectivity_for_web/test/pubspec.yaml | 24 ++++ .../connectivity_for_web/test/web/index.html | 10 ++ .../connectivity_for_web/ts/.gitignore | 2 + .../connectivity_for_web/ts/README.md | 25 ++++ .../connectivity_for_web/ts/package-lock.json | 117 ++++++++++++++++++ .../connectivity_for_web/ts/package.json | 17 +++ .../ts/scripts/run_facade_gen.sh | 18 +++ 22 files changed, 805 insertions(+) create mode 100644 packages/connectivity/connectivity_for_web/.gitignore create mode 100644 packages/connectivity/connectivity_for_web/.metadata create mode 100644 packages/connectivity/connectivity_for_web/CHANGELOG.md create mode 100644 packages/connectivity/connectivity_for_web/LICENSE create mode 100644 packages/connectivity/connectivity_for_web/README.md create mode 100644 packages/connectivity/connectivity_for_web/ios/connectivity_for_web.podspec create mode 100644 packages/connectivity/connectivity_for_web/lib/connectivity_for_web.dart create mode 100644 packages/connectivity/connectivity_for_web/lib/src/dart_html_connectivity_plugin.dart create mode 100644 packages/connectivity/connectivity_for_web/lib/src/generated/network_information_types.dart create mode 100644 packages/connectivity/connectivity_for_web/lib/src/network_information_api_connectivity_plugin.dart create mode 100644 packages/connectivity/connectivity_for_web/lib/src/utils/connectivity_result.dart create mode 100644 packages/connectivity/connectivity_for_web/pubspec.yaml create mode 100644 packages/connectivity/connectivity_for_web/test/.gitignore create mode 100644 packages/connectivity/connectivity_for_web/test/lib/main.dart create mode 100644 packages/connectivity/connectivity_for_web/test/lib/src/connectivity_mocks.dart create mode 100644 packages/connectivity/connectivity_for_web/test/pubspec.yaml create mode 100644 packages/connectivity/connectivity_for_web/test/web/index.html create mode 100644 packages/connectivity/connectivity_for_web/ts/.gitignore create mode 100644 packages/connectivity/connectivity_for_web/ts/README.md create mode 100644 packages/connectivity/connectivity_for_web/ts/package-lock.json create mode 100644 packages/connectivity/connectivity_for_web/ts/package.json create mode 100755 packages/connectivity/connectivity_for_web/ts/scripts/run_facade_gen.sh diff --git a/packages/connectivity/connectivity_for_web/.gitignore b/packages/connectivity/connectivity_for_web/.gitignore new file mode 100644 index 000000000000..d7dee828a6b9 --- /dev/null +++ b/packages/connectivity/connectivity_for_web/.gitignore @@ -0,0 +1,8 @@ +.DS_Store +.dart_tool/ + +.packages +.pub/ + +build/ +lib/generated_plugin_registrant.dart diff --git a/packages/connectivity/connectivity_for_web/.metadata b/packages/connectivity/connectivity_for_web/.metadata new file mode 100644 index 000000000000..23eb55ba6da2 --- /dev/null +++ b/packages/connectivity/connectivity_for_web/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 52ee8a6c6565cd421dfa32042941eb40691f4746 + channel: master + +project_type: plugin diff --git a/packages/connectivity/connectivity_for_web/CHANGELOG.md b/packages/connectivity/connectivity_for_web/CHANGELOG.md new file mode 100644 index 000000000000..89e186abe1cb --- /dev/null +++ b/packages/connectivity/connectivity_for_web/CHANGELOG.md @@ -0,0 +1,11 @@ +## 0.3.0 + +* Rename from "experimental_connectivity_web" to "connectivity_for_web", and move to flutter/plugins master. + +## 0.2.0 + +* Add fallback on dart:html for browsers where NetworkInformationAPI is not supported. + +## 0.1.0 + +* Initial release. diff --git a/packages/connectivity/connectivity_for_web/LICENSE b/packages/connectivity/connectivity_for_web/LICENSE new file mode 100644 index 000000000000..4da9688730d1 --- /dev/null +++ b/packages/connectivity/connectivity_for_web/LICENSE @@ -0,0 +1,26 @@ +Copyright 2016, the Flutter project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/connectivity/connectivity_for_web/README.md b/packages/connectivity/connectivity_for_web/README.md new file mode 100644 index 000000000000..66efc49fc840 --- /dev/null +++ b/packages/connectivity/connectivity_for_web/README.md @@ -0,0 +1,62 @@ +# connectivity_for_web + +A web implementation of [connectivity](https://pub.dev/connectivity/connectivity). Currently this package uses an experimental API, with a fallback to dart:html, so not all features may be available to all browsers. + +## Usage + +### Import the package + +This package is a non-endorsed implementation of `connectivity` for the web platform, so you need to modify your `pubspec.yaml` to use it: + +```yaml +... +dependencies: + ... + connectivity: ^0.4.9 + connectivity_for_web: ^0.3.0 + ... +... +``` + +## Example + +Find the example wiring in the [Google sign-in example application](https://github.com/ditman/plugins/blob/connectivity-web/packages/connectivity/connectivity/example/lib/main.dart). + +## Limitations on the web platform + +In order to retrieve information about the quality/speed of a browser's connection, the web implementation of the `connectivity` plugin uses the browser's [**NetworkInformation** Web API](https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation), which as of this writing (June 2020) is still "experimental", and not available in all browsers: + +![Data on support for the netinfo feature across the major browsers from caniuse.com](https://caniuse.bitsofco.de/image/netinfo.png) + +On desktop browsers, this API only returns a very broad set of connectivity statuses (One of `'slow-2g', '2g', '3g', or '4g'`), and may *not* provide a Stream of changes. Firefox still hasn't enabled this feature by default. + +**Fallback to `navigator.onLine`** + +For those browsers where the NetworkInformation Web API is not available, the plugin falls back to the [**NavigatorOnLine** Web API](https://developer.mozilla.org/en-US/docs/Web/API/NavigatorOnLine), which is more broadly supported: + +![Data on support for the online-status feature across the major browsers from caniuse.com](https://caniuse.bitsofco.de/image/online-status.png) + + +The NavigatorOnLine API is [provided by `dart:html`](https://api.dart.dev/stable/2.7.2/dart-html/Navigator/onLine.html), and only supports a boolean connectivity status (either online or offline), with no network speed information. In those cases the plugin will return either `wifi` (when the browser is online) or `none` (when it's not). + +Other than the approximate "downlink" speed, where available, and due to security and privacy concerns, **no Web browser will provide** any specific information about the actual network your users' device is connected to, like **the SSID on a Wi-Fi, or the MAC address of their device.** + +## Contributions and Testing + +Tests are crucial to contributions to this package. All new contributions should be reasonably tested. + +In order to run tests in this package, do: + +``` +cd test +flutter run -d chrome +``` + +All contributions to this package are welcome. Read the [Contributing to Flutter Plugins](https://github.com/flutter/plugins/blob/master/CONTRIBUTING.md) guide to get started. + +## Issues and feedback + +Please file an [issue](https://github.com/ditman/plugins/issues/new) +to send feedback or report a bug. + +**Thank you!** diff --git a/packages/connectivity/connectivity_for_web/ios/connectivity_for_web.podspec b/packages/connectivity/connectivity_for_web/ios/connectivity_for_web.podspec new file mode 100644 index 000000000000..75b891c56533 --- /dev/null +++ b/packages/connectivity/connectivity_for_web/ios/connectivity_for_web.podspec @@ -0,0 +1,23 @@ +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. +# Run `pod lib lint connectivity_web.podspec' to validate before publishing. +# +Pod::Spec.new do |s| + s.name = 'connectivity_for_web' + s.version = '0.1.0' + s.summary = 'No-op implementation of connectivity web plugin to avoid build issues on iOS' + s.description = <<-DESC +temp fake connectivity_web plugin + DESC + s.homepage = 'https://github.com/flutter/plugins/tree/master/packages/connectivity/connectivity_for_web' + s.license = { :file => '../LICENSE' } + s.author = { 'Flutter Team' => 'flutter-dev@googlegroups.com' } + s.source = { :path => '.' } + s.source_files = 'Classes/**/*' + s.dependency 'Flutter' + s.platform = :ios, '8.0' + + # Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported. + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' } + s.swift_version = '5.0' +end diff --git a/packages/connectivity/connectivity_for_web/lib/connectivity_for_web.dart b/packages/connectivity/connectivity_for_web/lib/connectivity_for_web.dart new file mode 100644 index 000000000000..fd061a878867 --- /dev/null +++ b/packages/connectivity/connectivity_for_web/lib/connectivity_for_web.dart @@ -0,0 +1,63 @@ +import 'dart:async'; + +import 'package:connectivity_platform_interface/connectivity_platform_interface.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_web_plugins/flutter_web_plugins.dart'; + +import 'src/network_information_api_connectivity_plugin.dart'; +import 'src/dart_html_connectivity_plugin.dart'; + +/// The web implementation of the ConnectivityPlatform of the Connectivity plugin. +class ConnectivityPlugin extends ConnectivityPlatform { + /// Factory method that initializes the connectivity plugin platform with an instance + /// of the plugin for the web. + static void registerWith(Registrar registrar) { + if (NetworkInformationApiConnectivityPlugin.isSupported()) { + ConnectivityPlatform.instance = NetworkInformationApiConnectivityPlugin(); + } else { + ConnectivityPlatform.instance = DartHtmlConnectivityPlugin(); + } + } + + // The following are completely unsupported methods on the web platform. + + // Creates an "unsupported_operation" PlatformException for a given `method` name. + Object _unsupported(String method) { + return PlatformException( + code: 'UNSUPPORTED_OPERATION', + message: '$method() is not supported on the web platform.', + ); + } + + /// Obtains the wifi name (SSID) of the connected network + @override + Future getWifiName() { + throw _unsupported('getWifiName'); + } + + /// Obtains the wifi BSSID of the connected network. + @override + Future getWifiBSSID() { + throw _unsupported('getWifiBSSID'); + } + + /// Obtains the IP address of the connected wifi network + @override + Future getWifiIP() { + throw _unsupported('getWifiIP'); + } + + /// Request to authorize the location service (Only on iOS). + @override + Future requestLocationServiceAuthorization({ + bool requestAlwaysLocationUsage = false, + }) { + throw _unsupported('requestLocationServiceAuthorization'); + } + + /// Get the current location service authorization (Only on iOS). + @override + Future getLocationServiceAuthorization() { + throw _unsupported('getLocationServiceAuthorization'); + } +} diff --git a/packages/connectivity/connectivity_for_web/lib/src/dart_html_connectivity_plugin.dart b/packages/connectivity/connectivity_for_web/lib/src/dart_html_connectivity_plugin.dart new file mode 100644 index 000000000000..5caa5679d6ad --- /dev/null +++ b/packages/connectivity/connectivity_for_web/lib/src/dart_html_connectivity_plugin.dart @@ -0,0 +1,34 @@ +import 'dart:async'; +import 'dart:html' as html show window; + +import 'package:connectivity_platform_interface/connectivity_platform_interface.dart'; +import 'package:connectivity_for_web/connectivity_for_web.dart'; + +/// The web implementation of the ConnectivityPlatform of the Connectivity plugin. +class DartHtmlConnectivityPlugin extends ConnectivityPlugin { + /// Checks the connection status of the device. + @override + Future checkConnectivity() async { + return html.window.navigator.onLine + ? ConnectivityResult.wifi + : ConnectivityResult.none; + } + + StreamController _connectivityResult; + + /// Returns a Stream of ConnectivityResults changes. + @override + Stream get onConnectivityChanged { + if (_connectivityResult == null) { + _connectivityResult = StreamController(); + // Fallback to dart:html window.onOnline / window.onOffline + html.window.onOnline.listen((event) { + _connectivityResult.add(ConnectivityResult.wifi); + }); + html.window.onOffline.listen((event) { + _connectivityResult.add(ConnectivityResult.none); + }); + } + return _connectivityResult.stream; + } +} diff --git a/packages/connectivity/connectivity_for_web/lib/src/generated/network_information_types.dart b/packages/connectivity/connectivity_for_web/lib/src/generated/network_information_types.dart new file mode 100644 index 000000000000..c4045b3ec1fc --- /dev/null +++ b/packages/connectivity/connectivity_for_web/lib/src/generated/network_information_types.dart @@ -0,0 +1,78 @@ +@JS() +library network_information_types; + +import "package:js/js.dart"; +import "dart:html" show EventListener, EventTarget; + +/// W3C Spec Draft http://wicg.github.io/netinfo/ +/// Edition: Draft Community Group Report 20 February 2019 + +/// http://wicg.github.io/netinfo/#navigatornetworkinformation-interface +@anonymous +@JS() +abstract class Navigator implements NavigatorNetworkInformation {} + +@anonymous +@JS() +abstract class WorkerNavigator implements NavigatorNetworkInformation { + external factory WorkerNavigator({NetworkInformation connection}); +} + +/// http://wicg.github.io/netinfo/#navigatornetworkinformation-interface +@anonymous +@JS() +abstract class NavigatorNetworkInformation { + external NetworkInformation get connection; + external factory NavigatorNetworkInformation({NetworkInformation connection}); +} + +/// http://wicg.github.io/netinfo/#connection-types +/*type ConnectionType = + | 'bluetooth' + | 'cellular' + | 'ethernet' + | 'mixed' + | 'none' + | 'other' + | 'unknown' + | 'wifi' + | 'wimax'; +*/ + +/// http://wicg.github.io/netinfo/#effectiveconnectiontype-enum +/*type EffectiveConnectionType = '2g' | '3g' | '4g' | 'slow-2g';*/ + +/// http://wicg.github.io/netinfo/#dom-megabit +/*type Megabit = number;*/ +/// http://wicg.github.io/netinfo/#dom-millisecond +/*type Millisecond = number;*/ + +/// http://wicg.github.io/netinfo/#networkinformation-interface +@anonymous +@JS() +abstract class NetworkInformation implements EventTarget { + /// http://wicg.github.io/netinfo/#type-attribute + external String /*'bluetooth'|'cellular'|'ethernet'|'mixed'|'none'|'other'|'unknown'|'wifi'|'wimax'*/ get type; + + /// http://wicg.github.io/netinfo/#effectivetype-attribute + external String /*'2g'|'3g'|'4g'|'slow-2g'*/ get effectiveType; + + /// http://wicg.github.io/netinfo/#downlinkmax-attribute + external num get downlinkMax; + + /// http://wicg.github.io/netinfo/#downlink-attribute + external num get downlink; + + /// http://wicg.github.io/netinfo/#rtt-attribute + external num get rtt; + + /// http://wicg.github.io/netinfo/#savedata-attribute + external bool get saveData; + + /// http://wicg.github.io/netinfo/#handling-changes-to-the-underlying-connection + external EventListener get onchange; + external set onchange(EventListener v); +} + +@JS() +external Navigator get navigator; diff --git a/packages/connectivity/connectivity_for_web/lib/src/network_information_api_connectivity_plugin.dart b/packages/connectivity/connectivity_for_web/lib/src/network_information_api_connectivity_plugin.dart new file mode 100644 index 000000000000..d88487b9c406 --- /dev/null +++ b/packages/connectivity/connectivity_for_web/lib/src/network_information_api_connectivity_plugin.dart @@ -0,0 +1,48 @@ +import 'dart:async'; + +import 'package:connectivity_platform_interface/connectivity_platform_interface.dart'; +import 'package:connectivity_for_web/connectivity_for_web.dart'; +import 'package:flutter/foundation.dart'; +import 'package:js/js.dart'; + +import 'generated/network_information_types.dart' as dom; +import 'utils/connectivity_result.dart'; + +/// The web implementation of the ConnectivityPlatform of the Connectivity plugin. +class NetworkInformationApiConnectivityPlugin extends ConnectivityPlugin { + final dom.NetworkInformation _networkInformation; + + /// A check to determine if this version of the plugin can be used. + static bool isSupported() => dom.navigator?.connection != null; + + /// The constructor of the plugin. + NetworkInformationApiConnectivityPlugin() + : this.withConnection(dom.navigator?.connection); + + /// Creates the plugin, with an override of the NetworkInformation object. + @visibleForTesting + NetworkInformationApiConnectivityPlugin.withConnection( + dom.NetworkInformation connection) + : _networkInformation = connection; + + /// Checks the connection status of the device. + @override + Future checkConnectivity() async { + return networkInformationToConnectivityResult(_networkInformation); + } + + StreamController _connectivityResult; + + /// Returns a Stream of ConnectivityResults changes. + @override + Stream get onConnectivityChanged { + if (_connectivityResult == null) { + _connectivityResult = StreamController(); + _networkInformation.onchange = allowInterop((_) { + _connectivityResult + .add(networkInformationToConnectivityResult(_networkInformation)); + }); + } + return _connectivityResult.stream; + } +} diff --git a/packages/connectivity/connectivity_for_web/lib/src/utils/connectivity_result.dart b/packages/connectivity/connectivity_for_web/lib/src/utils/connectivity_result.dart new file mode 100644 index 000000000000..28943ef5c7e1 --- /dev/null +++ b/packages/connectivity/connectivity_for_web/lib/src/utils/connectivity_result.dart @@ -0,0 +1,56 @@ +import 'package:connectivity_platform_interface/connectivity_platform_interface.dart'; + +/// Converts an incoming NetworkInformation object into the correct ConnectivityResult. +// +// We can't be more specific on the signature of this method because the API is odd, +// data can come from a static value in the DOM, or as the 'target' of a DOM Event. +// +// If we type info as `NetworkInformation`, Dart will complain with: +// "Uncaught Error: Expected a value of type 'NetworkInformation', +// but got one of type 'NetworkInformation'" +ConnectivityResult networkInformationToConnectivityResult( + dynamic /* NetworkInformation */ info) { + if (info == null) { + return ConnectivityResult.none; + } + if (info.downlink == 0 && info.rtt == 0) { + return ConnectivityResult.none; + } + if (info.type != null) { + return _typeToConnectivityResult(info.type); + } + if (info.effectiveType != null) { + return _effectiveTypeToConnectivityResult(info.effectiveType); + } + return ConnectivityResult.none; +} + +ConnectivityResult _effectiveTypeToConnectivityResult(String effectiveType) { + // Possible values: + /*'2g'|'3g'|'4g'|'slow-2g'*/ + switch (effectiveType) { + case 'slow-2g': + case '2g': + case '3g': + return ConnectivityResult.mobile; + default: + return ConnectivityResult.wifi; + } +} + +ConnectivityResult _typeToConnectivityResult(String type) { + // Possible values: + /*'bluetooth'|'cellular'|'ethernet'|'mixed'|'none'|'other'|'unknown'|'wifi'|'wimax'*/ + switch (type) { + case 'none': + return ConnectivityResult.none; + case 'bluetooth': + case 'cellular': + case 'mixed': + case 'other': + case 'unknown': + return ConnectivityResult.mobile; + default: + return ConnectivityResult.wifi; + } +} diff --git a/packages/connectivity/connectivity_for_web/pubspec.yaml b/packages/connectivity/connectivity_for_web/pubspec.yaml new file mode 100644 index 000000000000..e4a1673e40c2 --- /dev/null +++ b/packages/connectivity/connectivity_for_web/pubspec.yaml @@ -0,0 +1,31 @@ +name: connectivity_for_web +description: An implementation for the web platform of the Flutter `connectivity` plugin. This uses the NetworkInformation Web API, with a fallback to Navigator.onLine. +version: 0.3.0 +homepage: https://github.com/ditman/plugins/tree/connectivity-web/packages/connectivity/experimental_connectivity_web + +flutter: + plugin: + platforms: + web: + pluginClass: ConnectivityPlugin + fileName: connectivity_for_web.dart + +dependencies: + connectivity_platform_interface: ^1.0.3 + js: ^0.6.1+1 + flutter_web_plugins: + sdk: flutter + flutter: + sdk: flutter + +dev_dependencies: + test: any + flutter_driver: + sdk: flutter + flutter_test: + sdk: flutter + e2e: ^0.2.4+3 + +environment: + sdk: ">=2.6.0 <3.0.0" + flutter: ">=1.12.13+hotfix.4" diff --git a/packages/connectivity/connectivity_for_web/test/.gitignore b/packages/connectivity/connectivity_for_web/test/.gitignore new file mode 100644 index 000000000000..d7dee828a6b9 --- /dev/null +++ b/packages/connectivity/connectivity_for_web/test/.gitignore @@ -0,0 +1,8 @@ +.DS_Store +.dart_tool/ + +.packages +.pub/ + +build/ +lib/generated_plugin_registrant.dart diff --git a/packages/connectivity/connectivity_for_web/test/lib/main.dart b/packages/connectivity/connectivity_for_web/test/lib/main.dart new file mode 100644 index 000000000000..21621a947ee6 --- /dev/null +++ b/packages/connectivity/connectivity_for_web/test/lib/main.dart @@ -0,0 +1,74 @@ +import 'package:e2e/e2e.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:connectivity_platform_interface/connectivity_platform_interface.dart'; +import 'package:connectivity_for_web/src/network_information_api_connectivity_plugin.dart'; + +import 'src/connectivity_mocks.dart'; + +void main() { + E2EWidgetsFlutterBinding.ensureInitialized(); + + group('checkConnectivity', () { + void testCheckConnectivity({ + String type, + String effectiveType, + num downlink = 10, + num rtt = 50, + ConnectivityResult expected, + }) { + MockNetworkInformation connection = MockNetworkInformation( + type: type, + effectiveType: effectiveType, + downlink: downlink, + rtt: rtt); + NetworkInformationApiConnectivityPlugin plugin = + NetworkInformationApiConnectivityPlugin.withConnection(connection); + expect(plugin.checkConnectivity(), completion(equals(expected))); + } + + test('0 downlink and rtt -> none', () { + testCheckConnectivity( + effectiveType: '4g', + downlink: 0, + rtt: 0, + expected: ConnectivityResult.none); + }); + test('slow-2g -> mobile', () { + testCheckConnectivity( + effectiveType: 'slow-2g', expected: ConnectivityResult.mobile); + }); + test('2g -> mobile', () { + testCheckConnectivity( + effectiveType: '2g', expected: ConnectivityResult.mobile); + }); + test('3g -> mobile', () { + testCheckConnectivity( + effectiveType: '3g', expected: ConnectivityResult.mobile); + }); + test('4g -> wifi', () { + testCheckConnectivity( + effectiveType: '4g', expected: ConnectivityResult.wifi); + }); + }); + + group('get onConnectivityChanged', () { + test('puts change events in a Stream', () async { + MockNetworkInformation connection = + MockNetworkInformation(effectiveType: '4g', downlink: 10, rtt: 50); + NetworkInformationApiConnectivityPlugin plugin = + NetworkInformationApiConnectivityPlugin.withConnection(connection); + + Stream results = plugin.onConnectivityChanged; + + // Fake a disconnect-reconnect + connection.mockChangeValue(downlink: 0, rtt: 0); + connection.mockChangeValue(downlink: 10, rtt: 50); + + // The stream of results is infinite, so we need to .take(2) for this test to complete. + expect( + results.take(2).toList(), + completion( + equals([ConnectivityResult.none, ConnectivityResult.wifi]))); + }); + }); +} diff --git a/packages/connectivity/connectivity_for_web/test/lib/src/connectivity_mocks.dart b/packages/connectivity/connectivity_for_web/test/lib/src/connectivity_mocks.dart new file mode 100644 index 000000000000..9ce2e811d461 --- /dev/null +++ b/packages/connectivity/connectivity_for_web/test/lib/src/connectivity_mocks.dart @@ -0,0 +1,60 @@ +import 'dart:html'; + +import 'package:connectivity_for_web/src/generated/network_information_types.dart' + as dom; + +/// A Mock implementation of the NetworkInformation API that allows +/// for external modification of its values. +class MockNetworkInformation extends dom.NetworkInformation { + @override + String type; + + @override + String effectiveType; + + @override + num downlink; + + @override + num rtt; + + @override + EventListener onchange; + + /// Constructor of mocked instances... + MockNetworkInformation({ + this.type, + this.effectiveType, + this.downlink, + this.rtt, + }); + + /// Changes the desired values, and triggers the change event listener. + void mockChangeValue({ + String type, + String effectiveType, + num downlink, + num rtt, + }) { + this.type = type ?? this.type; + this.effectiveType = effectiveType ?? this.effectiveType; + this.downlink = downlink ?? this.downlink; + this.rtt = rtt ?? this.rtt; + + onchange(Event('change')); + } + + @override + void addEventListener(String type, listener, [bool useCapture]) {} + + @override + bool dispatchEvent(Event event) { + return true; + } + + @override + Events get on => null; + + @override + void removeEventListener(String type, listener, [bool useCapture]) {} +} diff --git a/packages/connectivity/connectivity_for_web/test/pubspec.yaml b/packages/connectivity/connectivity_for_web/test/pubspec.yaml new file mode 100644 index 000000000000..4d7d10a775e2 --- /dev/null +++ b/packages/connectivity/connectivity_for_web/test/pubspec.yaml @@ -0,0 +1,24 @@ +name: connectivity_web_example +description: Example web app for the connectivity plugin +version: 0.1.0 +homepage: https://github.com/flutter/plugins/tree/master/packages/connectivity/connectivity_web + +dependencies: + connectivity_for_web: + path: ../ + js: ^0.6.1+1 + flutter_web_plugins: + sdk: flutter + flutter: + sdk: flutter + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_driver: + sdk: flutter + e2e: ^0.2.4+3 + +environment: + sdk: ">=2.6.0 <3.0.0" + flutter: ">=1.12.13+hotfix.4" diff --git a/packages/connectivity/connectivity_for_web/test/web/index.html b/packages/connectivity/connectivity_for_web/test/web/index.html new file mode 100644 index 000000000000..6eff9a740d43 --- /dev/null +++ b/packages/connectivity/connectivity_for_web/test/web/index.html @@ -0,0 +1,10 @@ + + + + + example + + + + + diff --git a/packages/connectivity/connectivity_for_web/ts/.gitignore b/packages/connectivity/connectivity_for_web/ts/.gitignore new file mode 100644 index 000000000000..de4d1f007dd1 --- /dev/null +++ b/packages/connectivity/connectivity_for_web/ts/.gitignore @@ -0,0 +1,2 @@ +dist +node_modules diff --git a/packages/connectivity/connectivity_for_web/ts/README.md b/packages/connectivity/connectivity_for_web/ts/README.md new file mode 100644 index 000000000000..3372ad2f3790 --- /dev/null +++ b/packages/connectivity/connectivity_for_web/ts/README.md @@ -0,0 +1,25 @@ +# JS Facade generator + +This npm script takes the `network-information-types` npm package, and runs it through Dart's `dart_js_facade_gen` to auto-generate (most) of the JS facades used by this plugin. + +The process is not completely automated yet, but it should be pretty close. + +To generate the facades, and after [installing `npm`](https://www.npmjs.com/get-npm), do: + +``` +npm install +npm run build +``` + +The above will fetch the required dependencies, and generate a `dist/network_information_types.dart` file that you can use with the plugin. + +``` +cp dist/*.dart ../lib/src/generated +``` + +This script should come handy once the Network Information Web API changes, or becomes stable, so the JS-interop part of this plugin can be regenerated more easily. + +Read more: + +* [Dart JS Interop](https://dart.dev/web/js-interop) +* [dart_js_facade_gen](https://www.npmjs.com/package/dart_js_facade_gen) \ No newline at end of file diff --git a/packages/connectivity/connectivity_for_web/ts/package-lock.json b/packages/connectivity/connectivity_for_web/ts/package-lock.json new file mode 100644 index 000000000000..45293a400492 --- /dev/null +++ b/packages/connectivity/connectivity_for_web/ts/package-lock.json @@ -0,0 +1,117 @@ +{ + "name": "network-information-types-to-dart-generator", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/chai": { + "version": "4.2.9", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.9.tgz", + "integrity": "sha512-NeXgZj+MFL4izGqA4sapdYzkzQG+MtGra9vhQ58dnmDY++VgJaRUws+aLVV5zRJCYJl/8s9IjMmhiUw1WsKSmw==" + }, + "@types/fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-UoOfVEzAUpeSPmjm7h1uk5MH6KZma2z2O7a75onTGjnNvAvMVrPzPL/vBbT65iIGHWj6rokwfmYcmxmlSf2uwg==", + "requires": { + "@types/node": "*" + } + }, + "@types/minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY=" + }, + "@types/mocha": { + "version": "5.2.7", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz", + "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==" + }, + "@types/node": { + "version": "12.12.28", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.28.tgz", + "integrity": "sha512-g73GJYJDXgf0jqg+P9S8h2acWbDXNkoCX8DLtJVu7Fkn788pzQ/oJsrdJz/2JejRf/SjfZaAhsw+3nd1D5EWGg==" + }, + "@types/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@types/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LrnsgZIfJaysFkv9rRJp4/uAyqw87oVed3s1hhF83nwbo9c7MG9g5DqR0seHP+lkX4ldmMrVolPjQSe2ZfD0yA==", + "requires": { + "source-map": "*" + } + }, + "@types/source-map-support": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/@types/source-map-support/-/source-map-support-0.5.1.tgz", + "integrity": "sha512-VDqnZe9D2zR19qbeRvwYyHSp7AtUtCkTaRVFQ8wzwH9TXw9kKKq/vBhfEnFEXVupO2M0lBMA9mr/XyQ6gEkUOA==", + "requires": { + "@types/node": "*" + } + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" + }, + "dart-style": { + "version": "1.3.2-dev", + "resolved": "https://registry.npmjs.org/dart-style/-/dart-style-1.3.2-dev.tgz", + "integrity": "sha512-NFI4UQYvG32t/cEkQAdkXT2ZT72tjF61tMWoALmnGwj03d2Co94zwGfbnFfdQUQvrhUNx8Wz2jKSVxGrmFaVJQ==" + }, + "dart_js_facade_gen": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/dart_js_facade_gen/-/dart_js_facade_gen-0.0.7.tgz", + "integrity": "sha512-AZiWsccbzhgJWmBjbFTPuvBhwGXk7AN8nOP91/I8PqUfSvVALiWshDc66TvywNkdNogAE5X8zlxjodw1C3iHpA==", + "requires": { + "@types/chai": "^4.2.3", + "@types/fs-extra": "^8.0.0", + "@types/minimist": "^1.2.0", + "@types/mocha": "^5.2.7", + "@types/node": "^12.7.8", + "@types/source-map": "^0.5.7", + "@types/source-map-support": "^0.5.0", + "dart-style": "^1.3.2-dev", + "minimist": "^1.2.0", + "source-map": "^0.7.3", + "source-map-support": "^0.5.13", + "typescript": "^3.6.3" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + }, + "network-information-types": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/network-information-types/-/network-information-types-0.1.0.tgz", + "integrity": "sha512-cRUCYZoRHTMjYcgk5MbwqM0h0Za34panRxAJKY8n+mQ+NLMuRIw7aKzmaZqkC/cte7bnRcdfTwFA27GgN62EtQ==" + }, + "source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==" + }, + "source-map-support": { + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.16.tgz", + "integrity": "sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==", + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + } + } + }, + "typescript": { + "version": "3.8.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.2.tgz", + "integrity": "sha512-EgOVgL/4xfVrCMbhYKUQTdF37SQn4Iw73H5BgCrF1Abdun7Kwy/QZsE/ssAy0y4LxBbvua3PIbFsbRczWWnDdQ==" + } + } +} diff --git a/packages/connectivity/connectivity_for_web/ts/package.json b/packages/connectivity/connectivity_for_web/ts/package.json new file mode 100644 index 000000000000..665c89d6afbb --- /dev/null +++ b/packages/connectivity/connectivity_for_web/ts/package.json @@ -0,0 +1,17 @@ +{ + "name": "network-information-types-to-dart-generator", + "version": "1.0.0", + "description": "Use dart_js_facade_gen to generate the facade for the network-information-types package.", + "main": "index.js", + "private": true, + "scripts": { + "build": "./scripts/run_facade_gen.sh", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "MIT", + "dependencies": { + "network-information-types": "0.1.0", + "dart_js_facade_gen": "^0.0.7" + } +} diff --git a/packages/connectivity/connectivity_for_web/ts/scripts/run_facade_gen.sh b/packages/connectivity/connectivity_for_web/ts/scripts/run_facade_gen.sh new file mode 100755 index 000000000000..c74b8ba171b2 --- /dev/null +++ b/packages/connectivity/connectivity_for_web/ts/scripts/run_facade_gen.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +INDEX_PATH=node_modules/network-information-types/dist-types/index.d.ts +WORK_PATH=network_information_types.d.ts +DIST_PATH=dist + +# Create dist if it doesn't exist already +mkdir -p $DIST_PATH + +# Copy the input file(s) into our work path +cp $INDEX_PATH $WORK_PATH + +# Run dart_js_facade_gen +dart_js_facade_gen $WORK_PATH --trust-js-types --generate-html --destination . + +# Move output to the right place, and clean after yourself +mv *.dart $DIST_PATH +rm $WORK_PATH From 940c10ca28290a01a11f1d830972b88bdac672e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Palma?= Date: Tue, 30 Jun 2020 19:42:00 +0100 Subject: [PATCH 005/233] [url_launcher_web] Adds "tel" and "sms" URL support (#2847) --- .../url_launcher_web/CHANGELOG.md | 4 ++ .../lib/url_launcher_web.dart | 19 ++++-- .../url_launcher_web/pubspec.yaml | 2 +- .../test/url_launcher_web_test.dart | 65 ++++++++++++++++++- 4 files changed, 82 insertions(+), 8 deletions(-) diff --git a/packages/url_launcher/url_launcher_web/CHANGELOG.md b/packages/url_launcher/url_launcher_web/CHANGELOG.md index df1b2c97b744..e9f7bde63fda 100644 --- a/packages/url_launcher/url_launcher_web/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_web/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.1.2 + +- Adds "tel" and "sms" support + # 0.1.1+6 - Open "mailto" urls with target set as "\_top" on Safari browsers. diff --git a/packages/url_launcher/url_launcher_web/lib/url_launcher_web.dart b/packages/url_launcher/url_launcher_web/lib/url_launcher_web.dart index e55ceb2269bc..1bac4d524122 100644 --- a/packages/url_launcher/url_launcher_web/lib/url_launcher_web.dart +++ b/packages/url_launcher/url_launcher_web/lib/url_launcher_web.dart @@ -7,7 +7,11 @@ import 'package:url_launcher_platform_interface/url_launcher_platform_interface. import 'package:platform_detect/platform_detect.dart' show browser; -const _mailtoScheme = 'mailto'; +const _safariTargetTopSchemes = { + 'mailto', + 'tel', + 'sms', +}; /// The web implementation of [UrlLauncherPlatform]. /// @@ -16,7 +20,10 @@ class UrlLauncherPlugin extends UrlLauncherPlatform { html.Window _window; // The set of schemes that can be handled by the plugin - static final _supportedSchemes = {'http', 'https', _mailtoScheme}; + static final _supportedSchemes = { + 'http', + 'https', + }.union(_safariTargetTopSchemes); /// A constructor that allows tests to override the window object used by the plugin. UrlLauncherPlugin({@visibleForTesting html.Window window}) @@ -29,16 +36,18 @@ class UrlLauncherPlugin extends UrlLauncherPlatform { String _getUrlScheme(String url) => Uri.tryParse(url)?.scheme; - bool _isMailtoScheme(String url) => _getUrlScheme(url) == _mailtoScheme; + bool _isSafariTargetTopScheme(String url) => + _safariTargetTopSchemes.contains(_getUrlScheme(url)); /// Opens the given [url] in a new window. /// /// Returns the newly created window. @visibleForTesting html.WindowBase openNewWindow(String url) { - // We need to open mailto urls on the _top window context on safari browsers. + // We need to open mailto, tel and sms urls on the _top window context on safari browsers. // See https://github.com/flutter/flutter/issues/51461 for reference. - final target = browser.isSafari && _isMailtoScheme(url) ? '_top' : ''; + final target = + browser.isSafari && _isSafariTargetTopScheme(url) ? '_top' : ''; return _window.open(url, target); } diff --git a/packages/url_launcher/url_launcher_web/pubspec.yaml b/packages/url_launcher/url_launcher_web/pubspec.yaml index 207f2dc15424..9a5beac00b94 100644 --- a/packages/url_launcher/url_launcher_web/pubspec.yaml +++ b/packages/url_launcher/url_launcher_web/pubspec.yaml @@ -4,7 +4,7 @@ homepage: https://github.com/flutter/plugins/tree/master/packages/url_launcher/u # 0.1.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.1.1+6 +version: 0.1.2 flutter: plugin: diff --git a/packages/url_launcher/url_launcher_web/test/url_launcher_web_test.dart b/packages/url_launcher/url_launcher_web/test/url_launcher_web_test.dart index 4cf92062e10f..b7e107d892cf 100644 --- a/packages/url_launcher/url_launcher_web/test/url_launcher_web_test.dart +++ b/packages/url_launcher/url_launcher_web/test/url_launcher_web_test.dart @@ -36,8 +36,13 @@ void main() { plugin.canLaunch('mailto:name@mydomain.com'), completion(isTrue)); }); - test('"tel" URLs -> false', () { - expect(plugin.canLaunch('tel:5551234567'), completion(isFalse)); + test('"tel" URLs -> true', () { + expect(plugin.canLaunch('tel:5551234567'), completion(isTrue)); + }); + + test('"sms" URLs -> true', () { + expect(plugin.canLaunch('sms:+19725551212?body=hello%20there'), + completion(isTrue)); }); }); @@ -48,6 +53,9 @@ void main() { .thenReturn(MockWindow()); when(mockWindow.open('mailto:name@mydomain.com', '')) .thenReturn(MockWindow()); + when(mockWindow.open('tel:5551234567', '')).thenReturn(MockWindow()); + when(mockWindow.open('sms:+19725551212?body=hello%20there', '')) + .thenReturn(MockWindow()); }); test('launching a URL returns true', () { @@ -77,6 +85,34 @@ void main() { ), completion(isTrue)); }); + + test('launching a "tel" returns true', () { + expect( + plugin.launch( + 'tel:5551234567', + useSafariVC: null, + useWebView: null, + universalLinksOnly: null, + enableDomStorage: null, + enableJavaScript: null, + headers: null, + ), + completion(isTrue)); + }); + + test('launching a "sms" returns true', () { + expect( + plugin.launch( + 'sms:+19725551212?body=hello%20there', + useSafariVC: null, + useWebView: null, + universalLinksOnly: null, + enableDomStorage: null, + enableJavaScript: null, + headers: null, + ), + completion(isTrue)); + }); }); group('openNewWindow', () { @@ -98,6 +134,18 @@ void main() { verify(mockWindow.open('mailto:name@mydomain.com', '')); }); + test('tel urls should be launched on a new window', () { + plugin.openNewWindow('tel:5551234567'); + + verify(mockWindow.open('tel:5551234567', '')); + }); + + test('sms urls should be launched on a new window', () { + plugin.openNewWindow('sms:+19725551212?body=hello%20there'); + + verify(mockWindow.open('sms:+19725551212?body=hello%20there', '')); + }); + group('Safari', () { setUp(() { platform.configurePlatformForTesting(browser: platform.safari); @@ -120,6 +168,19 @@ void main() { verify(mockWindow.open('mailto:name@mydomain.com', '_top')); }); + + test('tel urls should be launched on the same window', () { + plugin.openNewWindow('tel:5551234567'); + + verify(mockWindow.open('tel:5551234567', '_top')); + }); + + test('sms urls should be launched on the same window', () { + plugin.openNewWindow('sms:+19725551212?body=hello%20there'); + + verify( + mockWindow.open('sms:+19725551212?body=hello%20there', '_top')); + }); }); }); }); From e08b09cb74a1a5f9fd4c1744de6cf0d69b688a07 Mon Sep 17 00:00:00 2001 From: Robert Ancell Date: Wed, 1 Jul 2020 10:07:47 +1200 Subject: [PATCH 006/233] [shared_preferences_linux] Add support for Linux (#2836) Adds shared_preferences support for Linux. Part of flutter/flutter#41720 --- .../shared_preferences_linux/.gitignore | 7 ++ .../shared_preferences_linux/.metadata | 10 ++ .../shared_preferences_linux/CHANGELOG.md | 2 + .../shared_preferences_linux/LICENSE | 27 ++++++ .../shared_preferences_linux/README.md | 22 +++++ .../example/.gitignore | 43 +++++++++ .../example/.metadata | 10 ++ .../example/README.md | 8 ++ .../example/lib/main.dart | 87 +++++++++++++++++ .../example/pubspec.yaml | 15 +++ .../lib/shared_preferences_linux.dart | 96 +++++++++++++++++++ .../shared_preferences_linux/pubspec.yaml | 29 ++++++ .../test/shared_preferences_linux_test.dart | 74 ++++++++++++++ script/build_all_plugins_app.sh | 1 + 14 files changed, 431 insertions(+) create mode 100644 packages/shared_preferences/shared_preferences_linux/.gitignore create mode 100644 packages/shared_preferences/shared_preferences_linux/.metadata create mode 100644 packages/shared_preferences/shared_preferences_linux/CHANGELOG.md create mode 100644 packages/shared_preferences/shared_preferences_linux/LICENSE create mode 100644 packages/shared_preferences/shared_preferences_linux/README.md create mode 100644 packages/shared_preferences/shared_preferences_linux/example/.gitignore create mode 100644 packages/shared_preferences/shared_preferences_linux/example/.metadata create mode 100644 packages/shared_preferences/shared_preferences_linux/example/README.md create mode 100644 packages/shared_preferences/shared_preferences_linux/example/lib/main.dart create mode 100644 packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml create mode 100644 packages/shared_preferences/shared_preferences_linux/lib/shared_preferences_linux.dart create mode 100644 packages/shared_preferences/shared_preferences_linux/pubspec.yaml create mode 100644 packages/shared_preferences/shared_preferences_linux/test/shared_preferences_linux_test.dart diff --git a/packages/shared_preferences/shared_preferences_linux/.gitignore b/packages/shared_preferences/shared_preferences_linux/.gitignore new file mode 100644 index 000000000000..e9dc58d3d6e2 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_linux/.gitignore @@ -0,0 +1,7 @@ +.DS_Store +.dart_tool/ + +.packages +.pub/ + +build/ diff --git a/packages/shared_preferences/shared_preferences_linux/.metadata b/packages/shared_preferences/shared_preferences_linux/.metadata new file mode 100644 index 000000000000..9615744e96d1 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_linux/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: e491544588e8d34fdf31d5f840b4649850ef167a + channel: master + +project_type: plugin diff --git a/packages/shared_preferences/shared_preferences_linux/CHANGELOG.md b/packages/shared_preferences/shared_preferences_linux/CHANGELOG.md new file mode 100644 index 000000000000..11694802aacf --- /dev/null +++ b/packages/shared_preferences/shared_preferences_linux/CHANGELOG.md @@ -0,0 +1,2 @@ +## 0.0.1 +* Initial release to support shared_preferences on Linux. diff --git a/packages/shared_preferences/shared_preferences_linux/LICENSE b/packages/shared_preferences/shared_preferences_linux/LICENSE new file mode 100644 index 000000000000..0c91662b3f2f --- /dev/null +++ b/packages/shared_preferences/shared_preferences_linux/LICENSE @@ -0,0 +1,27 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/shared_preferences/shared_preferences_linux/README.md b/packages/shared_preferences/shared_preferences_linux/README.md new file mode 100644 index 000000000000..1894f50ae99e --- /dev/null +++ b/packages/shared_preferences/shared_preferences_linux/README.md @@ -0,0 +1,22 @@ +# shared_preferences_linux + +The Linux implementation of [`shared_preferences`][1]. + +## Usage + +### Import the package + +This package is an unendorsed Linux implementation of `shared_preferences`. + +In order to use this now, you'll need to depend on `shared_preferences_linux`. +When this package is endorsed it will be automatically used by the `shared_preferences` package and you can switch to that API. + +```yaml +... +dependencies: + ... + shared_preferences_linux: ^0.0.1 + ... +``` + +[1]: ../ diff --git a/packages/shared_preferences/shared_preferences_linux/example/.gitignore b/packages/shared_preferences/shared_preferences_linux/example/.gitignore new file mode 100644 index 000000000000..1ba9c339effb --- /dev/null +++ b/packages/shared_preferences/shared_preferences_linux/example/.gitignore @@ -0,0 +1,43 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Web related +lib/generated_plugin_registrant.dart + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Exceptions to above rules. +!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages diff --git a/packages/shared_preferences/shared_preferences_linux/example/.metadata b/packages/shared_preferences/shared_preferences_linux/example/.metadata new file mode 100644 index 000000000000..c0bc9a90268a --- /dev/null +++ b/packages/shared_preferences/shared_preferences_linux/example/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: e491544588e8d34fdf31d5f840b4649850ef167a + channel: master + +project_type: app diff --git a/packages/shared_preferences/shared_preferences_linux/example/README.md b/packages/shared_preferences/shared_preferences_linux/example/README.md new file mode 100644 index 000000000000..9d3bf1faf406 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_linux/example/README.md @@ -0,0 +1,8 @@ +# shared_preferences_example + +Demonstrates how to use the shared_preferences plugin. + +## Getting Started + +For help getting started with Flutter, view our online +[documentation](http://flutter.io/). diff --git a/packages/shared_preferences/shared_preferences_linux/example/lib/main.dart b/packages/shared_preferences/shared_preferences_linux/example/lib/main.dart new file mode 100644 index 000000000000..ceacf2f95f28 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_linux/example/lib/main.dart @@ -0,0 +1,87 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// ignore_for_file: public_member_api_docs + +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:shared_preferences_linux/shared_preferences_linux.dart'; + +void main() { + runApp(MyApp()); +} + +class MyApp extends StatelessWidget { + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'SharedPreferences Demo', + home: SharedPreferencesDemo(), + ); + } +} + +class SharedPreferencesDemo extends StatefulWidget { + SharedPreferencesDemo({Key key}) : super(key: key); + + @override + SharedPreferencesDemoState createState() => SharedPreferencesDemoState(); +} + +class SharedPreferencesDemoState extends State { + final prefs = SharedPreferencesLinux.instance; + Future _counter; + + Future _incrementCounter() async { + final values = await prefs.getAll(); + final int counter = (values['counter'] as int ?? 0) + 1; + + setState(() { + _counter = prefs.setValue(null, "counter", counter).then((bool success) { + return counter; + }); + }); + } + + @override + void initState() { + super.initState(); + _counter = prefs.getAll().then((Map values) { + return (values['counter'] ?? 0); + }); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text("SharedPreferences Demo"), + ), + body: Center( + child: FutureBuilder( + future: _counter, + builder: (BuildContext context, AsyncSnapshot snapshot) { + switch (snapshot.connectionState) { + case ConnectionState.waiting: + return const CircularProgressIndicator(); + default: + if (snapshot.hasError) { + return Text('Error: ${snapshot.error}'); + } else { + return Text( + 'Button tapped ${snapshot.data} time${snapshot.data == 1 ? '' : 's'}.\n\n' + 'This should persist across restarts.', + ); + } + } + })), + floatingActionButton: FloatingActionButton( + onPressed: _incrementCounter, + tooltip: 'Increment', + child: const Icon(Icons.add), + ), + ); + } +} diff --git a/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml b/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml new file mode 100644 index 000000000000..1c0624035c54 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml @@ -0,0 +1,15 @@ +name: shared_preferences_linux_example +description: Demonstrates how to use the shared_preferences_linux plugin. + +dependencies: + flutter: + sdk: flutter + shared_preferences_linux: ^0.1.0 + +dependency_overrides: + shared_preferences_linux: + path: ../ + +flutter: + uses-material-design: true + diff --git a/packages/shared_preferences/shared_preferences_linux/lib/shared_preferences_linux.dart b/packages/shared_preferences/shared_preferences_linux/lib/shared_preferences_linux.dart new file mode 100644 index 000000000000..dc93100c3277 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_linux/lib/shared_preferences_linux.dart @@ -0,0 +1,96 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:async'; +import 'dart:convert' show json; +import 'package:file/file.dart'; +import 'package:file/local.dart'; +import 'package:meta/meta.dart'; +import 'package:path/path.dart' as path; +import 'package:path_provider/path_provider.dart'; +import 'package:shared_preferences_platform_interface/shared_preferences_platform_interface.dart'; + +/// The Linux implementation of [SharedPreferencesStorePlatform]. +/// +/// This class implements the `package:shared_preferences` functionality for Linux. +class SharedPreferencesLinux extends SharedPreferencesStorePlatform { + /// The default instance of [SharedPreferencesLinux] to use. + static SharedPreferencesLinux instance = SharedPreferencesLinux(); + + /// Local copy of preferences + Map _cachedPreferences; + + /// File system used to store to disk. Exposed for testing only. + @visibleForTesting + FileSystem fs = LocalFileSystem(); + + /// Gets the file where the preferences are stored. + Future _getLocalDataFile() async { + var directory = await getApplicationSupportDirectory(); + var filePath = path.join(directory.path, 'shared_preferences.json'); + return fs.file(filePath); + } + + /// Gets the preferences from the stored file. Once read, the preferences are + /// maintained in memory. + Future> _readPreferences() async { + if (_cachedPreferences != null) { + return _cachedPreferences; + } + + _cachedPreferences = {}; + var localDataFile = await _getLocalDataFile(); + if (localDataFile.existsSync()) { + String stringMap = localDataFile.readAsStringSync(); + if (stringMap.isNotEmpty) { + _cachedPreferences = json.decode(stringMap) as Map; + } + } + + return _cachedPreferences; + } + + /// Writes the cached preferences to disk. Returns [true] if the operation + /// succeeded. + Future _writePreferences(Map preferences) async { + try { + var localDataFile = await _getLocalDataFile(); + if (!localDataFile.existsSync()) { + localDataFile.createSync(recursive: true); + } + var stringMap = json.encode(preferences); + localDataFile.writeAsStringSync(stringMap); + } catch (e) { + print("Error saving preferences to disk: $e"); + return false; + } + return true; + } + + @override + Future clear() async { + var preferences = await _readPreferences(); + preferences.clear(); + return _writePreferences(preferences); + } + + @override + Future> getAll() async { + return _readPreferences(); + } + + @override + Future remove(String key) async { + var preferences = await _readPreferences(); + preferences.remove(key); + return _writePreferences(preferences); + } + + @override + Future setValue(String valueType, String key, Object value) async { + var preferences = await _readPreferences(); + preferences[key] = value; + return _writePreferences(preferences); + } +} diff --git a/packages/shared_preferences/shared_preferences_linux/pubspec.yaml b/packages/shared_preferences/shared_preferences_linux/pubspec.yaml new file mode 100644 index 000000000000..2539b937e006 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_linux/pubspec.yaml @@ -0,0 +1,29 @@ +name: shared_preferences_linux +description: Linux implementation of the shared_preferences plugin +version: 0.0.1 +homepage: https://github.com/flutter/plugins/tree/master/packages/shared_preferences/shared_preferences_linux + +flutter: + plugin: + platforms: + linux: + dartPluginClass: SharedPreferencesLinux + pluginClass: none + +environment: + sdk: ">=2.1.0 <3.0.0" + flutter: ">=1.12.8 <2.0.0" + +dependencies: + file: ^5.1.0 + flutter: + sdk: flutter + meta: ^1.0.4 + path: ^1.6.4 + path_provider: ^1.6.11 + shared_preferences_platform_interface: ^1.0.0 + +dev_dependencies: + flutter_test: + sdk: flutter + pedantic: ^1.8.0 diff --git a/packages/shared_preferences/shared_preferences_linux/test/shared_preferences_linux_test.dart b/packages/shared_preferences/shared_preferences_linux/test/shared_preferences_linux_test.dart new file mode 100644 index 000000000000..8a794b1fa7c2 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_linux/test/shared_preferences_linux_test.dart @@ -0,0 +1,74 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +import 'package:file/memory.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:path/path.dart' as path; +import 'package:path_provider/path_provider.dart'; +import 'package:shared_preferences_linux/shared_preferences_linux.dart'; + +MemoryFileSystem fs = MemoryFileSystem.test(); + +void main() { + setUp(() {}); + + tearDown(() {}); + + Future _getFilePath() async { + var directory = await getApplicationSupportDirectory(); + return path.join(directory.path, 'shared_preferences.json'); + } + + _writeTestFile(String value) async { + fs.file(await _getFilePath()) + ..createSync(recursive: true) + ..writeAsStringSync(value); + } + + Future _readTestFile() async { + return fs.file(await _getFilePath()).readAsStringSync(); + } + + SharedPreferencesLinux _getPreferences() { + var prefs = SharedPreferencesLinux(); + prefs.fs = fs; + return prefs; + } + + test('getAll', () async { + await _writeTestFile('{"key1": "one", "key2": 2}'); + var prefs = _getPreferences(); + + var values = await prefs.getAll(); + expect(values, hasLength(2)); + expect(values['key1'], 'one'); + expect(values['key2'], 2); + }); + + test('remove', () async { + await _writeTestFile('{"key1":"one","key2":2}'); + var prefs = _getPreferences(); + + await prefs.remove('key2'); + + expect(await _readTestFile(), '{"key1":"one"}'); + }); + + test('setValue', () async { + await _writeTestFile('{}'); + var prefs = _getPreferences(); + + await prefs.setValue('', 'key1', 'one'); + await prefs.setValue('', 'key2', 2); + + expect(await _readTestFile(), '{"key1":"one","key2":2}'); + }); + + test('clear', () async { + await _writeTestFile('{"key1":"one","key2":2}'); + var prefs = _getPreferences(); + + await prefs.clear(); + expect(await _readTestFile(), '{}'); + }); +} diff --git a/script/build_all_plugins_app.sh b/script/build_all_plugins_app.sh index 2c0a90693851..262c4ed7b1d3 100755 --- a/script/build_all_plugins_app.sh +++ b/script/build_all_plugins_app.sh @@ -26,6 +26,7 @@ readonly EXCLUDED_PLUGINS_LIST=( "path_provider_platform_interface" "path_provider_web" "plugin_platform_interface" + "shared_preferences_linux" "shared_preferences_macos" "shared_preferences_platform_interface" "shared_preferences_web" From 71cc865b2504a8f834588f79535f64a889632a93 Mon Sep 17 00:00:00 2001 From: Jia Hao Date: Wed, 1 Jul 2020 08:02:49 +0800 Subject: [PATCH 007/233] [e2e] Use SettableFuture instead of CompletableFuture (#2854) Expose a `Future` for `testResults` instead. This works better for internal use cases. --- packages/e2e/CHANGELOG.md | 4 ++++ packages/e2e/android/build.gradle | 3 ++- .../src/main/java/dev/flutter/plugins/e2e/E2EPlugin.java | 9 ++++++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/e2e/CHANGELOG.md b/packages/e2e/CHANGELOG.md index 0d349965371b..ad2f8d3e24f0 100644 --- a/packages/e2e/CHANGELOG.md +++ b/packages/e2e/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.6.0 + +* **Breaking change** `E2EPlugin` exports a `Future` for `testResults`. + ## 0.5.0+1 * Fixed the device pixel ratio problem. diff --git a/packages/e2e/android/build.gradle b/packages/e2e/android/build.gradle index ec686f4b4e3d..d0bb6c5a5967 100644 --- a/packages/e2e/android/build.gradle +++ b/packages/e2e/android/build.gradle @@ -33,11 +33,12 @@ android { } dependencies { api 'junit:junit:4.12' - implementation 'net.sourceforge.streamsupport:android-retrofuture:1.7.2' // https://developer.android.com/jetpack/androidx/releases/test/#1.2.0 api 'androidx.test:runner:1.2.0' api 'androidx.test:rules:1.2.0' api 'androidx.test.espresso:espresso-core:3.2.0' + + implementation 'com.google.guava:guava:28.1-android' } } diff --git a/packages/e2e/android/src/main/java/dev/flutter/plugins/e2e/E2EPlugin.java b/packages/e2e/android/src/main/java/dev/flutter/plugins/e2e/E2EPlugin.java index f6c5b306b5d9..31100d442731 100644 --- a/packages/e2e/android/src/main/java/dev/flutter/plugins/e2e/E2EPlugin.java +++ b/packages/e2e/android/src/main/java/dev/flutter/plugins/e2e/E2EPlugin.java @@ -5,6 +5,7 @@ package dev.flutter.plugins.e2e; import android.content.Context; +import com.google.common.util.concurrent.SettableFuture; import io.flutter.embedding.engine.plugins.FlutterPlugin; import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugin.common.MethodCall; @@ -13,13 +14,15 @@ import io.flutter.plugin.common.MethodChannel.Result; import io.flutter.plugin.common.PluginRegistry.Registrar; import java.util.Map; -import java9.util.concurrent.CompletableFuture; +import java.util.concurrent.Future; /** E2EPlugin */ public class E2EPlugin implements MethodCallHandler, FlutterPlugin { private MethodChannel methodChannel; - public static CompletableFuture> testResults = new CompletableFuture<>(); + private static final SettableFuture> testResultsSettable = + SettableFuture.create(); + public static final Future> testResults = testResultsSettable; private static final String CHANNEL = "plugins.flutter.io/e2e"; @@ -49,7 +52,7 @@ public void onDetachedFromEngine(FlutterPluginBinding binding) { public void onMethodCall(MethodCall call, Result result) { if (call.method.equals("allTestsFinished")) { Map results = call.argument("results"); - testResults.complete(results); + testResultsSettable.set(results); result.success(null); } else { result.notImplemented(); From a3dbe7357c593e3788b7a2cdfbb6aa1cb1722706 Mon Sep 17 00:00:00 2001 From: David Iglesias Date: Tue, 30 Jun 2020 17:32:17 -0700 Subject: [PATCH 008/233] [connectivity] Endorse connectivity_for_web. (#2853) --- .../connectivity/connectivity/CHANGELOG.md | 4 +++ .../connectivity/example/lib/main.dart | 6 ++-- .../connectivity/example/web/favicon.png | Bin 0 -> 917 bytes .../example/web/icons/Icon-192.png | Bin 0 -> 5292 bytes .../example/web/icons/Icon-512.png | Bin 0 -> 8252 bytes .../connectivity/example/web/index.html | 33 ++++++++++++++++++ .../connectivity/example/web/manifest.json | 23 ++++++++++++ .../connectivity/connectivity/pubspec.yaml | 7 ++-- 8 files changed, 68 insertions(+), 5 deletions(-) create mode 100644 packages/connectivity/connectivity/example/web/favicon.png create mode 100644 packages/connectivity/connectivity/example/web/icons/Icon-192.png create mode 100644 packages/connectivity/connectivity/example/web/icons/Icon-512.png create mode 100644 packages/connectivity/connectivity/example/web/index.html create mode 100644 packages/connectivity/connectivity/example/web/manifest.json diff --git a/packages/connectivity/connectivity/CHANGELOG.md b/packages/connectivity/connectivity/CHANGELOG.md index 9325f1a7868f..3bb777104c0e 100644 --- a/packages/connectivity/connectivity/CHANGELOG.md +++ b/packages/connectivity/connectivity/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.4.9 + +* Add support for `web` (by endorsing `connectivity_for_web` 0.3.0) + ## 0.4.8+6 * Update lower bound of dart dependency to 2.1.0. diff --git a/packages/connectivity/connectivity/example/lib/main.dart b/packages/connectivity/connectivity/example/lib/main.dart index 4ad30972679a..f8486165fa70 100644 --- a/packages/connectivity/connectivity/example/lib/main.dart +++ b/packages/connectivity/connectivity/example/lib/main.dart @@ -91,7 +91,7 @@ class _MyHomePageState extends State { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - title: const Text('Plugin example app'), + title: const Text('Connectivity example app'), ), body: Center(child: Text('Connection Status: $_connectionStatus')), ); @@ -103,7 +103,7 @@ class _MyHomePageState extends State { String wifiName, wifiBSSID, wifiIP; try { - if (Platform.isIOS) { + if (!kIsWeb && Platform.isIOS) { LocationAuthorizationStatus status = await _connectivity.getLocationServiceAuthorization(); if (status == LocationAuthorizationStatus.notDetermined) { @@ -125,7 +125,7 @@ class _MyHomePageState extends State { } try { - if (Platform.isIOS) { + if (!kIsWeb && Platform.isIOS) { LocationAuthorizationStatus status = await _connectivity.getLocationServiceAuthorization(); if (status == LocationAuthorizationStatus.notDetermined) { diff --git a/packages/connectivity/connectivity/example/web/favicon.png b/packages/connectivity/connectivity/example/web/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..8aaa46ac1ae21512746f852a42ba87e4165dfdd1 GIT binary patch literal 917 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0X7 zltGxWVyS%@P(fs7NJL45ua8x7ey(0(N`6wRUPW#JP&EUCO@$SZnVVXYs8ErclUHn2 zVXFjIVFhG^g!Ppaz)DK8ZIvQ?0~DO|i&7O#^-S~(l1AfjnEK zjFOT9D}DX)@^Za$W4-*MbbUihOG|wNBYh(yU7!lx;>x^|#0uTKVr7USFmqf|i<65o z3raHc^AtelCMM;Vme?vOfh>Xph&xL%(-1c06+^uR^q@XSM&D4+Kp$>4P^%3{)XKjo zGZknv$b36P8?Z_gF{nK@`XI}Z90TzwSQO}0J1!f2c(B=V`5aP@1P1a|PZ!4!3&Gl8 zTYqUsf!gYFyJnXpu0!n&N*SYAX-%d(5gVjrHJWqXQshj@!Zm{!01WsQrH~9=kTxW#6SvuapgMqt>$=j#%eyGrQzr zP{L-3gsMA^$I1&gsBAEL+vxi1*Igl=8#8`5?A-T5=z-sk46WA1IUT)AIZHx1rdUrf zVJrJn<74DDw`j)Ki#gt}mIT-Q`XRa2-jQXQoI%w`nb|XblvzK${ZzlV)m-XcwC(od z71_OEC5Bt9GEXosOXaPTYOia#R4ID2TiU~`zVMl08TV_C%DnU4^+HE>9(CE4D6?Fz oujB08i7adh9xk7*FX66dWH6F5TM;?E2b5PlUHx3vIVCg!0Dx9vYXATM literal 0 HcmV?d00001 diff --git a/packages/connectivity/connectivity/example/web/icons/Icon-192.png b/packages/connectivity/connectivity/example/web/icons/Icon-192.png new file mode 100644 index 0000000000000000000000000000000000000000..b749bfef07473333cf1dd31e9eed89862a5d52aa GIT binary patch literal 5292 zcmZ`-2T+sGz6~)*FVZ`aW+(v>MIm&M-g^@e2u-B-DoB?qO+b1Tq<5uCCv>ESfRum& zp%X;f!~1{tzL__3=gjVJ=j=J>+nMj%ncXj1Q(b|Ckbw{Y0FWpt%4y%$uD=Z*c-x~o zE;IoE;xa#7Ll5nj-e4CuXB&G*IM~D21rCP$*xLXAK8rIMCSHuSu%bL&S3)8YI~vyp@KBu9Ph7R_pvKQ@xv>NQ`dZp(u{Z8K3yOB zn7-AR+d2JkW)KiGx0hosml;+eCXp6+w%@STjFY*CJ?udJ64&{BCbuebcuH;}(($@@ znNlgBA@ZXB)mcl9nbX#F!f_5Z=W>0kh|UVWnf!At4V*LQP%*gPdCXd6P@J4Td;!Ur z<2ZLmwr(NG`u#gDEMP19UcSzRTL@HsK+PnIXbVBT@oHm53DZr?~V(0{rsalAfwgo zEh=GviaqkF;}F_5-yA!1u3!gxaR&Mj)hLuj5Q-N-@Lra{%<4ONja8pycD90&>yMB` zchhd>0CsH`^|&TstH-8+R`CfoWqmTTF_0?zDOY`E`b)cVi!$4xA@oO;SyOjJyP^_j zx^@Gdf+w|FW@DMdOi8=4+LJl$#@R&&=UM`)G!y%6ZzQLoSL%*KE8IO0~&5XYR9 z&N)?goEiWA(YoRfT{06&D6Yuu@Qt&XVbuW@COb;>SP9~aRc+z`m`80pB2o%`#{xD@ zI3RAlukL5L>px6b?QW1Ac_0>ew%NM!XB2(H+1Y3AJC?C?O`GGs`331Nd4ZvG~bMo{lh~GeL zSL|tT*fF-HXxXYtfu5z+T5Mx9OdP7J4g%@oeC2FaWO1D{=NvL|DNZ}GO?O3`+H*SI z=grGv=7dL{+oY0eJFGO!Qe(e2F?CHW(i!!XkGo2tUvsQ)I9ev`H&=;`N%Z{L zO?vV%rDv$y(@1Yj@xfr7Kzr<~0{^T8wM80xf7IGQF_S-2c0)0D6b0~yD7BsCy+(zL z#N~%&e4iAwi4F$&dI7x6cE|B{f@lY5epaDh=2-(4N05VO~A zQT3hanGy_&p+7Fb^I#ewGsjyCEUmSCaP6JDB*=_()FgQ(-pZ28-{qx~2foO4%pM9e z*_63RT8XjgiaWY|*xydf;8MKLd{HnfZ2kM%iq}fstImB-K6A79B~YoPVa@tYN@T_$ zea+9)<%?=Fl!kd(Y!G(-o}ko28hg2!MR-o5BEa_72uj7Mrc&{lRh3u2%Y=Xk9^-qa zBPWaD=2qcuJ&@Tf6ue&)4_V*45=zWk@Z}Q?f5)*z)-+E|-yC4fs5CE6L_PH3=zI8p z*Z3!it{1e5_^(sF*v=0{`U9C741&lub89gdhKp|Y8CeC{_{wYK-LSbp{h)b~9^j!s z7e?Y{Z3pZv0J)(VL=g>l;<}xk=T*O5YR|hg0eg4u98f2IrA-MY+StQIuK-(*J6TRR z|IM(%uI~?`wsfyO6Tgmsy1b3a)j6M&-jgUjVg+mP*oTKdHg?5E`!r`7AE_#?Fc)&a z08KCq>Gc=ne{PCbRvs6gVW|tKdcE1#7C4e`M|j$C5EYZ~Y=jUtc zj`+?p4ba3uy7><7wIokM79jPza``{Lx0)zGWg;FW1^NKY+GpEi=rHJ+fVRGfXO zPHV52k?jxei_!YYAw1HIz}y8ZMwdZqU%ESwMn7~t zdI5%B;U7RF=jzRz^NuY9nM)&<%M>x>0(e$GpU9th%rHiZsIT>_qp%V~ILlyt^V`=d z!1+DX@ah?RnB$X!0xpTA0}lN@9V-ePx>wQ?-xrJr^qDlw?#O(RsXeAvM%}rg0NT#t z!CsT;-vB=B87ShG`GwO;OEbeL;a}LIu=&@9cb~Rsx(ZPNQ!NT7H{@j0e(DiLea>QD zPmpe90gEKHEZ8oQ@6%E7k-Ptn#z)b9NbD@_GTxEhbS+}Bb74WUaRy{w;E|MgDAvHw zL)ycgM7mB?XVh^OzbC?LKFMotw3r@i&VdUV%^Efdib)3@soX%vWCbnOyt@Y4swW925@bt45y0HY3YI~BnnzZYrinFy;L?2D3BAL`UQ zEj))+f>H7~g8*VuWQ83EtGcx`hun$QvuurSMg3l4IP8Fe`#C|N6mbYJ=n;+}EQm;< z!!N=5j1aAr_uEnnzrEV%_E|JpTb#1p1*}5!Ce!R@d$EtMR~%9# zd;h8=QGT)KMW2IKu_fA_>p_und#-;Q)p%%l0XZOXQicfX8M~7?8}@U^ihu;mizj)t zgV7wk%n-UOb z#!P5q?Ex+*Kx@*p`o$q8FWL*E^$&1*!gpv?Za$YO~{BHeGY*5%4HXUKa_A~~^d z=E*gf6&+LFF^`j4$T~dR)%{I)T?>@Ma?D!gi9I^HqvjPc3-v~=qpX1Mne@*rzT&Xw zQ9DXsSV@PqpEJO-g4A&L{F&;K6W60D!_vs?Vx!?w27XbEuJJP&);)^+VF1nHqHBWu z^>kI$M9yfOY8~|hZ9WB!q-9u&mKhEcRjlf2nm_@s;0D#c|@ED7NZE% zzR;>P5B{o4fzlfsn3CkBK&`OSb-YNrqx@N#4CK!>bQ(V(D#9|l!e9(%sz~PYk@8zt zPN9oK78&-IL_F zhsk1$6p;GqFbtB^ZHHP+cjMvA0(LqlskbdYE_rda>gvQLTiqOQ1~*7lg%z*&p`Ry& zRcG^DbbPj_jOKHTr8uk^15Boj6>hA2S-QY(W-6!FIq8h$<>MI>PYYRenQDBamO#Fv zAH5&ImqKBDn0v5kb|8i0wFhUBJTpT!rB-`zK)^SNnRmLraZcPYK7b{I@+}wXVdW-{Ps17qdRA3JatEd?rPV z4@}(DAMf5EqXCr4-B+~H1P#;t@O}B)tIJ(W6$LrK&0plTmnPpb1TKn3?f?Kk``?D+ zQ!MFqOX7JbsXfQrz`-M@hq7xlfNz;_B{^wbpG8des56x(Q)H)5eLeDwCrVR}hzr~= zM{yXR6IM?kXxauLza#@#u?Y|o;904HCqF<8yT~~c-xyRc0-vxofnxG^(x%>bj5r}N zyFT+xnn-?B`ohA>{+ZZQem=*Xpqz{=j8i2TAC#x-m;;mo{{sLB_z(UoAqD=A#*juZ zCv=J~i*O8;F}A^Wf#+zx;~3B{57xtoxC&j^ie^?**T`WT2OPRtC`xj~+3Kprn=rVM zVJ|h5ux%S{dO}!mq93}P+h36mZ5aZg1-?vhL$ke1d52qIiXSE(llCr5i=QUS?LIjc zV$4q=-)aaR4wsrQv}^shL5u%6;`uiSEs<1nG^?$kl$^6DL z43CjY`M*p}ew}}3rXc7Xck@k41jx}c;NgEIhKZ*jsBRZUP-x2cm;F1<5$jefl|ppO zmZd%%?gMJ^g9=RZ^#8Mf5aWNVhjAS^|DQO+q$)oeob_&ZLFL(zur$)); zU19yRm)z<4&4-M}7!9+^Wl}Uk?`S$#V2%pQ*SIH5KI-mn%i;Z7-)m$mN9CnI$G7?# zo`zVrUwoSL&_dJ92YhX5TKqaRkfPgC4=Q&=K+;_aDs&OU0&{WFH}kKX6uNQC6%oUH z2DZa1s3%Vtk|bglbxep-w)PbFG!J17`<$g8lVhqD2w;Z0zGsh-r zxZ13G$G<48leNqR!DCVt9)@}(zMI5w6Wo=N zpP1*3DI;~h2WDWgcKn*f!+ORD)f$DZFwgKBafEZmeXQMAsq9sxP9A)7zOYnkHT9JU zRA`umgmP9d6=PHmFIgx=0$(sjb>+0CHG)K@cPG{IxaJ&Ueo8)0RWgV9+gO7+Bl1(F z7!BslJ2MP*PWJ;x)QXbR$6jEr5q3 z(3}F@YO_P1NyTdEXRLU6fp?9V2-S=E+YaeLL{Y)W%6`k7$(EW8EZSA*(+;e5@jgD^I zaJQ2|oCM1n!A&-8`;#RDcZyk*+RPkn_r8?Ak@agHiSp*qFNX)&i21HE?yuZ;-C<3C zwJGd1lx5UzViP7sZJ&|LqH*mryb}y|%AOw+v)yc`qM)03qyyrqhX?ub`Cjwx2PrR! z)_z>5*!*$x1=Qa-0uE7jy0z`>|Ni#X+uV|%_81F7)b+nf%iz=`fF4g5UfHS_?PHbr zB;0$bK@=di?f`dS(j{l3-tSCfp~zUuva+=EWxJcRfp(<$@vd(GigM&~vaYZ0c#BTs z3ijkxMl=vw5AS&DcXQ%eeKt!uKvh2l3W?&3=dBHU=Gz?O!40S&&~ei2vg**c$o;i89~6DVns zG>9a*`k5)NI9|?W!@9>rzJ;9EJ=YlJTx1r1BA?H`LWijk(rTax9(OAu;q4_wTj-yj z1%W4GW&K4T=uEGb+E!>W0SD_C0RR91 literal 0 HcmV?d00001 diff --git a/packages/connectivity/connectivity/example/web/icons/Icon-512.png b/packages/connectivity/connectivity/example/web/icons/Icon-512.png new file mode 100644 index 0000000000000000000000000000000000000000..88cfd48dff1169879ba46840804b412fe02fefd6 GIT binary patch literal 8252 zcmd5=2T+s!lYZ%-(h(2@5fr2dC?F^$C=i-}R6$UX8af(!je;W5yC_|HmujSgN*6?W z3knF*TL1$|?oD*=zPbBVex*RUIKsL<(&Rj9%^UD2IK3W?2j>D?eWQgvS-HLymHo9%~|N2Q{~j za?*X-{b9JRowv_*Mh|;*-kPFn>PI;r<#kFaxFqbn?aq|PduQg=2Q;~Qc}#z)_T%x9 zE|0!a70`58wjREmAH38H1)#gof)U3g9FZ^ zF7&-0^Hy{4XHWLoC*hOG(dg~2g6&?-wqcpf{ z&3=o8vw7lMi22jCG9RQbv8H}`+}9^zSk`nlR8?Z&G2dlDy$4#+WOlg;VHqzuE=fM@ z?OI6HEJH4&tA?FVG}9>jAnq_^tlw8NbjNhfqk2rQr?h(F&WiKy03Sn=-;ZJRh~JrD zbt)zLbnabttEZ>zUiu`N*u4sfQaLE8-WDn@tHp50uD(^r-}UsUUu)`!Rl1PozAc!a z?uj|2QDQ%oV-jxUJmJycySBINSKdX{kDYRS=+`HgR2GO19fg&lZKyBFbbXhQV~v~L za^U944F1_GtuFXtvDdDNDvp<`fqy);>Vw=ncy!NB85Tw{&sT5&Ox%-p%8fTS;OzlRBwErvO+ROe?{%q-Zge=%Up|D4L#>4K@Ke=x%?*^_^P*KD zgXueMiS63!sEw@fNLB-i^F|@Oib+S4bcy{eu&e}Xvb^(mA!=U=Xr3||IpV~3K zQWzEsUeX_qBe6fky#M zzOJm5b+l;~>=sdp%i}}0h zO?B?i*W;Ndn02Y0GUUPxERG`3Bjtj!NroLoYtyVdLtl?SE*CYpf4|_${ku2s`*_)k zN=a}V8_2R5QANlxsq!1BkT6$4>9=-Ix4As@FSS;1q^#TXPrBsw>hJ}$jZ{kUHoP+H zvoYiR39gX}2OHIBYCa~6ERRPJ#V}RIIZakUmuIoLF*{sO8rAUEB9|+A#C|@kw5>u0 zBd=F!4I)Be8ycH*)X1-VPiZ+Ts8_GB;YW&ZFFUo|Sw|x~ZajLsp+_3gv((Q#N>?Jz zFBf`~p_#^${zhPIIJY~yo!7$-xi2LK%3&RkFg}Ax)3+dFCjGgKv^1;lUzQlPo^E{K zmCnrwJ)NuSaJEmueEPO@(_6h3f5mFffhkU9r8A8(JC5eOkux{gPmx_$Uv&|hyj)gN zd>JP8l2U&81@1Hc>#*su2xd{)T`Yw< zN$dSLUN}dfx)Fu`NcY}TuZ)SdviT{JHaiYgP4~@`x{&h*Hd>c3K_To9BnQi@;tuoL z%PYQo&{|IsM)_>BrF1oB~+`2_uZQ48z9!)mtUR zdfKE+b*w8cPu;F6RYJiYyV;PRBbThqHBEu_(U{(gGtjM}Zi$pL8Whx}<JwE3RM0F8x7%!!s)UJVq|TVd#hf1zVLya$;mYp(^oZQ2>=ZXU1c$}f zm|7kfk>=4KoQoQ!2&SOW5|JP1)%#55C$M(u4%SP~tHa&M+=;YsW=v(Old9L3(j)`u z2?#fK&1vtS?G6aOt@E`gZ9*qCmyvc>Ma@Q8^I4y~f3gs7*d=ATlP>1S zyF=k&6p2;7dn^8?+!wZO5r~B+;@KXFEn^&C=6ma1J7Au6y29iMIxd7#iW%=iUzq&C=$aPLa^Q zncia$@TIy6UT@69=nbty5epP>*fVW@5qbUcb2~Gg75dNd{COFLdiz3}kODn^U*=@E z0*$7u7Rl2u)=%fk4m8EK1ctR!6%Ve`e!O20L$0LkM#f+)n9h^dn{n`T*^~d+l*Qlx z$;JC0P9+en2Wlxjwq#z^a6pdnD6fJM!GV7_%8%c)kc5LZs_G^qvw)&J#6WSp< zmsd~1-(GrgjC56Pdf6#!dt^y8Rg}!#UXf)W%~PeU+kU`FeSZHk)%sFv++#Dujk-~m zFHvVJC}UBn2jN& zs!@nZ?e(iyZPNo`p1i#~wsv9l@#Z|ag3JR>0#u1iW9M1RK1iF6-RbJ4KYg?B`dET9 zyR~DjZ>%_vWYm*Z9_+^~hJ_|SNTzBKx=U0l9 z9x(J96b{`R)UVQ$I`wTJ@$_}`)_DyUNOso6=WOmQKI1e`oyYy1C&%AQU<0-`(ow)1 zT}gYdwWdm4wW6|K)LcfMe&psE0XGhMy&xS`@vLi|1#Za{D6l@#D!?nW87wcscUZgELT{Cz**^;Zb~7 z(~WFRO`~!WvyZAW-8v!6n&j*PLm9NlN}BuUN}@E^TX*4Or#dMMF?V9KBeLSiLO4?B zcE3WNIa-H{ThrlCoN=XjOGk1dT=xwwrmt<1a)mrRzg{35`@C!T?&_;Q4Ce=5=>z^*zE_c(0*vWo2_#TD<2)pLXV$FlwP}Ik74IdDQU@yhkCr5h zn5aa>B7PWy5NQ!vf7@p_qtC*{dZ8zLS;JetPkHi>IvPjtJ#ThGQD|Lq#@vE2xdl%`x4A8xOln}BiQ92Po zW;0%A?I5CQ_O`@Ad=`2BLPPbBuPUp@Hb%a_OOI}y{Rwa<#h z5^6M}s7VzE)2&I*33pA>e71d78QpF>sNK;?lj^Kl#wU7G++`N_oL4QPd-iPqBhhs| z(uVM}$ItF-onXuuXO}o$t)emBO3Hjfyil@*+GF;9j?`&67GBM;TGkLHi>@)rkS4Nj zAEk;u)`jc4C$qN6WV2dVd#q}2X6nKt&X*}I@jP%Srs%%DS92lpDY^K*Sx4`l;aql$ zt*-V{U&$DM>pdO?%jt$t=vg5|p+Rw?SPaLW zB6nvZ69$ne4Z(s$3=Rf&RX8L9PWMV*S0@R zuIk&ba#s6sxVZ51^4Kon46X^9`?DC9mEhWB3f+o4#2EXFqy0(UTc>GU| zGCJmI|Dn-dX#7|_6(fT)>&YQ0H&&JX3cTvAq(a@ydM4>5Njnuere{J8p;3?1az60* z$1E7Yyxt^ytULeokgDnRVKQw9vzHg1>X@@jM$n$HBlveIrKP5-GJq%iWH#odVwV6cF^kKX(@#%%uQVb>#T6L^mC@)%SMd4DF? zVky!~ge27>cpUP1Vi}Z32lbLV+CQy+T5Wdmva6Fg^lKb!zrg|HPU=5Qu}k;4GVH+x z%;&pN1LOce0w@9i1Mo-Y|7|z}fbch@BPp2{&R-5{GLoeu8@limQmFF zaJRR|^;kW_nw~0V^ zfTnR!Ni*;-%oSHG1yItARs~uxra|O?YJxBzLjpeE-=~TO3Dn`JL5Gz;F~O1u3|FE- zvK2Vve`ylc`a}G`gpHg58Cqc9fMoy1L}7x7T>%~b&irrNMo?np3`q;d3d;zTK>nrK zOjPS{@&74-fA7j)8uT9~*g23uGnxwIVj9HorzUX#s0pcp2?GH6i}~+kv9fWChtPa_ z@T3m+$0pbjdQw7jcnHn;Pi85hk_u2-1^}c)LNvjdam8K-XJ+KgKQ%!?2n_!#{$H|| zLO=%;hRo6EDmnOBKCL9Cg~ETU##@u^W_5joZ%Et%X_n##%JDOcsO=0VL|Lkk!VdRJ z^|~2pB@PUspT?NOeO?=0Vb+fAGc!j%Ufn-cB`s2A~W{Zj{`wqWq_-w0wr@6VrM zbzni@8c>WS!7c&|ZR$cQ;`niRw{4kG#e z70e!uX8VmP23SuJ*)#(&R=;SxGAvq|&>geL&!5Z7@0Z(No*W561n#u$Uc`f9pD70# z=sKOSK|bF~#khTTn)B28h^a1{;>EaRnHj~>i=Fnr3+Fa4 z`^+O5_itS#7kPd20rq66_wH`%?HNzWk@XFK0n;Z@Cx{kx==2L22zWH$Yg?7 zvDj|u{{+NR3JvUH({;b*$b(U5U z7(lF!1bz2%06+|-v(D?2KgwNw7( zJB#Tz+ZRi&U$i?f34m7>uTzO#+E5cbaiQ&L}UxyOQq~afbNB4EI{E04ZWg53w0A{O%qo=lF8d zf~ktGvIgf-a~zQoWf>loF7pOodrd0a2|BzwwPDV}ShauTK8*fmF6NRbO>Iw9zZU}u zw8Ya}?seBnEGQDmH#XpUUkj}N49tP<2jYwTFp!P+&Fd(%Z#yo80|5@zN(D{_pNow*&4%ql zW~&yp@scb-+Qj-EmErY+Tu=dUmf@*BoXY2&oKT8U?8?s1d}4a`Aq>7SV800m$FE~? zjmz(LY+Xx9sDX$;vU`xgw*jLw7dWOnWWCO8o|;}f>cu0Q&`0I{YudMn;P;L3R-uz# zfns_mZED_IakFBPP2r_S8XM$X)@O-xVKi4`7373Jkd5{2$M#%cRhWer3M(vr{S6>h zj{givZJ3(`yFL@``(afn&~iNx@B1|-qfYiZu?-_&Z8+R~v`d6R-}EX9IVXWO-!hL5 z*k6T#^2zAXdardU3Ao~I)4DGdAv2bx{4nOK`20rJo>rmk3S2ZDu}))8Z1m}CKigf0 z3L`3Y`{huj`xj9@`$xTZzZc3je?n^yG<8sw$`Y%}9mUsjUR%T!?k^(q)6FH6Af^b6 zlPg~IEwg0y;`t9y;#D+uz!oE4VP&Je!<#q*F?m5L5?J3i@!0J6q#eu z!RRU`-)HeqGi_UJZ(n~|PSNsv+Wgl{P-TvaUQ9j?ZCtvb^37U$sFpBrkT{7Jpd?HpIvj2!}RIq zH{9~+gErN2+}J`>Jvng2hwM`=PLNkc7pkjblKW|+Fk9rc)G1R>Ww>RC=r-|!m-u7( zc(a$9NG}w#PjWNMS~)o=i~WA&4L(YIW25@AL9+H9!?3Y}sv#MOdY{bb9j>p`{?O(P zIvb`n?_(gP2w3P#&91JX*md+bBEr%xUHMVqfB;(f?OPtMnAZ#rm5q5mh;a2f_si2_ z3oXWB?{NF(JtkAn6F(O{z@b76OIqMC$&oJ_&S|YbFJ*)3qVX_uNf5b8(!vGX19hsG z(OP>RmZp29KH9Ge2kKjKigUmOe^K_!UXP`von)PR8Qz$%=EmOB9xS(ZxE_tnyzo}7 z=6~$~9k0M~v}`w={AeqF?_)9q{m8K#6M{a&(;u;O41j)I$^T?lx5(zlebpY@NT&#N zR+1bB)-1-xj}R8uwqwf=iP1GbxBjneCC%UrSdSxK1vM^i9;bUkS#iRZw2H>rS<2<$ zNT3|sDH>{tXb=zq7XZi*K?#Zsa1h1{h5!Tq_YbKFm_*=A5-<~j63he;4`77!|LBlo zR^~tR3yxcU=gDFbshyF6>o0bdp$qmHS7D}m3;^QZq9kBBU|9$N-~oU?G5;jyFR7>z hN`IR97YZXIo@y!QgFWddJ3|0`sjFx!m))><{BI=FK%f8s literal 0 HcmV?d00001 diff --git a/packages/connectivity/connectivity/example/web/index.html b/packages/connectivity/connectivity/example/web/index.html new file mode 100644 index 000000000000..9b7a438f823a --- /dev/null +++ b/packages/connectivity/connectivity/example/web/index.html @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + example + + + + + + + + diff --git a/packages/connectivity/connectivity/example/web/manifest.json b/packages/connectivity/connectivity/example/web/manifest.json new file mode 100644 index 000000000000..8c012917dab7 --- /dev/null +++ b/packages/connectivity/connectivity/example/web/manifest.json @@ -0,0 +1,23 @@ +{ + "name": "example", + "short_name": "example", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + } + ] +} diff --git a/packages/connectivity/connectivity/pubspec.yaml b/packages/connectivity/connectivity/pubspec.yaml index 9aaa2620f82c..c7ef8fe6e723 100644 --- a/packages/connectivity/connectivity/pubspec.yaml +++ b/packages/connectivity/connectivity/pubspec.yaml @@ -5,7 +5,7 @@ homepage: https://github.com/flutter/plugins/tree/master/packages/connectivity/c # 0.4.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.4.8+6 +version: 0.4.9 flutter: plugin: @@ -17,13 +17,16 @@ flutter: pluginClass: FLTConnectivityPlugin macos: default_package: connectivity_macos + web: + default_package: connectivity_for_web dependencies: flutter: sdk: flutter - meta: "^1.0.5" + meta: ^1.0.5 connectivity_platform_interface: ^1.0.2 connectivity_macos: ^0.1.0 + connectivity_for_web: ^0.3.0 dev_dependencies: flutter_test: From 40db092fc71cd15f5b03e03a045cbb95e7a71424 Mon Sep 17 00:00:00 2001 From: Jia Hao Date: Wed, 1 Jul 2020 22:20:34 +0800 Subject: [PATCH 009/233] [e2e] Bump version to 0.6.0 (#2855) Missed this earlier in #2854 --- packages/e2e/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/e2e/pubspec.yaml b/packages/e2e/pubspec.yaml index 0d4bc99f64f3..25eeb3ce1374 100644 --- a/packages/e2e/pubspec.yaml +++ b/packages/e2e/pubspec.yaml @@ -1,6 +1,6 @@ name: e2e description: Runs tests that use the flutter_test API as integration tests. -version: 0.5.0+1 +version: 0.6.0 homepage: https://github.com/flutter/plugins/tree/master/packages/e2e environment: From d3ccc34855b77afae39f4078cb4add8bec9e6b2b Mon Sep 17 00:00:00 2001 From: David Iglesias Date: Wed, 1 Jul 2020 15:53:53 -0700 Subject: [PATCH 010/233] [multiple] Improve video playback in image_picker example (#2819) This change adds small bugfixes to the following packages: * video_player_web: * Prevent parsing Blob URLs so Safari can play from a PickedFile. * Allow users to 'mute' videos by setting their volume to 0.0 (this enables auto-play in most modern browsers) * video_player: * Fix an issue where aspect ratio calculations failed when some of the video sizes were zero (happened in web for incorrect videos) * image_picker (example app): * Start videos in web muted so they can auto-play * Dispose video controllers when they're really not needed. This fixes a fatal crash in Safari (not so fatal in other browsers). --- .../image_picker/image_picker/CHANGELOG.md | 6 +++ .../image_picker/example/lib/main.dart | 16 +++++-- .../image_picker/image_picker/pubspec.yaml | 2 +- .../video_player/video_player/CHANGELOG.md | 4 ++ .../video_player/lib/video_player.dart | 2 +- .../video_player/video_player/pubspec.yaml | 2 +- .../video_player/test/video_player_test.dart | 42 +++++++++++++++++++ .../video_player_web/CHANGELOG.md | 5 +++ .../lib/video_player_web.dart | 21 +++++++--- .../video_player_web/pubspec.yaml | 2 +- 10 files changed, 89 insertions(+), 13 deletions(-) diff --git a/packages/image_picker/image_picker/CHANGELOG.md b/packages/image_picker/image_picker/CHANGELOG.md index 6b85f26daf33..0cba0c8d92cb 100644 --- a/packages/image_picker/image_picker/CHANGELOG.md +++ b/packages/image_picker/image_picker/CHANGELOG.md @@ -1,3 +1,9 @@ +## 0.6.7+3 + +* Fixes to the example app: + * Make videos in web start muted. This allows auto-play across browsers. + * Prevent the app from disposing of video controllers too early. + ## 0.6.7+2 * iOS: Fixes unpresentable album/image picker if window's root view controller is already presenting other view controller. diff --git a/packages/image_picker/image_picker/example/lib/main.dart b/packages/image_picker/image_picker/example/lib/main.dart index dff2906edf87..ece8c45d9c8e 100755 --- a/packages/image_picker/image_picker/example/lib/main.dart +++ b/packages/image_picker/image_picker/example/lib/main.dart @@ -42,6 +42,7 @@ class _MyHomePageState extends State { dynamic _pickImageError; bool isVideo = false; VideoPlayerController _controller; + VideoPlayerController _toBeDisposed; String _retrieveDataError; final ImagePicker _picker = ImagePicker(); @@ -54,10 +55,16 @@ class _MyHomePageState extends State { await _disposeVideoController(); if (kIsWeb) { _controller = VideoPlayerController.network(file.path); + // In web, most browsers won't honor a programmatic call to .play + // if the video has a sound track (and is not muted). + // Mute the video so it auto-plays in web! + // This is not needed if the call to .play is the result of user + // interaction (clicking on a "play" button, for example). + await _controller.setVolume(0.0); } else { _controller = VideoPlayerController.file(File(file.path)); + await _controller.setVolume(1.0); } - await _controller.setVolume(1.0); await _controller.initialize(); await _controller.setLooping(true); await _controller.play(); @@ -114,10 +121,11 @@ class _MyHomePageState extends State { } Future _disposeVideoController() async { - if (_controller != null) { - await _controller.dispose(); - _controller = null; + if (_toBeDisposed != null) { + await _toBeDisposed.dispose(); } + _toBeDisposed = _controller; + _controller = null; } Widget _previewVideo() { diff --git a/packages/image_picker/image_picker/pubspec.yaml b/packages/image_picker/image_picker/pubspec.yaml index 4f52b19c2659..eedecd46e1ee 100755 --- a/packages/image_picker/image_picker/pubspec.yaml +++ b/packages/image_picker/image_picker/pubspec.yaml @@ -2,7 +2,7 @@ name: image_picker description: Flutter plugin for selecting images from the Android and iOS image library, and taking new pictures with the camera. homepage: https://github.com/flutter/plugins/tree/master/packages/image_picker/image_picker -version: 0.6.7+2 +version: 0.6.7+3 flutter: plugin: diff --git a/packages/video_player/video_player/CHANGELOG.md b/packages/video_player/video_player/CHANGELOG.md index 9928fe31c5a3..e3f49e736411 100644 --- a/packages/video_player/video_player/CHANGELOG.md +++ b/packages/video_player/video_player/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.10.11+2 + +* Fix aspectRatio calculation when size.width or size.height are zero. + ## 0.10.11+1 * Post-v2 Android embedding cleanups. diff --git a/packages/video_player/video_player/lib/video_player.dart b/packages/video_player/video_player/lib/video_player.dart index f2f9289c1fda..a2290b2e5916 100644 --- a/packages/video_player/video_player/lib/video_player.dart +++ b/packages/video_player/video_player/lib/video_player.dart @@ -97,7 +97,7 @@ class VideoPlayerValue { /// Returns [size.width] / [size.height] when size is non-null, or `1.0.` when /// size is null or the aspect ratio would be less than or equal to 0.0. double get aspectRatio { - if (size == null) { + if (size == null || size.width == 0 || size.height == 0) { return 1.0; } final double aspectRatio = size.width / size.height; diff --git a/packages/video_player/video_player/pubspec.yaml b/packages/video_player/video_player/pubspec.yaml index f967cd07ef7f..03f71bf4f412 100644 --- a/packages/video_player/video_player/pubspec.yaml +++ b/packages/video_player/video_player/pubspec.yaml @@ -4,7 +4,7 @@ description: Flutter plugin for displaying inline video with other Flutter # 0.10.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.10.11+1 +version: 0.10.11+2 homepage: https://github.com/flutter/plugins/tree/master/packages/video_player/video_player flutter: diff --git a/packages/video_player/video_player/test/video_player_test.dart b/packages/video_player/video_player/test/video_player_test.dart index ac8459d0c9e9..ae236def4e57 100644 --- a/packages/video_player/video_player/test/video_player_test.dart +++ b/packages/video_player/video_player/test/video_player_test.dart @@ -517,6 +517,48 @@ void main() { expect(exactCopy.toString(), original.toString()); }); + + group('aspectRatio', () { + test('640x480 -> 4:3', () { + final value = VideoPlayerValue( + size: Size(640, 480), + duration: Duration(seconds: 1), + ); + expect(value.aspectRatio, 4 / 3); + }); + + test('null size -> 1.0', () { + final value = VideoPlayerValue( + size: null, + duration: Duration(seconds: 1), + ); + expect(value.aspectRatio, 1.0); + }); + + test('height = 0 -> 1.0', () { + final value = VideoPlayerValue( + size: Size(640, 0), + duration: Duration(seconds: 1), + ); + expect(value.aspectRatio, 1.0); + }); + + test('width = 0 -> 1.0', () { + final value = VideoPlayerValue( + size: Size(0, 480), + duration: Duration(seconds: 1), + ); + expect(value.aspectRatio, 1.0); + }); + + test('negative aspect ratio -> 1.0', () { + final value = VideoPlayerValue( + size: Size(640, -480), + duration: Duration(seconds: 1), + ); + expect(value.aspectRatio, 1.0); + }); + }); }); test('VideoProgressColors', () { diff --git a/packages/video_player/video_player_web/CHANGELOG.md b/packages/video_player/video_player_web/CHANGELOG.md index cd977c335d62..9c500e951122 100644 --- a/packages/video_player/video_player_web/CHANGELOG.md +++ b/packages/video_player/video_player_web/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.1.3+2 + +* Allow users to set the 'muted' attribute on video elements by setting their volume to 0. +* Do not parse URIs on 'network' videos to not break blobs (Safari). + ## 0.1.3+1 * Remove Android folder from `video_player_web`. diff --git a/packages/video_player/video_player_web/lib/video_player_web.dart b/packages/video_player/video_player_web/lib/video_player_web.dart index 039c3ce65a7e..3a849f45e0c1 100644 --- a/packages/video_player/video_player_web/lib/video_player_web.dart +++ b/packages/video_player/video_player_web/lib/video_player_web.dart @@ -66,10 +66,12 @@ class VideoPlayerPlugin extends VideoPlayerPlatform { final int textureId = _textureCounter; _textureCounter++; - Uri uri; + String uri; switch (dataSource.sourceType) { case DataSourceType.network: - uri = Uri.parse(dataSource.uri); + // Do NOT modify the incoming uri, it can be a Blob, and Safari doesn't + // like blobs that have changed. + uri = dataSource.uri; break; case DataSourceType.asset: String assetUrl = dataSource.asset; @@ -79,7 +81,7 @@ class VideoPlayerPlugin extends VideoPlayerPlatform { // 'webOnlyAssetManager' is only in the web version of dart:ui // ignore: undefined_prefixed_name assetUrl = ui.webOnlyAssetManager.getAssetUrl(assetUrl); - uri = Uri.parse(assetUrl); + uri = assetUrl; break; case DataSourceType.file: return Future.error(UnimplementedError( @@ -145,18 +147,21 @@ class _VideoPlayer { final StreamController eventController = StreamController(); - final Uri uri; + final String uri; final int textureId; VideoElement videoElement; bool isInitialized = false; void initialize() { videoElement = VideoElement() - ..src = uri.toString() + ..src = uri ..autoplay = false ..controls = false ..style.border = 'none'; + // Allows Safari iOS to play the video inline + videoElement.setAttribute('playsinline', 'true'); + // TODO(hterkelsen): Use initialization parameters once they are available // ignore: undefined_prefixed_name ui.platformViewRegistry.registerViewFactory( @@ -218,6 +223,12 @@ class _VideoPlayer { } void setVolume(double value) { + // TODO: Do we need to expose a "muted" API? https://github.com/flutter/flutter/issues/60721 + if (value > 0.0) { + videoElement.muted = false; + } else { + videoElement.muted = true; + } videoElement.volume = value; } diff --git a/packages/video_player/video_player_web/pubspec.yaml b/packages/video_player/video_player_web/pubspec.yaml index 523d5a79a75b..891430d7483b 100644 --- a/packages/video_player/video_player_web/pubspec.yaml +++ b/packages/video_player/video_player_web/pubspec.yaml @@ -4,7 +4,7 @@ homepage: https://github.com/flutter/plugins/tree/master/packages/video_player/v # 0.1.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.1.3+1 +version: 0.1.3+2 flutter: plugin: From a5db6e08042b3f6a44e554fc384c76b9e18c7c62 Mon Sep 17 00:00:00 2001 From: Juan Alvarez Date: Mon, 6 Jul 2020 14:42:10 -0500 Subject: [PATCH 011/233] [image_picker] updated VALID_ARCHS to support iPhone simulator (#2761) --- AUTHORS | 1 + packages/image_picker/image_picker/CHANGELOG.md | 4 ++++ packages/image_picker/image_picker/ios/image_picker.podspec | 2 +- packages/image_picker/image_picker/pubspec.yaml | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index 17ede94e79ba..51345c9a3481 100644 --- a/AUTHORS +++ b/AUTHORS @@ -58,3 +58,4 @@ Théo Champion Kazuki Yamaguchi Eitan Schwartz Chris Rutkowski +Juan Alvarez diff --git a/packages/image_picker/image_picker/CHANGELOG.md b/packages/image_picker/image_picker/CHANGELOG.md index 0cba0c8d92cb..0cec3a32b5f1 100644 --- a/packages/image_picker/image_picker/CHANGELOG.md +++ b/packages/image_picker/image_picker/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.6.7+4 + +* Support iOS simulator x86_64 architecture. + ## 0.6.7+3 * Fixes to the example app: diff --git a/packages/image_picker/image_picker/ios/image_picker.podspec b/packages/image_picker/image_picker/ios/image_picker.podspec index 47020f71711c..5c13cef272dd 100644 --- a/packages/image_picker/image_picker/ios/image_picker.podspec +++ b/packages/image_picker/image_picker/ios/image_picker.podspec @@ -18,7 +18,7 @@ Downloaded by pub (not CocoaPods). s.public_header_files = 'Classes/**/*.h' s.dependency 'Flutter' s.platform = :ios, '8.0' - s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS' => 'armv7 arm64 x86_64' } + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' } s.test_spec 'Tests' do |test_spec| test_spec.source_files = 'Tests/**/*' diff --git a/packages/image_picker/image_picker/pubspec.yaml b/packages/image_picker/image_picker/pubspec.yaml index eedecd46e1ee..06da5297d80c 100755 --- a/packages/image_picker/image_picker/pubspec.yaml +++ b/packages/image_picker/image_picker/pubspec.yaml @@ -2,7 +2,7 @@ name: image_picker description: Flutter plugin for selecting images from the Android and iOS image library, and taking new pictures with the camera. homepage: https://github.com/flutter/plugins/tree/master/packages/image_picker/image_picker -version: 0.6.7+3 +version: 0.6.7+4 flutter: plugin: From 65e7bdb699e3ae09091ac8a52d556e575fee2c3b Mon Sep 17 00:00:00 2001 From: Robert Ancell Date: Wed, 8 Jul 2020 02:36:39 +1200 Subject: [PATCH 012/233] [url_launcher_linux] Add Linux url_launcher plugin (#2857) Adds url_launcher_linux, the federated implementation of url_launcher. Not yet endorsed by url_launcher Part of https://github.com/flutter/flutter/issues/41721 --- .ci/Dockerfile-LinuxDesktop | 8 + .../url_launcher_linux/.gitignore | 3 + .../url_launcher/url_launcher_linux/.metadata | 10 + .../url_launcher_linux/CHANGELOG.md | 2 + .../url_launcher/url_launcher_linux/LICENSE | 27 +++ .../url_launcher/url_launcher_linux/README.md | 22 ++ .../url_launcher_linux/example/.gitignore | 44 ++++ .../url_launcher_linux/example/.metadata | 10 + .../url_launcher_linux/example/README.md | 8 + .../url_launcher_linux/example/lib/main.dart | 194 ++++++++++++++++++ .../example/linux/.gitignore | 1 + .../example/linux/CMakeLists.txt | 95 +++++++++ .../example/linux/flutter/CMakeLists.txt | 86 ++++++++ .../flutter/generated_plugin_registrant.cc | 13 ++ .../flutter/generated_plugin_registrant.h | 13 ++ .../linux/flutter/generated_plugins.cmake | 16 ++ .../url_launcher_linux/example/linux/main.cc | 6 + .../example/linux/my_application.cc | 44 ++++ .../example/linux/my_application.h | 18 ++ .../url_launcher_linux/example/pubspec.yaml | 18 ++ .../example/test_driver/url_launcher_e2e.dart | 23 +++ .../test_driver/url_launcher_e2e_test.dart | 15 ++ .../url_launcher_linux/ios/.gitignore | 37 ++++ .../ios/url_launcher_linux.podspec | 22 ++ .../lib/url_launcher_linux.dart | 3 + .../url_launcher_linux/linux/CMakeLists.txt | 17 ++ .../url_launcher_linux/url_launcher_plugin.h | 31 +++ .../linux/url_launcher_plugin.cc | 148 +++++++++++++ .../url_launcher_linux/pubspec.yaml | 19 ++ 29 files changed, 953 insertions(+) create mode 100644 packages/url_launcher/url_launcher_linux/.gitignore create mode 100644 packages/url_launcher/url_launcher_linux/.metadata create mode 100644 packages/url_launcher/url_launcher_linux/CHANGELOG.md create mode 100644 packages/url_launcher/url_launcher_linux/LICENSE create mode 100644 packages/url_launcher/url_launcher_linux/README.md create mode 100644 packages/url_launcher/url_launcher_linux/example/.gitignore create mode 100644 packages/url_launcher/url_launcher_linux/example/.metadata create mode 100644 packages/url_launcher/url_launcher_linux/example/README.md create mode 100644 packages/url_launcher/url_launcher_linux/example/lib/main.dart create mode 100644 packages/url_launcher/url_launcher_linux/example/linux/.gitignore create mode 100644 packages/url_launcher/url_launcher_linux/example/linux/CMakeLists.txt create mode 100644 packages/url_launcher/url_launcher_linux/example/linux/flutter/CMakeLists.txt create mode 100644 packages/url_launcher/url_launcher_linux/example/linux/flutter/generated_plugin_registrant.cc create mode 100644 packages/url_launcher/url_launcher_linux/example/linux/flutter/generated_plugin_registrant.h create mode 100644 packages/url_launcher/url_launcher_linux/example/linux/flutter/generated_plugins.cmake create mode 100644 packages/url_launcher/url_launcher_linux/example/linux/main.cc create mode 100644 packages/url_launcher/url_launcher_linux/example/linux/my_application.cc create mode 100644 packages/url_launcher/url_launcher_linux/example/linux/my_application.h create mode 100644 packages/url_launcher/url_launcher_linux/example/pubspec.yaml create mode 100644 packages/url_launcher/url_launcher_linux/example/test_driver/url_launcher_e2e.dart create mode 100644 packages/url_launcher/url_launcher_linux/example/test_driver/url_launcher_e2e_test.dart create mode 100644 packages/url_launcher/url_launcher_linux/ios/.gitignore create mode 100644 packages/url_launcher/url_launcher_linux/ios/url_launcher_linux.podspec create mode 100644 packages/url_launcher/url_launcher_linux/lib/url_launcher_linux.dart create mode 100644 packages/url_launcher/url_launcher_linux/linux/CMakeLists.txt create mode 100644 packages/url_launcher/url_launcher_linux/linux/include/url_launcher_linux/url_launcher_plugin.h create mode 100644 packages/url_launcher/url_launcher_linux/linux/url_launcher_plugin.cc create mode 100644 packages/url_launcher/url_launcher_linux/pubspec.yaml diff --git a/.ci/Dockerfile-LinuxDesktop b/.ci/Dockerfile-LinuxDesktop index 25924d4ea8d9..63e4516e26fc 100644 --- a/.ci/Dockerfile-LinuxDesktop +++ b/.ci/Dockerfile-LinuxDesktop @@ -21,3 +21,11 @@ RUN sudo apt-get install -y xvfb libegl1-mesa RUN sudo apt-get install -y clang cmake ninja-build file pkg-config # Install necessary libraries. RUN sudo apt-get install -y libgtk-3-dev + +# Add repo for Google Chrome and install it, for url_launcher tests. +RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - +RUN echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' | sudo tee /etc/apt/sources.list.d/google-chrome.list +RUN sudo apt-get update && sudo apt-get install -y --no-install-recommends google-chrome-stable +# Make it the default so http: has a handler. +RUN sudo apt-get install -y xdg-utils +RUN xdg-settings set default-web-browser google-chrome.desktop diff --git a/packages/url_launcher/url_launcher_linux/.gitignore b/packages/url_launcher/url_launcher_linux/.gitignore new file mode 100644 index 000000000000..53e92cc4181f --- /dev/null +++ b/packages/url_launcher/url_launcher_linux/.gitignore @@ -0,0 +1,3 @@ +.packages +.flutter-plugins +pubspec.lock diff --git a/packages/url_launcher/url_launcher_linux/.metadata b/packages/url_launcher/url_launcher_linux/.metadata new file mode 100644 index 000000000000..457a92ae1645 --- /dev/null +++ b/packages/url_launcher/url_launcher_linux/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 4b12050112afd581ddf53df848275fa681f908f3 + channel: master + +project_type: plugin diff --git a/packages/url_launcher/url_launcher_linux/CHANGELOG.md b/packages/url_launcher/url_launcher_linux/CHANGELOG.md new file mode 100644 index 000000000000..18ba82adbe4d --- /dev/null +++ b/packages/url_launcher/url_launcher_linux/CHANGELOG.md @@ -0,0 +1,2 @@ +# 0.0.1 +* The initial implementation of url_launcher for Linux diff --git a/packages/url_launcher/url_launcher_linux/LICENSE b/packages/url_launcher/url_launcher_linux/LICENSE new file mode 100644 index 000000000000..0c91662b3f2f --- /dev/null +++ b/packages/url_launcher/url_launcher_linux/LICENSE @@ -0,0 +1,27 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/url_launcher/url_launcher_linux/README.md b/packages/url_launcher/url_launcher_linux/README.md new file mode 100644 index 000000000000..9b16bdfad813 --- /dev/null +++ b/packages/url_launcher/url_launcher_linux/README.md @@ -0,0 +1,22 @@ +# url_launcher_linux + +The Linux implementation of [`url_launcher`][1]. + +## Usage + +### Import the package + +This package is an unendorsed Linux implementation of `url_launcher`. + +In order to use this now, you'll need to depend on `url_launcher_linux`. +When this package is endorsed it will be automatically used by the `url_launcher` package and you can switch to that API. + +```yaml +... +dependencies: + ... + url_launcher_linux: ^0.0.1 + ... +``` + +[1]: ../ diff --git a/packages/url_launcher/url_launcher_linux/example/.gitignore b/packages/url_launcher/url_launcher_linux/example/.gitignore new file mode 100644 index 000000000000..f3c205341e7d --- /dev/null +++ b/packages/url_launcher/url_launcher_linux/example/.gitignore @@ -0,0 +1,44 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Web related +lib/generated_plugin_registrant.dart + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Exceptions to above rules. +!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages diff --git a/packages/url_launcher/url_launcher_linux/example/.metadata b/packages/url_launcher/url_launcher_linux/example/.metadata new file mode 100644 index 000000000000..99b1a7456d66 --- /dev/null +++ b/packages/url_launcher/url_launcher_linux/example/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 4b12050112afd581ddf53df848275fa681f908f3 + channel: master + +project_type: app diff --git a/packages/url_launcher/url_launcher_linux/example/README.md b/packages/url_launcher/url_launcher_linux/example/README.md new file mode 100644 index 000000000000..28dd90d71700 --- /dev/null +++ b/packages/url_launcher/url_launcher_linux/example/README.md @@ -0,0 +1,8 @@ +# url_launcher_example + +Demonstrates how to use the url_launcher plugin. + +## Getting Started + +For help getting started with Flutter, view our online +[documentation](http://flutter.io/). diff --git a/packages/url_launcher/url_launcher_linux/example/lib/main.dart b/packages/url_launcher/url_launcher_linux/example/lib/main.dart new file mode 100644 index 000000000000..b5cce7482d07 --- /dev/null +++ b/packages/url_launcher/url_launcher_linux/example/lib/main.dart @@ -0,0 +1,194 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// ignore_for_file: public_member_api_docs + +import 'dart:async'; +import 'package:flutter/material.dart'; +import 'package:url_launcher/url_launcher.dart'; + +void main() { + runApp(MyApp()); +} + +class MyApp extends StatelessWidget { + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'URL Launcher', + theme: ThemeData( + primarySwatch: Colors.blue, + ), + home: MyHomePage(title: 'URL Launcher'), + ); + } +} + +class MyHomePage extends StatefulWidget { + MyHomePage({Key key, this.title}) : super(key: key); + final String title; + + @override + _MyHomePageState createState() => _MyHomePageState(); +} + +class _MyHomePageState extends State { + Future _launched; + String _phone = ''; + + Future _launchInBrowser(String url) async { + if (await canLaunch(url)) { + await launch( + url, + forceSafariVC: false, + forceWebView: false, + headers: {'my_header_key': 'my_header_value'}, + ); + } else { + throw 'Could not launch $url'; + } + } + + Future _launchInWebViewOrVC(String url) async { + if (await canLaunch(url)) { + await launch( + url, + forceSafariVC: true, + forceWebView: true, + headers: {'my_header_key': 'my_header_value'}, + ); + } else { + throw 'Could not launch $url'; + } + } + + Future _launchInWebViewWithJavaScript(String url) async { + if (await canLaunch(url)) { + await launch( + url, + forceSafariVC: true, + forceWebView: true, + enableJavaScript: true, + ); + } else { + throw 'Could not launch $url'; + } + } + + Future _launchInWebViewWithDomStorage(String url) async { + if (await canLaunch(url)) { + await launch( + url, + forceSafariVC: true, + forceWebView: true, + enableDomStorage: true, + ); + } else { + throw 'Could not launch $url'; + } + } + + Future _launchUniversalLinkIos(String url) async { + if (await canLaunch(url)) { + final bool nativeAppLaunchSucceeded = await launch( + url, + forceSafariVC: false, + universalLinksOnly: true, + ); + if (!nativeAppLaunchSucceeded) { + await launch( + url, + forceSafariVC: true, + ); + } + } + } + + Widget _launchStatus(BuildContext context, AsyncSnapshot snapshot) { + if (snapshot.hasError) { + return Text('Error: ${snapshot.error}'); + } else { + return const Text(''); + } + } + + Future _makePhoneCall(String url) async { + if (await canLaunch(url)) { + await launch(url); + } else { + throw 'Could not launch $url'; + } + } + + @override + Widget build(BuildContext context) { + const String toLaunch = 'https://www.cylog.org/headers/'; + return Scaffold( + appBar: AppBar( + title: Text(widget.title), + ), + body: ListView( + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.all(16.0), + child: TextField( + onChanged: (String text) => _phone = text, + decoration: const InputDecoration( + hintText: 'Input the phone number to launch')), + ), + RaisedButton( + onPressed: () => setState(() { + _launched = _makePhoneCall('tel:$_phone'); + }), + child: const Text('Make phone call'), + ), + const Padding( + padding: EdgeInsets.all(16.0), + child: Text(toLaunch), + ), + RaisedButton( + onPressed: () => setState(() { + _launched = _launchInBrowser(toLaunch); + }), + child: const Text('Launch in browser'), + ), + const Padding(padding: EdgeInsets.all(16.0)), + RaisedButton( + onPressed: () => setState(() { + _launched = _launchInWebViewOrVC(toLaunch); + }), + child: const Text('Launch in app'), + ), + RaisedButton( + onPressed: () => setState(() { + _launched = _launchInWebViewWithJavaScript(toLaunch); + }), + child: const Text('Launch in app(JavaScript ON)'), + ), + RaisedButton( + onPressed: () => setState(() { + _launched = _launchInWebViewWithDomStorage(toLaunch); + }), + child: const Text('Launch in app(DOM storage ON)'), + ), + const Padding(padding: EdgeInsets.all(16.0)), + RaisedButton( + onPressed: () => setState(() { + _launched = _launchUniversalLinkIos(toLaunch); + }), + child: const Text( + 'Launch a universal link in a native app, fallback to Safari.(Youtube)'), + ), + const Padding(padding: EdgeInsets.all(16.0)), + FutureBuilder(future: _launched, builder: _launchStatus), + ], + ), + ], + ), + ); + } +} diff --git a/packages/url_launcher/url_launcher_linux/example/linux/.gitignore b/packages/url_launcher/url_launcher_linux/example/linux/.gitignore new file mode 100644 index 000000000000..d3896c98444f --- /dev/null +++ b/packages/url_launcher/url_launcher_linux/example/linux/.gitignore @@ -0,0 +1 @@ +flutter/ephemeral diff --git a/packages/url_launcher/url_launcher_linux/example/linux/CMakeLists.txt b/packages/url_launcher/url_launcher_linux/example/linux/CMakeLists.txt new file mode 100644 index 000000000000..0236a8806654 --- /dev/null +++ b/packages/url_launcher/url_launcher_linux/example/linux/CMakeLists.txt @@ -0,0 +1,95 @@ +cmake_minimum_required(VERSION 3.10) +project(runner LANGUAGES CXX) + +set(BINARY_NAME "example") + +cmake_policy(SET CMP0063 NEW) + +set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") + +# Configure build options. +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") +endif() + +# Compilation settings that should be applied to most targets. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_14) + target_compile_options(${TARGET} PRIVATE -Wall -Werror) + target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") + target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") +endfunction() + +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") + +# Flutter library and tool build rules. +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) + +# Application build +add_executable(${BINARY_NAME} + "main.cc" + "my_application.cc" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" +) +apply_standard_settings(${BINARY_NAME}) +target_link_libraries(${BINARY_NAME} PRIVATE flutter) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) +add_dependencies(${BINARY_NAME} flutter_assemble) + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# By default, "installing" just makes a relocatable bundle in the build +# directory. +set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +# Start with a clean build bundle directory every time. +install(CODE " + file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") + " COMPONENT Runtime) + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +if(PLUGIN_BUNDLED_LIBRARIES) + install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") + install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() diff --git a/packages/url_launcher/url_launcher_linux/example/linux/flutter/CMakeLists.txt b/packages/url_launcher/url_launcher_linux/example/linux/flutter/CMakeLists.txt new file mode 100644 index 000000000000..94f43ff7fa6a --- /dev/null +++ b/packages/url_launcher/url_launcher_linux/example/linux/flutter/CMakeLists.txt @@ -0,0 +1,86 @@ +cmake_minimum_required(VERSION 3.10) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. + +# Serves the same purpose as list(TRANSFORM ... PREPEND ...), +# which isn't available in 3.10. +function(list_prepend LIST_NAME PREFIX) + set(NEW_LIST "") + foreach(element ${${LIST_NAME}}) + list(APPEND NEW_LIST "${PREFIX}${element}") + endforeach(element) + set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) +endfunction() + +# === Flutter Library === +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) +pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) +pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) + +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "fl_basic_message_channel.h" + "fl_binary_codec.h" + "fl_binary_messenger.h" + "fl_dart_project.h" + "fl_engine.h" + "fl_json_message_codec.h" + "fl_json_method_codec.h" + "fl_message_codec.h" + "fl_method_call.h" + "fl_method_channel.h" + "fl_method_codec.h" + "fl_method_response.h" + "fl_plugin_registrar.h" + "fl_plugin_registry.h" + "fl_standard_message_codec.h" + "fl_standard_method_codec.h" + "fl_string_codec.h" + "fl_value.h" + "fl_view.h" + "flutter_linux.h" +) +list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") +target_link_libraries(flutter INTERFACE + PkgConfig::GTK + PkgConfig::GLIB + PkgConfig::GIO +) +add_dependencies(flutter flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CMAKE_CURRENT_BINARY_DIR}/_phony_ + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" + linux-x64 ${CMAKE_BUILD_TYPE} +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} +) diff --git a/packages/url_launcher/url_launcher_linux/example/linux/flutter/generated_plugin_registrant.cc b/packages/url_launcher/url_launcher_linux/example/linux/flutter/generated_plugin_registrant.cc new file mode 100644 index 000000000000..026851fa2f96 --- /dev/null +++ b/packages/url_launcher/url_launcher_linux/example/linux/flutter/generated_plugin_registrant.cc @@ -0,0 +1,13 @@ +// +// Generated file. Do not edit. +// + +#include "generated_plugin_registrant.h" + +#include + +void fl_register_plugins(FlPluginRegistry* registry) { + g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); + url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); +} diff --git a/packages/url_launcher/url_launcher_linux/example/linux/flutter/generated_plugin_registrant.h b/packages/url_launcher/url_launcher_linux/example/linux/flutter/generated_plugin_registrant.h new file mode 100644 index 000000000000..9bf7478940c1 --- /dev/null +++ b/packages/url_launcher/url_launcher_linux/example/linux/flutter/generated_plugin_registrant.h @@ -0,0 +1,13 @@ +// +// Generated file. Do not edit. +// + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void fl_register_plugins(FlPluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/packages/url_launcher/url_launcher_linux/example/linux/flutter/generated_plugins.cmake b/packages/url_launcher/url_launcher_linux/example/linux/flutter/generated_plugins.cmake new file mode 100644 index 000000000000..1fc8ed344297 --- /dev/null +++ b/packages/url_launcher/url_launcher_linux/example/linux/flutter/generated_plugins.cmake @@ -0,0 +1,16 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST + url_launcher_linux +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) diff --git a/packages/url_launcher/url_launcher_linux/example/linux/main.cc b/packages/url_launcher/url_launcher_linux/example/linux/main.cc new file mode 100644 index 000000000000..e7c5c5437037 --- /dev/null +++ b/packages/url_launcher/url_launcher_linux/example/linux/main.cc @@ -0,0 +1,6 @@ +#include "my_application.h" + +int main(int argc, char** argv) { + g_autoptr(MyApplication) app = my_application_new(); + return g_application_run(G_APPLICATION(app), argc, argv); +} diff --git a/packages/url_launcher/url_launcher_linux/example/linux/my_application.cc b/packages/url_launcher/url_launcher_linux/example/linux/my_application.cc new file mode 100644 index 000000000000..c2357f17ea9c --- /dev/null +++ b/packages/url_launcher/url_launcher_linux/example/linux/my_application.cc @@ -0,0 +1,44 @@ +#include "my_application.h" + +#include + +#include "flutter/generated_plugin_registrant.h" + +struct _MyApplication { + GtkApplication parent_instance; +}; + +G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) + +// Implements GApplication::activate. +static void my_application_activate(GApplication* application) { + GtkWindow* window = + GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); + GtkHeaderBar *header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); + gtk_widget_show(GTK_WIDGET(header_bar)); + gtk_header_bar_set_title(header_bar, "example"); + gtk_header_bar_set_show_close_button(header_bar, TRUE); + gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); + gtk_window_set_default_size(window, 1280, 720); + gtk_widget_show(GTK_WIDGET(window)); + + g_autoptr(FlDartProject) project = fl_dart_project_new(); + + FlView* view = fl_view_new(project); + gtk_widget_show(GTK_WIDGET(view)); + gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); + + fl_register_plugins(FL_PLUGIN_REGISTRY(view)); + + gtk_widget_grab_focus(GTK_WIDGET(view)); +} + +static void my_application_class_init(MyApplicationClass* klass) { + G_APPLICATION_CLASS(klass)->activate = my_application_activate; +} + +static void my_application_init(MyApplication* self) {} + +MyApplication* my_application_new() { + return MY_APPLICATION(g_object_new(my_application_get_type(), nullptr)); +} diff --git a/packages/url_launcher/url_launcher_linux/example/linux/my_application.h b/packages/url_launcher/url_launcher_linux/example/linux/my_application.h new file mode 100644 index 000000000000..72271d5e4170 --- /dev/null +++ b/packages/url_launcher/url_launcher_linux/example/linux/my_application.h @@ -0,0 +1,18 @@ +#ifndef FLUTTER_MY_APPLICATION_H_ +#define FLUTTER_MY_APPLICATION_H_ + +#include + +G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, + GtkApplication) + +/** + * my_application_new: + * + * Creates a new Flutter-based application. + * + * Returns: a new #MyApplication. + */ +MyApplication* my_application_new(); + +#endif // FLUTTER_MY_APPLICATION_H_ diff --git a/packages/url_launcher/url_launcher_linux/example/pubspec.yaml b/packages/url_launcher/url_launcher_linux/example/pubspec.yaml new file mode 100644 index 000000000000..a4d08f30d6b4 --- /dev/null +++ b/packages/url_launcher/url_launcher_linux/example/pubspec.yaml @@ -0,0 +1,18 @@ +name: url_launcher_example +description: Demonstrates how to use the url_launcher plugin. + +dependencies: + flutter: + sdk: flutter + url_launcher: any + url_launcher_linux: + path: ../ + +dev_dependencies: + e2e: "^0.2.0" + flutter_driver: + sdk: flutter + pedantic: ^1.8.0 + +flutter: + uses-material-design: true diff --git a/packages/url_launcher/url_launcher_linux/example/test_driver/url_launcher_e2e.dart b/packages/url_launcher/url_launcher_linux/example/test_driver/url_launcher_e2e.dart new file mode 100644 index 000000000000..516835cec33b --- /dev/null +++ b/packages/url_launcher/url_launcher_linux/example/test_driver/url_launcher_e2e.dart @@ -0,0 +1,23 @@ +// Copyright 2019, the Chromium project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:flutter_test/flutter_test.dart'; +import 'package:e2e/e2e.dart'; +import 'package:url_launcher/url_launcher.dart'; + +void main() { + E2EWidgetsFlutterBinding.ensureInitialized(); + + test('canLaunch', () async { + expect(await canLaunch('randomstring'), false); + + // Generally all devices should have some default browser. + expect(await canLaunch('http://flutter.dev'), true); + + // Desktop will not necessarily support sms:. + + // tel: and mailto: links may not be openable on every device. iOS + // simulators notably can't open these link types. + }); +} diff --git a/packages/url_launcher/url_launcher_linux/example/test_driver/url_launcher_e2e_test.dart b/packages/url_launcher/url_launcher_linux/example/test_driver/url_launcher_e2e_test.dart new file mode 100644 index 000000000000..1bcd0d37f450 --- /dev/null +++ b/packages/url_launcher/url_launcher_linux/example/test_driver/url_launcher_e2e_test.dart @@ -0,0 +1,15 @@ +// Copyright 2019, the Chromium project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:io'; + +import 'package:flutter_driver/flutter_driver.dart'; + +Future main() async { + final FlutterDriver driver = await FlutterDriver.connect(); + final String result = + await driver.requestData(null, timeout: const Duration(minutes: 1)); + await driver.close(); + exit(result == 'pass' ? 0 : 1); +} diff --git a/packages/url_launcher/url_launcher_linux/ios/.gitignore b/packages/url_launcher/url_launcher_linux/ios/.gitignore new file mode 100644 index 000000000000..aa479fd3ce8a --- /dev/null +++ b/packages/url_launcher/url_launcher_linux/ios/.gitignore @@ -0,0 +1,37 @@ +.idea/ +.vagrant/ +.sconsign.dblite +.svn/ + +.DS_Store +*.swp +profile + +DerivedData/ +build/ +GeneratedPluginRegistrant.h +GeneratedPluginRegistrant.m + +.generated/ + +*.pbxuser +*.mode1v3 +*.mode2v3 +*.perspectivev3 + +!default.pbxuser +!default.mode1v3 +!default.mode2v3 +!default.perspectivev3 + +xcuserdata + +*.moved-aside + +*.pyc +*sync/ +Icon? +.tags* + +/Flutter/Generated.xcconfig +/Flutter/flutter_export_environment.sh \ No newline at end of file diff --git a/packages/url_launcher/url_launcher_linux/ios/url_launcher_linux.podspec b/packages/url_launcher/url_launcher_linux/ios/url_launcher_linux.podspec new file mode 100644 index 000000000000..1359fd403d8d --- /dev/null +++ b/packages/url_launcher/url_launcher_linux/ios/url_launcher_linux.podspec @@ -0,0 +1,22 @@ +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. +# Run `pod lib lint url_launcher_linux.podspec' to validate before publishing. +# +Pod::Spec.new do |s| + s.name = 'url_launcher_linux' + s.version = '0.0.1' + s.summary = 'url_launcher_linux iOS stub' + s.description = <<-DESC + No-op implementation of the Linux url_launcher plugin to avoid build issues on iOS + DESC + s.homepage = 'https://github.com/flutter/plugins' + s.license = { :type => 'BSD', :file => '../LICENSE' } + s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } + s.source = { :http => 'https://github.com/flutter/plugins/tree/master/packages/url_launcher/url_launcher_linux' } + s.dependency 'Flutter' + s.platform = :ios, '8.0' + + # Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported. + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' } + s.swift_version = '5.0' +end diff --git a/packages/url_launcher/url_launcher_linux/lib/url_launcher_linux.dart b/packages/url_launcher/url_launcher_linux/lib/url_launcher_linux.dart new file mode 100644 index 000000000000..18f7af1836ce --- /dev/null +++ b/packages/url_launcher/url_launcher_linux/lib/url_launcher_linux.dart @@ -0,0 +1,3 @@ +// The url_launcher_platform_interface defaults to MethodChannelUrlLauncher +// as its instance, which is all the Linux implementation needs. This file +// is here to silence warnings when publishing to pub. diff --git a/packages/url_launcher/url_launcher_linux/linux/CMakeLists.txt b/packages/url_launcher/url_launcher_linux/linux/CMakeLists.txt new file mode 100644 index 000000000000..1403d0cbc9e4 --- /dev/null +++ b/packages/url_launcher/url_launcher_linux/linux/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.10) +set(PROJECT_NAME "url_launcher_linux") +project(${PROJECT_NAME} LANGUAGES CXX) + +set(PLUGIN_NAME "${PROJECT_NAME}_plugin") + +add_library(${PLUGIN_NAME} SHARED + "url_launcher_plugin.cc" +) +apply_standard_settings(${PLUGIN_NAME}) +set_target_properties(${PLUGIN_NAME} PROPERTIES + CXX_VISIBILITY_PRESET hidden) +target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL) +target_include_directories(${PLUGIN_NAME} INTERFACE + "${CMAKE_CURRENT_SOURCE_DIR}/include") +target_link_libraries(${PLUGIN_NAME} PRIVATE flutter) +target_link_libraries(${PLUGIN_NAME} PRIVATE PkgConfig::GTK) diff --git a/packages/url_launcher/url_launcher_linux/linux/include/url_launcher_linux/url_launcher_plugin.h b/packages/url_launcher/url_launcher_linux/linux/include/url_launcher_linux/url_launcher_plugin.h new file mode 100644 index 000000000000..efcfe62e706a --- /dev/null +++ b/packages/url_launcher/url_launcher_linux/linux/include/url_launcher_linux/url_launcher_plugin.h @@ -0,0 +1,31 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef PACKAGES_URL_LAUNCHER_URL_LAUNCHER_LINUX_LINUX_INCLUDE_URL_LAUNCHER_URL_LAUNCHER_PLUGIN_H_ +#define PACKAGES_URL_LAUNCHER_URL_LAUNCHER_LINUX_LINUX_INCLUDE_URL_LAUNCHER_URL_LAUNCHER_PLUGIN_H_ + +// A plugin to launch URLs. + +#include + +G_BEGIN_DECLS + +#ifdef FLUTTER_PLUGIN_IMPL +#define FLUTTER_PLUGIN_EXPORT __attribute__((visibility("default"))) +#else +#define FLUTTER_PLUGIN_EXPORT +#endif + +G_DECLARE_FINAL_TYPE(FlUrlLauncherPlugin, fl_url_launcher_plugin, FL, + URL_LAUNCHER_PLUGIN, GObject) + +FLUTTER_PLUGIN_EXPORT FlUrlLauncherPlugin* fl_url_launcher_plugin_new( + FlPluginRegistrar* registrar); + +FLUTTER_PLUGIN_EXPORT void url_launcher_plugin_register_with_registrar( + FlPluginRegistrar* registrar); + +G_END_DECLS + +#endif // PACKAGES_URL_LAUNCHER_URL_LAUNCHER_LINUX_LINUX_INCLUDE_URL_LAUNCHER_URL_LAUNCHER_PLUGIN_H_ diff --git a/packages/url_launcher/url_launcher_linux/linux/url_launcher_plugin.cc b/packages/url_launcher/url_launcher_linux/linux/url_launcher_plugin.cc new file mode 100644 index 000000000000..592bb965e83f --- /dev/null +++ b/packages/url_launcher/url_launcher_linux/linux/url_launcher_plugin.cc @@ -0,0 +1,148 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "include/url_launcher_linux/url_launcher_plugin.h" + +#include +#include + +// See url_launcher_channel.dart for documentation. +const char kChannelName[] = "plugins.flutter.io/url_launcher"; +const char kBadArgumentsError[] = "Bad Arguments"; +const char kLaunchError[] = "Launch Error"; +const char kCanLaunchMethod[] = "canLaunch"; +const char kLaunchMethod[] = "launch"; +const char kUrlKey[] = "url"; + +struct _FlUrlLauncherPlugin { + GObject parent_instance; + + FlPluginRegistrar* registrar; + + // Connection to Flutter engine. + FlMethodChannel* channel; +}; + +G_DEFINE_TYPE(FlUrlLauncherPlugin, fl_url_launcher_plugin, g_object_get_type()) + +// Gets the URL from the arguments or generates an error. +static gchar* get_url(FlValue* args, GError** error) { + if (fl_value_get_type(args) != FL_VALUE_TYPE_MAP) { + g_set_error(error, 0, 0, "Argument map missing or malformed"); + return nullptr; + } + FlValue* url_value = fl_value_lookup_string(args, kUrlKey); + if (url_value == nullptr) { + g_set_error(error, 0, 0, "Missing URL"); + return nullptr; + } + + return g_strdup(fl_value_get_string(url_value)); +} + +// Called to check if a URL can be launched. +static FlMethodResponse* can_launch(FlUrlLauncherPlugin* self, FlValue* args) { + g_autoptr(GError) error = nullptr; + g_autofree gchar* url = get_url(args, &error); + if (url == nullptr) { + return FL_METHOD_RESPONSE(fl_method_error_response_new( + kBadArgumentsError, error->message, nullptr)); + } + + gboolean is_launchable = FALSE; + g_autofree gchar* scheme = g_uri_parse_scheme(url); + if (scheme != nullptr) { + g_autoptr(GAppInfo) app_info = + g_app_info_get_default_for_uri_scheme(scheme); + is_launchable = app_info != nullptr; + } + + g_autoptr(FlValue) result = fl_value_new_bool(is_launchable); + return FL_METHOD_RESPONSE(fl_method_success_response_new(result)); +} + +// Called when a URL should launch. +static FlMethodResponse* launch(FlUrlLauncherPlugin* self, FlValue* args) { + g_autoptr(GError) error = nullptr; + g_autofree gchar* url = get_url(args, &error); + if (url == nullptr) { + return FL_METHOD_RESPONSE(fl_method_error_response_new( + kBadArgumentsError, error->message, nullptr)); + } + + FlView* view = fl_plugin_registrar_get_view(self->registrar); + gboolean launched; + if (view != nullptr) { + GtkWindow* window = GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(view))); + launched = gtk_show_uri_on_window(window, url, GDK_CURRENT_TIME, &error); + } else { + launched = g_app_info_launch_default_for_uri(url, nullptr, &error); + } + if (!launched) { + g_autofree gchar* message = + g_strdup_printf("Failed to launch URL: %s", error->message); + return FL_METHOD_RESPONSE( + fl_method_error_response_new(kLaunchError, message, nullptr)); + } + + g_autoptr(FlValue) result = fl_value_new_bool(TRUE); + return FL_METHOD_RESPONSE(fl_method_success_response_new(result)); +} + +// Called when a method call is received from Flutter. +static void method_call_cb(FlMethodChannel* channel, FlMethodCall* method_call, + gpointer user_data) { + FlUrlLauncherPlugin* self = FL_URL_LAUNCHER_PLUGIN(user_data); + + const gchar* method = fl_method_call_get_name(method_call); + FlValue* args = fl_method_call_get_args(method_call); + + g_autoptr(FlMethodResponse) response = nullptr; + if (strcmp(method, kCanLaunchMethod) == 0) + response = can_launch(self, args); + else if (strcmp(method, kLaunchMethod) == 0) + response = launch(self, args); + else + response = FL_METHOD_RESPONSE(fl_method_not_implemented_response_new()); + + g_autoptr(GError) error = nullptr; + if (!fl_method_call_respond(method_call, response, &error)) + g_warning("Failed to send method call response: %s", error->message); +} + +static void fl_url_launcher_plugin_dispose(GObject* object) { + FlUrlLauncherPlugin* self = FL_URL_LAUNCHER_PLUGIN(object); + + g_clear_object(&self->registrar); + g_clear_object(&self->channel); + + G_OBJECT_CLASS(fl_url_launcher_plugin_parent_class)->dispose(object); +} + +static void fl_url_launcher_plugin_class_init(FlUrlLauncherPluginClass* klass) { + G_OBJECT_CLASS(klass)->dispose = fl_url_launcher_plugin_dispose; +} + +FlUrlLauncherPlugin* fl_url_launcher_plugin_new(FlPluginRegistrar* registrar) { + FlUrlLauncherPlugin* self = FL_URL_LAUNCHER_PLUGIN( + g_object_new(fl_url_launcher_plugin_get_type(), nullptr)); + + self->registrar = FL_PLUGIN_REGISTRAR(g_object_ref(registrar)); + + g_autoptr(FlStandardMethodCodec) codec = fl_standard_method_codec_new(); + self->channel = + fl_method_channel_new(fl_plugin_registrar_get_messenger(registrar), + kChannelName, FL_METHOD_CODEC(codec)); + fl_method_channel_set_method_call_handler(self->channel, method_call_cb, + g_object_ref(self), g_object_unref); + + return self; +} + +static void fl_url_launcher_plugin_init(FlUrlLauncherPlugin* self) {} + +void url_launcher_plugin_register_with_registrar(FlPluginRegistrar* registrar) { + FlUrlLauncherPlugin* plugin = fl_url_launcher_plugin_new(registrar); + g_object_unref(plugin); +} diff --git a/packages/url_launcher/url_launcher_linux/pubspec.yaml b/packages/url_launcher/url_launcher_linux/pubspec.yaml new file mode 100644 index 000000000000..2662176ca9e6 --- /dev/null +++ b/packages/url_launcher/url_launcher_linux/pubspec.yaml @@ -0,0 +1,19 @@ +name: url_launcher_linux +description: Linux implementation of the url_launcher plugin. +version: 0.0.1 +homepage: https://github.com/flutter/plugins/tree/master/packages/url_launcher/url_launcher_linux + +flutter: + plugin: + platforms: + linux: + pluginClass: UrlLauncherPlugin + +environment: + sdk: ">=2.1.0 <3.0.0" + flutter: ">=1.12.8 <2.0.0" + +dependencies: + flutter: + sdk: flutter + From 8db69f34b6e17c4256c48934bbbf03821f478f68 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Tue, 7 Jul 2020 11:32:38 -0700 Subject: [PATCH 013/233] [url_launcher] Endorse url_launcher_linux (#2863) Adds an endorsement for url_launcher_linux, so that Linux is supported automatically. Part of https://github.com/flutter/flutter/issues/41721 --- .../url_launcher/url_launcher/CHANGELOG.md | 6 +- .../url_launcher/example/linux/CMakeLists.txt | 95 +++++++++++++++++++ .../example/linux/flutter/CMakeLists.txt | 86 +++++++++++++++++ .../flutter/generated_plugin_registrant.cc | 13 +++ .../flutter/generated_plugin_registrant.h | 13 +++ .../linux/flutter/generated_plugins.cmake | 16 ++++ .../url_launcher/example/linux/main.cc | 6 ++ .../example/linux/my_application.cc | 44 +++++++++ .../example/linux/my_application.h | 18 ++++ .../example/test_driver/url_launcher_e2e.dart | 9 +- .../url_launcher/url_launcher/pubspec.yaml | 5 +- .../url_launcher_linux/CHANGELOG.md | 3 + .../url_launcher/url_launcher_linux/README.md | 18 +++- .../url_launcher_linux/pubspec.yaml | 2 +- script/build_all_plugins_app.sh | 1 + 15 files changed, 327 insertions(+), 8 deletions(-) create mode 100644 packages/url_launcher/url_launcher/example/linux/CMakeLists.txt create mode 100644 packages/url_launcher/url_launcher/example/linux/flutter/CMakeLists.txt create mode 100644 packages/url_launcher/url_launcher/example/linux/flutter/generated_plugin_registrant.cc create mode 100644 packages/url_launcher/url_launcher/example/linux/flutter/generated_plugin_registrant.h create mode 100644 packages/url_launcher/url_launcher/example/linux/flutter/generated_plugins.cmake create mode 100644 packages/url_launcher/url_launcher/example/linux/main.cc create mode 100644 packages/url_launcher/url_launcher/example/linux/my_application.cc create mode 100644 packages/url_launcher/url_launcher/example/linux/my_application.h diff --git a/packages/url_launcher/url_launcher/CHANGELOG.md b/packages/url_launcher/url_launcher/CHANGELOG.md index 6b1327a2da52..a5364726bee3 100644 --- a/packages/url_launcher/url_launcher/CHANGELOG.md +++ b/packages/url_launcher/url_launcher/CHANGELOG.md @@ -1,3 +1,7 @@ +## 5.5.0 + +* Support Linux by default. + ## 5.4.11 * Add documentation in README suggesting how to properly encode urls with special characters. @@ -46,7 +50,7 @@ ## 5.4.0 -* Support macos by default. +* Support macOS by default. ## 5.3.0 diff --git a/packages/url_launcher/url_launcher/example/linux/CMakeLists.txt b/packages/url_launcher/url_launcher/example/linux/CMakeLists.txt new file mode 100644 index 000000000000..0236a8806654 --- /dev/null +++ b/packages/url_launcher/url_launcher/example/linux/CMakeLists.txt @@ -0,0 +1,95 @@ +cmake_minimum_required(VERSION 3.10) +project(runner LANGUAGES CXX) + +set(BINARY_NAME "example") + +cmake_policy(SET CMP0063 NEW) + +set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") + +# Configure build options. +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") +endif() + +# Compilation settings that should be applied to most targets. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_14) + target_compile_options(${TARGET} PRIVATE -Wall -Werror) + target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") + target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") +endfunction() + +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") + +# Flutter library and tool build rules. +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) + +# Application build +add_executable(${BINARY_NAME} + "main.cc" + "my_application.cc" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" +) +apply_standard_settings(${BINARY_NAME}) +target_link_libraries(${BINARY_NAME} PRIVATE flutter) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) +add_dependencies(${BINARY_NAME} flutter_assemble) + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# By default, "installing" just makes a relocatable bundle in the build +# directory. +set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +# Start with a clean build bundle directory every time. +install(CODE " + file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") + " COMPONENT Runtime) + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +if(PLUGIN_BUNDLED_LIBRARIES) + install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") + install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() diff --git a/packages/url_launcher/url_launcher/example/linux/flutter/CMakeLists.txt b/packages/url_launcher/url_launcher/example/linux/flutter/CMakeLists.txt new file mode 100644 index 000000000000..94f43ff7fa6a --- /dev/null +++ b/packages/url_launcher/url_launcher/example/linux/flutter/CMakeLists.txt @@ -0,0 +1,86 @@ +cmake_minimum_required(VERSION 3.10) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. + +# Serves the same purpose as list(TRANSFORM ... PREPEND ...), +# which isn't available in 3.10. +function(list_prepend LIST_NAME PREFIX) + set(NEW_LIST "") + foreach(element ${${LIST_NAME}}) + list(APPEND NEW_LIST "${PREFIX}${element}") + endforeach(element) + set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) +endfunction() + +# === Flutter Library === +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) +pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) +pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) + +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "fl_basic_message_channel.h" + "fl_binary_codec.h" + "fl_binary_messenger.h" + "fl_dart_project.h" + "fl_engine.h" + "fl_json_message_codec.h" + "fl_json_method_codec.h" + "fl_message_codec.h" + "fl_method_call.h" + "fl_method_channel.h" + "fl_method_codec.h" + "fl_method_response.h" + "fl_plugin_registrar.h" + "fl_plugin_registry.h" + "fl_standard_message_codec.h" + "fl_standard_method_codec.h" + "fl_string_codec.h" + "fl_value.h" + "fl_view.h" + "flutter_linux.h" +) +list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") +target_link_libraries(flutter INTERFACE + PkgConfig::GTK + PkgConfig::GLIB + PkgConfig::GIO +) +add_dependencies(flutter flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CMAKE_CURRENT_BINARY_DIR}/_phony_ + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" + linux-x64 ${CMAKE_BUILD_TYPE} +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} +) diff --git a/packages/url_launcher/url_launcher/example/linux/flutter/generated_plugin_registrant.cc b/packages/url_launcher/url_launcher/example/linux/flutter/generated_plugin_registrant.cc new file mode 100644 index 000000000000..026851fa2f96 --- /dev/null +++ b/packages/url_launcher/url_launcher/example/linux/flutter/generated_plugin_registrant.cc @@ -0,0 +1,13 @@ +// +// Generated file. Do not edit. +// + +#include "generated_plugin_registrant.h" + +#include + +void fl_register_plugins(FlPluginRegistry* registry) { + g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); + url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); +} diff --git a/packages/url_launcher/url_launcher/example/linux/flutter/generated_plugin_registrant.h b/packages/url_launcher/url_launcher/example/linux/flutter/generated_plugin_registrant.h new file mode 100644 index 000000000000..9bf7478940c1 --- /dev/null +++ b/packages/url_launcher/url_launcher/example/linux/flutter/generated_plugin_registrant.h @@ -0,0 +1,13 @@ +// +// Generated file. Do not edit. +// + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void fl_register_plugins(FlPluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/packages/url_launcher/url_launcher/example/linux/flutter/generated_plugins.cmake b/packages/url_launcher/url_launcher/example/linux/flutter/generated_plugins.cmake new file mode 100644 index 000000000000..1fc8ed344297 --- /dev/null +++ b/packages/url_launcher/url_launcher/example/linux/flutter/generated_plugins.cmake @@ -0,0 +1,16 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST + url_launcher_linux +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) diff --git a/packages/url_launcher/url_launcher/example/linux/main.cc b/packages/url_launcher/url_launcher/example/linux/main.cc new file mode 100644 index 000000000000..e7c5c5437037 --- /dev/null +++ b/packages/url_launcher/url_launcher/example/linux/main.cc @@ -0,0 +1,6 @@ +#include "my_application.h" + +int main(int argc, char** argv) { + g_autoptr(MyApplication) app = my_application_new(); + return g_application_run(G_APPLICATION(app), argc, argv); +} diff --git a/packages/url_launcher/url_launcher/example/linux/my_application.cc b/packages/url_launcher/url_launcher/example/linux/my_application.cc new file mode 100644 index 000000000000..c2357f17ea9c --- /dev/null +++ b/packages/url_launcher/url_launcher/example/linux/my_application.cc @@ -0,0 +1,44 @@ +#include "my_application.h" + +#include + +#include "flutter/generated_plugin_registrant.h" + +struct _MyApplication { + GtkApplication parent_instance; +}; + +G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) + +// Implements GApplication::activate. +static void my_application_activate(GApplication* application) { + GtkWindow* window = + GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); + GtkHeaderBar *header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); + gtk_widget_show(GTK_WIDGET(header_bar)); + gtk_header_bar_set_title(header_bar, "example"); + gtk_header_bar_set_show_close_button(header_bar, TRUE); + gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); + gtk_window_set_default_size(window, 1280, 720); + gtk_widget_show(GTK_WIDGET(window)); + + g_autoptr(FlDartProject) project = fl_dart_project_new(); + + FlView* view = fl_view_new(project); + gtk_widget_show(GTK_WIDGET(view)); + gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); + + fl_register_plugins(FL_PLUGIN_REGISTRY(view)); + + gtk_widget_grab_focus(GTK_WIDGET(view)); +} + +static void my_application_class_init(MyApplicationClass* klass) { + G_APPLICATION_CLASS(klass)->activate = my_application_activate; +} + +static void my_application_init(MyApplication* self) {} + +MyApplication* my_application_new() { + return MY_APPLICATION(g_object_new(my_application_get_type(), nullptr)); +} diff --git a/packages/url_launcher/url_launcher/example/linux/my_application.h b/packages/url_launcher/url_launcher/example/linux/my_application.h new file mode 100644 index 000000000000..72271d5e4170 --- /dev/null +++ b/packages/url_launcher/url_launcher/example/linux/my_application.h @@ -0,0 +1,18 @@ +#ifndef FLUTTER_MY_APPLICATION_H_ +#define FLUTTER_MY_APPLICATION_H_ + +#include + +G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, + GtkApplication) + +/** + * my_application_new: + * + * Creates a new Flutter-based application. + * + * Returns: a new #MyApplication. + */ +MyApplication* my_application_new(); + +#endif // FLUTTER_MY_APPLICATION_H_ diff --git a/packages/url_launcher/url_launcher/example/test_driver/url_launcher_e2e.dart b/packages/url_launcher/url_launcher/example/test_driver/url_launcher_e2e.dart index e1d75f93b326..6cf1168c81bd 100644 --- a/packages/url_launcher/url_launcher/example/test_driver/url_launcher_e2e.dart +++ b/packages/url_launcher/url_launcher/example/test_driver/url_launcher_e2e.dart @@ -2,6 +2,9 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'dart:io' show Platform; + +import 'package:flutter/foundation.dart' show kIsWeb; import 'package:flutter_test/flutter_test.dart'; import 'package:e2e/e2e.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -15,8 +18,10 @@ void main() { // Generally all devices should have some default browser. expect(await canLaunch('http://flutter.dev'), true); - // Generally all devices should have some default SMS app. - expect(await canLaunch('sms:5555555555'), true); + // SMS handling is available by default on most platforms. + if (kIsWeb || !Platform.isLinux) { + expect(await canLaunch('sms:5555555555'), true); + } // tel: and mailto: links may not be openable on every device. iOS // simulators notably can't open these link types. diff --git a/packages/url_launcher/url_launcher/pubspec.yaml b/packages/url_launcher/url_launcher/pubspec.yaml index 08ac3f9f8b80..299de938165f 100644 --- a/packages/url_launcher/url_launcher/pubspec.yaml +++ b/packages/url_launcher/url_launcher/pubspec.yaml @@ -2,7 +2,7 @@ name: url_launcher description: Flutter plugin for launching a URL on Android and iOS. Supports web, phone, SMS, and email schemes. homepage: https://github.com/flutter/plugins/tree/master/packages/url_launcher/url_launcher -version: 5.4.11 +version: 5.5.0 flutter: plugin: @@ -14,6 +14,8 @@ flutter: pluginClass: FLTURLLauncherPlugin web: default_package: url_launcher_web + linux: + default_package: url_laucher_linux macos: default_package: url_laucher_macos @@ -27,6 +29,7 @@ dependencies: # TODO(amirh): Revisit this (either update this part in the design or the pub tool). # https://github.com/flutter/flutter/issues/46264 url_launcher_web: ^0.1.0+1 + url_launcher_linux: ^0.0.1 url_launcher_macos: ^0.0.1 dev_dependencies: diff --git a/packages/url_launcher/url_launcher_linux/CHANGELOG.md b/packages/url_launcher/url_launcher_linux/CHANGELOG.md index 18ba82adbe4d..e03b1d387c55 100644 --- a/packages/url_launcher/url_launcher_linux/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_linux/CHANGELOG.md @@ -1,2 +1,5 @@ +# 0.0.1+1 +* README update for endorsement by url_launcher. + # 0.0.1 * The initial implementation of url_launcher for Linux diff --git a/packages/url_launcher/url_launcher_linux/README.md b/packages/url_launcher/url_launcher_linux/README.md index 9b16bdfad813..0474c58da40e 100644 --- a/packages/url_launcher/url_launcher_linux/README.md +++ b/packages/url_launcher/url_launcher_linux/README.md @@ -6,10 +6,22 @@ The Linux implementation of [`url_launcher`][1]. ### Import the package -This package is an unendorsed Linux implementation of `url_launcher`. +This package has been endorsed, meaning that you only need to add `url_launcher` +as a dependency in your `pubspec.yaml`. It will be automatically included in your app +when you depend on `package:url_launcher`. -In order to use this now, you'll need to depend on `url_launcher_linux`. -When this package is endorsed it will be automatically used by the `url_launcher` package and you can switch to that API. +This is what the above means to your `pubspec.yaml`: + +```yaml +... +dependencies: + ... + url_launcher: ^5.5.0 + ... +``` + +If you wish to use the Linux package only, you can add `url_launcher_linux` as a +dependency: ```yaml ... diff --git a/packages/url_launcher/url_launcher_linux/pubspec.yaml b/packages/url_launcher/url_launcher_linux/pubspec.yaml index 2662176ca9e6..74c2968aba69 100644 --- a/packages/url_launcher/url_launcher_linux/pubspec.yaml +++ b/packages/url_launcher/url_launcher_linux/pubspec.yaml @@ -1,6 +1,6 @@ name: url_launcher_linux description: Linux implementation of the url_launcher plugin. -version: 0.0.1 +version: 0.0.1+1 homepage: https://github.com/flutter/plugins/tree/master/packages/url_launcher/url_launcher_linux flutter: diff --git a/script/build_all_plugins_app.sh b/script/build_all_plugins_app.sh index 262c4ed7b1d3..961cecce7903 100755 --- a/script/build_all_plugins_app.sh +++ b/script/build_all_plugins_app.sh @@ -31,6 +31,7 @@ readonly EXCLUDED_PLUGINS_LIST=( "shared_preferences_platform_interface" "shared_preferences_web" "shared_preferences_windows" + "url_launcher_linux" "url_launcher_macos" "url_launcher_platform_interface" "url_launcher_web" From f3f7e8c02ab6979a6582fcfcac12eaa002d577da Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Tue, 7 Jul 2020 18:33:49 -0700 Subject: [PATCH 014/233] [shared_preferences_linux] Add iOS stub (#2865) Add missing iOS stub to shared_preferences_linux --- .../shared_preferences_linux/CHANGELOG.md | 3 +++ .../ios/shared_preferences_linux.podspec | 22 +++++++++++++++++++ .../shared_preferences_linux/pubspec.yaml | 2 +- 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 packages/shared_preferences/shared_preferences_linux/ios/shared_preferences_linux.podspec diff --git a/packages/shared_preferences/shared_preferences_linux/CHANGELOG.md b/packages/shared_preferences/shared_preferences_linux/CHANGELOG.md index 11694802aacf..de171a9fcf80 100644 --- a/packages/shared_preferences/shared_preferences_linux/CHANGELOG.md +++ b/packages/shared_preferences/shared_preferences_linux/CHANGELOG.md @@ -1,2 +1,5 @@ +## 0.0.2 +* Add iOS stub. + ## 0.0.1 * Initial release to support shared_preferences on Linux. diff --git a/packages/shared_preferences/shared_preferences_linux/ios/shared_preferences_linux.podspec b/packages/shared_preferences/shared_preferences_linux/ios/shared_preferences_linux.podspec new file mode 100644 index 000000000000..8f4d3cdddcd5 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_linux/ios/shared_preferences_linux.podspec @@ -0,0 +1,22 @@ +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. +# Run `pod lib lint shared_preferences_launcher_linux.podspec' to validate before publishing. +# +Pod::Spec.new do |s| + s.name = 'shared_preferences_linux' + s.version = '0.0.1' + s.summary = 'shared_preferences_linux iOS stub' + s.description = <<-DESC + No-op implementation of the Linux shared_preferences plugin to avoid build issues on iOS + DESC + s.homepage = 'https://github.com/flutter/plugins' + s.license = { :type => 'BSD', :file => '../LICENSE' } + s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } + s.source = { :http => 'https://github.com/flutter/plugins/tree/master/packages/shared_preferences/shared_preferences_linux' } + s.dependency 'Flutter' + s.platform = :ios, '8.0' + + # Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported. + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' } + s.swift_version = '5.0' +end diff --git a/packages/shared_preferences/shared_preferences_linux/pubspec.yaml b/packages/shared_preferences/shared_preferences_linux/pubspec.yaml index 2539b937e006..95c3aca71237 100644 --- a/packages/shared_preferences/shared_preferences_linux/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_linux/pubspec.yaml @@ -1,6 +1,6 @@ name: shared_preferences_linux description: Linux implementation of the shared_preferences plugin -version: 0.0.1 +version: 0.0.2 homepage: https://github.com/flutter/plugins/tree/master/packages/shared_preferences/shared_preferences_linux flutter: From 3b931d0a9c10e6a833cff1dffcd8e6a947a43936 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Tue, 7 Jul 2020 21:00:58 -0700 Subject: [PATCH 015/233] [shared_preferences] Shared preferences linux endorsement (#2864) Endorses shared_preferences_linux. Since shared_preferences_linux is pure Dart, this uses manual registration of the Linux implementation. It is similar to the solution used for path_provider, but improves on it by more narrowly tailoring the registration to cases where another registration hasn't already been done, and only checking the first time, thus avoiding the need for a variable to override it. Updates shared_preferences_linux to depend on path_provider_linux rather than path_provider, to avoid adding unnecessary native plugin dependencies to other platforms. Also adds a driver test for shared_preference_linux, which I missed in reviewing the initial shared_preferences_linux landing. --- .../shared_preferences/CHANGELOG.md | 4 + .../shared_preferences/README.md | 8 +- .../lib/shared_preferences.dart | 25 ++++- .../shared_preferences/pubspec.yaml | 5 +- .../shared_preferences_linux/CHANGELOG.md | 3 + .../example/linux/CMakeLists.txt | 95 +++++++++++++++++++ .../example/linux/flutter/CMakeLists.txt | 86 +++++++++++++++++ .../flutter/generated_plugin_registrant.cc | 9 ++ .../flutter/generated_plugin_registrant.h | 13 +++ .../linux/flutter/generated_plugins.cmake | 15 +++ .../example/linux/main.cc | 6 ++ .../example/linux/my_application.cc | 44 +++++++++ .../example/linux/my_application.h | 18 ++++ .../example/pubspec.yaml | 11 +++ .../test_driver/shared_preferences_e2e.dart | 89 +++++++++++++++++ .../shared_preferences_e2e_test.dart | 15 +++ .../lib/shared_preferences_linux.dart | 9 +- .../shared_preferences_linux/pubspec.yaml | 4 +- .../test/shared_preferences_linux_test.dart | 13 ++- 19 files changed, 454 insertions(+), 18 deletions(-) create mode 100644 packages/shared_preferences/shared_preferences_linux/example/linux/CMakeLists.txt create mode 100644 packages/shared_preferences/shared_preferences_linux/example/linux/flutter/CMakeLists.txt create mode 100644 packages/shared_preferences/shared_preferences_linux/example/linux/flutter/generated_plugin_registrant.cc create mode 100644 packages/shared_preferences/shared_preferences_linux/example/linux/flutter/generated_plugin_registrant.h create mode 100644 packages/shared_preferences/shared_preferences_linux/example/linux/flutter/generated_plugins.cmake create mode 100644 packages/shared_preferences/shared_preferences_linux/example/linux/main.cc create mode 100644 packages/shared_preferences/shared_preferences_linux/example/linux/my_application.cc create mode 100644 packages/shared_preferences/shared_preferences_linux/example/linux/my_application.h create mode 100644 packages/shared_preferences/shared_preferences_linux/example/test_driver/shared_preferences_e2e.dart create mode 100644 packages/shared_preferences/shared_preferences_linux/example/test_driver/shared_preferences_e2e_test.dart diff --git a/packages/shared_preferences/shared_preferences/CHANGELOG.md b/packages/shared_preferences/shared_preferences/CHANGELOG.md index 8c7ee24dfa6b..d17bbb96289b 100644 --- a/packages/shared_preferences/shared_preferences/CHANGELOG.md +++ b/packages/shared_preferences/shared_preferences/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.5.8 + +* Support Linux by default. + ## 0.5.7+3 * Post-v2 Android embedding cleanup. diff --git a/packages/shared_preferences/shared_preferences/README.md b/packages/shared_preferences/shared_preferences/README.md index b5bf4050a8fd..9ccac0ac49ae 100644 --- a/packages/shared_preferences/shared_preferences/README.md +++ b/packages/shared_preferences/shared_preferences/README.md @@ -2,10 +2,10 @@ [![pub package](https://img.shields.io/pub/v/shared_preferences.svg)](https://pub.dartlang.org/packages/shared_preferences) -Wraps NSUserDefaults (on iOS) and SharedPreferences (on Android), providing -a persistent store for simple data. Data is persisted to disk asynchronously. -Neither platform can guarantee that writes will be persisted to disk after -returning and this plugin must not be used for storing critical data. +Wraps platform-specific persistent storage for simple data +(NSUserDefaults on iOS and macOS, SharedPreferences on Android, etc.). Data may be persisted to disk asynchronously, +and there is no guarantee that writes will be persisted to disk after +returning, so this plugin must not be used for storing critical data. **Please set your constraint to `shared_preferences: '>=0.5.y+x <2.0.0'`** diff --git a/packages/shared_preferences/shared_preferences/lib/shared_preferences.dart b/packages/shared_preferences/shared_preferences/lib/shared_preferences.dart index 62160dee20fd..b8d3452a0a0e 100644 --- a/packages/shared_preferences/shared_preferences/lib/shared_preferences.dart +++ b/packages/shared_preferences/shared_preferences/lib/shared_preferences.dart @@ -3,10 +3,14 @@ // found in the LICENSE file. import 'dart:async'; +import 'dart:io' show Platform; +import 'package:flutter/foundation.dart' show kIsWeb; import 'package:meta/meta.dart'; +import 'package:shared_preferences_linux/shared_preferences_linux.dart'; import 'package:shared_preferences_platform_interface/shared_preferences_platform_interface.dart'; +import 'package:shared_preferences_platform_interface/method_channel_shared_preferences.dart'; /// Wraps NSUserDefaults (on iOS) and SharedPreferences (on Android), providing /// a persistent store for simple data. @@ -17,9 +21,26 @@ class SharedPreferences { static const String _prefix = 'flutter.'; static Completer _completer; + static bool _manualDartRegistrationNeeded = true; + + static SharedPreferencesStorePlatform get _store { + // This is to manually endorse the Linux implementation until automatic + // registration of dart plugins is implemented. For details see + // https://github.com/flutter/flutter/issues/52267. + if (_manualDartRegistrationNeeded) { + // Only do the initial registration if it hasn't already been overridden + // with a non-default instance. + if (!kIsWeb && + Platform.isLinux && + SharedPreferencesStorePlatform.instance + is MethodChannelSharedPreferencesStore) { + SharedPreferencesStorePlatform.instance = SharedPreferencesLinux(); + } + _manualDartRegistrationNeeded = false; + } - static SharedPreferencesStorePlatform get _store => - SharedPreferencesStorePlatform.instance; + return SharedPreferencesStorePlatform.instance; + } /// Loads and parses the [SharedPreferences] for this app from disk. /// diff --git a/packages/shared_preferences/shared_preferences/pubspec.yaml b/packages/shared_preferences/shared_preferences/pubspec.yaml index 2b278248745a..ca8c443cd753 100644 --- a/packages/shared_preferences/shared_preferences/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences/pubspec.yaml @@ -5,7 +5,7 @@ homepage: https://github.com/flutter/plugins/tree/master/packages/shared_prefere # 0.5.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.5.7+3 +version: 0.5.8 flutter: plugin: @@ -15,6 +15,8 @@ flutter: pluginClass: SharedPreferencesPlugin ios: pluginClass: FLTSharedPreferencesPlugin + linux: + default_package: shared_preferences_linux macos: default_package: shared_preferences_macos web: @@ -30,6 +32,7 @@ dependencies: # validation, so we set a ^ constraint. # TODO(franciscojma): Revisit this (either update this part in the design or the pub tool). # https://github.com/flutter/flutter/issues/46264 + shared_preferences_linux: ^0.0.2 shared_preferences_macos: ^0.0.1 shared_preferences_web: ^0.1.2 diff --git a/packages/shared_preferences/shared_preferences_linux/CHANGELOG.md b/packages/shared_preferences/shared_preferences_linux/CHANGELOG.md index de171a9fcf80..353a921ff281 100644 --- a/packages/shared_preferences/shared_preferences_linux/CHANGELOG.md +++ b/packages/shared_preferences/shared_preferences_linux/CHANGELOG.md @@ -1,3 +1,6 @@ +## 0.0.2+1 +* Replace path_provider dependency with path_provider_linux. + ## 0.0.2 * Add iOS stub. diff --git a/packages/shared_preferences/shared_preferences_linux/example/linux/CMakeLists.txt b/packages/shared_preferences/shared_preferences_linux/example/linux/CMakeLists.txt new file mode 100644 index 000000000000..0236a8806654 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_linux/example/linux/CMakeLists.txt @@ -0,0 +1,95 @@ +cmake_minimum_required(VERSION 3.10) +project(runner LANGUAGES CXX) + +set(BINARY_NAME "example") + +cmake_policy(SET CMP0063 NEW) + +set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") + +# Configure build options. +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") +endif() + +# Compilation settings that should be applied to most targets. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_14) + target_compile_options(${TARGET} PRIVATE -Wall -Werror) + target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") + target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") +endfunction() + +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") + +# Flutter library and tool build rules. +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) + +# Application build +add_executable(${BINARY_NAME} + "main.cc" + "my_application.cc" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" +) +apply_standard_settings(${BINARY_NAME}) +target_link_libraries(${BINARY_NAME} PRIVATE flutter) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) +add_dependencies(${BINARY_NAME} flutter_assemble) + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# By default, "installing" just makes a relocatable bundle in the build +# directory. +set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +# Start with a clean build bundle directory every time. +install(CODE " + file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") + " COMPONENT Runtime) + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +if(PLUGIN_BUNDLED_LIBRARIES) + install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") + install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() diff --git a/packages/shared_preferences/shared_preferences_linux/example/linux/flutter/CMakeLists.txt b/packages/shared_preferences/shared_preferences_linux/example/linux/flutter/CMakeLists.txt new file mode 100644 index 000000000000..94f43ff7fa6a --- /dev/null +++ b/packages/shared_preferences/shared_preferences_linux/example/linux/flutter/CMakeLists.txt @@ -0,0 +1,86 @@ +cmake_minimum_required(VERSION 3.10) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. + +# Serves the same purpose as list(TRANSFORM ... PREPEND ...), +# which isn't available in 3.10. +function(list_prepend LIST_NAME PREFIX) + set(NEW_LIST "") + foreach(element ${${LIST_NAME}}) + list(APPEND NEW_LIST "${PREFIX}${element}") + endforeach(element) + set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) +endfunction() + +# === Flutter Library === +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) +pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) +pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) + +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "fl_basic_message_channel.h" + "fl_binary_codec.h" + "fl_binary_messenger.h" + "fl_dart_project.h" + "fl_engine.h" + "fl_json_message_codec.h" + "fl_json_method_codec.h" + "fl_message_codec.h" + "fl_method_call.h" + "fl_method_channel.h" + "fl_method_codec.h" + "fl_method_response.h" + "fl_plugin_registrar.h" + "fl_plugin_registry.h" + "fl_standard_message_codec.h" + "fl_standard_method_codec.h" + "fl_string_codec.h" + "fl_value.h" + "fl_view.h" + "flutter_linux.h" +) +list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") +target_link_libraries(flutter INTERFACE + PkgConfig::GTK + PkgConfig::GLIB + PkgConfig::GIO +) +add_dependencies(flutter flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CMAKE_CURRENT_BINARY_DIR}/_phony_ + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" + linux-x64 ${CMAKE_BUILD_TYPE} +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} +) diff --git a/packages/shared_preferences/shared_preferences_linux/example/linux/flutter/generated_plugin_registrant.cc b/packages/shared_preferences/shared_preferences_linux/example/linux/flutter/generated_plugin_registrant.cc new file mode 100644 index 000000000000..d38195aa0412 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_linux/example/linux/flutter/generated_plugin_registrant.cc @@ -0,0 +1,9 @@ +// +// Generated file. Do not edit. +// + +#include "generated_plugin_registrant.h" + + +void fl_register_plugins(FlPluginRegistry* registry) { +} diff --git a/packages/shared_preferences/shared_preferences_linux/example/linux/flutter/generated_plugin_registrant.h b/packages/shared_preferences/shared_preferences_linux/example/linux/flutter/generated_plugin_registrant.h new file mode 100644 index 000000000000..9bf7478940c1 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_linux/example/linux/flutter/generated_plugin_registrant.h @@ -0,0 +1,13 @@ +// +// Generated file. Do not edit. +// + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void fl_register_plugins(FlPluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/packages/shared_preferences/shared_preferences_linux/example/linux/flutter/generated_plugins.cmake b/packages/shared_preferences/shared_preferences_linux/example/linux/flutter/generated_plugins.cmake new file mode 100644 index 000000000000..51436ae8c982 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_linux/example/linux/flutter/generated_plugins.cmake @@ -0,0 +1,15 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) diff --git a/packages/shared_preferences/shared_preferences_linux/example/linux/main.cc b/packages/shared_preferences/shared_preferences_linux/example/linux/main.cc new file mode 100644 index 000000000000..e7c5c5437037 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_linux/example/linux/main.cc @@ -0,0 +1,6 @@ +#include "my_application.h" + +int main(int argc, char** argv) { + g_autoptr(MyApplication) app = my_application_new(); + return g_application_run(G_APPLICATION(app), argc, argv); +} diff --git a/packages/shared_preferences/shared_preferences_linux/example/linux/my_application.cc b/packages/shared_preferences/shared_preferences_linux/example/linux/my_application.cc new file mode 100644 index 000000000000..c2357f17ea9c --- /dev/null +++ b/packages/shared_preferences/shared_preferences_linux/example/linux/my_application.cc @@ -0,0 +1,44 @@ +#include "my_application.h" + +#include + +#include "flutter/generated_plugin_registrant.h" + +struct _MyApplication { + GtkApplication parent_instance; +}; + +G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) + +// Implements GApplication::activate. +static void my_application_activate(GApplication* application) { + GtkWindow* window = + GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); + GtkHeaderBar *header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); + gtk_widget_show(GTK_WIDGET(header_bar)); + gtk_header_bar_set_title(header_bar, "example"); + gtk_header_bar_set_show_close_button(header_bar, TRUE); + gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); + gtk_window_set_default_size(window, 1280, 720); + gtk_widget_show(GTK_WIDGET(window)); + + g_autoptr(FlDartProject) project = fl_dart_project_new(); + + FlView* view = fl_view_new(project); + gtk_widget_show(GTK_WIDGET(view)); + gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); + + fl_register_plugins(FL_PLUGIN_REGISTRY(view)); + + gtk_widget_grab_focus(GTK_WIDGET(view)); +} + +static void my_application_class_init(MyApplicationClass* klass) { + G_APPLICATION_CLASS(klass)->activate = my_application_activate; +} + +static void my_application_init(MyApplication* self) {} + +MyApplication* my_application_new() { + return MY_APPLICATION(g_object_new(my_application_get_type(), nullptr)); +} diff --git a/packages/shared_preferences/shared_preferences_linux/example/linux/my_application.h b/packages/shared_preferences/shared_preferences_linux/example/linux/my_application.h new file mode 100644 index 000000000000..72271d5e4170 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_linux/example/linux/my_application.h @@ -0,0 +1,18 @@ +#ifndef FLUTTER_MY_APPLICATION_H_ +#define FLUTTER_MY_APPLICATION_H_ + +#include + +G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, + GtkApplication) + +/** + * my_application_new: + * + * Creates a new Flutter-based application. + * + * Returns: a new #MyApplication. + */ +MyApplication* my_application_new(); + +#endif // FLUTTER_MY_APPLICATION_H_ diff --git a/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml b/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml index 1c0624035c54..8e726d642274 100644 --- a/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml @@ -4,11 +4,22 @@ description: Demonstrates how to use the shared_preferences_linux plugin. dependencies: flutter: sdk: flutter + shared_preferences: any shared_preferences_linux: ^0.1.0 dependency_overrides: shared_preferences_linux: path: ../ + # Remove this override once the endorsement is published. + shared_preferences: + path: ../../shared_preferences/ + +dev_dependencies: + flutter_driver: + sdk: flutter + test: any + e2e: ^0.2.0 + pedantic: ^1.8.0 flutter: uses-material-design: true diff --git a/packages/shared_preferences/shared_preferences_linux/example/test_driver/shared_preferences_e2e.dart b/packages/shared_preferences/shared_preferences_linux/example/test_driver/shared_preferences_e2e.dart new file mode 100644 index 000000000000..b693df2131ed --- /dev/null +++ b/packages/shared_preferences/shared_preferences_linux/example/test_driver/shared_preferences_e2e.dart @@ -0,0 +1,89 @@ +import 'dart:async'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:e2e/e2e.dart'; + +void main() { + E2EWidgetsFlutterBinding.ensureInitialized(); + + group('$SharedPreferences', () { + const Map kTestValues = { + 'flutter.String': 'hello world', + 'flutter.bool': true, + 'flutter.int': 42, + 'flutter.double': 3.14159, + 'flutter.List': ['foo', 'bar'], + }; + + const Map kTestValues2 = { + 'flutter.String': 'goodbye world', + 'flutter.bool': false, + 'flutter.int': 1337, + 'flutter.double': 2.71828, + 'flutter.List': ['baz', 'quox'], + }; + + SharedPreferences preferences; + + setUp(() async { + preferences = await SharedPreferences.getInstance(); + }); + + tearDown(() { + preferences.clear(); + }); + + test('reading', () async { + expect(preferences.get('String'), isNull); + expect(preferences.get('bool'), isNull); + expect(preferences.get('int'), isNull); + expect(preferences.get('double'), isNull); + expect(preferences.get('List'), isNull); + expect(preferences.getString('String'), isNull); + expect(preferences.getBool('bool'), isNull); + expect(preferences.getInt('int'), isNull); + expect(preferences.getDouble('double'), isNull); + expect(preferences.getStringList('List'), isNull); + }); + + test('writing', () async { + await Future.wait(>[ + preferences.setString('String', kTestValues2['flutter.String']), + preferences.setBool('bool', kTestValues2['flutter.bool']), + preferences.setInt('int', kTestValues2['flutter.int']), + preferences.setDouble('double', kTestValues2['flutter.double']), + preferences.setStringList('List', kTestValues2['flutter.List']) + ]); + expect(preferences.getString('String'), kTestValues2['flutter.String']); + expect(preferences.getBool('bool'), kTestValues2['flutter.bool']); + expect(preferences.getInt('int'), kTestValues2['flutter.int']); + expect(preferences.getDouble('double'), kTestValues2['flutter.double']); + expect(preferences.getStringList('List'), kTestValues2['flutter.List']); + }); + + test('removing', () async { + const String key = 'testKey'; + await preferences.setString(key, kTestValues['flutter.String']); + await preferences.setBool(key, kTestValues['flutter.bool']); + await preferences.setInt(key, kTestValues['flutter.int']); + await preferences.setDouble(key, kTestValues['flutter.double']); + await preferences.setStringList(key, kTestValues['flutter.List']); + await preferences.remove(key); + expect(preferences.get('testKey'), isNull); + }); + + test('clearing', () async { + await preferences.setString('String', kTestValues['flutter.String']); + await preferences.setBool('bool', kTestValues['flutter.bool']); + await preferences.setInt('int', kTestValues['flutter.int']); + await preferences.setDouble('double', kTestValues['flutter.double']); + await preferences.setStringList('List', kTestValues['flutter.List']); + await preferences.clear(); + expect(preferences.getString('String'), null); + expect(preferences.getBool('bool'), null); + expect(preferences.getInt('int'), null); + expect(preferences.getDouble('double'), null); + expect(preferences.getStringList('List'), null); + }); + }); +} diff --git a/packages/shared_preferences/shared_preferences_linux/example/test_driver/shared_preferences_e2e_test.dart b/packages/shared_preferences/shared_preferences_linux/example/test_driver/shared_preferences_e2e_test.dart new file mode 100644 index 000000000000..f3aa9e218d82 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_linux/example/test_driver/shared_preferences_e2e_test.dart @@ -0,0 +1,15 @@ +// Copyright 2019, the Chromium project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:async'; +import 'dart:io'; +import 'package:flutter_driver/flutter_driver.dart'; + +Future main() async { + final FlutterDriver driver = await FlutterDriver.connect(); + final String result = + await driver.requestData(null, timeout: const Duration(minutes: 1)); + await driver.close(); + exit(result == 'pass' ? 0 : 1); +} diff --git a/packages/shared_preferences/shared_preferences_linux/lib/shared_preferences_linux.dart b/packages/shared_preferences/shared_preferences_linux/lib/shared_preferences_linux.dart index dc93100c3277..c975ad1a7544 100644 --- a/packages/shared_preferences/shared_preferences_linux/lib/shared_preferences_linux.dart +++ b/packages/shared_preferences/shared_preferences_linux/lib/shared_preferences_linux.dart @@ -4,11 +4,12 @@ import 'dart:async'; import 'dart:convert' show json; + import 'package:file/file.dart'; import 'package:file/local.dart'; import 'package:meta/meta.dart'; import 'package:path/path.dart' as path; -import 'package:path_provider/path_provider.dart'; +import 'package:path_provider_linux/path_provider_linux.dart'; import 'package:shared_preferences_platform_interface/shared_preferences_platform_interface.dart'; /// The Linux implementation of [SharedPreferencesStorePlatform]. @@ -27,9 +28,9 @@ class SharedPreferencesLinux extends SharedPreferencesStorePlatform { /// Gets the file where the preferences are stored. Future _getLocalDataFile() async { - var directory = await getApplicationSupportDirectory(); - var filePath = path.join(directory.path, 'shared_preferences.json'); - return fs.file(filePath); + final pathProvider = PathProviderLinux(); + final directory = await pathProvider.getApplicationSupportPath(); + return fs.file(path.join(directory, 'shared_preferences.json')); } /// Gets the preferences from the stored file. Once read, the preferences are diff --git a/packages/shared_preferences/shared_preferences_linux/pubspec.yaml b/packages/shared_preferences/shared_preferences_linux/pubspec.yaml index 95c3aca71237..3d40d39241ac 100644 --- a/packages/shared_preferences/shared_preferences_linux/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_linux/pubspec.yaml @@ -1,6 +1,6 @@ name: shared_preferences_linux description: Linux implementation of the shared_preferences plugin -version: 0.0.2 +version: 0.0.2+1 homepage: https://github.com/flutter/plugins/tree/master/packages/shared_preferences/shared_preferences_linux flutter: @@ -20,7 +20,7 @@ dependencies: sdk: flutter meta: ^1.0.4 path: ^1.6.4 - path_provider: ^1.6.11 + path_provider_linux: ^0.0.1 shared_preferences_platform_interface: ^1.0.0 dev_dependencies: diff --git a/packages/shared_preferences/shared_preferences_linux/test/shared_preferences_linux_test.dart b/packages/shared_preferences/shared_preferences_linux/test/shared_preferences_linux_test.dart index 8a794b1fa7c2..8c659f212aa5 100644 --- a/packages/shared_preferences/shared_preferences_linux/test/shared_preferences_linux_test.dart +++ b/packages/shared_preferences/shared_preferences_linux/test/shared_preferences_linux_test.dart @@ -4,19 +4,22 @@ import 'package:file/memory.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:path/path.dart' as path; -import 'package:path_provider/path_provider.dart'; +import 'package:path_provider_linux/path_provider_linux.dart'; import 'package:shared_preferences_linux/shared_preferences_linux.dart'; -MemoryFileSystem fs = MemoryFileSystem.test(); +MemoryFileSystem fs; void main() { - setUp(() {}); + setUp(() { + fs = MemoryFileSystem.test(); + }); tearDown(() {}); Future _getFilePath() async { - var directory = await getApplicationSupportDirectory(); - return path.join(directory.path, 'shared_preferences.json'); + final pathProvider = PathProviderLinux(); + final directory = await pathProvider.getApplicationSupportPath(); + return path.join(directory, 'shared_preferences.json'); } _writeTestFile(String value) async { From d6435f03595bc65bcf826f52f87ffad248179af8 Mon Sep 17 00:00:00 2001 From: David Iglesias Date: Mon, 13 Jul 2020 15:45:57 -0700 Subject: [PATCH 016/233] [connectivity_for_web] Fix JS Interop in release mode. (#2869) * Switch to dart:html window.navigator.connection instead of package:js JS-interop. * Overwrite connection.onchange instead of listening to connection.onChange Stream (prevents multiple subscriptions after hot-reload). * Cleaned up old code related to generating the JS facade. --- .../connectivity_for_web/CHANGELOG.md | 4 + .../generated/network_information_types.dart | 78 ------------ ...k_information_api_connectivity_plugin.dart | 39 ++++-- .../lib/src/utils/connectivity_result.dart | 17 +-- .../connectivity_for_web/pubspec.yaml | 4 +- .../connectivity_for_web/test/lib/main.dart | 21 ++-- .../test/lib/src/connectivity_mocks.dart | 53 ++------ .../connectivity_for_web/test/pubspec.yaml | 3 +- .../connectivity_for_web/ts/.gitignore | 2 - .../connectivity_for_web/ts/README.md | 25 ---- .../connectivity_for_web/ts/package-lock.json | 117 ------------------ .../connectivity_for_web/ts/package.json | 17 --- .../ts/scripts/run_facade_gen.sh | 18 --- 13 files changed, 61 insertions(+), 337 deletions(-) delete mode 100644 packages/connectivity/connectivity_for_web/lib/src/generated/network_information_types.dart delete mode 100644 packages/connectivity/connectivity_for_web/ts/.gitignore delete mode 100644 packages/connectivity/connectivity_for_web/ts/README.md delete mode 100644 packages/connectivity/connectivity_for_web/ts/package-lock.json delete mode 100644 packages/connectivity/connectivity_for_web/ts/package.json delete mode 100755 packages/connectivity/connectivity_for_web/ts/scripts/run_facade_gen.sh diff --git a/packages/connectivity/connectivity_for_web/CHANGELOG.md b/packages/connectivity/connectivity_for_web/CHANGELOG.md index 89e186abe1cb..83dc386a0314 100644 --- a/packages/connectivity/connectivity_for_web/CHANGELOG.md +++ b/packages/connectivity/connectivity_for_web/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.3.1 + +* Use NetworkInformation API from dart:html, instead of the JS-interop version. + ## 0.3.0 * Rename from "experimental_connectivity_web" to "connectivity_for_web", and move to flutter/plugins master. diff --git a/packages/connectivity/connectivity_for_web/lib/src/generated/network_information_types.dart b/packages/connectivity/connectivity_for_web/lib/src/generated/network_information_types.dart deleted file mode 100644 index c4045b3ec1fc..000000000000 --- a/packages/connectivity/connectivity_for_web/lib/src/generated/network_information_types.dart +++ /dev/null @@ -1,78 +0,0 @@ -@JS() -library network_information_types; - -import "package:js/js.dart"; -import "dart:html" show EventListener, EventTarget; - -/// W3C Spec Draft http://wicg.github.io/netinfo/ -/// Edition: Draft Community Group Report 20 February 2019 - -/// http://wicg.github.io/netinfo/#navigatornetworkinformation-interface -@anonymous -@JS() -abstract class Navigator implements NavigatorNetworkInformation {} - -@anonymous -@JS() -abstract class WorkerNavigator implements NavigatorNetworkInformation { - external factory WorkerNavigator({NetworkInformation connection}); -} - -/// http://wicg.github.io/netinfo/#navigatornetworkinformation-interface -@anonymous -@JS() -abstract class NavigatorNetworkInformation { - external NetworkInformation get connection; - external factory NavigatorNetworkInformation({NetworkInformation connection}); -} - -/// http://wicg.github.io/netinfo/#connection-types -/*type ConnectionType = - | 'bluetooth' - | 'cellular' - | 'ethernet' - | 'mixed' - | 'none' - | 'other' - | 'unknown' - | 'wifi' - | 'wimax'; -*/ - -/// http://wicg.github.io/netinfo/#effectiveconnectiontype-enum -/*type EffectiveConnectionType = '2g' | '3g' | '4g' | 'slow-2g';*/ - -/// http://wicg.github.io/netinfo/#dom-megabit -/*type Megabit = number;*/ -/// http://wicg.github.io/netinfo/#dom-millisecond -/*type Millisecond = number;*/ - -/// http://wicg.github.io/netinfo/#networkinformation-interface -@anonymous -@JS() -abstract class NetworkInformation implements EventTarget { - /// http://wicg.github.io/netinfo/#type-attribute - external String /*'bluetooth'|'cellular'|'ethernet'|'mixed'|'none'|'other'|'unknown'|'wifi'|'wimax'*/ get type; - - /// http://wicg.github.io/netinfo/#effectivetype-attribute - external String /*'2g'|'3g'|'4g'|'slow-2g'*/ get effectiveType; - - /// http://wicg.github.io/netinfo/#downlinkmax-attribute - external num get downlinkMax; - - /// http://wicg.github.io/netinfo/#downlink-attribute - external num get downlink; - - /// http://wicg.github.io/netinfo/#rtt-attribute - external num get rtt; - - /// http://wicg.github.io/netinfo/#savedata-attribute - external bool get saveData; - - /// http://wicg.github.io/netinfo/#handling-changes-to-the-underlying-connection - external EventListener get onchange; - external set onchange(EventListener v); -} - -@JS() -external Navigator get navigator; diff --git a/packages/connectivity/connectivity_for_web/lib/src/network_information_api_connectivity_plugin.dart b/packages/connectivity/connectivity_for_web/lib/src/network_information_api_connectivity_plugin.dart index d88487b9c406..99bac2ab8d30 100644 --- a/packages/connectivity/connectivity_for_web/lib/src/network_information_api_connectivity_plugin.dart +++ b/packages/connectivity/connectivity_for_web/lib/src/network_information_api_connectivity_plugin.dart @@ -1,28 +1,29 @@ import 'dart:async'; +import 'dart:html' as html show window, NetworkInformation; +import 'dart:js'; +import 'dart:js_util'; import 'package:connectivity_platform_interface/connectivity_platform_interface.dart'; import 'package:connectivity_for_web/connectivity_for_web.dart'; import 'package:flutter/foundation.dart'; -import 'package:js/js.dart'; -import 'generated/network_information_types.dart' as dom; import 'utils/connectivity_result.dart'; /// The web implementation of the ConnectivityPlatform of the Connectivity plugin. class NetworkInformationApiConnectivityPlugin extends ConnectivityPlugin { - final dom.NetworkInformation _networkInformation; + final html.NetworkInformation _networkInformation; /// A check to determine if this version of the plugin can be used. - static bool isSupported() => dom.navigator?.connection != null; + static bool isSupported() => html.window.navigator.connection != null; /// The constructor of the plugin. NetworkInformationApiConnectivityPlugin() - : this.withConnection(dom.navigator?.connection); + : this.withConnection(html.window.navigator.connection); /// Creates the plugin, with an override of the NetworkInformation object. @visibleForTesting NetworkInformationApiConnectivityPlugin.withConnection( - dom.NetworkInformation connection) + html.NetworkInformation connection) : _networkInformation = connection; /// Checks the connection status of the device. @@ -31,18 +32,30 @@ class NetworkInformationApiConnectivityPlugin extends ConnectivityPlugin { return networkInformationToConnectivityResult(_networkInformation); } - StreamController _connectivityResult; + StreamController _connectivityResultStreamController; + Stream _connectivityResultStream; /// Returns a Stream of ConnectivityResults changes. @override Stream get onConnectivityChanged { - if (_connectivityResult == null) { - _connectivityResult = StreamController(); - _networkInformation.onchange = allowInterop((_) { - _connectivityResult + if (_connectivityResultStreamController == null) { + _connectivityResultStreamController = + StreamController(); + setProperty(_networkInformation, 'onchange', allowInterop((_) { + _connectivityResultStreamController .add(networkInformationToConnectivityResult(_networkInformation)); - }); + })); + // TODO: Implement the above with _networkInformation.onChange: + // _networkInformation.onChange.listen((_) { + // _connectivityResult + // .add(networkInformationToConnectivityResult(_networkInformation)); + // }); + // Once we can detect when to *cancel* a subscription to the _networkInformation + // onChange Stream upon hot restart. + // https://github.com/dart-lang/sdk/issues/42679 + _connectivityResultStream = + _connectivityResultStreamController.stream.asBroadcastStream(); } - return _connectivityResult.stream; + return _connectivityResultStream; } } diff --git a/packages/connectivity/connectivity_for_web/lib/src/utils/connectivity_result.dart b/packages/connectivity/connectivity_for_web/lib/src/utils/connectivity_result.dart index 28943ef5c7e1..efefd8d52440 100644 --- a/packages/connectivity/connectivity_for_web/lib/src/utils/connectivity_result.dart +++ b/packages/connectivity/connectivity_for_web/lib/src/utils/connectivity_result.dart @@ -1,27 +1,22 @@ +import 'dart:html' as html show NetworkInformation; import 'package:connectivity_platform_interface/connectivity_platform_interface.dart'; /// Converts an incoming NetworkInformation object into the correct ConnectivityResult. -// -// We can't be more specific on the signature of this method because the API is odd, -// data can come from a static value in the DOM, or as the 'target' of a DOM Event. -// -// If we type info as `NetworkInformation`, Dart will complain with: -// "Uncaught Error: Expected a value of type 'NetworkInformation', -// but got one of type 'NetworkInformation'" ConnectivityResult networkInformationToConnectivityResult( - dynamic /* NetworkInformation */ info) { + html.NetworkInformation info, +) { if (info == null) { return ConnectivityResult.none; } if (info.downlink == 0 && info.rtt == 0) { return ConnectivityResult.none; } - if (info.type != null) { - return _typeToConnectivityResult(info.type); - } if (info.effectiveType != null) { return _effectiveTypeToConnectivityResult(info.effectiveType); } + if (info.type != null) { + return _typeToConnectivityResult(info.type); + } return ConnectivityResult.none; } diff --git a/packages/connectivity/connectivity_for_web/pubspec.yaml b/packages/connectivity/connectivity_for_web/pubspec.yaml index e4a1673e40c2..e1142a75c91f 100644 --- a/packages/connectivity/connectivity_for_web/pubspec.yaml +++ b/packages/connectivity/connectivity_for_web/pubspec.yaml @@ -1,6 +1,6 @@ name: connectivity_for_web description: An implementation for the web platform of the Flutter `connectivity` plugin. This uses the NetworkInformation Web API, with a fallback to Navigator.onLine. -version: 0.3.0 +version: 0.3.1 homepage: https://github.com/ditman/plugins/tree/connectivity-web/packages/connectivity/experimental_connectivity_web flutter: @@ -12,7 +12,6 @@ flutter: dependencies: connectivity_platform_interface: ^1.0.3 - js: ^0.6.1+1 flutter_web_plugins: sdk: flutter flutter: @@ -25,6 +24,7 @@ dev_dependencies: flutter_test: sdk: flutter e2e: ^0.2.4+3 + mockito: ^4.1.1 environment: sdk: ">=2.6.0 <3.0.0" diff --git a/packages/connectivity/connectivity_for_web/test/lib/main.dart b/packages/connectivity/connectivity_for_web/test/lib/main.dart index 21621a947ee6..93b9a73cf31b 100644 --- a/packages/connectivity/connectivity_for_web/test/lib/main.dart +++ b/packages/connectivity/connectivity_for_web/test/lib/main.dart @@ -3,6 +3,8 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:connectivity_platform_interface/connectivity_platform_interface.dart'; import 'package:connectivity_for_web/src/network_information_api_connectivity_plugin.dart'; +import 'package:mockito/mockito.dart'; + import 'src/connectivity_mocks.dart'; void main() { @@ -16,11 +18,12 @@ void main() { num rtt = 50, ConnectivityResult expected, }) { - MockNetworkInformation connection = MockNetworkInformation( - type: type, - effectiveType: effectiveType, - downlink: downlink, - rtt: rtt); + final connection = MockNetworkInformation(); + when(connection.type).thenReturn(type); + when(connection.effectiveType).thenReturn(effectiveType); + when(connection.downlink).thenReturn(downlink); + when(connection.rtt).thenReturn(downlink); + NetworkInformationApiConnectivityPlugin plugin = NetworkInformationApiConnectivityPlugin.withConnection(connection); expect(plugin.checkConnectivity(), completion(equals(expected))); @@ -53,16 +56,16 @@ void main() { group('get onConnectivityChanged', () { test('puts change events in a Stream', () async { - MockNetworkInformation connection = - MockNetworkInformation(effectiveType: '4g', downlink: 10, rtt: 50); + final connection = MockNetworkInformation(); NetworkInformationApiConnectivityPlugin plugin = NetworkInformationApiConnectivityPlugin.withConnection(connection); Stream results = plugin.onConnectivityChanged; // Fake a disconnect-reconnect - connection.mockChangeValue(downlink: 0, rtt: 0); - connection.mockChangeValue(downlink: 10, rtt: 50); + await connection.mockChangeValue(downlink: 0, rtt: 0); + await connection.mockChangeValue( + downlink: 10, rtt: 50, effectiveType: '4g'); // The stream of results is infinite, so we need to .take(2) for this test to complete. expect( diff --git a/packages/connectivity/connectivity_for_web/test/lib/src/connectivity_mocks.dart b/packages/connectivity/connectivity_for_web/test/lib/src/connectivity_mocks.dart index 9ce2e811d461..7b82b512065b 100644 --- a/packages/connectivity/connectivity_for_web/test/lib/src/connectivity_mocks.dart +++ b/packages/connectivity/connectivity_for_web/test/lib/src/connectivity_mocks.dart @@ -1,33 +1,12 @@ import 'dart:html'; -import 'package:connectivity_for_web/src/generated/network_information_types.dart' - as dom; +import 'package:mockito/mockito.dart'; /// A Mock implementation of the NetworkInformation API that allows /// for external modification of its values. -class MockNetworkInformation extends dom.NetworkInformation { - @override - String type; - - @override - String effectiveType; - - @override - num downlink; - - @override - num rtt; - - @override - EventListener onchange; - - /// Constructor of mocked instances... - MockNetworkInformation({ - this.type, - this.effectiveType, - this.downlink, - this.rtt, - }); +class MockNetworkInformation extends Mock implements NetworkInformation { + /// The callback that will fire after the network information values change. + Function onchange; /// Changes the desired values, and triggers the change event listener. void mockChangeValue({ @@ -35,26 +14,12 @@ class MockNetworkInformation extends dom.NetworkInformation { String effectiveType, num downlink, num rtt, - }) { - this.type = type ?? this.type; - this.effectiveType = effectiveType ?? this.effectiveType; - this.downlink = downlink ?? this.downlink; - this.rtt = rtt ?? this.rtt; + }) async { + when(this.type).thenAnswer((_) => type); + when(this.effectiveType).thenAnswer((_) => effectiveType); + when(this.downlink).thenAnswer((_) => downlink); + when(this.rtt).thenAnswer((_) => rtt); onchange(Event('change')); } - - @override - void addEventListener(String type, listener, [bool useCapture]) {} - - @override - bool dispatchEvent(Event event) { - return true; - } - - @override - Events get on => null; - - @override - void removeEventListener(String type, listener, [bool useCapture]) {} } diff --git a/packages/connectivity/connectivity_for_web/test/pubspec.yaml b/packages/connectivity/connectivity_for_web/test/pubspec.yaml index 4d7d10a775e2..44f4b552b443 100644 --- a/packages/connectivity/connectivity_for_web/test/pubspec.yaml +++ b/packages/connectivity/connectivity_for_web/test/pubspec.yaml @@ -1,6 +1,6 @@ name: connectivity_web_example description: Example web app for the connectivity plugin -version: 0.1.0 +version: 0.1.1 homepage: https://github.com/flutter/plugins/tree/master/packages/connectivity/connectivity_web dependencies: @@ -18,6 +18,7 @@ dev_dependencies: flutter_driver: sdk: flutter e2e: ^0.2.4+3 + mockito: ^4.1.1 environment: sdk: ">=2.6.0 <3.0.0" diff --git a/packages/connectivity/connectivity_for_web/ts/.gitignore b/packages/connectivity/connectivity_for_web/ts/.gitignore deleted file mode 100644 index de4d1f007dd1..000000000000 --- a/packages/connectivity/connectivity_for_web/ts/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -dist -node_modules diff --git a/packages/connectivity/connectivity_for_web/ts/README.md b/packages/connectivity/connectivity_for_web/ts/README.md deleted file mode 100644 index 3372ad2f3790..000000000000 --- a/packages/connectivity/connectivity_for_web/ts/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# JS Facade generator - -This npm script takes the `network-information-types` npm package, and runs it through Dart's `dart_js_facade_gen` to auto-generate (most) of the JS facades used by this plugin. - -The process is not completely automated yet, but it should be pretty close. - -To generate the facades, and after [installing `npm`](https://www.npmjs.com/get-npm), do: - -``` -npm install -npm run build -``` - -The above will fetch the required dependencies, and generate a `dist/network_information_types.dart` file that you can use with the plugin. - -``` -cp dist/*.dart ../lib/src/generated -``` - -This script should come handy once the Network Information Web API changes, or becomes stable, so the JS-interop part of this plugin can be regenerated more easily. - -Read more: - -* [Dart JS Interop](https://dart.dev/web/js-interop) -* [dart_js_facade_gen](https://www.npmjs.com/package/dart_js_facade_gen) \ No newline at end of file diff --git a/packages/connectivity/connectivity_for_web/ts/package-lock.json b/packages/connectivity/connectivity_for_web/ts/package-lock.json deleted file mode 100644 index 45293a400492..000000000000 --- a/packages/connectivity/connectivity_for_web/ts/package-lock.json +++ /dev/null @@ -1,117 +0,0 @@ -{ - "name": "network-information-types-to-dart-generator", - "version": "1.0.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@types/chai": { - "version": "4.2.9", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.9.tgz", - "integrity": "sha512-NeXgZj+MFL4izGqA4sapdYzkzQG+MtGra9vhQ58dnmDY++VgJaRUws+aLVV5zRJCYJl/8s9IjMmhiUw1WsKSmw==" - }, - "@types/fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-UoOfVEzAUpeSPmjm7h1uk5MH6KZma2z2O7a75onTGjnNvAvMVrPzPL/vBbT65iIGHWj6rokwfmYcmxmlSf2uwg==", - "requires": { - "@types/node": "*" - } - }, - "@types/minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY=" - }, - "@types/mocha": { - "version": "5.2.7", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz", - "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==" - }, - "@types/node": { - "version": "12.12.28", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.28.tgz", - "integrity": "sha512-g73GJYJDXgf0jqg+P9S8h2acWbDXNkoCX8DLtJVu7Fkn788pzQ/oJsrdJz/2JejRf/SjfZaAhsw+3nd1D5EWGg==" - }, - "@types/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/@types/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha512-LrnsgZIfJaysFkv9rRJp4/uAyqw87oVed3s1hhF83nwbo9c7MG9g5DqR0seHP+lkX4ldmMrVolPjQSe2ZfD0yA==", - "requires": { - "source-map": "*" - } - }, - "@types/source-map-support": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/@types/source-map-support/-/source-map-support-0.5.1.tgz", - "integrity": "sha512-VDqnZe9D2zR19qbeRvwYyHSp7AtUtCkTaRVFQ8wzwH9TXw9kKKq/vBhfEnFEXVupO2M0lBMA9mr/XyQ6gEkUOA==", - "requires": { - "@types/node": "*" - } - }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" - }, - "dart-style": { - "version": "1.3.2-dev", - "resolved": "https://registry.npmjs.org/dart-style/-/dart-style-1.3.2-dev.tgz", - "integrity": "sha512-NFI4UQYvG32t/cEkQAdkXT2ZT72tjF61tMWoALmnGwj03d2Co94zwGfbnFfdQUQvrhUNx8Wz2jKSVxGrmFaVJQ==" - }, - "dart_js_facade_gen": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/dart_js_facade_gen/-/dart_js_facade_gen-0.0.7.tgz", - "integrity": "sha512-AZiWsccbzhgJWmBjbFTPuvBhwGXk7AN8nOP91/I8PqUfSvVALiWshDc66TvywNkdNogAE5X8zlxjodw1C3iHpA==", - "requires": { - "@types/chai": "^4.2.3", - "@types/fs-extra": "^8.0.0", - "@types/minimist": "^1.2.0", - "@types/mocha": "^5.2.7", - "@types/node": "^12.7.8", - "@types/source-map": "^0.5.7", - "@types/source-map-support": "^0.5.0", - "dart-style": "^1.3.2-dev", - "minimist": "^1.2.0", - "source-map": "^0.7.3", - "source-map-support": "^0.5.13", - "typescript": "^3.6.3" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" - }, - "network-information-types": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/network-information-types/-/network-information-types-0.1.0.tgz", - "integrity": "sha512-cRUCYZoRHTMjYcgk5MbwqM0h0Za34panRxAJKY8n+mQ+NLMuRIw7aKzmaZqkC/cte7bnRcdfTwFA27GgN62EtQ==" - }, - "source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==" - }, - "source-map-support": { - "version": "0.5.16", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.16.tgz", - "integrity": "sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==", - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" - } - } - }, - "typescript": { - "version": "3.8.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.2.tgz", - "integrity": "sha512-EgOVgL/4xfVrCMbhYKUQTdF37SQn4Iw73H5BgCrF1Abdun7Kwy/QZsE/ssAy0y4LxBbvua3PIbFsbRczWWnDdQ==" - } - } -} diff --git a/packages/connectivity/connectivity_for_web/ts/package.json b/packages/connectivity/connectivity_for_web/ts/package.json deleted file mode 100644 index 665c89d6afbb..000000000000 --- a/packages/connectivity/connectivity_for_web/ts/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "network-information-types-to-dart-generator", - "version": "1.0.0", - "description": "Use dart_js_facade_gen to generate the facade for the network-information-types package.", - "main": "index.js", - "private": true, - "scripts": { - "build": "./scripts/run_facade_gen.sh", - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "MIT", - "dependencies": { - "network-information-types": "0.1.0", - "dart_js_facade_gen": "^0.0.7" - } -} diff --git a/packages/connectivity/connectivity_for_web/ts/scripts/run_facade_gen.sh b/packages/connectivity/connectivity_for_web/ts/scripts/run_facade_gen.sh deleted file mode 100755 index c74b8ba171b2..000000000000 --- a/packages/connectivity/connectivity_for_web/ts/scripts/run_facade_gen.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -INDEX_PATH=node_modules/network-information-types/dist-types/index.d.ts -WORK_PATH=network_information_types.d.ts -DIST_PATH=dist - -# Create dist if it doesn't exist already -mkdir -p $DIST_PATH - -# Copy the input file(s) into our work path -cp $INDEX_PATH $WORK_PATH - -# Run dart_js_facade_gen -dart_js_facade_gen $WORK_PATH --trust-js-types --generate-html --destination . - -# Move output to the right place, and clean after yourself -mv *.dart $DIST_PATH -rm $WORK_PATH From 5971e2f5bca9c07fc037effeabbf4410ce48e644 Mon Sep 17 00:00:00 2001 From: David Iglesias Date: Mon, 13 Jul 2020 17:32:57 -0700 Subject: [PATCH 017/233] [google_sign_in] Bridge google_sign_in and googleapis. (#2824) Introduce the first version of the `extension_google_sign_in_as_googleapis_auth` package. This package lets users of the `google_sign_in` plugin to create an authenticated HTTP clients (from `googleapis_auth`) that can access any APIs from the `googleapis` package. --- .../.gitignore | 75 +++ .../.metadata | 10 + .../CHANGELOG.md | 3 + .../LICENSE | 27 + .../README.md | 46 ++ .../example/README.md | 8 + .../example/android/app/build.gradle | 64 +++ .../example/android/app/google-services.json | 246 +++++++++ .../gradle/wrapper/gradle-wrapper.properties | 5 + .../android/app/src/main/AndroidManifest.xml | 25 + .../main/java/io/flutter/plugins/.gitignore | 1 + .../EmbeddingV1Activity.java | 19 + .../EmbeddingV1ActivityTest.java | 17 + .../FlutterActivityTest.java | 17 + .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 544 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 442 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 721 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 1031 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 1443 bytes .../app/src/main/res/values/strings.xml | 4 + .../example/android/build.gradle | 29 + .../example/android/gradle.properties | 4 + .../gradle/wrapper/gradle-wrapper.properties | 5 + .../example/android/settings.gradle | 15 + .../ios/Flutter/AppFrameworkInfo.plist | 30 ++ .../example/ios/Flutter/Debug.xcconfig | 2 + .../example/ios/Flutter/Release.xcconfig | 2 + .../ios/GoogleSignInPluginTest/Info.plist | 22 + .../ios/Runner.xcodeproj/project.pbxproj | 502 ++++++++++++++++++ .../contents.xcworkspacedata | 10 + .../xcshareddata/xcschemes/Runner.xcscheme | 87 +++ .../contents.xcworkspacedata | 10 + .../example/ios/Runner/AppDelegate.h | 10 + .../example/ios/Runner/AppDelegate.m | 17 + .../AppIcon.appiconset/Contents.json | 116 ++++ .../AppIcon.appiconset/Icon-App-20x20@1x.png | Bin 0 -> 564 bytes .../AppIcon.appiconset/Icon-App-20x20@2x.png | Bin 0 -> 1283 bytes .../AppIcon.appiconset/Icon-App-20x20@3x.png | Bin 0 -> 1588 bytes .../AppIcon.appiconset/Icon-App-29x29@1x.png | Bin 0 -> 1025 bytes .../AppIcon.appiconset/Icon-App-29x29@2x.png | Bin 0 -> 1716 bytes .../AppIcon.appiconset/Icon-App-29x29@3x.png | Bin 0 -> 1920 bytes .../AppIcon.appiconset/Icon-App-40x40@1x.png | Bin 0 -> 1283 bytes .../AppIcon.appiconset/Icon-App-40x40@2x.png | Bin 0 -> 1895 bytes .../AppIcon.appiconset/Icon-App-40x40@3x.png | Bin 0 -> 2665 bytes .../AppIcon.appiconset/Icon-App-60x60@2x.png | Bin 0 -> 2665 bytes .../AppIcon.appiconset/Icon-App-60x60@3x.png | Bin 0 -> 3831 bytes .../AppIcon.appiconset/Icon-App-76x76@1x.png | Bin 0 -> 1888 bytes .../AppIcon.appiconset/Icon-App-76x76@2x.png | Bin 0 -> 3294 bytes .../Icon-App-83.5x83.5@2x.png | Bin 0 -> 3612 bytes .../Runner/Base.lproj/LaunchScreen.storyboard | 27 + .../ios/Runner/Base.lproj/Main.storyboard | 26 + .../ios/Runner/GoogleService-Info.plist | 44 ++ .../example/ios/Runner/Info.plist | 62 +++ .../example/ios/Runner/main.m | 13 + .../example/lib/main.dart | 149 ++++++ .../example/pubspec.yaml | 23 + .../example/web/index.html | 11 + ...ion_google_sign_in_as_googleapis_auth.dart | 36 ++ .../pubspec.yaml | 28 + ...oogle_sign_in_as_googleapis_auth_test.dart | 46 ++ script/build_all_plugins_app.sh | 1 + 61 files changed, 1894 insertions(+) create mode 100644 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/.gitignore create mode 100644 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/.metadata create mode 100644 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/CHANGELOG.md create mode 100644 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/LICENSE create mode 100644 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/README.md create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/README.md create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/build.gradle create mode 100644 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/google-services.json create mode 100644 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/gradle/wrapper/gradle-wrapper.properties create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/AndroidManifest.xml create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/.gitignore create mode 100644 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/EmbeddingV1Activity.java create mode 100644 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/EmbeddingV1ActivityTest.java create mode 100644 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/FlutterActivityTest.java create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/res/values/strings.xml create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/build.gradle create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/gradle.properties create mode 100644 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/gradle/wrapper/gradle-wrapper.properties create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/settings.gradle create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Flutter/AppFrameworkInfo.plist create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Flutter/Debug.xcconfig create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Flutter/Release.xcconfig create mode 100644 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/GoogleSignInPluginTest/Info.plist create mode 100644 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner.xcodeproj/project.pbxproj create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner.xcworkspace/contents.xcworkspacedata create mode 100644 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/AppDelegate.h create mode 100644 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/AppDelegate.m create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Base.lproj/LaunchScreen.storyboard create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Base.lproj/Main.storyboard create mode 100644 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/GoogleService-Info.plist create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Info.plist create mode 100644 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/main.m create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/lib/main.dart create mode 100755 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/pubspec.yaml create mode 100644 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/web/index.html create mode 100644 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/lib/extension_google_sign_in_as_googleapis_auth.dart create mode 100644 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/pubspec.yaml create mode 100644 packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/test/extension_google_sign_in_as_googleapis_auth_test.dart diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/.gitignore b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/.gitignore new file mode 100644 index 000000000000..bb431f0d5b47 --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/.gitignore @@ -0,0 +1,75 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +build/ + +# Android related +**/android/**/gradle-wrapper.jar +**/android/.gradle +**/android/captures/ +**/android/gradlew +**/android/gradlew.bat +**/android/local.properties +**/android/**/GeneratedPluginRegistrant.java + +# iOS/XCode related +**/ios/**/*.mode1v3 +**/ios/**/*.mode2v3 +**/ios/**/*.moved-aside +**/ios/**/*.pbxuser +**/ios/**/*.perspectivev3 +**/ios/**/*sync/ +**/ios/**/.sconsign.dblite +**/ios/**/.tags* +**/ios/**/.vagrant/ +**/ios/**/DerivedData/ +**/ios/**/Icon? +**/ios/**/Pods/ +**/ios/**/.symlinks/ +**/ios/**/profile +**/ios/**/xcuserdata +**/ios/.generated/ +**/ios/Flutter/App.framework +**/ios/Flutter/Flutter.framework +**/ios/Flutter/Flutter.podspec +**/ios/Flutter/Generated.xcconfig +**/ios/Flutter/app.flx +**/ios/Flutter/app.zip +**/ios/Flutter/flutter_assets/ +**/ios/Flutter/flutter_export_environment.sh +**/ios/ServiceDefinitions.json +**/ios/Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!**/ios/**/default.mode1v3 +!**/ios/**/default.mode2v3 +!**/ios/**/default.pbxuser +!**/ios/**/default.perspectivev3 +!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/.metadata b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/.metadata new file mode 100644 index 000000000000..2c91cc0fc35a --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 5e3e5a2a1a977c34b22f3709109fd237b5cab9c6 + channel: master + +project_type: package diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/CHANGELOG.md b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/CHANGELOG.md new file mode 100644 index 000000000000..7f35c8490e1f --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/CHANGELOG.md @@ -0,0 +1,3 @@ +## 1.0.0 + +* First published version. diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/LICENSE b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/LICENSE new file mode 100644 index 000000000000..14fbc7c48e1c --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/LICENSE @@ -0,0 +1,27 @@ +Copyright 2020 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google LLC nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/README.md b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/README.md new file mode 100644 index 000000000000..78ddb4bdc91b --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/README.md @@ -0,0 +1,46 @@ +# extension_google_sign_in_as_googleapis_auth + +A bridge package between Flutter's [`google_sign_in` plugin](https://pub.dev/packages/google_sign_in) and Dart's [`googleapis` package](https://pub.dev/packages/googleapis), that is able to create [`googleapis_auth`-like `AuthClient` instances](https://pub.dev/documentation/googleapis_auth/latest/googleapis_auth.auth/AuthClient-class.html) directly from the `GoogleSignIn` plugin. + +## Usage + +This package is implemented as an [extension method](https://dart.dev/guides/language/extension-methods) on top of the `GoogleSignIn` plugin. + +In order to use it, you need to add a `dependency` to your `pubspec.yaml`. Then, wherever you're importing `package:google_sign_in/google_sign_in.dart`, add the following: + +```dart +... +import 'package:extension_google_sign_in_as_googleapis_auth/extension_google_sign_in_as_googleapis_auth.dart'; +... +``` + +From that moment on, your `GoogleSignIn` instance will have an additional `Future authenticatedClient()` method that you can call once your sign in is successful to retrieve an `AuthClient`. + +That object can then be used to create instances of `googleapis` API clients: + +```dart +... +final peopleApi = PeopleApi(await _googleSignIn.authenticatedClient()); +final response = await peopleApi.people.connections.list( + 'people/me', + personFields: 'names', +); +... +``` + +## Example + +This package contains a modified version of Flutter's Google Sign In example app that uses `package:googleapis`' API clients, instead of raw http requests. + +See it [here](https://github.com/flutter/plugins/blob/master/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/lib/main.dart). + +The original code (and its license) can be seen [here](https://github.com/flutter/plugins/tree/master/packages/google_sign_in/google_sign_in/example/lib/main.dart). + +## Testing + +Run tests with `flutter test`. + +## Issues and feedback + +Please file [issues](https://github.com/flutter/flutter/issues/new) +to send feedback or report a bug. Thank you! diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/README.md b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/README.md new file mode 100755 index 000000000000..689071dcfe8d --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/README.md @@ -0,0 +1,8 @@ +# extension_google_sign_in_example + +Demonstrates how to use the google_sign_in plugin with the `googleapis` package. + +## Getting Started + +For help getting started with Flutter, view our online +[documentation](http://flutter.io/). diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/build.gradle b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/build.gradle new file mode 100755 index 000000000000..e6da1a0aebf5 --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/build.gradle @@ -0,0 +1,64 @@ +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterRoot = localProperties.getProperty('flutter.sdk') +if (flutterRoot == null) { + throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + +apply plugin: 'com.android.application' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" + +android { + compileSdkVersion 28 + + lintOptions { + disable 'InvalidPackage' + } + + defaultConfig { + applicationId "io.flutter.plugins.googlesigninexample" + minSdkVersion 16 + targetSdkVersion 28 + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig signingConfigs.debug + } + } + + testOptions { + unitTests.returnDefaultValues = true + } +} + +flutter { + source '../..' +} + +dependencies { + implementation 'com.google.android.gms:play-services-auth:16.0.1' + testImplementation'junit:junit:4.12' + testImplementation 'org.mockito:mockito-core:2.17.0' +} diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/google-services.json b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/google-services.json new file mode 100644 index 000000000000..efa524535553 --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/google-services.json @@ -0,0 +1,246 @@ +{ + "project_info": { + "project_number": "479882132969", + "firebase_url": "https://my-flutter-proj.firebaseio.com", + "project_id": "my-flutter-proj", + "storage_bucket": "my-flutter-proj.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:479882132969:android:c73fd19ff7e2c0be", + "android_client_info": { + "package_name": "io.flutter.plugins.cameraexample" + } + }, + "oauth_client": [ + { + "client_id": "479882132969-0d20fkjtr1p8evfomfkf3vmi50uajml2.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyCrZz9T0Pg0rDnpxfNuPBrOxGhXskfebXs" + } + ], + "services": { + "analytics_service": { + "status": 1 + }, + "appinvite_service": { + "status": 1, + "other_platform_oauth_client": [] + }, + "ads_service": { + "status": 2 + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:479882132969:android:632cdf3fc0a17139", + "android_client_info": { + "package_name": "io.flutter.plugins.firebasedynamiclinksexample" + } + }, + "oauth_client": [ + { + "client_id": "479882132969-32qusitiag53931ck80h121ajhlc5a7e.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "io.flutter.plugins.firebasedynamiclinksexample", + "certificate_hash": "e733b7a303250b63e06de6f7c9767c517d69cfa0" + } + }, + { + "client_id": "479882132969-0d20fkjtr1p8evfomfkf3vmi50uajml2.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyCrZz9T0Pg0rDnpxfNuPBrOxGhXskfebXs" + } + ], + "services": { + "analytics_service": { + "status": 1 + }, + "appinvite_service": { + "status": 2, + "other_platform_oauth_client": [ + { + "client_id": "479882132969-0d20fkjtr1p8evfomfkf3vmi50uajml2.apps.googleusercontent.com", + "client_type": 3 + }, + { + "client_id": "479882132969-gjp4e63ogu2h6guttj2ie6t3f10ic7i8.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "io.flutter.plugins.firebaseMlVisionExample" + } + } + ] + }, + "ads_service": { + "status": 2 + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:479882132969:android:ae50362b4bc06086", + "android_client_info": { + "package_name": "io.flutter.plugins.firebasemlvisionexample" + } + }, + "oauth_client": [ + { + "client_id": "479882132969-9pp74fkgmtvt47t9rikc1p861v7n85tn.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "io.flutter.plugins.firebasemlvisionexample", + "certificate_hash": "e733b7a303250b63e06de6f7c9767c517d69cfa0" + } + }, + { + "client_id": "479882132969-0d20fkjtr1p8evfomfkf3vmi50uajml2.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyCrZz9T0Pg0rDnpxfNuPBrOxGhXskfebXs" + } + ], + "services": { + "analytics_service": { + "status": 1 + }, + "appinvite_service": { + "status": 2, + "other_platform_oauth_client": [ + { + "client_id": "479882132969-0d20fkjtr1p8evfomfkf3vmi50uajml2.apps.googleusercontent.com", + "client_type": 3 + }, + { + "client_id": "479882132969-gjp4e63ogu2h6guttj2ie6t3f10ic7i8.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "io.flutter.plugins.firebaseMlVisionExample" + } + } + ] + }, + "ads_service": { + "status": 2 + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:479882132969:android:215a22700e1b466b", + "android_client_info": { + "package_name": "io.flutter.plugins.firebaseperformanceexample" + } + }, + "oauth_client": [ + { + "client_id": "479882132969-8h4kiv8m7ho4tvn6uuujsfcrf69unuf7.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "io.flutter.plugins.firebaseperformanceexample", + "certificate_hash": "e733b7a303250b63e06de6f7c9767c517d69cfa0" + } + }, + { + "client_id": "479882132969-0d20fkjtr1p8evfomfkf3vmi50uajml2.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyCrZz9T0Pg0rDnpxfNuPBrOxGhXskfebXs" + } + ], + "services": { + "analytics_service": { + "status": 1 + }, + "appinvite_service": { + "status": 2, + "other_platform_oauth_client": [ + { + "client_id": "479882132969-0d20fkjtr1p8evfomfkf3vmi50uajml2.apps.googleusercontent.com", + "client_type": 3 + }, + { + "client_id": "479882132969-gjp4e63ogu2h6guttj2ie6t3f10ic7i8.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "io.flutter.plugins.firebaseMlVisionExample" + } + } + ] + }, + "ads_service": { + "status": 2 + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:479882132969:android:5e9f1f89e134dc86", + "android_client_info": { + "package_name": "io.flutter.plugins.googlesigninexample" + } + }, + "oauth_client": [ + { + "client_id": "479882132969-90ml692hkonp587sl0v0rurmnvkekgrg.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "io.flutter.plugins.googlesigninexample", + "certificate_hash": "e733b7a303250b63e06de6f7c9767c517d69cfa0" + } + }, + { + "client_id": "479882132969-0d20fkjtr1p8evfomfkf3vmi50uajml2.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyCrZz9T0Pg0rDnpxfNuPBrOxGhXskfebXs" + } + ], + "services": { + "analytics_service": { + "status": 1 + }, + "appinvite_service": { + "status": 2, + "other_platform_oauth_client": [ + { + "client_id": "479882132969-0d20fkjtr1p8evfomfkf3vmi50uajml2.apps.googleusercontent.com", + "client_type": 3 + }, + { + "client_id": "479882132969-gjp4e63ogu2h6guttj2ie6t3f10ic7i8.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "io.flutter.plugins.firebaseMlVisionExample" + } + } + ] + }, + "ads_service": { + "status": 2 + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000000..9a4163a4f5ee --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/AndroidManifest.xml b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/AndroidManifest.xml new file mode 100755 index 000000000000..df80f829c1e7 --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/.gitignore b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/.gitignore new file mode 100755 index 000000000000..9eb4563d2ae1 --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/.gitignore @@ -0,0 +1 @@ +GeneratedPluginRegistrant.java diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/EmbeddingV1Activity.java b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/EmbeddingV1Activity.java new file mode 100644 index 000000000000..f7ea0c4043a6 --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/EmbeddingV1Activity.java @@ -0,0 +1,19 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package io.flutter.plugins.googlesigninexample; + +import android.os.Bundle; +import io.flutter.app.FlutterActivity; +import io.flutter.plugins.googlesignin.GoogleSignInPlugin; +import io.flutter.view.FlutterMain; + +public class EmbeddingV1Activity extends FlutterActivity { + @Override + protected void onCreate(Bundle savedInstanceState) { + FlutterMain.startInitialization(this); + super.onCreate(savedInstanceState); + GoogleSignInPlugin.registerWith(registrarFor("io.flutter.plugins.googlesignin")); + } +} diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/EmbeddingV1ActivityTest.java b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/EmbeddingV1ActivityTest.java new file mode 100644 index 000000000000..8bddbff7ce27 --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/EmbeddingV1ActivityTest.java @@ -0,0 +1,17 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package io.flutter.plugins.googlesigninexample; + +import androidx.test.rule.ActivityTestRule; +import dev.flutter.plugins.e2e.FlutterRunner; +import org.junit.Rule; +import org.junit.runner.RunWith; + +@RunWith(FlutterRunner.class) +public class EmbeddingV1ActivityTest { + @Rule + public ActivityTestRule rule = + new ActivityTestRule<>(EmbeddingV1Activity.class); +} diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/FlutterActivityTest.java b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/FlutterActivityTest.java new file mode 100644 index 000000000000..77cdcee9bcdb --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/FlutterActivityTest.java @@ -0,0 +1,17 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package io.flutter.plugins.googlesigninexample; + +import androidx.test.rule.ActivityTestRule; +import dev.flutter.plugins.e2e.FlutterRunner; +import io.flutter.embedding.android.FlutterActivity; +import org.junit.Rule; +import org.junit.runner.RunWith; + +@RunWith(FlutterRunner.class) +public class FlutterActivityTest { + @Rule + public ActivityTestRule rule = new ActivityTestRule<>(FlutterActivity.class); +} diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100755 index 0000000000000000000000000000000000000000..db77bb4b7b0906d62b1847e87f15cdcacf6a4f29 GIT binary patch literal 544 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY3?!3`olAj~WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8bpbvhu0Wd6uZuB!w&u2PAxD2eNXD>P5D~Wn-+_Wa#27Xc zC?Zj|6r#X(-D3u$NCt}(Ms06KgJ4FxJVv{GM)!I~&n8Bnc94O7-Hd)cjDZswgC;Qs zO=b+9!WcT8F?0rF7!Uys2bs@gozCP?z~o%U|N3vA*22NaGQG zlg@K`O_XuxvZ&Ks^m&R!`&1=spLvfx7oGDKDwpwW`#iqdw@AL`7MR}m`rwr|mZgU`8P7SBkL78fFf!WnuYWm$5Z0 zNXhDbCv&49sM544K|?c)WrFfiZvCi9h0O)B3Pgg&ebxsLQ05GG~ AQ2+n{ literal 0 HcmV?d00001 diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100755 index 0000000000000000000000000000000000000000..17987b79bb8a35cc66c3c1fd44f5a5526c1b78be GIT binary patch literal 442 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5Xx&nMcT!A!W`0S9QKQy;}1Cl^CgaH=;G9cpY;r$Q>i*pfB zP2drbID<_#qf;rPZx^FqH)F_D#*k@@q03KywUtLX8Ua?`H+NMzkczFPK3lFz@i_kW%1NOn0|D2I9n9wzH8m|-tHjsw|9>@K=iMBhxvkv6m8Y-l zytQ?X=U+MF$@3 zt`~i=@j|6y)RWMK--}M|=T`o&^Ni>IoWKHEbBXz7?A@mgWoL>!*SXo`SZH-*HSdS+ yn*9;$7;m`l>wYBC5bq;=U}IMqLzqbYCidGC!)_gkIk_C@Uy!y&wkt5C($~2D>~)O*cj@FGjOCM)M>_ixfudOh)?xMu#Fs z#}Y=@YDTwOM)x{K_j*Q;dPdJ?Mz0n|pLRx{4n|)f>SXlmV)XB04CrSJn#dS5nK2lM zrZ9#~WelCp7&e13Y$jvaEXHskn$2V!!DN-nWS__6T*l;H&Fopn?A6HZ-6WRLFP=R` zqG+CE#d4|IbyAI+rJJ`&x9*T`+a=p|0O(+s{UBcyZdkhj=yS1>AirP+0R;mf2uMgM zC}@~JfByORAh4SyRgi&!(cja>F(l*O+nd+@4m$|6K6KDn_&uvCpV23&>G9HJp{xgg zoq1^2_p9@|WEo z*X_Uko@K)qYYv~>43eQGMdbiGbo>E~Q& zrYBH{QP^@Sti!`2)uG{irBBq@y*$B zi#&(U-*=fp74j)RyIw49+0MRPMRU)+a2r*PJ$L5roHt2$UjExCTZSbq%V!HeS7J$N zdG@vOZB4v_lF7Plrx+hxo7(fCV&}fHq)$ literal 0 HcmV?d00001 diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100755 index 0000000000000000000000000000000000000000..d5f1c8d34e7a88e3f88bea192c3a370d44689c3c GIT binary patch literal 1031 zcmeAS@N?(olHy`uVBq!ia0vp^6F``Q8Ax83A=Cw=BuiW)N`mv#O3D+9QW+dm@{>{( zJaZG%Q-e|yQz{EjrrIztFa`(sgt!6~Yi|1%a`XoT0ojZ}lNrNjb9xjc(B0U1_% zz5^97Xt*%oq$rQy4?0GKNfJ44uvxI)gC`h-NZ|&0-7(qS@?b!5r36oQ}zyZrNO3 zMO=Or+<~>+A&uN&E!^Sl+>xE!QC-|oJv`ApDhqC^EWD|@=#J`=d#Xzxs4ah}w&Jnc z$|q_opQ^2TrnVZ0o~wh<3t%W&flvYGe#$xqda2bR_R zvPYgMcHgjZ5nSA^lJr%;<&0do;O^tDDh~=pIxA#coaCY>&N%M2^tq^U%3DB@ynvKo}b?yu-bFc-u0JHzced$sg7S3zqI(2 z#Km{dPr7I=pQ5>FuK#)QwK?Y`E`B?nP+}U)I#c1+FM*1kNvWG|a(TpksZQ3B@sD~b zpQ2)*V*TdwjFOtHvV|;OsiDqHi=6%)o4b!)x$)%9pGTsE z-JL={-Ffv+T87W(Xpooq<`r*VzWQcgBN$$`u}f>-ZQI1BB8ykN*=e4rIsJx9>z}*o zo~|9I;xof literal 0 HcmV?d00001 diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100755 index 0000000000000000000000000000000000000000..4d6372eebdb28e45604e46eeda8dd24651419bc0 GIT binary patch literal 1443 zcmb`G{WsKk6vsdJTdFg%tJav9_E4vzrOaqkWF|A724Nly!y+?N9`YV6wZ}5(X(D_N(?!*n3`|_r0Hc?=PQw&*vnU?QTFY zB_MsH|!j$PP;I}?dppoE_gA(4uc!jV&0!l7_;&p2^pxNo>PEcNJv za5_RT$o2Mf!<+r?&EbHH6nMoTsDOa;mN(wv8RNsHpG)`^ymG-S5By8=l9iVXzN_eG%Xg2@Xeq76tTZ*dGh~Lo9vl;Zfs+W#BydUw zCkZ$o1LqWQO$FC9aKlLl*7x9^0q%0}$OMlp@Kk_jHXOjofdePND+j!A{q!8~Jn+s3 z?~~w@4?egS02}8NuulUA=L~QQfm;MzCGd)XhiftT;+zFO&JVyp2mBww?;QByS_1w! zrQlx%{^cMj0|Bo1FjwY@Q8?Hx0cIPF*@-ZRFpPc#bBw{5@tD(5%sClzIfl8WU~V#u zm5Q;_F!wa$BSpqhN>W@2De?TKWR*!ujY;Yylk_X5#~V!L*Gw~;$%4Q8~Mad z@`-kG?yb$a9cHIApZDVZ^U6Xkp<*4rU82O7%}0jjHlK{id@?-wpN*fCHXyXh(bLt* zPc}H-x0e4E&nQ>y%B-(EL=9}RyC%MyX=upHuFhAk&MLbsF0LP-q`XnH78@fT+pKPW zu72MW`|?8ht^tz$iC}ZwLp4tB;Q49K!QCF3@!iB1qOI=?w z7In!}F~ij(18UYUjnbmC!qKhPo%24?8U1x{7o(+?^Zu0Hx81|FuS?bJ0jgBhEMzf< zCgUq7r2OCB(`XkKcN-TL>u5y#dD6D!)5W?`O5)V^>jb)P)GBdy%t$uUMpf$SNV31$ zb||OojAbvMP?T@$h_ZiFLFVHDmbyMhJF|-_)HX3%m=CDI+ID$0^C>kzxprBW)hw(v zr!Gmda);ICoQyhV_oP5+C%?jcG8v+D@9f?Dk*!BxY}dazmrT@64UrP3hlslANK)bq z$67n83eh}OeW&SV@HG95P|bjfqJ7gw$e+`Hxo!4cx`jdK1bJ>YDSpGKLPZ^1cv$ek zIB?0S<#tX?SJCLWdMd{-ME?$hc7A$zBOdIJ)4!KcAwb=VMov)nK;9z>x~rfT1>dS+ zZ6#`2v@`jgbqq)P22H)Tx2CpmM^o1$B+xT6`(v%5xJ(?j#>Q$+rx_R|7TzDZe{J6q zG1*EcU%tE?!kO%^M;3aM6JN*LAKUVb^xz8-Pxo#jR5(-KBeLJvA@-gxNHx0M-ZJLl z;#JwQoh~9V?`UVo#}{6ka@II>++D@%KqGpMdlQ}?9E*wFcf5(#XQnP$Dk5~%iX^>f z%$y;?M0BLp{O3a(-4A?ewryHrrD%cx#Q^%KY1H zNre$ve+vceSLZcNY4U(RBX&)oZn*Py()h)XkE?PL$!bNb{N5FVI2Y%LKEm%yvpyTP z(1P?z~7YxD~Rf<(a@_y` literal 0 HcmV?d00001 diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/res/values/strings.xml b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/res/values/strings.xml new file mode 100644 index 000000000000..c7e28ffcedd1 --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/res/values/strings.xml @@ -0,0 +1,4 @@ + + + YOUR_WEB_CLIENT_ID + diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/build.gradle b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/build.gradle new file mode 100755 index 000000000000..541636cc492a --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/build.gradle @@ -0,0 +1,29 @@ +buildscript { + repositories { + google() + jcenter() + } + + dependencies { + classpath 'com.android.tools.build:gradle:3.3.0' + } +} + +allprojects { + repositories { + google() + jcenter() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/gradle.properties b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/gradle.properties new file mode 100755 index 000000000000..38c8d4544ff1 --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/gradle.properties @@ -0,0 +1,4 @@ +org.gradle.jvmargs=-Xmx1536M +android.enableR8=true +android.useAndroidX=true +android.enableJetifier=true diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000000..019065d1d650 --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/settings.gradle b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/settings.gradle new file mode 100755 index 000000000000..115da6cb4f4d --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/settings.gradle @@ -0,0 +1,15 @@ +include ':app' + +def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() + +def plugins = new Properties() +def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') +if (pluginsFile.exists()) { + pluginsFile.withInputStream { stream -> plugins.load(stream) } +} + +plugins.each { name, path -> + def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() + include ":$name" + project(":$name").projectDir = pluginDirectory +} diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Flutter/AppFrameworkInfo.plist b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Flutter/AppFrameworkInfo.plist new file mode 100755 index 000000000000..6c2de8086bcd --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,30 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + UIRequiredDeviceCapabilities + + arm64 + + MinimumOSVersion + 8.0 + + diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Flutter/Debug.xcconfig b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Flutter/Debug.xcconfig new file mode 100755 index 000000000000..9803018ca79d --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Flutter/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "Generated.xcconfig" +#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Flutter/Release.xcconfig b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Flutter/Release.xcconfig new file mode 100755 index 000000000000..a4a8c604e13d --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Flutter/Release.xcconfig @@ -0,0 +1,2 @@ +#include "Generated.xcconfig" +#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/GoogleSignInPluginTest/Info.plist b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/GoogleSignInPluginTest/Info.plist new file mode 100644 index 000000000000..64d65ca49577 --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/GoogleSignInPluginTest/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner.xcodeproj/project.pbxproj b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 000000000000..faaaa58070bd --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,502 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 5C6F5A6E1EC3B4CB008D64B5 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C6F5A6D1EC3B4CB008D64B5 /* GeneratedPluginRegistrant.m */; }; + 7A303C2E1E89D76400B1F19E /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7A303C2D1E89D76400B1F19E /* GoogleService-Info.plist */; }; + 7ACDFB0E1E8944C400BE2D00 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7ACDFB0D1E8944C400BE2D00 /* AppFrameworkInfo.plist */; }; + 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; + 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; + C2FB9CBA01DB0A2DE5F31E12 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0263E28FA425D1CE928BDE15 /* libPods-Runner.a */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 0263E28FA425D1CE928BDE15 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 5A76713E622F06379AEDEBFA /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 5C6F5A6C1EC3B4CB008D64B5 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 5C6F5A6D1EC3B4CB008D64B5 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 7A303C2D1E89D76400B1F19E /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; + 7ACDFB0D1E8944C400BE2D00 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + F582639B44581540871D9BB0 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C2FB9CBA01DB0A2DE5F31E12 /* libPods-Runner.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 840012C8B5EDBCF56B0E4AC1 /* Pods */ = { + isa = PBXGroup; + children = ( + 5A76713E622F06379AEDEBFA /* Pods-Runner.debug.xcconfig */, + F582639B44581540871D9BB0 /* Pods-Runner.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 7ACDFB0D1E8944C400BE2D00 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 840012C8B5EDBCF56B0E4AC1 /* Pods */, + CF3B75C9A7D2FA2A4C99F110 /* Frameworks */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 5C6F5A6C1EC3B4CB008D64B5 /* GeneratedPluginRegistrant.h */, + 5C6F5A6D1EC3B4CB008D64B5 /* GeneratedPluginRegistrant.m */, + 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, + 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 7A303C2D1E89D76400B1F19E /* GoogleService-Info.plist */, + 97C147021CF9000F007C117D /* Info.plist */, + 97C146F11CF9000F007C117D /* Supporting Files */, + ); + path = Runner; + sourceTree = ""; + }; + 97C146F11CF9000F007C117D /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 97C146F21CF9000F007C117D /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + CF3B75C9A7D2FA2A4C99F110 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 0263E28FA425D1CE928BDE15 /* libPods-Runner.a */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + AB1344B0443C71CD721E1BB7 /* [CP] Check Pods Manifest.lock */, + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 95BB15E9E1769C0D146AA592 /* [CP] Embed Pods Frameworks */, + 532EA9D341340B1DCD08293D /* [CP] Copy Pods Resources */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1100; + ORGANIZATIONNAME = "The Chromium Authors"; + TargetAttributes = { + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 7A303C2E1E89D76400B1F19E /* GoogleService-Info.plist in Resources */, + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 7ACDFB0E1E8944C400BE2D00 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed\n/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin\n"; + }; + 532EA9D341340B1DCD08293D /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh", + "${PODS_ROOT}/GoogleSignIn/Resources/GoogleSignIn.bundle", + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleSignIn.bundle", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + 95BB15E9E1769C0D146AA592 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", + "${PODS_ROOT}/../Flutter/Flutter.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; + AB1344B0443C71CD721E1BB7 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, + 97C146F31CF9000F007C117D /* main.m in Sources */, + 5C6F5A6E1EC3B4CB008D64B5 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.googleSignInExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.googleSignInExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100755 index 000000000000..21a3cc14c74e --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100755 index 000000000000..3bb3697ef41c --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100755 index 000000000000..21a3cc14c74e --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/AppDelegate.h b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/AppDelegate.h new file mode 100644 index 000000000000..d9e18e990f2e --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/AppDelegate.h @@ -0,0 +1,10 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import +#import + +@interface AppDelegate : FlutterAppDelegate + +@end diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/AppDelegate.m b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/AppDelegate.m new file mode 100644 index 000000000000..f08675707182 --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/AppDelegate.m @@ -0,0 +1,17 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "AppDelegate.h" +#include "GeneratedPluginRegistrant.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application + didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + [GeneratedPluginRegistrant registerWithRegistry:self]; + // Override point for customization after application launch. + return [super application:application didFinishLaunchingWithOptions:launchOptions]; +} + +@end diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100755 index 000000000000..d22f10b2ab63 --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,116 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100755 index 0000000000000000000000000000000000000000..28c6bf03016f6c994b70f38d1b7346e5831b531f GIT binary patch literal 564 zcmV-40?Yl0P)Px$?ny*JR5%f>l)FnDQ543{x%ZCiu33$Wg!pQFfT_}?5Q|_VSlIbLC`dpoMXL}9 zHfd9&47Mo(7D231gb+kjFxZHS4-m~7WurTH&doVX2KI5sU4v(sJ1@T9eCIKPjsqSr z)C01LsCxk=72-vXmX}CQD#BD;Cthymh&~=f$Q8nn0J<}ZrusBy4PvRNE}+1ceuj8u z0mW5k8fmgeLnTbWHGwfKA3@PdZxhn|PypR&^p?weGftrtCbjF#+zk_5BJh7;0`#Wr zgDpM_;Ax{jO##IrT`Oz;MvfwGfV$zD#c2xckpcXC6oou4ML~ezCc2EtnsQTB4tWNg z?4bkf;hG7IMfhgNI(FV5Gs4|*GyMTIY0$B=_*mso9Ityq$m^S>15>-?0(zQ<8Qy<_TjHE33(?_M8oaM zyc;NxzRVK@DL6RJnX%U^xW0Gpg(lXp(!uK1v0YgHjs^ZXSQ|m#lV7ip7{`C_J2TxPmfw%h$|%acrYHt)Re^PB%O&&=~a zhS(%I#+V>J-vjIib^<+s%ludY7y^C(P8nmqn9fp!i+?vr`bziDE=bx`%2W#Xyrj|i z!XQ4v1%L`m{7KT7q+LZNB^h8Ha2e=`Wp65^0;J00)_^G=au=8Yo;1b`CV&@#=jIBo zjN^JNVfYSs)+kDdGe7`1&8!?MQYKS?DuHZf3iogk_%#9E|5S zWeHrmAo>P;ejX7mwq#*}W25m^ZI+{(Z8fI?4jM_fffY0nok=+88^|*_DwcW>mR#e+ zX$F_KMdb6sRz!~7KkyN0G(3XQ+;z3X%PZ4gh;n-%62U<*VUKNv(D&Q->Na@Xb&u5Q3`3DGf+a8O5x7c#7+R+EAYl@R5us)CIw z7sT@_y~Ao@uL#&^LIh&QceqiT^+lb0YbFZt_SHOtWA%mgPEKVNvVgCsXy{5+zl*X8 zCJe)Q@y>wH^>l4;h1l^Y*9%-23TSmE>q5nI@?mt%n;Sj4Qq`Z+ib)a*a^cJc%E9^J zB;4s+K@rARbcBLT5P=@r;IVnBMKvT*)ew*R;&8vu%?Z&S>s?8?)3*YawM0P4!q$Kv zMmKh3lgE~&w&v%wVzH3Oe=jeNT=n@Y6J6TdHWTjXfX~-=1A1Bw`EW8rn}MqeI34nh zexFeA?&C3B2(E?0{drE@DA2pu(A#ElY&6el60Rn|Qpn-FkfQ8M93AfWIr)drgDFEU zghdWK)^71EWCP(@(=c4kfH1Y(4iugD4fve6;nSUpLT%!)MUHs1!zJYy4y||C+SwQ! z)KM&$7_tyM`sljP2fz6&Z;jxRn{Wup8IOUx8D4uh&(=O zx-7$a;U><*5L^!%xRlw)vAbh;sdlR||& ze}8_8%)c2Fwy=F&H|LM+p{pZB5DKTx>Y?F1N%BlZkXf!}JeGuMZk~LPi7{cidvUGB zAJ4LVeNV%XO>LTrklB#^-;8nb;}6l;1oW&WS=Mz*Az!4cqqQzbOSFq`$Q%PfD7srM zpKgP-D_0XPTRX*hAqeq0TDkJ;5HB1%$3Np)99#16c{ zJImlNL(npL!W|Gr_kxl1GVmF5&^$^YherS7+~q$p zt}{a=*RiD2Ikv6o=IM1kgc7zqpaZ;OB)P!1zz*i3{U()Dq#jG)egvK}@uFLa`oyWZ zf~=MV)|yJn`M^$N%ul5);JuQvaU1r2wt(}J_Qgyy`qWQI`hEeRX0uC@c1(dQ2}=U$ tNIIaX+dr)NRWXcxoR{>fqI{SF_dm1Ylv~=3YHI)h002ovPDHLkV1g(pWS;;4 literal 0 HcmV?d00001 diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100755 index 0000000000000000000000000000000000000000..f091b6b0bca859a3f474b03065bef75ba58a9e4c GIT binary patch literal 1588 zcmV-42Fv-0P)C1SqPt}wig>|5Crh^=oyX$BK<}M8eLU3e2hGT;=G|!_SP)7zNI6fqUMB=)y zRAZ>eDe#*r`yDAVgB_R*LB*MAc)8(b{g{9McCXW!lq7r(btRoB9!8B-#AI6JMb~YFBEvdsV)`mEQO^&#eRKx@b&x- z5lZm*!WfD8oCLzfHGz#u7sT0^VLMI1MqGxF^v+`4YYnVYgk*=kU?HsSz{v({E3lb9 z>+xILjBN)t6`=g~IBOelGQ(O990@BfXf(DRI5I$qN$0Gkz-FSc$3a+2fX$AedL4u{ z4V+5Ong(9LiGcIKW?_352sR;LtDPmPJXI{YtT=O8=76o9;*n%_m|xo!i>7$IrZ-{l z-x3`7M}qzHsPV@$v#>H-TpjDh2UE$9g6sysUREDy_R(a)>=eHw-WAyfIN z*qb!_hW>G)Tu8nSw9yn#3wFMiLcfc4pY0ek1}8(NqkBR@t4{~oC>ryc-h_ByH(Cg5 z>ao-}771+xE3um9lWAY1FeQFxowa1(!J(;Jg*wrg!=6FdRX+t_<%z&d&?|Bn){>zm zZQj(aA_HeBY&OC^jj*)N`8fa^ePOU72VpInJoI1?`ty#lvlNzs(&MZX+R%2xS~5Kh zX*|AU4QE#~SgPzOXe9>tRj>hjU@c1k5Y_mW*Jp3fI;)1&g3j|zDgC+}2Q_v%YfDax z!?umcN^n}KYQ|a$Lr+51Nf9dkkYFSjZZjkma$0KOj+;aQ&721~t7QUKx61J3(P4P1 zstI~7-wOACnWP4=8oGOwz%vNDqD8w&Q`qcNGGrbbf&0s9L0De{4{mRS?o0MU+nR_! zrvshUau0G^DeMhM_v{5BuLjb#Hh@r23lDAk8oF(C+P0rsBpv85EP>4CVMx#04MOfG z;P%vktHcXwTj~+IE(~px)3*MY77e}p#|c>TD?sMatC0Tu4iKKJ0(X8jxQY*gYtxsC z(zYC$g|@+I+kY;dg_dE>scBf&bP1Nc@Hz<3R)V`=AGkc;8CXqdi=B4l2k|g;2%#m& z*jfX^%b!A8#bI!j9-0Fi0bOXl(-c^AB9|nQaE`*)Hw+o&jS9@7&Gov#HbD~#d{twV zXd^Tr^mWLfFh$@Dr$e;PBEz4(-2q1FF0}c;~B5sA}+Q>TOoP+t>wf)V9Iy=5ruQa;z)y zI9C9*oUga6=hxw6QasLPnee@3^Rr*M{CdaL5=R41nLs(AHk_=Y+A9$2&H(B7!_pURs&8aNw7?`&Z&xY_Ye z)~D5Bog^td-^QbUtkTirdyK^mTHAOuptDflut!#^lnKqU md>ggs(5nOWAqO?umG&QVYK#ibz}*4>0000U6E9hRK9^#O7(mu>ETqrXGsduA8$)?`v2seloOCza43C{NQ$$gAOH**MCn0Q?+L7dl7qnbRdqZ8LSVp1ItDxhxD?t@5_yHg6A8yI zC*%Wgg22K|8E#!~cTNYR~@Y9KepMPrrB8cABapAFa=`H+UGhkXUZV1GnwR1*lPyZ;*K(i~2gp|@bzp8}og7e*#% zEnr|^CWdVV!-4*Y_7rFvlww2Ze+>j*!Z!pQ?2l->4q#nqRu9`ELo6RMS5=br47g_X zRw}P9a7RRYQ%2Vsd0Me{_(EggTnuN6j=-?uFS6j^u69elMypu?t>op*wBx<=Wx8?( ztpe^(fwM6jJX7M-l*k3kEpWOl_Vk3@(_w4oc}4YF4|Rt=2V^XU?#Yz`8(e?aZ@#li0n*=g^qOcVpd-Wbok=@b#Yw zqn8u9a)z>l(1kEaPYZ6hwubN6i<8QHgsu0oE) ziJ(p;Wxm>sf!K+cw>R-(^Y2_bahB+&KI9y^);#0qt}t-$C|Bo71lHi{_+lg#f%RFy z0um=e3$K3i6K{U_4K!EX?F&rExl^W|G8Z8;`5z-k}OGNZ0#WVb$WCpQu-_YsiqKP?BB# vzVHS-CTUF4Ozn5G+mq_~Qqto~ahA+K`|lyv3(-e}00000NkvXXu0mjfd`9t{ literal 0 HcmV?d00001 diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100755 index 0000000000000000000000000000000000000000..d0ef06e7edb86cdfe0d15b4b0d98334a86163658 GIT binary patch literal 1716 zcmds$`#;kQ7{|XelZftyR5~xW7?MLxS4^|Hw3&P7^y)@A9Fj{Xm1~_CIV^XZ%SLBn zA;!r`GqGHg=7>xrB{?psZQs88ZaedDoagm^KF{a*>G|dJWRSe^I$DNW008I^+;Kjt z>9p3GNR^I;v>5_`+91i(*G;u5|L+Bu6M=(afLjtkya#yZ175|z$pU~>2#^Z_pCZ7o z1c6UNcv2B3?; zX%qdxCXQpdKRz=#b*q0P%b&o)5ZrNZt7$fiETSK_VaY=mb4GK`#~0K#~9^ zcY!`#Af+4h?UMR-gMKOmpuYeN5P*RKF!(tb`)oe0j2BH1l?=>y#S5pMqkx6i{*=V9JF%>N8`ewGhRE(|WohnD59R^$_36{4>S zDFlPC5|k?;SPsDo87!B{6*7eqmMdU|QZ84>6)Kd9wNfh90=y=TFQay-0__>=<4pk& zYDjgIhL-jQ9o>z32K)BgAH+HxamL{ZL~ozu)Qqe@a`FpH=oQRA8=L-m-1dam(Ix2V z?du;LdMO+ooBelr^_y4{|44tmgH^2hSzPFd;U^!1p>6d|o)(-01z{i&Kj@)z-yfWQ)V#3Uo!_U}q3u`(fOs`_f^ueFii1xBNUB z6MecwJN$CqV&vhc+)b(p4NzGGEgwWNs z@*lUV6LaduZH)4_g!cE<2G6#+hJrWd5(|p1Z;YJ7ifVHv+n49btR}dq?HHDjl{m$T z!jLZcGkb&XS2OG~u%&R$(X+Z`CWec%QKt>NGYvd5g20)PU(dOn^7%@6kQb}C(%=vr z{?RP(z~C9DPnL{q^@pVw@|Vx~@3v!9dCaBtbh2EdtoNHm4kGxp>i#ct)7p|$QJs+U z-a3qtcPvhihub?wnJqEt>zC@)2suY?%-96cYCm$Q8R%-8$PZYsx3~QOLMDf(piXMm zB=<63yQk1AdOz#-qsEDX>>c)EES%$owHKue;?B3)8aRd}m~_)>SL3h2(9X;|+2#7X z+#2)NpD%qJvCQ0a-uzZLmz*ms+l*N}w)3LRQ*6>|Ub-fyptY(keUxw+)jfwF5K{L9 z|Cl_w=`!l_o><384d&?)$6Nh(GAm=4p_;{qVn#hI8lqewW7~wUlyBM-4Z|)cZr?Rh z=xZ&Ol>4(CU85ea(CZ^aO@2N18K>ftl8>2MqetAR53_JA>Fal`^)1Y--Am~UDa4th zKfCYpcXky$XSFDWBMIl(q=Mxj$iMBX=|j9P)^fDmF(5(5$|?Cx}DKEJa&XZP%OyE`*GvvYQ4PV&!g2|L^Q z?YG}tx;sY@GzMmsY`7r$P+F_YLz)(e}% zyakqFB<6|x9R#TdoP{R$>o7y(-`$$p0NxJ6?2B8tH)4^yF(WhqGZlM3=9Ibs$%U1w zWzcss*_c0=v_+^bfb`kBFsI`d;ElwiU%frgRB%qBjn@!0U2zZehBn|{%uNIKBA7n= zzE`nnwTP85{g;8AkYxA68>#muXa!G>xH22D1I*SiD~7C?7Za+9y7j1SHiuSkKK*^O zsZ==KO(Ua#?YUpXl{ViynyT#Hzk=}5X$e04O@fsMQjb}EMuPWFO0e&8(2N(29$@Vd zn1h8Yd>6z(*p^E{c(L0Lg=wVdupg!z@WG;E0k|4a%s7Up5C0c)55XVK*|x9RQeZ1J@1v9MX;>n34(i>=YE@Iur`0Vah(inE3VUFZNqf~tSz{1fz3Fsn_x4F>o(Yo;kpqvBe-sbwH(*Y zu$JOl0b83zu$JMvy<#oH^Wl>aWL*?aDwnS0iEAwC?DK@aT)GHRLhnz2WCvf3Ba;o=aY7 z2{Asu5MEjGOY4O#Ggz@@J;q*0`kd2n8I3BeNuMmYZf{}pg=jTdTCrIIYuW~luKecn z+E-pHY%ohj@uS0%^ z&(OxwPFPD$+#~`H?fMvi9geVLci(`K?Kj|w{rZ9JgthFHV+=6vMbK~0)Ea<&WY-NC zy-PnZft_k2tfeQ*SuC=nUj4H%SQ&Y$gbH4#2sT0cU0SdFs=*W*4hKGpuR1{)mV;Qf5pw4? zfiQgy0w3fC*w&Bj#{&=7033qFR*<*61B4f9K%CQvxEn&bsWJ{&winp;FP!KBj=(P6 z4Z_n4L7cS;ao2)ax?Tm|I1pH|uLpDSRVghkA_UtFFuZ0b2#>!8;>-_0ELjQSD-DRd z4im;599VHDZYtnWZGAB25W-e(2VrzEh|etsv2YoP#VbIZ{aFkwPrzJ#JvCvA*mXS& z`}Q^v9(W4GiSs}#s7BaN!WA2bniM$0J(#;MR>uIJ^uvgD3GS^%*ikdW6-!VFUU?JV zZc2)4cMsX@j z5HQ^e3BUzOdm}yC-xA%SY``k$rbfk z;CHqifhU*jfGM@DkYCecD9vl*qr58l6x<8URB=&%{!Cu3RO*MrKZ4VO}V6R0a zZw3Eg^0iKWM1dcTYZ0>N899=r6?+adUiBKPciJw}L$=1f4cs^bio&cr9baLF>6#BM z(F}EXe-`F=f_@`A7+Q&|QaZ??Txp_dB#lg!NH=t3$G8&06MFhwR=Iu*Im0s_b2B@| znW>X}sy~m#EW)&6E&!*0%}8UAS)wjt+A(io#wGI@Z2S+Ms1Cxl%YVE800007ip7{`C_J2TxPmfw%h$|%acrYHt)Re^PB%O&&=~a zhS(%I#+V>J-vjIib^<+s%ludY7y^C(P8nmqn9fp!i+?vr`bziDE=bx`%2W#Xyrj|i z!XQ4v1%L`m{7KT7q+LZNB^h8Ha2e=`Wp65^0;J00)_^G=au=8Yo;1b`CV&@#=jIBo zjN^JNVfYSs)+kDdGe7`1&8!?MQYKS?DuHZf3iogk_%#9E|5S zWeHrmAo>P;ejX7mwq#*}W25m^ZI+{(Z8fI?4jM_fffY0nok=+88^|*_DwcW>mR#e+ zX$F_KMdb6sRz!~7KkyN0G(3XQ+;z3X%PZ4gh;n-%62U<*VUKNv(D&Q->Na@Xb&u5Q3`3DGf+a8O5x7c#7+R+EAYl@R5us)CIw z7sT@_y~Ao@uL#&^LIh&QceqiT^+lb0YbFZt_SHOtWA%mgPEKVNvVgCsXy{5+zl*X8 zCJe)Q@y>wH^>l4;h1l^Y*9%-23TSmE>q5nI@?mt%n;Sj4Qq`Z+ib)a*a^cJc%E9^J zB;4s+K@rARbcBLT5P=@r;IVnBMKvT*)ew*R;&8vu%?Z&S>s?8?)3*YawM0P4!q$Kv zMmKh3lgE~&w&v%wVzH3Oe=jeNT=n@Y6J6TdHWTjXfX~-=1A1Bw`EW8rn}MqeI34nh zexFeA?&C3B2(E?0{drE@DA2pu(A#ElY&6el60Rn|Qpn-FkfQ8M93AfWIr)drgDFEU zghdWK)^71EWCP(@(=c4kfH1Y(4iugD4fve6;nSUpLT%!)MUHs1!zJYy4y||C+SwQ! z)KM&$7_tyM`sljP2fz6&Z;jxRn{Wup8IOUx8D4uh&(=O zx-7$a;U><*5L^!%xRlw)vAbh;sdlR||& ze}8_8%)c2Fwy=F&H|LM+p{pZB5DKTx>Y?F1N%BlZkXf!}JeGuMZk~LPi7{cidvUGB zAJ4LVeNV%XO>LTrklB#^-;8nb;}6l;1oW&WS=Mz*Az!4cqqQzbOSFq`$Q%PfD7srM zpKgP-D_0XPTRX*hAqeq0TDkJ;5HB1%$3Np)99#16c{ zJImlNL(npL!W|Gr_kxl1GVmF5&^$^YherS7+~q$p zt}{a=*RiD2Ikv6o=IM1kgc7zqpaZ;OB)P!1zz*i3{U()Dq#jG)egvK}@uFLa`oyWZ zf~=MV)|yJn`M^$N%ul5);JuQvaU1r2wt(}J_Qgyy`qWQI`hEeRX0uC@c1(dQ2}=U$ tNIIaX+dr)NRWXcxoR{>fqI{SF_dm1Ylv~=3YHI)h002ovPDHLkV1g(pWS;;4 literal 0 HcmV?d00001 diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100755 index 0000000000000000000000000000000000000000..c8f9ed8f5cee1c98386d13b17e89f719e83555b2 GIT binary patch literal 1895 zcmV-t2blPYP)FQtfgmafE#=YDCq`qUBt#QpG%*H6QHY765~R=q zZ6iudfM}q!Pz#~9JgOi8QJ|DSu?1-*(kSi1K4#~5?#|rh?sS)(-JQqX*}ciXJ56_H zdw=^s_srbAdqxlvGyrgGet#6T7_|j;95sL%MtM;q86vOxKM$f#puR)Bjv9Zvz9-di zXOTSsZkM83)E9PYBXC<$6(|>lNLVBb&&6y{NByFCp%6+^ALR@NCTse_wqvNmSWI-m z!$%KlHFH2omF!>#%1l3LTZg(s7eof$7*xB)ZQ0h?ejh?Ta9fDv59+u#MokW+1t8Zb zgHv%K(u9G^Lv`lh#f3<6!JVTL3(dCpxHbnbA;kKqQyd1~^Xe0VIaYBSWm6nsr;dFj z4;G-RyL?cYgsN1{L4ZFFNa;8)Rv0fM0C(~Tkit94 zz#~A)59?QjD&pAPSEQ)p8gP|DS{ng)j=2ux)_EzzJ773GmQ_Cic%3JJhC0t2cx>|v zJcVusIB!%F90{+}8hG3QU4KNeKmK%T>mN57NnCZ^56=0?&3@!j>a>B43pi{!u z7JyDj7`6d)qVp^R=%j>UIY6f+3`+qzIc!Y_=+uN^3BYV|o+$vGo-j-Wm<10%A=(Yk^beI{t%ld@yhKjq0iNjqN4XMGgQtbKubPM$JWBz}YA65k%dm*awtC^+f;a-x4+ddbH^7iDWGg&N0n#MW{kA|=8iMUiFYvMoDY@sPC#t$55gn6ykUTPAr`a@!(;np824>2xJthS z*ZdmT`g5-`BuJs`0LVhz+D9NNa3<=6m;cQLaF?tCv8)zcRSh66*Z|vXhG@$I%U~2l z?`Q zykI#*+rQ=z6Jm=Bui-SfpDYLA=|vzGE(dYm=OC8XM&MDo7ux4UF1~0J1+i%aCUpRe zt3L_uNyQ*cE(38Uy03H%I*)*Bh=Lb^Xj3?I^Hnbeq72(EOK^Y93CNp*uAA{5Lc=ky zx=~RKa4{iTm{_>_vSCm?$Ej=i6@=m%@VvAITnigVg{&@!7CDgs908761meDK5azA} z4?=NOH|PdvabgJ&fW2{Mo$Q0CcD8Qc84%{JPYt5EiG{MdLIAeX%T=D7NIP4%Hw}p9 zg)==!2Lbp#j{u_}hMiao9=!VSyx0gHbeCS`;q&vzeq|fs`y&^X-lso(Ls@-706qmA z7u*T5PMo_w3{se1t2`zWeO^hOvTsohG_;>J0wVqVe+n)AbQCx)yh9;w+J6?NF5Lmo zecS@ieAKL8%bVd@+-KT{yI|S}O>pYckUFs;ry9Ow$CD@ztz5K-*D$^{i(_1llhSh^ zEkL$}tsQt5>QA^;QgjgIfBDmcOgi5YDyu?t6vSnbp=1+@6D& z5MJ}B8q;bRlVoxasyhcUF1+)o`&3r0colr}QJ3hcSdLu;9;td>kf@Tcn<@9sIx&=m z;AD;SCh95=&p;$r{Xz3iWCO^MX83AGJ(yH&eTXgv|0=34#-&WAmw{)U7OU9!Wz^!7 zZ%jZFi@JR;>Mhi7S>V7wQ176|FdW2m?&`qa(ScO^CFPR80HucLHOTy%5s*HR0^8)i h0WYBP*#0Ks^FNSabJA*5${_#%002ovPDHLkV1oKhTl@e3 literal 0 HcmV?d00001 diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100755 index 0000000000000000000000000000000000000000..a6d6b8609df07bf62e5100a53a01510388bd2b22 GIT binary patch literal 2665 zcmV-v3YPVWP)oFh3q0MFesq&64WThn3$;G69TfjsAv=f2G9}p zgSx99+!YV6qME!>9MD13x)k(+XE7W?_O4LoLb5ND8 zaV{9+P@>42xDfRiYBMSgD$0!vssptcb;&?u9u(LLBKmkZ>RMD=kvD3h`sk6!QYtBa ztlZI#nu$8lJ^q2Z79UTgZe>BU73(Aospiq+?SdMt8lDZ;*?@tyWVZVS_Q7S&*tJaiRlJ z+aSMOmbg3@h5}v;A*c8SbqM3icg-`Cnwl;7Ts%A1RkNIp+Txl-Ckkvg4oxrqGA5ewEgYqwtECD<_3Egu)xGllKt&J8g&+=ac@Jq4-?w6M3b*>w5 z69N3O%=I^6&UL5gZ!}trC7bUj*12xLdkNs~Bz4QdJJ*UDZox2UGR}SNg@lmOvhCc~ z*f_UeXv(=#I#*7>VZx2ObEN~UoGUTl=-@)E;YtCRZ>SVp$p9yG5hEFZ!`wI!spd)n zSk+vK0Vin7FL{7f&6OB%f;SH22dtbcF<|9fi2Fp%q4kxL!b1#l^)8dUwJ zwEf{(wJj@8iYDVnKB`eSU+;ml-t2`@%_)0jDM`+a46xhDbBj2+&Ih>1A>6aky#(-SYyE{R3f#y57wfLs z6w1p~$bp;6!9DX$M+J~S@D6vJAaElETnsX4h9a5tvPhC3L@qB~bOzkL@^z0k_hS{T4PF*TDrgdXp+dzsE? z>V|VR035Pl9n5&-RePFdS{7KAr2vPOqR9=M$vXA1Yy5>w;EsF`;OK{2pkn-kpp9Pw z)r;5JfJKKaT$4qCb{TaXHjb$QA{y0EYy*+b1XI;6Ah- zw13P)xT`>~eFoJC!>{2XL(a_#upp3gaR1#5+L(Jmzp4TBnx{~WHedpJ1ch8JFk~Sw z>F+gN+i+VD?gMXwcIhn8rz`>e>J^TI3E-MW>f}6R-pL}>WMOa0k#jN+`RyUVUC;#D zg|~oS^$6%wpF{^Qr+}X>0PKcr3Fc&>Z>uv@C);pwDs@2bZWhYP!rvGx?_|q{d`t<*XEb#=aOb=N+L@CVBGqImZf&+a zCQEa3$~@#kC);pasdG=f6tuIi0PO-y&tvX%>Mv=oY3U$nD zJ#gMegnQ46pq+3r=;zmgcG+zRc9D~c>z+jo9&D+`E6$LmyFqlmCYw;-Zooma{sR@~ z)_^|YL1&&@|GXo*pivH7k!msl+$Sew3%XJnxajt0K%3M6Bd&YFNy9}tWG^aovK2eX z1aL1%7;KRDrA@eG-Wr6w+;*H_VD~qLiVI`{_;>o)k`{8xa3EJT1O_>#iy_?va0eR? zDV=N%;Zjb%Z2s$@O>w@iqt!I}tLjGk!=p`D23I}N4Be@$(|iSA zf3Ih7b<{zqpDB4WF_5X1(peKe+rASze%u8eKLn#KKXt;UZ+Adf$_TO+vTqshLLJ5c z52HucO=lrNVae5XWOLm!V@n-ObU11!b+DN<$RuU+YsrBq*lYT;?AwJpmNKniF0Q1< zJCo>Q$=v$@&y=sj6{r!Y&y&`0$-I}S!H_~pI&2H8Z1C|BX4VgZ^-! zje3-;x0PBD!M`v*J_)rL^+$<1VJhH*2Fi~aA7s&@_rUHYJ9zD=M%4AFQ`}k8OC$9s XsPq=LnkwKG00000NkvXXu0mjfhAk5^ literal 0 HcmV?d00001 diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100755 index 0000000000000000000000000000000000000000..a6d6b8609df07bf62e5100a53a01510388bd2b22 GIT binary patch literal 2665 zcmV-v3YPVWP)oFh3q0MFesq&64WThn3$;G69TfjsAv=f2G9}p zgSx99+!YV6qME!>9MD13x)k(+XE7W?_O4LoLb5ND8 zaV{9+P@>42xDfRiYBMSgD$0!vssptcb;&?u9u(LLBKmkZ>RMD=kvD3h`sk6!QYtBa ztlZI#nu$8lJ^q2Z79UTgZe>BU73(Aospiq+?SdMt8lDZ;*?@tyWVZVS_Q7S&*tJaiRlJ z+aSMOmbg3@h5}v;A*c8SbqM3icg-`Cnwl;7Ts%A1RkNIp+Txl-Ckkvg4oxrqGA5ewEgYqwtECD<_3Egu)xGllKt&J8g&+=ac@Jq4-?w6M3b*>w5 z69N3O%=I^6&UL5gZ!}trC7bUj*12xLdkNs~Bz4QdJJ*UDZox2UGR}SNg@lmOvhCc~ z*f_UeXv(=#I#*7>VZx2ObEN~UoGUTl=-@)E;YtCRZ>SVp$p9yG5hEFZ!`wI!spd)n zSk+vK0Vin7FL{7f&6OB%f;SH22dtbcF<|9fi2Fp%q4kxL!b1#l^)8dUwJ zwEf{(wJj@8iYDVnKB`eSU+;ml-t2`@%_)0jDM`+a46xhDbBj2+&Ih>1A>6aky#(-SYyE{R3f#y57wfLs z6w1p~$bp;6!9DX$M+J~S@D6vJAaElETnsX4h9a5tvPhC3L@qB~bOzkL@^z0k_hS{T4PF*TDrgdXp+dzsE? z>V|VR035Pl9n5&-RePFdS{7KAr2vPOqR9=M$vXA1Yy5>w;EsF`;OK{2pkn-kpp9Pw z)r;5JfJKKaT$4qCb{TaXHjb$QA{y0EYy*+b1XI;6Ah- zw13P)xT`>~eFoJC!>{2XL(a_#upp3gaR1#5+L(Jmzp4TBnx{~WHedpJ1ch8JFk~Sw z>F+gN+i+VD?gMXwcIhn8rz`>e>J^TI3E-MW>f}6R-pL}>WMOa0k#jN+`RyUVUC;#D zg|~oS^$6%wpF{^Qr+}X>0PKcr3Fc&>Z>uv@C);pwDs@2bZWhYP!rvGx?_|q{d`t<*XEb#=aOb=N+L@CVBGqImZf&+a zCQEa3$~@#kC);pasdG=f6tuIi0PO-y&tvX%>Mv=oY3U$nD zJ#gMegnQ46pq+3r=;zmgcG+zRc9D~c>z+jo9&D+`E6$LmyFqlmCYw;-Zooma{sR@~ z)_^|YL1&&@|GXo*pivH7k!msl+$Sew3%XJnxajt0K%3M6Bd&YFNy9}tWG^aovK2eX z1aL1%7;KRDrA@eG-Wr6w+;*H_VD~qLiVI`{_;>o)k`{8xa3EJT1O_>#iy_?va0eR? zDV=N%;Zjb%Z2s$@O>w@iqt!I}tLjGk!=p`D23I}N4Be@$(|iSA zf3Ih7b<{zqpDB4WF_5X1(peKe+rASze%u8eKLn#KKXt;UZ+Adf$_TO+vTqshLLJ5c z52HucO=lrNVae5XWOLm!V@n-ObU11!b+DN<$RuU+YsrBq*lYT;?AwJpmNKniF0Q1< zJCo>Q$=v$@&y=sj6{r!Y&y&`0$-I}S!H_~pI&2H8Z1C|BX4VgZ^-! zje3-;x0PBD!M`v*J_)rL^+$<1VJhH*2Fi~aA7s&@_rUHYJ9zD=M%4AFQ`}k8OC$9s XsPq=LnkwKG00000NkvXXu0mjfhAk5^ literal 0 HcmV?d00001 diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100755 index 0000000000000000000000000000000000000000..75b2d164a5a98e212cca15ea7bf2ab5de5108680 GIT binary patch literal 3831 zcmVjJBgitF5mAp-i>4+KS_oR{|13AP->1TD4=w)g|)JHOx|a2Wk1Va z!k)vP$UcQ#mdj%wNQoaJ!w>jv_6&JPyutpQps?s5dmDQ>`%?Bvj>o<%kYG!YW6H-z zu`g$@mp`;qDR!51QaS}|ZToSuAGcJ7$2HF0z`ln4t!#Yg46>;vGG9N9{V@9z#}6v* zfP?}r6b{*-C*)(S>NECI_E~{QYzN5SXRmVnP<=gzP+_Sp(Aza_hKlZ{C1D&l*(7IKXxQC1Z9#6wx}YrGcn~g%;icdw>T0Rf^w0{ z$_wn1J+C0@!jCV<%Go5LA45e{5gY9PvZp8uM$=1}XDI+9m7!A95L>q>>oe0$nC->i zeexUIvq%Uk<-$>DiDb?!In)lAmtuMWxvWlk`2>4lNuhSsjAf2*2tjT`y;@d}($o)S zn(+W&hJ1p0xy@oxP%AM15->wPLp{H!k)BdBD$toBpJh+crWdsNV)qsHaqLg2_s|Ih z`8E9z{E3sA!}5aKu?T!#enD(wLw?IT?k-yWVHZ8Akz4k5(TZJN^zZgm&zM28sfTD2BYJ|Fde3Xzh;;S` z=GXTnY4Xc)8nYoz6&vF;P7{xRF-{|2Xs5>a5)@BrnQ}I(_x7Cgpx#5&Td^4Q9_FnQ zX5so*;#8-J8#c$OlA&JyPp$LKUhC~-e~Ij!L%uSMu!-VZG7Hx-L{m2DVR2i=GR(_% zCVD!4N`I)&Q5S`?P&fQZ=4#Dgt_v2-DzkT}K(9gF0L(owe-Id$Rc2qZVLqI_M_DyO z9@LC#U28_LU{;wGZ&))}0R2P4MhajKCd^K#D+JJ&JIXZ_p#@+7J9A&P<0kdRujtQ_ zOy>3=C$kgi6$0pW06KaLz!21oOryKM3ZUOWqppndxfH}QpgjEJ`j7Tzn5bk6K&@RA?vl##y z$?V~1E(!wB5rH`>3nc&@)|#<1dN2cMzzm=PGhQ|Yppne(C-Vlt450IXc`J4R0W@I7 zd1e5uW6juvO%ni(WX7BsKx3MLngO7rHO;^R5I~0^nE^9^E_eYLgiR9&KnJ)pBbfno zSVnW$0R+&6jOOsZ82}nJ126+c|%svPo;TeUku<2G7%?$oft zyaO;tVo}(W)VsTUhq^XmFi#2z%-W9a{7mXn{uzivYQ_d6b7VJG{77naW(vHt-uhnY zVN#d!JTqVh(7r-lhtXVU6o})aZbDt_;&wJVGl2FKYFBFpU-#9U)z#(A%=IVnqytR$SY-sO( z($oNE09{D^@OuYPz&w~?9>Fl5`g9u&ecFGhqX=^#fmR=we0CJw+5xna*@oHnkahk+ z9aWeE3v|An+O5%?4fA&$Fgu~H_YmqR!yIU!bFCk4!#pAj%(lI(A5n)n@Id#M)O9Yx zJU9oKy{sRAIV3=5>(s8n{8ryJ!;ho}%pn6hZKTKbqk=&m=f*UnK$zW3YQP*)pw$O* zIfLA^!-bmBl6%d_n$#tP8Zd_(XdA*z*WH|E_yILwjtI~;jK#v-6jMl^?<%Y%`gvpwv&cFb$||^v4D&V=aNy?NGo620jL3VZnA%s zH~I|qPzB~e(;p;b^gJr7Ure#7?8%F0m4vzzPy^^(q4q1OdthF}Fi*RmVZN1OwTsAP zn9CZP`FazX3^kG(KodIZ=Kty8DLTy--UKfa1$6XugS zk%6v$Kmxt6U!YMx0JQ)0qX*{CXwZZk$vEROidEc7=J-1;peNat!vS<3P-FT5po>iE z!l3R+<`#x|+_hw!HjQGV=8!q|76y8L7N8gP3$%0kfush|u0uU^?dKBaeRSBUpOZ0c z62;D&Mdn2}N}xHRFTRI?zRv=>=AjHgH}`2k4WK=#AHB)UFrR-J87GgX*x5fL^W2#d z=(%K8-oZfMO=i{aWRDg=FX}UubM4eotRDcn;OR#{3q=*?3mE3_oJ-~prjhxh%PgQT zyn)Qozaq0@o&|LEgS{Ind4Swsr;b`u185hZPOBLL<`d2%^Yp1?oL)=jnLi;Zo0ZDliTtQ^b5SmfIMe{T==zZkbvn$KTQGlbG8w}s@M3TZnde;1Am46P3juKb zl9GU&3F=q`>j!`?SyH#r@O59%@aMX^rx}Nxe<>NqpUp5=lX1ojGDIR*-D^SDuvCKF z?3$xG(gVUsBERef_YjPFl^rU9EtD{pt z0CXwpN7BN3!8>hajGaTVk-wl=9rxmfWtIhC{mheHgStLi^+Nz12a?4r(fz)?3A%at zMlvQmL<2-R)-@G1wJ0^zQK%mR=r4d{Y3fHp){nWXUL#|CqXl(+v+qDh>FkF9`eWrW zfr^D%LNfOcTNvtx0JXR35J0~Jpi2#P3Q&80w+nqNfc}&G0A~*)lGHKv=^FE+b(37|)zL;KLF>oiGfb(?&1 zV3XRu!Sw>@quKiab%g6jun#oZ%!>V#A%+lNc?q>6+VvyAn=kf_6z^(TZUa4Eelh{{ zqFX-#dY(EV@7l$NE&kv9u9BR8&Ojd#ZGJ6l8_BW}^r?DIS_rU2(XaGOK z225E@kH5Opf+CgD^{y29jD4gHbGf{1MD6ggQ&%>UG4WyPh5q_tb`{@_34B?xfSO*| zZv8!)q;^o-bz`MuxXk*G^}(6)ACb@=Lfs`Hxoh>`Y0NE8QRQ!*p|SH@{r8=%RKd4p z+#Ty^-0kb=-H-O`nAA3_6>2z(D=~Tbs(n8LHxD0`R0_ATFqp-SdY3(bZ3;VUM?J=O zKCNsxsgt@|&nKMC=*+ZqmLHhX1KHbAJs{nGVMs6~TiF%Q)P@>!koa$%oS zjXa=!5>P`vC-a}ln!uH1ooeI&v?=?v7?1n~P(wZ~0>xWxd_Aw;+}9#eULM7M8&E?Y zC-ZLhi3RoM92SXUb-5i-Lmt5_rfjE{6y^+24`y$1lywLyHO!)Boa7438K4#iLe?rh z2O~YGSgFUBH?og*6=r9rme=peP~ah`(8Zt7V)j5!V0KPFf_mebo3z95U8(up$-+EA^9dTRLq>Yl)YMBuch9%=e5B`Vnb>o zt03=kq;k2TgGe4|lGne&zJa~h(UGutjP_zr?a7~#b)@15XNA>Dj(m=gg2Q5V4-$)D|Q9}R#002ovPDHLkV1o7DH3k3x literal 0 HcmV?d00001 diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100755 index 0000000000000000000000000000000000000000..c4df70d39da7941ef3f6dcb7f06a192d8dcb308d GIT binary patch literal 1888 zcmV-m2cP(fP)x~L`~4d)Rspd&<9kFh{hn*KP1LP0~$;u(LfAu zp%fx&qLBcRHx$G|3q(bv@+b;o0*D|jwD-Q9uQR(l*ST}s+uPgQ-MeFwZ#GS?b332? z&Tk$&_miXn3IGq)AmQ)3sisq{raD4(k*bHvpCe-TdWq^NRTEVM)i9xbgQ&ccnUVx* zEY%vS%gDcSg=!tuIK8$Th2_((_h^+7;R|G{n06&O2#6%LK`a}n?h_fL18btz<@lFG za}xS}u?#DBMB> zw^b($1Z)`9G?eP95EKi&$eOy@K%h;ryrR3la%;>|o*>CgB(s>dDcNOXg}CK9SPmD? zmr-s{0wRmxUnbDrYfRvnZ@d z6johZ2sMX{YkGSKWd}m|@V7`Degt-43=2M?+jR%8{(H$&MLLmS;-|JxnX2pnz;el1jsvqQz}pGSF<`mqEXRQ5sC4#BbwnB_4` zc5bFE-Gb#JV3tox9fp-vVEN{(tOCpRse`S+@)?%pz+zVJXSooTrNCUg`R6`hxwb{) zC@{O6MKY8tfZ5@!yy=p5Y|#+myRL=^{tc(6YgAnkg3I(Cd!r5l;|;l-MQ8B`;*SCE z{u)uP^C$lOPM z5d~UhKhRRmvv{LIa^|oavk1$QiEApSrP@~Jjbg`<*dW4TO?4qG%a%sTPUFz(QtW5( zM)lA+5)0TvH~aBaOAs|}?u2FO;yc-CZ1gNM1dAxJ?%m?YsGR`}-xk2*dxC}r5j$d* zE!#Vtbo69h>V4V`BL%_&$} z+oJAo@jQ^Tk`;%xw-4G>hhb&)B?##U+(6Fi7nno`C<|#PVA%$Y{}N-?(Gc$1%tr4Pc}}hm~yY#fTOe!@v9s-ik$dX~|ygArPhByaXn8 zpI^FUjNWMsTFKTP3X7m?UK)3m zp6rI^_zxRYrx6_QmhoWoDR`fp4R7gu6;gdO)!KexaoO2D88F9x#TM1(9Bn7g;|?|o z)~$n&Lh#hCP6_LOPD>a)NmhW})LADx2kq=X7}7wYRj-0?dXr&bHaRWCfSqvzFa=sn z-8^gSyn-RmH=BZ{AJZ~!8n5621GbUJV7Qvs%JNv&$%Q17s_X%s-41vAPfIR>;x0Wlqr5?09S>x#%Qkt>?(&XjFRY}*L6BeQ3 z<6XEBh^S7>AbwGm@XP{RkeEKj6@_o%oV?hDuUpUJ+r#JZO?!IUc;r0R?>mi)*ZpQ) z#((dn=A#i_&EQn|hd)N$#A*fjBFuiHcYvo?@y1 z5|fV=a^a~d!c-%ZbMNqkMKiSzM{Yq=7_c&1H!mXk60Uv32dV;vMg&-kQ)Q{+PFtwc zj|-uQ;b^gts??J*9VxxOro}W~Q9j4Em|zSRv)(WSO9$F$s=Ydu%Q+5DOid~lwk&we zY%W(Z@ofdwPHncEZzZgmqS|!gTj3wQq9rxQy+^eNYKr1mj&?tm@wkO*9@UtnRMG>c aR{jt9+;fr}hV%pg00001^@s67{VYS000c7NklQEG_j zup^)eW&WUIApqy$=APz8jE@awGp)!bsTjDbrJO`$x^ZR^dr;>)LW>{ zs70vpsD38v)19rI=GNk1b(0?Js9~rjsQsu*K;@SD40RB-3^gKU-MYC7G!Bw{fZsqp zih4iIi;Hr_xZ033Iu{sQxLS=}yBXgLMn40d++>aQ0#%8D1EbGZp7+ z5=mK?t31BkVYbGOxE9`i748x`YgCMwL$qMsChbSGSE1`p{nSmadR zcQ#R)(?!~dmtD0+D2!K zR9%!Xp1oOJzm(vbLvT^$IKp@+W2=-}qTzTgVtQ!#Y7Gxz}stUIm<1;oBQ^Sh2X{F4ibaOOx;5ZGSNK z0maF^@(UtV$=p6DXLgRURwF95C=|U8?osGhgOED*b z7woJ_PWXBD>V-NjQAm{~T%sjyJ{5tn2f{G%?J!KRSrrGvQ1(^`YLA5B!~eycY(e5_ z*%aa{at13SxC(=7JT7$IQF~R3sy`Nn%EMv!$-8ZEAryB*yB1k&stni)=)8-ODo41g zkJu~roIgAih94tb=YsL%iH5@^b~kU9M-=aqgXIrbtxMpFy5mekFm#edF9z7RQ6V}R zBIhbXs~pMzt0VWy1Fi$^fh+1xxLDoK09&5&MJl(q#THjPm(0=z2H2Yfm^a&E)V+a5 zbi>08u;bJsDRUKR9(INSc7XyuWv(JsD+BB*0hS)FO&l&7MdViuur@-<-EHw>kHRGY zqoT}3fDv2-m{NhBG8X}+rgOEZ;amh*DqN?jEfQdqxdj08`Sr=C-KmT)qU1 z+9Cl)a1mgXxhQiHVB}l`m;-RpmKy?0*|yl?FXvJkFxuu!fKlcmz$kN(a}i*saM3nr z0!;a~_%Xqy24IxA2rz<+08=B-Q|2PT)O4;EaxP^6qixOv7-cRh?*T?zZU`{nIM-at zTKYWr9rJ=tppQ9I#Z#mLgINVB!pO-^FOcvFw6NhV0gztuO?g ztoA*C-52Q-Z-P#xB4HAY3KQVd%dz1S4PA3vHp0aa=zAO?FCt zC_GaTyVBg2F!bBr3U@Zy2iJgIAt>1sf$JWA9kh{;L+P*HfUBX1Zy{4MgNbDfBV_ly z!y#+753arsZUt@366jIC0klaC@ckuk!qu=pAyf7&QmiBUT^L1&tOHzsK)4n|pmrVT zs2($4=?s~VejTFHbFdDOwG;_58LkIj1Fh@{glkO#F1>a==ymJS$z;gdedT1zPx4Kj ztjS`y_C}%af-RtpehdQDt3a<=W5C4$)9W@QAse;WUry$WYmr51ml9lkeunUrE`-3e zmq1SgSOPNEE-Mf+AGJ$g0M;3@w!$Ej;hMh=v=I+Lpz^n%Pg^MgwyqOkNyu2c^of)C z1~ALor3}}+RiF*K4+4{(1%1j3pif1>sv0r^mTZ?5Jd-It!tfPfiG_p$AY*Vfak%FG z4z#;wLtw&E&?}w+eKG^=#jF7HQzr8rV0mY<1YAJ_uGz~$E13p?F^fPSzXSn$8UcI$ z8er9{5w5iv0qf8%70zV71T1IBB1N}R5Kp%NO0=5wJalZt8;xYp;b{1K) zHY>2wW-`Sl{=NpR%iu3(u6l&)rc%%cSA#aV7WCowfbFR4wcc{LQZv~o1u_`}EJA3>ki`?9CKYTA!rhO)if*zRdd}Kn zEPfYbhoVE~!FI_2YbC5qAj1kq;xP6%J8+?2PAs?`V3}nyFVD#sV3+uP`pi}{$l9U^ zSz}_M9f7RgnnRhaoIJgT8us!1aB&4!*vYF07Hp&}L zCRlop0oK4DL@ISz{2_BPlezc;xj2|I z23RlDNpi9LgTG_#(w%cMaS)%N`e>~1&a3<{Xy}>?WbF>OOLuO+j&hc^YohQ$4F&ze z+hwnro1puQjnKm;vFG~o>`kCeUIlkA-2tI?WBKCFLMBY=J{hpSsQ=PDtU$=duS_hq zHpymHt^uuV1q@uc4bFb{MdG*|VoW@15Osrqt2@8ll0qO=j*uOXn{M0UJX#SUztui9FN4)K3{9!y8PC-AHHvpVTU;x|-7P+taAtyglk#rjlH2 z5Gq8ik}BPaGiM{#Woyg;*&N9R2{J0V+WGB69cEtH7F?U~Kbi6ksi*`CFXsi931q7Y zGO82?whBhN%w1iDetv%~wM*Y;E^)@Vl?VDj-f*RX>{;o_=$fU!&KAXbuadYZ46Zbg z&6jMF=49$uL^73y;;N5jaHYv)BTyfh&`qVLYn?`o6BCA_z-0niZz=qPG!vonK3MW_ zo$V96zM!+kJRs{P-5-rQVse0VBH*n6A58)4uc&gfHMa{gIhV2fGf{st>E8sKyP-$8zp~wJX^A*@DI&-;8>gANXZj zU)R+Y)PB?=)a|Kj>8NXEu^S_h^7R`~Q&7*Kn!xyvzVv&^>?^iu;S~R2e-2fJx-oUb cX)(b1KSk$MOV07*qoM6N<$f&6$jw%VRuvdN2+38CZWny1cRtlsl+0_KtW)EU14Ei(F!UtWuj4IK+3{sK@>rh zs1Z;=(DD&U6+tlyL?UnHVN^&g6QhFi2#HS+*qz;(>63G(`|jRtW|nz$Pv7qTovP!^ zP_jES{mr@O-02w%!^a?^1ZP!_KmQiz0L~jZ=W@Qt`8wzOoclQsAS<5YdH;a(4bGLE zk8s}1If(PSIgVi!XE!5kA?~z*sobvNyohr;=Q_@h2@$6Flyej3J)D-6YfheRGl`HEcPk|~huT_2-U?PfL=4BPV)f1o!%rQ!NMt_MYw-5bUSwQ9Z&zC>u zOrl~UJglJNa%f50Ok}?WB{on`Ci`p^Y!xBA?m@rcJXLxtrE0FhRF3d*ir>yzO|BD$ z3V}HpFcCh6bTzY}Nt_(W%QYd3NG)jJ4<`F<1Od) zfQblTdC&h2lCz`>y?>|9o2CdvC8qZeIZt%jN;B7Hdn2l*k4M4MFEtq`q_#5?}c$b$pf_3y{Y!cRDafZBEj-*OD|gz#PBDeu3QoueOesLzB+O zxjf2wvf6Wwz>@AiOo2mO4=TkAV+g~%_n&R;)l#!cBxjuoD$aS-`IIJv7cdX%2{WT7 zOm%5rs(wqyPE^k5SIpUZ!&Lq4<~%{*>_Hu$2|~Xa;iX*tz8~G6O3uFOS?+)tWtdi| zV2b#;zRN!m@H&jd=!$7YY6_}|=!IU@=SjvGDFtL;aCtw06U;-v^0%k0FOyESt z1Wv$={b_H&8FiRV?MrzoHWd>%v6KTRU;-v^Miiz+@q`(BoT!+<37CKhoKb)|8!+RG z6BQFU^@fRW;s8!mOf2QViKQGk0TVER6EG1`#;Nm39Do^PoT!+<37AD!%oJe86(=et zZ~|sLzU>V-qYiU6V8$0GmU7_K8|Fd0B?+9Un1BhKAz#V~Fk^`mJtlCX#{^8^M8!me z8Yg;8-~>!e<-iG;h*0B1kBKm}hItVGY6WnjVpgnTTAC$rqQ^v)4KvOtpY|sIj@WYg zyw##ZZ5AC2IKNC;^hwg9BPk0wLStlmBr;E|$5GoAo$&Ui_;S9WY62n3)i49|T%C#i017z3J=$RF|KyZWnci*@lW4 z=AKhNN6+m`Q!V3Ye68|8y@%=am>YD0nG99M)NWc20%)gwO!96j7muR}Fr&54SxKP2 zP30S~lt=a*qDlbu3+Av57=9v&vr<6g0&`!8E2fq>I|EJGKs}t|{h7+KT@)LfIV-3K zK)r_fr2?}FFyn*MYoLC>oV-J~eavL2ho4a4^r{E-8m2hi>~hA?_vIG4a*KT;2eyl1 zh_hUvUJpNCFwBvRq5BI*srSle>c6%n`#VNsyC|MGa{(P&08p=C9+WUw9Hl<1o9T4M zdD=_C0F7#o8A_bRR?sFNmU0R6tW`ElnF8p53IdHo#S9(JoZCz}fHwJ6F<&?qrpVqE zte|m%89JQD+XwaPU#%#lVs-@-OL);|MdfINd6!XwP2h(eyafTUsoRkA%&@fe?9m@jw-v(yTTiV2(*fthQH9}SqmsRPVnwwbV$1E(_lkmo&S zF-truCU914_$jpqjr(>Ha4HkM4YMT>m~NosUu&UZ>zirfHo%N6PPs9^_o$WqPA0#5 z%tG>qFCL+b*0s?sZ;Sht0nE7Kl>OVXy=gjWxxK;OJ3yGd7-pZf7JYNcZo2*1SF`u6 zHJyRRxGw9mDlOiXqVMsNe#WX`fC`vrtjSQ%KmLcl(lC>ZOQzG^%iql2w-f_K@r?OE zwCICifM#L-HJyc7Gm>Ern?+Sk3&|Khmu4(~3qa$(m6Ub^U0E5RHq49za|XklN#?kP zl;EstdW?(_4D>kwjWy2f!LM)y?F94kyU3`W!6+AyId-89v}sXJpuic^NLL7GJItl~ zsiuB98AI-(#Mnm|=A-R6&2fwJ0JVSY#Q>&3$zFh|@;#%0qeF=j5Ajq@4i0tIIW z&}sk$&fGwoJpe&u-JeGLi^r?dO`m=y(QO{@h zQqAC7$rvz&5+mo3IqE?h=a~6m>%r5Quapvzq;{y~p zJpyXOBgD9VrW7@#p6l7O?o3feml(DtSL>D^R) zZUY%T2b0-vBAFN7VB;M88!~HuOXi4KcI6aRQ&h|XQ0A?m%j2=l1f0cGP}h(oVfJ`N zz#PpmFC*ieab)zJK<4?^k=g%OjPnkANzbAbmGZHoVRk*mTfm75s_cWVa`l*f$B@xu z5E*?&@seIo#*Y~1rBm!7sF9~~u6Wrj5oICUOuz}CS)jdNIznfzCA(stJ(7$c^e5wN z?lt>eYgbA!kvAR7zYSD&*r1$b|(@;9dcZ^67R0 zXAXJKa|5Sdmj!g578Nwt6d$sXuc&MWezA0Whd`94$h{{?1IwXP4)Tx4obDK%xoFZ_Z zjjHJ_P@R_e5blG@yEjnaJb`l;s%Lb2&=8$&Ct-fV`E^4CUs)=jTk!I}2d&n!f@)bm z@ z_4Dc86+3l2*p|~;o-Sb~oXb_RuLmoifDU^&Te$*FevycC0*nE3Xws8gsWp|Rj2>SM zns)qcYj?^2sd8?N!_w~4v+f-HCF|a$TNZDoNl$I1Uq87euoNgKb6&r26TNrfkUa@o zfdiFA@p{K&mH3b8i!lcoz)V{n8Q@g(vR4ns4r6w;K z>1~ecQR0-<^J|Ndg5fvVUM9g;lbu-){#ghGw(fg>L zh)T5Ljb%lWE;V9L!;Cqk>AV1(rULYF07ZBJbGb9qbSoLAd;in9{)95YqX$J43-dY7YU*k~vrM25 zxh5_IqO0LYZW%oxQ5HOzmk4x{atE*vipUk}sh88$b2tn?!ujEHn`tQLe&vo}nMb&{ zio`xzZ&GG6&ZyN3jnaQy#iVqXE9VT(3tWY$n-)uWDQ|tc{`?fq2F`oQ{;d3aWPg4Hp-(iE{ry>MIPWL> iW8 + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Base.lproj/Main.storyboard b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Base.lproj/Main.storyboard new file mode 100755 index 000000000000..f3c28516fb38 --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/GoogleService-Info.plist b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/GoogleService-Info.plist new file mode 100644 index 000000000000..6042aab908af --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/GoogleService-Info.plist @@ -0,0 +1,44 @@ + + + + + AD_UNIT_ID_FOR_BANNER_TEST + ca-app-pub-3940256099942544/2934735716 + AD_UNIT_ID_FOR_INTERSTITIAL_TEST + ca-app-pub-3940256099942544/4411468910 + CLIENT_ID + 479882132969-9i9aqik3jfjd7qhci1nqf0bm2g71rm1u.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.479882132969-9i9aqik3jfjd7qhci1nqf0bm2g71rm1u + ANDROID_CLIENT_ID + 479882132969-jie8r1me6dsra60pal6ejaj8dgme3tg0.apps.googleusercontent.com + API_KEY + AIzaSyBECOwLTAN6PU4Aet1b2QLGIb3kRK8Xjew + GCM_SENDER_ID + 479882132969 + PLIST_VERSION + 1 + BUNDLE_ID + io.flutter.plugins.googleSignInExample + PROJECT_ID + my-flutter-proj + STORAGE_BUCKET + my-flutter-proj.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:479882132969:ios:2643f950e0a0da08 + DATABASE_URL + https://my-flutter-proj.firebaseio.com + SERVER_CLIENT_ID + YOUR_SERVER_CLIENT_ID + + \ No newline at end of file diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Info.plist b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Info.plist new file mode 100755 index 000000000000..e03ccfe55e37 --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/Info.plist @@ -0,0 +1,62 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + Google Sign-In Example + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + GoogleSignInExample + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleURLTypes + + + CFBundleTypeRole + Editor + CFBundleURLSchemes + + com.googleusercontent.apps.479882132969-9i9aqik3jfjd7qhci1nqf0bm2g71rm1u + + + + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + + diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/main.m b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/main.m new file mode 100644 index 000000000000..bec320c0bee0 --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/ios/Runner/main.m @@ -0,0 +1,13 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import +#import +#import "AppDelegate.h" + +int main(int argc, char* argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/lib/main.dart b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/lib/main.dart new file mode 100755 index 000000000000..a238ca3bf8b5 --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/lib/main.dart @@ -0,0 +1,149 @@ +// Copyright 2019 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// ignore_for_file: public_member_api_docs + +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:google_sign_in/google_sign_in.dart'; + +import 'package:extension_google_sign_in_as_googleapis_auth/extension_google_sign_in_as_googleapis_auth.dart'; +import 'package:googleapis/people/v1.dart'; + +GoogleSignIn _googleSignIn = GoogleSignIn( + scopes: [ + 'email', + 'https://www.googleapis.com/auth/contacts.readonly', + ], +); + +void main() { + runApp( + MaterialApp( + title: 'Google Sign In', + home: SignInDemo(), + ), + ); +} + +class SignInDemo extends StatefulWidget { + @override + State createState() => SignInDemoState(); +} + +class SignInDemoState extends State { + GoogleSignInAccount _currentUser; + String _contactText; + + @override + void initState() { + super.initState(); + _googleSignIn.onCurrentUserChanged.listen((GoogleSignInAccount account) { + setState(() { + _currentUser = account; + }); + if (_currentUser != null) { + _handleGetContact(); + } + }); + _googleSignIn.signInSilently(); + } + + Future _handleGetContact() async { + setState(() { + _contactText = 'Loading contact info...'; + }); + + final peopleApi = PeopleApi(await _googleSignIn.authenticatedClient()); + final response = await peopleApi.people.connections.list( + 'people/me', + personFields: 'names', + ); + + final firstNamedContactName = _pickFirstNamedContact(response.connections); + + setState(() { + if (firstNamedContactName != null) { + _contactText = 'I see you know $firstNamedContactName!'; + } else { + _contactText = 'No contacts to display.'; + } + }); + } + + String _pickFirstNamedContact(List connections) { + return connections + ?.firstWhere( + (person) => person.names != null, + orElse: () => null, + ) + ?.names + ?.firstWhere( + (name) => name.displayName != null, + orElse: () => null, + ) + ?.displayName; + } + + Future _handleSignIn() async { + try { + await _googleSignIn.signIn(); + } catch (error) { + print(error); + } + } + + Future _handleSignOut() => _googleSignIn.disconnect(); + + Widget _buildBody() { + if (_currentUser != null) { + return Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + ListTile( + leading: GoogleUserCircleAvatar( + identity: _currentUser, + ), + title: Text(_currentUser.displayName ?? ''), + subtitle: Text(_currentUser.email ?? ''), + ), + const Text('Signed in successfully.'), + Text(_contactText ?? ''), + RaisedButton( + child: const Text('SIGN OUT'), + onPressed: _handleSignOut, + ), + RaisedButton( + child: const Text('REFRESH'), + onPressed: _handleGetContact, + ), + ], + ); + } else { + return Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + const Text('You are not currently signed in.'), + RaisedButton( + child: const Text('SIGN IN'), + onPressed: _handleSignIn, + ), + ], + ); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Google Sign In'), + ), + body: ConstrainedBox( + constraints: const BoxConstraints.expand(), + child: _buildBody(), + )); + } +} diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/pubspec.yaml b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/pubspec.yaml new file mode 100755 index 000000000000..aee073971d2c --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/pubspec.yaml @@ -0,0 +1,23 @@ +name: extension_google_sign_in_example +description: Example of Google Sign-In plugin and googleapis. + +dependencies: + flutter: + sdk: flutter + google_sign_in: ^4.4.1 + extension_google_sign_in_as_googleapis_auth: + path: ../ + googleapis: ^0.55.0 + +dev_dependencies: + pedantic: ^1.8.0 + e2e: ^0.2.1 + flutter_driver: + sdk: flutter + +flutter: + uses-material-design: true + +environment: + sdk: ">=2.0.0-dev.28.0 <3.0.0" + flutter: ">=1.12.13+hotfix.4 <2.0.0" diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/web/index.html b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/web/index.html new file mode 100644 index 000000000000..42a7d93582ba --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/web/index.html @@ -0,0 +1,11 @@ + + + + + + Google Sign-in Example + + + + + diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/lib/extension_google_sign_in_as_googleapis_auth.dart b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/lib/extension_google_sign_in_as_googleapis_auth.dart new file mode 100644 index 000000000000..eec45cc0e89a --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/lib/extension_google_sign_in_as_googleapis_auth.dart @@ -0,0 +1,36 @@ +// Copyright 2020 The Flutter Authors +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file or at +// https://developers.google.com/open-source/licenses/bsd + +import 'package:meta/meta.dart'; +import 'package:google_sign_in/google_sign_in.dart'; +import 'package:googleapis_auth/auth.dart' as googleapis_auth; +import 'package:http/http.dart' as http; + +/// Extension on [GoogleSignIn] that adds an `authenticatedClient` method. +/// +/// This method can be used to retrieve an authenticated [googleapis_auth.AuthClient] +/// client that can be used with the rest of the `googleapis` libraries. +extension GoogleApisGoogleSignInAuth on GoogleSignIn { + /// Retrieve a `googleapis` authenticated client. + Future authenticatedClient({ + @visibleForTesting GoogleSignInAuthentication debugAuthentication, + @visibleForTesting List debugScopes = const [], + }) async { + final auth = debugAuthentication ?? await currentUser.authentication; + final credentials = googleapis_auth.AccessCredentials( + googleapis_auth.AccessToken( + 'Bearer', + auth.accessToken, + // We don't know when the token expires, so we assume "never" + DateTime.now().toUtc().add(Duration(days: 365)), + ), + null, // We don't have a refreshToken + debugScopes ?? this.scopes, + ); + + return googleapis_auth.authenticatedClient(http.Client(), credentials); + } +} diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/pubspec.yaml b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/pubspec.yaml new file mode 100644 index 000000000000..f94b5e505946 --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/pubspec.yaml @@ -0,0 +1,28 @@ +# Copyright 2020 The Flutter Authors +# +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file or at +# https://developers.google.com/open-source/licenses/bsd + +name: extension_google_sign_in_as_googleapis_auth +description: A bridge package between google_sign_in and googleapis_auth, to create Authenticated Clients from google_sign_in user credentials. +version: 1.0.0 +homepage: https://github.com/flutter/plugins/google_sign_in/extension_google_sign_in_as_googleapis_auth + +dependencies: + flutter: + sdk: flutter + google_sign_in: ^4.4.1 + googleapis_auth: ^0.2.11+1 + meta: ^1.1.8 + http: ^0.12.1 + +dev_dependencies: + mockito: ^4.1.1 + pedantic: ^1.9.0 + flutter_test: + sdk: flutter + +environment: + sdk: ">=2.7.0 <3.0.0" + flutter: ">=1.12.13+hotfix.4 <2.0.0" diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/test/extension_google_sign_in_as_googleapis_auth_test.dart b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/test/extension_google_sign_in_as_googleapis_auth_test.dart new file mode 100644 index 000000000000..9f86703d4bb8 --- /dev/null +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/test/extension_google_sign_in_as_googleapis_auth_test.dart @@ -0,0 +1,46 @@ +// Copyright 2020 The Flutter Authors +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file or at +// https://developers.google.com/open-source/licenses/bsd + +import 'package:google_sign_in/google_sign_in.dart'; +import 'package:googleapis_auth/auth.dart' as auth; +import 'package:extension_google_sign_in_as_googleapis_auth/extension_google_sign_in_as_googleapis_auth.dart'; +import 'package:mockito/mockito.dart'; +import 'package:flutter_test/flutter_test.dart'; + +// Mocks so I don't have to prepare all the GoogleSignIn environment. +class MockGoogleSignIn extends Mock implements GoogleSignIn {} + +class MockGoogleSignInAuthentication extends Mock + implements GoogleSignInAuthentication {} + +const SOME_FAKE_ACCESS_TOKEN = 'this-is-something-not-null'; +const SOME_FAKE_SCOPES = ['some-scope', 'another-scope']; + +void main() { + GoogleSignIn signIn = MockGoogleSignIn(); + final authMock = MockGoogleSignInAuthentication(); + + setUp(() { + when(authMock.accessToken).thenReturn(SOME_FAKE_ACCESS_TOKEN); + }); + + test('authenticatedClient returns an authenticated client', () async { + final client = await signIn.authenticatedClient( + debugAuthentication: authMock, + ); + expect(client, isA()); + }); + + test('authenticatedClient returned client contains the passed-in credentials', + () async { + final client = await signIn.authenticatedClient( + debugAuthentication: authMock, + debugScopes: SOME_FAKE_SCOPES, + ); + expect(client.credentials.accessToken.data, equals(SOME_FAKE_ACCESS_TOKEN)); + expect(client.credentials.scopes, equals(SOME_FAKE_SCOPES)); + }); +} diff --git a/script/build_all_plugins_app.sh b/script/build_all_plugins_app.sh index 961cecce7903..f1f68ddbe985 100755 --- a/script/build_all_plugins_app.sh +++ b/script/build_all_plugins_app.sh @@ -14,6 +14,7 @@ readonly EXCLUDED_PLUGINS_LIST=( "connectivity_macos" "connectivity_platform_interface" "connectivity_web" + "extension_google_sign_in_as_googleapis_auth" "flutter_plugin_android_lifecycle" "google_maps_flutter_platform_interface" "google_maps_flutter_web" From fbd65101596d31e30b6b521d4e79861e7ccc6a93 Mon Sep 17 00:00:00 2001 From: "Ming Lyu (CareF)" Date: Wed, 15 Jul 2020 22:21:34 -0400 Subject: [PATCH 018/233] [e2e] add support to report extra information (#2873) * add extra info report --- packages/e2e/CHANGELOG.md | 4 ++ packages/e2e/lib/common.dart | 19 ++++-- packages/e2e/lib/e2e.dart | 60 ++++++++++++------- packages/e2e/pubspec.yaml | 4 +- packages/e2e/test/binding_test.dart | 41 +++++++++++++ .../e2e/test/response_serialization_test.dart | 47 +++++++++++++++ 6 files changed, 144 insertions(+), 31 deletions(-) create mode 100644 packages/e2e/test/binding_test.dart create mode 100644 packages/e2e/test/response_serialization_test.dart diff --git a/packages/e2e/CHANGELOG.md b/packages/e2e/CHANGELOG.md index ad2f8d3e24f0..255d7ce08c2d 100644 --- a/packages/e2e/CHANGELOG.md +++ b/packages/e2e/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.6.1 + +* Added `data` in the reported json. + ## 0.6.0 * **Breaking change** `E2EPlugin` exports a `Future` for `testResults`. diff --git a/packages/e2e/lib/common.dart b/packages/e2e/lib/common.dart index 39efcc867704..4325b6555ba8 100644 --- a/packages/e2e/lib/common.dart +++ b/packages/e2e/lib/common.dart @@ -11,13 +11,17 @@ class Response { final bool _allTestsPassed; + /// The extra information to be added along side the test result. + Map data; + /// Constructor to use for positive response. - Response.allTestsPassed() + Response.allTestsPassed({this.data}) : this._allTestsPassed = true, this._failureDetails = null; /// Constructor for failure response. - Response.someTestsFailed(this._failureDetails) : this._allTestsPassed = false; + Response.someTestsFailed(this._failureDetails, {this.data}) + : this._allTestsPassed = false; /// Whether the test ran successfully or not. bool get allTestsPassed => _allTestsPassed; @@ -33,16 +37,19 @@ class Response { String toJson() => json.encode({ 'result': allTestsPassed.toString(), 'failureDetails': _failureDetailsAsString(), + if (data != null) 'data': data }); /// Deserializes the result from JSON. static Response fromJson(String source) { - Map responseJson = json.decode(source); - if (responseJson['result'] == 'true') { - return Response.allTestsPassed(); + final Map responseJson = json.decode(source); + if (responseJson['result'] as String == 'true') { + return Response.allTestsPassed(data: responseJson['data']); } else { return Response.someTestsFailed( - _failureDetailsFromJson(responseJson['failureDetails'])); + _failureDetailsFromJson(responseJson['failureDetails']), + data: responseJson['data'], + ); } } diff --git a/packages/e2e/lib/e2e.dart b/packages/e2e/lib/e2e.dart index ec1615e904b4..a9bf83041e40 100644 --- a/packages/e2e/lib/e2e.dart +++ b/packages/e2e/lib/e2e.dart @@ -78,33 +78,47 @@ class E2EWidgetsFlutterBinding extends LiveTestWidgetsFlutterBinding { static Map _results = {}; + /// The extra data for the reported result. + /// + /// The values in `reportData` must be json-serializable objects or `null`. + /// If it's `null`, no extra data is attached to the result. + /// + /// The default value is `null`. + Map reportData; + + /// the callback function to response the driver side input. + @visibleForTesting + Future> callback(Map params) async { + final String command = params['command']; + Map response; + switch (command) { + case 'request_data': + final bool allTestsPassed = await _allTestsPassed.future; + response = { + 'message': allTestsPassed + ? Response.allTestsPassed(data: reportData).toJson() + : Response.someTestsFailed( + _failureMethodsDetails, + data: reportData, + ).toJson(), + }; + break; + case 'get_health': + response = {'status': 'ok'}; + break; + default: + throw UnimplementedError('$command is not implemented'); + } + return { + 'isError': false, + 'response': response, + }; + } + // Emulates the Flutter driver extension, returning 'pass' or 'fail'. @override void initServiceExtensions() { super.initServiceExtensions(); - Future> callback(Map params) async { - final String command = params['command']; - Map response; - switch (command) { - case 'request_data': - final bool allTestsPassed = await _allTestsPassed.future; - response = { - 'message': allTestsPassed - ? Response.allTestsPassed().toJson() - : Response.someTestsFailed(_failureMethodsDetails).toJson(), - }; - break; - case 'get_health': - response = {'status': 'ok'}; - break; - default: - throw UnimplementedError('$command is not implemented'); - } - return { - 'isError': false, - 'response': response, - }; - } if (kIsWeb) { registerWebServiceExtension(callback); diff --git a/packages/e2e/pubspec.yaml b/packages/e2e/pubspec.yaml index 25eeb3ce1374..70e57d0cb4f7 100644 --- a/packages/e2e/pubspec.yaml +++ b/packages/e2e/pubspec.yaml @@ -1,10 +1,10 @@ name: e2e description: Runs tests that use the flutter_test API as integration tests. -version: 0.6.0 +version: 0.6.1 homepage: https://github.com/flutter/plugins/tree/master/packages/e2e environment: - sdk: ">=2.1.0 <3.0.0" + sdk: ">=2.2.2 <3.0.0" flutter: ">=1.12.13+hotfix.5 <2.0.0" dependencies: diff --git a/packages/e2e/test/binding_test.dart b/packages/e2e/test/binding_test.dart new file mode 100644 index 000000000000..8c97e161b0fe --- /dev/null +++ b/packages/e2e/test/binding_test.dart @@ -0,0 +1,41 @@ +import 'package:flutter/material.dart'; + +import 'package:e2e/e2e.dart'; +import 'package:e2e/common.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() async { + Future> request; + + group('Test E2E binding', () { + final WidgetsBinding binding = E2EWidgetsFlutterBinding.ensureInitialized(); + assert(binding is E2EWidgetsFlutterBinding); + final E2EWidgetsFlutterBinding e2ebinding = + binding as E2EWidgetsFlutterBinding; + + setUp(() { + request = e2ebinding.callback({ + 'command': 'request_data', + }); + }); + + testWidgets('Run E2E app', (WidgetTester tester) async { + runApp(MaterialApp( + home: Text('Test'), + )); + expect(tester.binding, e2ebinding); + e2ebinding.reportData = {'answer': 42}; + }); + }); + + tearDownAll(() async { + // This part is outside the group so that `request` has been compeleted as + // part of the `tearDownAll` registerred in the group during + // `E2EWidgetsFlutterBinding` initialization. + final Map response = + (await request)['response'] as Map; + final String message = response['message'] as String; + Response result = Response.fromJson(message); + assert(result.data['answer'] == 42); + }); +} diff --git a/packages/e2e/test/response_serialization_test.dart b/packages/e2e/test/response_serialization_test.dart new file mode 100644 index 000000000000..4d823e2ebf10 --- /dev/null +++ b/packages/e2e/test/response_serialization_test.dart @@ -0,0 +1,47 @@ +import 'package:flutter_test/flutter_test.dart'; + +import 'package:e2e/common.dart'; + +void main() { + test('Serialize and deserialize Failure', () { + Failure fail = Failure('what a name', 'no detail'); + Failure restored = Failure.fromJsonString(fail.toString()); + expect(restored.methodName, fail.methodName); + expect(restored.details, fail.details); + }); + + test('Serialize and deserialize Response', () { + Response response, restored; + String jsonString; + + response = Response.allTestsPassed(); + jsonString = response.toJson(); + expect(jsonString, '{"result":"true","failureDetails":[]}'); + restored = Response.fromJson(jsonString); + expect(restored.allTestsPassed, response.allTestsPassed); + expect(restored.data, null); + expect(restored.formattedFailureDetails, ''); + + final Failure fail = Failure('what a name', 'no detail'); + final Failure fail2 = Failure('what a name2', 'no detail2'); + response = Response.someTestsFailed([fail, fail2]); + jsonString = response.toJson(); + restored = Response.fromJson(jsonString); + expect(restored.allTestsPassed, response.allTestsPassed); + expect(restored.data, null); + expect(restored.formattedFailureDetails, response.formattedFailureDetails); + + Map data = {'aaa': 'bbb'}; + response = Response.allTestsPassed(data: data); + jsonString = response.toJson(); + restored = Response.fromJson(jsonString); + expect(restored.data.keys, ['aaa']); + expect(restored.data.values, ['bbb']); + + response = Response.someTestsFailed([fail, fail2], data: data); + jsonString = response.toJson(); + restored = Response.fromJson(jsonString); + expect(restored.data.keys, ['aaa']); + expect(restored.data.values, ['bbb']); + }); +} From 7d4a918be3e682104807cc70ba41d6e27a01248e Mon Sep 17 00:00:00 2001 From: Robert Ancell Date: Tue, 21 Jul 2020 16:58:32 +1200 Subject: [PATCH 019/233] [path_provider] Use the application ID in the application support path (#2845) --- .../path_provider_linux/CHANGELOG.md | 4 ++ .../lib/path_provider_linux.dart | 48 +++++++++++++++++-- .../path_provider_linux/pubspec.yaml | 3 +- 3 files changed, 51 insertions(+), 4 deletions(-) diff --git a/packages/path_provider/path_provider_linux/CHANGELOG.md b/packages/path_provider/path_provider_linux/CHANGELOG.md index e0155d3b3e83..2b95b38b9c59 100644 --- a/packages/path_provider/path_provider_linux/CHANGELOG.md +++ b/packages/path_provider/path_provider_linux/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.0 +* This release updates getApplicationSupportPath to use the application ID instead of the executable name. + * No migration is provided, so any older apps that were using this path will now have a different directory. + ## 0.0.1+2 * This release updates the example to depend on the endorsed plugin rather than relative path diff --git a/packages/path_provider/path_provider_linux/lib/path_provider_linux.dart b/packages/path_provider/path_provider_linux/lib/path_provider_linux.dart index 09d2447c0a6c..9441f6ea5f5d 100644 --- a/packages/path_provider/path_provider_linux/lib/path_provider_linux.dart +++ b/packages/path_provider/path_provider_linux/lib/path_provider_linux.dart @@ -3,11 +3,21 @@ // found in the LICENSE file. import 'dart:io'; import 'dart:async'; +import 'dart:ffi'; +import 'package:ffi/ffi.dart'; import 'package:xdg_directories/xdg_directories.dart' as xdg; import 'package:path/path.dart' as path; import 'package:path_provider_platform_interface/path_provider_platform_interface.dart'; +// GApplication* g_application_get_default(); +typedef g_application_get_default_c = IntPtr Function(); +typedef g_application_get_default_dart = int Function(); + +// const gchar* g_application_get_application_id(GApplication* application); +typedef g_application_get_application_id_c = Pointer Function(IntPtr); +typedef g_application_get_application_id_dart = Pointer Function(int); + /// The linux implementation of [PathProviderPlatform] /// /// This class implements the `package:path_provider` functionality for linux @@ -22,11 +32,43 @@ class PathProviderLinux extends PathProviderPlatform { return Future.value("/tmp"); } + // Gets the application ID set in GApplication. + String _getApplicationId() { + DynamicLibrary gio; + try { + gio = DynamicLibrary.open('libgio-2.0.so'); + } on ArgumentError { + return null; + } + var g_application_get_default = gio.lookupFunction< + g_application_get_default_c, + g_application_get_default_dart>('g_application_get_default'); + var app = g_application_get_default(); + if (app == 0) return null; + + var g_application_get_application_id = gio.lookupFunction< + g_application_get_application_id_c, + g_application_get_application_id_dart>( + 'g_application_get_application_id'); + var app_id = g_application_get_application_id(app); + if (app_id == null) return null; + + return Utf8.fromUtf8(app_id); + } + + // Gets the unique ID for this application. + Future _getId() async { + var appId = _getApplicationId(); + if (appId != null) return appId; + + // Fall back to using the executable name. + return path.basenameWithoutExtension( + await File('/proc/self/exe').resolveSymbolicLinks()); + } + @override Future getApplicationSupportPath() async { - final processName = path.basenameWithoutExtension( - await File('/proc/self/exe').resolveSymbolicLinks()); - final directory = Directory(path.join(xdg.dataHome.path, processName)); + final directory = Directory(path.join(xdg.dataHome.path, await _getId())); // Creating the directory if it doesn't exist, because mobile implementations assume the directory exists if (!await directory.exists()) { await directory.create(recursive: true); diff --git a/packages/path_provider/path_provider_linux/pubspec.yaml b/packages/path_provider/path_provider_linux/pubspec.yaml index 67c4ae6ae943..a6d48bfa59aa 100644 --- a/packages/path_provider/path_provider_linux/pubspec.yaml +++ b/packages/path_provider/path_provider_linux/pubspec.yaml @@ -1,6 +1,6 @@ name: path_provider_linux description: linux implementation of the path_provider plugin -version: 0.0.1+2 +version: 0.1.0 homepage: https://github.com/flutter/plugins/tree/master/packages/path_provider/path_provider_linux flutter: @@ -15,6 +15,7 @@ environment: flutter: ">=1.10.0 <2.0.0" dependencies: + ffi: ^0.1.3 path: ^1.6.4 xdg_directories: ^0.1.0 path_provider_platform_interface: ^1.0.1 From 7434e41fd032d5e2ab8749106e87e8003306c3aa Mon Sep 17 00:00:00 2001 From: Dan Field Date: Fri, 24 Jul 2020 14:42:04 -0700 Subject: [PATCH 020/233] Revert "[path_provider] Use the application ID in the application support path" (#2896) * Revert "[path_provider] Use the application ID in the application support path (#2845)" This reverts commit 7d4a918be3e682104807cc70ba41d6e27a01248e. * bump version to satisfy the machine. Also fix linting issue caught because of changes in this folder. --- .../path_provider/path_provider/CHANGELOG.md | 4 ++ .../androidTest/java/MainActivityTest.java | 2 +- .../path_provider/path_provider/pubspec.yaml | 2 +- .../path_provider_linux/CHANGELOG.md | 8 +++- .../lib/path_provider_linux.dart | 48 ++----------------- .../path_provider_linux/pubspec.yaml | 3 +- 6 files changed, 16 insertions(+), 51 deletions(-) diff --git a/packages/path_provider/path_provider/CHANGELOG.md b/packages/path_provider/path_provider/CHANGELOG.md index 226d9ae01d0c..07c82ca83b2a 100644 --- a/packages/path_provider/path_provider/CHANGELOG.md +++ b/packages/path_provider/path_provider/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.6.12 + +* Fixed a Java lint in a test. + ## 1.6.11 * Updated documentation to reflect the need for changes in testing for federated plugins diff --git a/packages/path_provider/path_provider/example/android/app/src/androidTest/java/MainActivityTest.java b/packages/path_provider/path_provider/example/android/app/src/androidTest/java/MainActivityTest.java index 25ee8d8fcdc0..5c37b59bf25a 100644 --- a/packages/path_provider/path_provider/example/android/app/src/androidTest/java/MainActivityTest.java +++ b/packages/path_provider/path_provider/example/android/app/src/androidTest/java/MainActivityTest.java @@ -8,7 +8,7 @@ import org.junit.runner.RunWith; @RunWith(FlutterRunner.class) -public class FlutterActivityTest { +public class MainActivityTest { @Rule public ActivityTestRule rule = new ActivityTestRule<>(FlutterActivity.class); } diff --git a/packages/path_provider/path_provider/pubspec.yaml b/packages/path_provider/path_provider/pubspec.yaml index d83911ddc2a8..db2da41d40c2 100644 --- a/packages/path_provider/path_provider/pubspec.yaml +++ b/packages/path_provider/path_provider/pubspec.yaml @@ -2,7 +2,7 @@ name: path_provider description: Flutter plugin for getting commonly used locations on the Android & iOS file systems, such as the temp and app data directories. homepage: https://github.com/flutter/plugins/tree/master/packages/path_provider/path_provider -version: 1.6.11 +version: 1.6.12 flutter: plugin: diff --git a/packages/path_provider/path_provider_linux/CHANGELOG.md b/packages/path_provider/path_provider_linux/CHANGELOG.md index 2b95b38b9c59..baec603b426f 100644 --- a/packages/path_provider/path_provider_linux/CHANGELOG.md +++ b/packages/path_provider/path_provider_linux/CHANGELOG.md @@ -1,4 +1,8 @@ -## 0.1.0 +## 0.1.1 - NOT PUBLISHED +* Reverts changes on 0.1.0, which broke the tree. + + +## 0.1.0 - NOT PUBLISHED * This release updates getApplicationSupportPath to use the application ID instead of the executable name. * No migration is provided, so any older apps that were using this path will now have a different directory. @@ -11,4 +15,4 @@ ## 0.0.1 * The initial implementation of path_provider for Linux * Implements getApplicationSupportPath, getApplicationDocumentsPath, getDownloadsPath, and getTemporaryPath - + diff --git a/packages/path_provider/path_provider_linux/lib/path_provider_linux.dart b/packages/path_provider/path_provider_linux/lib/path_provider_linux.dart index 9441f6ea5f5d..09d2447c0a6c 100644 --- a/packages/path_provider/path_provider_linux/lib/path_provider_linux.dart +++ b/packages/path_provider/path_provider_linux/lib/path_provider_linux.dart @@ -3,21 +3,11 @@ // found in the LICENSE file. import 'dart:io'; import 'dart:async'; -import 'dart:ffi'; -import 'package:ffi/ffi.dart'; import 'package:xdg_directories/xdg_directories.dart' as xdg; import 'package:path/path.dart' as path; import 'package:path_provider_platform_interface/path_provider_platform_interface.dart'; -// GApplication* g_application_get_default(); -typedef g_application_get_default_c = IntPtr Function(); -typedef g_application_get_default_dart = int Function(); - -// const gchar* g_application_get_application_id(GApplication* application); -typedef g_application_get_application_id_c = Pointer Function(IntPtr); -typedef g_application_get_application_id_dart = Pointer Function(int); - /// The linux implementation of [PathProviderPlatform] /// /// This class implements the `package:path_provider` functionality for linux @@ -32,43 +22,11 @@ class PathProviderLinux extends PathProviderPlatform { return Future.value("/tmp"); } - // Gets the application ID set in GApplication. - String _getApplicationId() { - DynamicLibrary gio; - try { - gio = DynamicLibrary.open('libgio-2.0.so'); - } on ArgumentError { - return null; - } - var g_application_get_default = gio.lookupFunction< - g_application_get_default_c, - g_application_get_default_dart>('g_application_get_default'); - var app = g_application_get_default(); - if (app == 0) return null; - - var g_application_get_application_id = gio.lookupFunction< - g_application_get_application_id_c, - g_application_get_application_id_dart>( - 'g_application_get_application_id'); - var app_id = g_application_get_application_id(app); - if (app_id == null) return null; - - return Utf8.fromUtf8(app_id); - } - - // Gets the unique ID for this application. - Future _getId() async { - var appId = _getApplicationId(); - if (appId != null) return appId; - - // Fall back to using the executable name. - return path.basenameWithoutExtension( - await File('/proc/self/exe').resolveSymbolicLinks()); - } - @override Future getApplicationSupportPath() async { - final directory = Directory(path.join(xdg.dataHome.path, await _getId())); + final processName = path.basenameWithoutExtension( + await File('/proc/self/exe').resolveSymbolicLinks()); + final directory = Directory(path.join(xdg.dataHome.path, processName)); // Creating the directory if it doesn't exist, because mobile implementations assume the directory exists if (!await directory.exists()) { await directory.create(recursive: true); diff --git a/packages/path_provider/path_provider_linux/pubspec.yaml b/packages/path_provider/path_provider_linux/pubspec.yaml index a6d48bfa59aa..b0188fd2a4c7 100644 --- a/packages/path_provider/path_provider_linux/pubspec.yaml +++ b/packages/path_provider/path_provider_linux/pubspec.yaml @@ -1,6 +1,6 @@ name: path_provider_linux description: linux implementation of the path_provider plugin -version: 0.1.0 +version: 0.1.1 homepage: https://github.com/flutter/plugins/tree/master/packages/path_provider/path_provider_linux flutter: @@ -15,7 +15,6 @@ environment: flutter: ">=1.10.0 <2.0.0" dependencies: - ffi: ^0.1.3 path: ^1.6.4 xdg_directories: ^0.1.0 path_provider_platform_interface: ^1.0.1 From 116b37dd4ad59aebec39ed7ea18b6b96205fec07 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Fri, 24 Jul 2020 16:00:02 -0700 Subject: [PATCH 021/233] Make package:e2e a relative reference (#2889) * Make package:e2e a relative reference --- packages/android_alarm_manager/CHANGELOG.md | 5 +++ .../example/pubspec.yaml | 3 +- .../android_alarm_manager_e2e_test.dart | 10 ++++-- .../EmbeddingV1ActivityTest.java | 4 +-- .../MainActivityTest.java | 4 +-- packages/android_intent/example/pubspec.yaml | 3 +- .../test_driver/android_intent_e2e_test.dart | 10 ++++-- packages/battery/CHANGELOG.md | 5 +++ .../battery/EmbedderV1ActivityTest.java | 4 +-- .../plugins/battery/FlutterActivityTest.java | 4 +-- packages/battery/example/pubspec.yaml | 3 +- packages/battery/pubspec.yaml | 5 +-- .../EmbeddingV1ActivityTest.java | 4 +-- .../cameraexample/FlutterActivityTest.java | 4 +-- packages/camera/example/pubspec.yaml | 3 +- .../example/test_driver/camera_e2e_test.dart | 11 ++++-- .../connectivity/connectivity/CHANGELOG.md | 5 +++ .../EmbeddingV1ActivityTest.java | 4 +-- .../FlutterActivityTest.java | 4 +-- .../connectivity/example/pubspec.yaml | 3 +- .../test/connectivity_e2e_test.dart | 6 ++-- .../connectivity/connectivity/pubspec.yaml | 5 +-- .../connectivity_for_web/CHANGELOG.md | 5 +++ .../connectivity_for_web/pubspec.yaml | 5 +-- .../connectivity_for_web/test/pubspec.yaml | 7 ++-- .../connectivity_macos/CHANGELOG.md | 5 +++ .../EmbeddingV1ActivityTest.java | 4 +-- .../FlutterActivityTest.java | 4 +-- .../connectivity_macos/example/pubspec.yaml | 3 +- .../test/connectivity_e2e_test.dart | 6 ++-- packages/device_info/CHANGELOG.md | 5 +++ .../EmbeddingV1ActivityTest.java | 4 +-- packages/device_info/example/pubspec.yaml | 3 +- .../test_driver/device_info_e2e_test.dart | 6 ++-- packages/device_info/pubspec.yaml | 3 +- packages/e2e/CHANGELOG.md | 4 +++ packages/e2e/lib/e2e.dart | 28 +++++++++++++-- packages/e2e/pubspec.yaml | 2 +- packages/e2e/test/binding_test.dart | 34 ++++++++++++++++--- .../EmbeddingV1ActivityTest.java | 4 +-- .../MainActivityTest.java | 4 +-- .../example/pubspec.yaml | 3 +- .../googlemaps/EmbeddingV1ActivityTest.java | 4 +-- .../plugins/googlemaps/MainActivityTest.java | 4 +-- .../google_maps_flutter/example/pubspec.yaml | 5 +-- .../example/test_driver/google_maps_e2e.dart | 3 ++ .../test_driver/google_maps_e2e_test.dart | 6 ++-- .../EmbeddingV1ActivityTest.java | 4 +-- .../FlutterActivityTest.java | 4 +-- .../example/pubspec.yaml | 3 +- .../google_sign_in/CHANGELOG.md | 5 +++ .../EmbeddingV1ActivityTest.java | 4 +-- .../FlutterActivityTest.java | 4 +-- .../google_sign_in/example/pubspec.yaml | 3 +- .../google_sign_in/pubspec.yaml | 5 +-- .../test_driver/google_sign_in_e2e_test.dart | 6 ++-- .../google_sign_in_web/CHANGELOG.md | 5 +++ .../google_sign_in_web/pubspec.yaml | 2 +- .../image_picker/image_picker/CHANGELOG.md | 6 ++++ .../EmbeddingV1ActivityTest.java | 4 +-- .../FlutterActivityTest.java | 4 +-- .../image_picker/example/pubspec.yaml | 3 +- .../test/image_picker_e2e_test.dart | 6 ++-- .../image_picker/image_picker/pubspec.yaml | 5 +-- packages/in_app_purchase/CHANGELOG.md | 5 +++ .../EmbeddingV1ActivityTest.java | 4 +-- .../FlutterActivityTest.java | 4 +-- packages/in_app_purchase/example/pubspec.yaml | 3 +- .../test/in_app_purchase_e2e_test.dart | 8 +++-- packages/in_app_purchase/pubspec.yaml | 5 +-- packages/local_auth/CHANGELOG.md | 5 +++ .../localauth/EmbeddingV1ActivityTest.java | 4 +-- .../plugins/localauth/MainActivityTest.java | 4 +-- packages/local_auth/example/pubspec.yaml | 3 +- packages/local_auth/pubspec.yaml | 5 +-- packages/package_info/CHANGELOG.md | 5 +++ .../EmbedderV1ActivityTest.java | 4 +-- .../packageinfoexample/MainActivityTest.java | 4 +-- packages/package_info/example/pubspec.yaml | 3 +- .../test_driver/package_info_e2e_test.dart | 10 ++++-- packages/package_info/pubspec.yaml | 5 +-- .../path_provider/path_provider/CHANGELOG.md | 7 ++++ .../java/EmbeddingV1ActivityTest.java | 4 +-- .../androidTest/java/MainActivityTest.java | 4 +-- .../path_provider/example/pubspec.yaml | 3 +- .../test_driver/path_provider_e2e_test.dart | 6 ++-- .../path_provider/path_provider/pubspec.yaml | 5 +-- .../path_provider_linux/example/pubspec.yaml | 3 +- .../test_driver/path_provider_e2e_test.dart | 6 ++-- .../java/EmbeddingV1ActivityTest.java | 4 +-- .../androidTest/java/MainActivityTest.java | 4 +-- .../path_provider_macos/example/pubspec.yaml | 3 +- .../test_driver/path_provider_e2e_test.dart | 6 ++-- packages/quick_actions/CHANGELOG.md | 5 +++ .../EmbeddingV1ActivityTest.java | 4 +-- .../FlutterActivityTest.java | 4 +-- packages/quick_actions/example/pubspec.yaml | 3 +- .../test_driver/quick_actions_e2e_test.dart | 6 ++-- packages/quick_actions/pubspec.yaml | 5 +-- packages/sensors/CHANGELOG.md | 5 +++ .../EmbeddingV1ActivityTest.java | 4 +-- .../sensorsexample/FlutterActivityTest.java | 4 +-- packages/sensors/example/pubspec.yaml | 3 +- .../test_driver/test/sensors_e2e_test.dart | 6 ++-- packages/sensors/pubspec.yaml | 5 +-- packages/share/CHANGELOG.md | 5 +++ .../shareexample/EmbeddingV1ActivityTest.java | 4 +-- .../shareexample/FlutterActivityTest.java | 4 +-- packages/share/example/pubspec.yaml | 5 +-- .../test_driver/test/share_e2e_test.dart | 6 ++-- packages/share/pubspec.yaml | 5 +-- .../shared_preferences/CHANGELOG.md | 5 +++ .../EmbeddingV1ActivityTest.java | 4 +-- .../FlutterActivityTest.java | 4 +-- .../shared_preferences/example/pubspec.yaml | 3 +- .../shared_preferences_e2e_test.dart | 6 ++-- .../shared_preferences/pubspec.yaml | 5 +-- .../example/pubspec.yaml | 3 +- .../shared_preferences_e2e_test.dart | 6 ++-- .../example/pubspec.yaml | 3 +- .../shared_preferences_e2e_test.dart | 6 ++-- .../EmbeddingV1ActivityTest.java | 4 +-- .../urllauncherexample/MainActivityTest.java | 4 +-- .../url_launcher/example/pubspec.yaml | 3 +- .../test_driver/url_launcher_e2e_test.dart | 8 +++-- .../url_launcher_linux/example/pubspec.yaml | 3 +- .../test_driver/url_launcher_e2e_test.dart | 8 +++-- .../EmbeddingV1ActivityTest.java | 4 +-- .../FlutterActivityTest.java | 4 +-- .../url_launcher_macos/example/pubspec.yaml | 3 +- .../test_driver/url_launcher_e2e_test.dart | 8 +++-- .../video_player/example/pubspec.yaml | 3 +- .../test_driver/video_player_e2e_test.dart | 6 ++-- packages/webview_flutter/CHANGELOG.md | 5 +++ .../EmbeddingV1ActivityTest.java | 4 +-- .../MainActivityTest.java | 4 +-- packages/webview_flutter/example/pubspec.yaml | 3 +- .../test_driver/webview_flutter_e2e_test.dart | 7 ++-- packages/webview_flutter/pubspec.yaml | 2 +- 139 files changed, 470 insertions(+), 220 deletions(-) diff --git a/packages/android_alarm_manager/CHANGELOG.md b/packages/android_alarm_manager/CHANGELOG.md index 689429dc08f2..faa2c731873d 100644 --- a/packages/android_alarm_manager/CHANGELOG.md +++ b/packages/android_alarm_manager/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.4.5+12 + +* Update package:e2e reference to use the local version in the flutter/plugins + repository. + ## 0.4.5+11 * Update lower bound of dart dependency to 2.1.0. diff --git a/packages/android_alarm_manager/example/pubspec.yaml b/packages/android_alarm_manager/example/pubspec.yaml index 2fc191881c10..c4d698bdde14 100644 --- a/packages/android_alarm_manager/example/pubspec.yaml +++ b/packages/android_alarm_manager/example/pubspec.yaml @@ -7,7 +7,8 @@ dependencies: android_alarm_manager: path: ../ shared_preferences: ^0.5.6 - e2e: 0.3.0 + e2e: + path: ../../e2e path_provider: ^1.3.1 dev_dependencies: diff --git a/packages/android_alarm_manager/example/test_driver/android_alarm_manager_e2e_test.dart b/packages/android_alarm_manager/example/test_driver/android_alarm_manager_e2e_test.dart index eea5e8abc15f..4e32b483f8d7 100644 --- a/packages/android_alarm_manager/example/test_driver/android_alarm_manager_e2e_test.dart +++ b/packages/android_alarm_manager/example/test_driver/android_alarm_manager_e2e_test.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:async'; +import 'dart:convert'; import 'dart:io'; import 'package:flutter_driver/flutter_driver.dart'; @@ -33,9 +34,12 @@ Future main() async { // for this plugin will need to be resumed for the test to pass. final StreamSubscription subscription = await resumeIsolatesOnPause(driver); - final String result = - await driver.requestData(null, timeout: const Duration(minutes: 5)); + final String data = await driver.requestData( + null, + timeout: const Duration(minutes: 1), + ); await driver.close(); await subscription.cancel(); - exit(result == 'pass' ? 0 : 1); + final Map result = jsonDecode(data); + exit(result['result'] == 'true' ? 0 : 1); } diff --git a/packages/android_intent/example/android/app/src/androidTestDebug/java/io/flutter/plugins/androidintentexample/EmbeddingV1ActivityTest.java b/packages/android_intent/example/android/app/src/androidTestDebug/java/io/flutter/plugins/androidintentexample/EmbeddingV1ActivityTest.java index db000f0f995c..f239ae88e5d1 100644 --- a/packages/android_intent/example/android/app/src/androidTestDebug/java/io/flutter/plugins/androidintentexample/EmbeddingV1ActivityTest.java +++ b/packages/android_intent/example/android/app/src/androidTestDebug/java/io/flutter/plugins/androidintentexample/EmbeddingV1ActivityTest.java @@ -1,11 +1,11 @@ package io.flutter.plugins.androidintentexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class EmbeddingV1ActivityTest { @Rule public ActivityTestRule rule = diff --git a/packages/android_intent/example/android/app/src/androidTestDebug/java/io/flutter/plugins/androidintentexample/MainActivityTest.java b/packages/android_intent/example/android/app/src/androidTestDebug/java/io/flutter/plugins/androidintentexample/MainActivityTest.java index d390dcd74997..5352e447ee3e 100644 --- a/packages/android_intent/example/android/app/src/androidTestDebug/java/io/flutter/plugins/androidintentexample/MainActivityTest.java +++ b/packages/android_intent/example/android/app/src/androidTestDebug/java/io/flutter/plugins/androidintentexample/MainActivityTest.java @@ -1,11 +1,11 @@ package io.flutter.plugins.androidintentexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class MainActivityTest { @Rule public ActivityTestRule rule = new ActivityTestRule<>(MainActivity.class); } diff --git a/packages/android_intent/example/pubspec.yaml b/packages/android_intent/example/pubspec.yaml index 22ff833f8198..325a4c54ee5f 100644 --- a/packages/android_intent/example/pubspec.yaml +++ b/packages/android_intent/example/pubspec.yaml @@ -8,7 +8,8 @@ dependencies: path: ../ dev_dependencies: - e2e: "^0.2.1" + e2e: + path: ../../e2e flutter_driver: sdk: flutter pedantic: ^1.8.0 diff --git a/packages/android_intent/example/test_driver/android_intent_e2e_test.dart b/packages/android_intent/example/test_driver/android_intent_e2e_test.dart index 6147d44df2ec..34483b996049 100644 --- a/packages/android_intent/example/test_driver/android_intent_e2e_test.dart +++ b/packages/android_intent/example/test_driver/android_intent_e2e_test.dart @@ -1,12 +1,16 @@ import 'dart:async'; +import 'dart:convert'; import 'dart:io'; import 'package:flutter_driver/flutter_driver.dart'; Future main() async { final FlutterDriver driver = await FlutterDriver.connect(); - final String result = - await driver.requestData(null, timeout: const Duration(minutes: 1)); + final String data = await driver.requestData( + null, + timeout: const Duration(minutes: 1), + ); await driver.close(); - exit(result == 'pass' ? 0 : 1); + final Map result = jsonDecode(data); + exit(result['result'] == 'true' ? 0 : 1); } diff --git a/packages/battery/CHANGELOG.md b/packages/battery/CHANGELOG.md index 2229fb13f291..7b948981d3f0 100644 --- a/packages/battery/CHANGELOG.md +++ b/packages/battery/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.0.2 + +* Update package:e2e reference to use the local version in the flutter/plugins + repository. + ## 1.0.1 * Update lower bound of dart dependency to 2.1.0. diff --git a/packages/battery/example/android/app/src/androidTest/java/io/flutter/plugins/battery/EmbedderV1ActivityTest.java b/packages/battery/example/android/app/src/androidTest/java/io/flutter/plugins/battery/EmbedderV1ActivityTest.java index ef6e5d9fe246..40fedbb889ba 100644 --- a/packages/battery/example/android/app/src/androidTest/java/io/flutter/plugins/battery/EmbedderV1ActivityTest.java +++ b/packages/battery/example/android/app/src/androidTest/java/io/flutter/plugins/battery/EmbedderV1ActivityTest.java @@ -5,11 +5,11 @@ package io.flutter.plugins.batteryexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class EmbedderV1ActivityTest { @Rule public ActivityTestRule rule = diff --git a/packages/battery/example/android/app/src/androidTest/java/io/flutter/plugins/battery/FlutterActivityTest.java b/packages/battery/example/android/app/src/androidTest/java/io/flutter/plugins/battery/FlutterActivityTest.java index 1986d0a55c32..88aade36d064 100644 --- a/packages/battery/example/android/app/src/androidTest/java/io/flutter/plugins/battery/FlutterActivityTest.java +++ b/packages/battery/example/android/app/src/androidTest/java/io/flutter/plugins/battery/FlutterActivityTest.java @@ -5,12 +5,12 @@ package io.flutter.plugins.batteryexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class FlutterActivityTest { @Rule public ActivityTestRule rule = new ActivityTestRule<>(FlutterActivity.class); diff --git a/packages/battery/example/pubspec.yaml b/packages/battery/example/pubspec.yaml index 0788d02a9431..d0ef82ea071a 100644 --- a/packages/battery/example/pubspec.yaml +++ b/packages/battery/example/pubspec.yaml @@ -10,7 +10,8 @@ dependencies: dev_dependencies: flutter_driver: sdk: flutter - e2e: ^0.2.1 + e2e: + path: ../../e2e pedantic: ^1.8.0 flutter: diff --git a/packages/battery/pubspec.yaml b/packages/battery/pubspec.yaml index 6ad8fcfad97a..487ee5b800ac 100644 --- a/packages/battery/pubspec.yaml +++ b/packages/battery/pubspec.yaml @@ -2,7 +2,7 @@ name: battery description: Flutter plugin for accessing information about the battery state (full, charging, discharging) on Android and iOS. homepage: https://github.com/flutter/plugins/tree/master/packages/battery -version: 1.0.1 +version: 1.0.2 flutter: plugin: @@ -24,7 +24,8 @@ dev_dependencies: mockito: 3.0.0 flutter_test: sdk: flutter - e2e: ^0.2.1 + e2e: + path: ../e2e pedantic: ^1.8.0 environment: diff --git a/packages/camera/example/android/app/src/androidTestDebug/java/io/flutter/plugins/cameraexample/EmbeddingV1ActivityTest.java b/packages/camera/example/android/app/src/androidTestDebug/java/io/flutter/plugins/cameraexample/EmbeddingV1ActivityTest.java index 95b5f4373b62..fd947a03f1b0 100644 --- a/packages/camera/example/android/app/src/androidTestDebug/java/io/flutter/plugins/cameraexample/EmbeddingV1ActivityTest.java +++ b/packages/camera/example/android/app/src/androidTestDebug/java/io/flutter/plugins/cameraexample/EmbeddingV1ActivityTest.java @@ -1,11 +1,11 @@ package io.flutter.plugins.cameraexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class EmbeddingV1ActivityTest { @Rule public ActivityTestRule rule = diff --git a/packages/camera/example/android/app/src/androidTestDebug/java/io/flutter/plugins/cameraexample/FlutterActivityTest.java b/packages/camera/example/android/app/src/androidTestDebug/java/io/flutter/plugins/cameraexample/FlutterActivityTest.java index 474e3b7e19c6..e5eff70941fd 100644 --- a/packages/camera/example/android/app/src/androidTestDebug/java/io/flutter/plugins/cameraexample/FlutterActivityTest.java +++ b/packages/camera/example/android/app/src/androidTestDebug/java/io/flutter/plugins/cameraexample/FlutterActivityTest.java @@ -1,12 +1,12 @@ package io.flutter.plugins.cameraexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class FlutterActivityTest { @Rule public ActivityTestRule rule = new ActivityTestRule<>(FlutterActivity.class); diff --git a/packages/camera/example/pubspec.yaml b/packages/camera/example/pubspec.yaml index a066129eebd4..cbd0adc8a61c 100644 --- a/packages/camera/example/pubspec.yaml +++ b/packages/camera/example/pubspec.yaml @@ -8,7 +8,8 @@ dependencies: flutter: sdk: flutter video_player: ^0.10.0 - e2e: "^0.2.0" + e2e: + path: ../../e2e dev_dependencies: flutter_test: diff --git a/packages/camera/example/test_driver/camera_e2e_test.dart b/packages/camera/example/test_driver/camera_e2e_test.dart index 4963854dea72..1e6e3ba7941f 100644 --- a/packages/camera/example/test_driver/camera_e2e_test.dart +++ b/packages/camera/example/test_driver/camera_e2e_test.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:convert'; import 'dart:io'; import 'package:flutter_driver/flutter_driver.dart'; @@ -33,8 +34,10 @@ Future main() async { ]); print('Starting test.'); final FlutterDriver driver = await FlutterDriver.connect(); - final String result = - await driver.requestData(null, timeout: const Duration(minutes: 1)); + final String data = await driver.requestData( + null, + timeout: const Duration(minutes: 1), + ); await driver.close(); print('Test finished. Revoking camera permissions...'); Process.runSync('adb', [ @@ -51,5 +54,7 @@ Future main() async { _examplePackage, 'android.permission.RECORD_AUDIO' ]); - exit(result == 'pass' ? 0 : 1); + + final Map result = jsonDecode(data); + exit(result['result'] == 'true' ? 0 : 1); } diff --git a/packages/connectivity/connectivity/CHANGELOG.md b/packages/connectivity/connectivity/CHANGELOG.md index 3bb777104c0e..9cecf8cd1489 100644 --- a/packages/connectivity/connectivity/CHANGELOG.md +++ b/packages/connectivity/connectivity/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.4.9+1 + +* Update package:e2e reference to use the local version in the flutter/plugins + repository. + ## 0.4.9 * Add support for `web` (by endorsing `connectivity_for_web` 0.3.0) diff --git a/packages/connectivity/connectivity/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/EmbeddingV1ActivityTest.java b/packages/connectivity/connectivity/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/EmbeddingV1ActivityTest.java index a34755399117..edd544d5f6ea 100644 --- a/packages/connectivity/connectivity/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/EmbeddingV1ActivityTest.java +++ b/packages/connectivity/connectivity/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/EmbeddingV1ActivityTest.java @@ -5,11 +5,11 @@ package io.flutter.plugins.connectivityexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class EmbeddingV1ActivityTest { @Rule public ActivityTestRule rule = diff --git a/packages/connectivity/connectivity/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/FlutterActivityTest.java b/packages/connectivity/connectivity/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/FlutterActivityTest.java index 35391fd5e0a0..0b0ee94c77b9 100644 --- a/packages/connectivity/connectivity/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/FlutterActivityTest.java +++ b/packages/connectivity/connectivity/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/FlutterActivityTest.java @@ -5,12 +5,12 @@ package io.flutter.plugins.connectivityexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class FlutterActivityTest { @Rule public ActivityTestRule rule = new ActivityTestRule<>(FlutterActivity.class); diff --git a/packages/connectivity/connectivity/example/pubspec.yaml b/packages/connectivity/connectivity/example/pubspec.yaml index a16e60442736..fb8ba621af2a 100644 --- a/packages/connectivity/connectivity/example/pubspec.yaml +++ b/packages/connectivity/connectivity/example/pubspec.yaml @@ -11,7 +11,8 @@ dev_dependencies: flutter_driver: sdk: flutter test: any - e2e: ^0.2.0 + e2e: + path: ../../../e2e pedantic: ^1.8.0 flutter: diff --git a/packages/connectivity/connectivity/example/test_driver/test/connectivity_e2e_test.dart b/packages/connectivity/connectivity/example/test_driver/test/connectivity_e2e_test.dart index 84b7ae6a47ab..c0cbdcab2fb6 100644 --- a/packages/connectivity/connectivity/example/test_driver/test/connectivity_e2e_test.dart +++ b/packages/connectivity/connectivity/example/test_driver/test/connectivity_e2e_test.dart @@ -2,13 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'dart:convert'; import 'dart:io'; import 'package:flutter_driver/flutter_driver.dart'; Future main() async { final FlutterDriver driver = await FlutterDriver.connect(); - final String result = + final String data = await driver.requestData(null, timeout: const Duration(minutes: 1)); await driver.close(); - exit(result == 'pass' ? 0 : 1); + final Map result = jsonDecode(data); + exit(result['result'] == 'true' ? 0 : 1); } diff --git a/packages/connectivity/connectivity/pubspec.yaml b/packages/connectivity/connectivity/pubspec.yaml index c7ef8fe6e723..cfe47792ff18 100644 --- a/packages/connectivity/connectivity/pubspec.yaml +++ b/packages/connectivity/connectivity/pubspec.yaml @@ -5,7 +5,7 @@ homepage: https://github.com/flutter/plugins/tree/master/packages/connectivity/c # 0.4.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.4.9 +version: 0.4.9+1 flutter: plugin: @@ -34,7 +34,8 @@ dev_dependencies: flutter_driver: sdk: flutter test: any - e2e: ^0.2.0 + e2e: + path: ../../e2e mockito: ^4.1.1 plugin_platform_interface: ^1.0.0 pedantic: ^1.8.0 diff --git a/packages/connectivity/connectivity_for_web/CHANGELOG.md b/packages/connectivity/connectivity_for_web/CHANGELOG.md index 83dc386a0314..906b0fce2d9d 100644 --- a/packages/connectivity/connectivity_for_web/CHANGELOG.md +++ b/packages/connectivity/connectivity_for_web/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.3.1+1 + +* Update package:e2e reference to use the local version in the flutter/plugins + repository. + ## 0.3.1 * Use NetworkInformation API from dart:html, instead of the JS-interop version. diff --git a/packages/connectivity/connectivity_for_web/pubspec.yaml b/packages/connectivity/connectivity_for_web/pubspec.yaml index e1142a75c91f..acb31c3e385b 100644 --- a/packages/connectivity/connectivity_for_web/pubspec.yaml +++ b/packages/connectivity/connectivity_for_web/pubspec.yaml @@ -1,6 +1,6 @@ name: connectivity_for_web description: An implementation for the web platform of the Flutter `connectivity` plugin. This uses the NetworkInformation Web API, with a fallback to Navigator.onLine. -version: 0.3.1 +version: 0.3.1+1 homepage: https://github.com/ditman/plugins/tree/connectivity-web/packages/connectivity/experimental_connectivity_web flutter: @@ -23,7 +23,8 @@ dev_dependencies: sdk: flutter flutter_test: sdk: flutter - e2e: ^0.2.4+3 + e2e: + path: ../../e2e mockito: ^4.1.1 environment: diff --git a/packages/connectivity/connectivity_for_web/test/pubspec.yaml b/packages/connectivity/connectivity_for_web/test/pubspec.yaml index 44f4b552b443..7c423f39a9b9 100644 --- a/packages/connectivity/connectivity_for_web/test/pubspec.yaml +++ b/packages/connectivity/connectivity_for_web/test/pubspec.yaml @@ -1,6 +1,6 @@ name: connectivity_web_example -description: Example web app for the connectivity plugin -version: 0.1.1 +description: Example web app for the connectivity plugin +version: 0.1.1+1 homepage: https://github.com/flutter/plugins/tree/master/packages/connectivity/connectivity_web dependencies: @@ -17,7 +17,8 @@ dev_dependencies: sdk: flutter flutter_driver: sdk: flutter - e2e: ^0.2.4+3 + e2e: + path: ../../../e2e mockito: ^4.1.1 environment: diff --git a/packages/connectivity/connectivity_macos/CHANGELOG.md b/packages/connectivity/connectivity_macos/CHANGELOG.md index 637be001518b..ac12b21b531a 100644 --- a/packages/connectivity/connectivity_macos/CHANGELOG.md +++ b/packages/connectivity/connectivity_macos/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.1.0+5 + +* Update package:e2e reference to use the local version in the flutter/plugins + repository. + ## 0.1.0+4 * Remove Android folder from `connectivity_macos`. diff --git a/packages/connectivity/connectivity_macos/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/EmbeddingV1ActivityTest.java b/packages/connectivity/connectivity_macos/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/EmbeddingV1ActivityTest.java index a34755399117..edd544d5f6ea 100644 --- a/packages/connectivity/connectivity_macos/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/EmbeddingV1ActivityTest.java +++ b/packages/connectivity/connectivity_macos/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/EmbeddingV1ActivityTest.java @@ -5,11 +5,11 @@ package io.flutter.plugins.connectivityexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class EmbeddingV1ActivityTest { @Rule public ActivityTestRule rule = diff --git a/packages/connectivity/connectivity_macos/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/FlutterActivityTest.java b/packages/connectivity/connectivity_macos/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/FlutterActivityTest.java index 35391fd5e0a0..0b0ee94c77b9 100644 --- a/packages/connectivity/connectivity_macos/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/FlutterActivityTest.java +++ b/packages/connectivity/connectivity_macos/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/FlutterActivityTest.java @@ -5,12 +5,12 @@ package io.flutter.plugins.connectivityexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class FlutterActivityTest { @Rule public ActivityTestRule rule = new ActivityTestRule<>(FlutterActivity.class); diff --git a/packages/connectivity/connectivity_macos/example/pubspec.yaml b/packages/connectivity/connectivity_macos/example/pubspec.yaml index 877250021f9a..fd18be002bef 100644 --- a/packages/connectivity/connectivity_macos/example/pubspec.yaml +++ b/packages/connectivity/connectivity_macos/example/pubspec.yaml @@ -12,7 +12,8 @@ dev_dependencies: flutter_driver: sdk: flutter test: any - e2e: ^0.2.0 + e2e: + path: ../../../e2e pedantic: ^1.8.0 flutter: diff --git a/packages/connectivity/connectivity_macos/example/test_driver/test/connectivity_e2e_test.dart b/packages/connectivity/connectivity_macos/example/test_driver/test/connectivity_e2e_test.dart index 84b7ae6a47ab..c0cbdcab2fb6 100644 --- a/packages/connectivity/connectivity_macos/example/test_driver/test/connectivity_e2e_test.dart +++ b/packages/connectivity/connectivity_macos/example/test_driver/test/connectivity_e2e_test.dart @@ -2,13 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'dart:convert'; import 'dart:io'; import 'package:flutter_driver/flutter_driver.dart'; Future main() async { final FlutterDriver driver = await FlutterDriver.connect(); - final String result = + final String data = await driver.requestData(null, timeout: const Duration(minutes: 1)); await driver.close(); - exit(result == 'pass' ? 0 : 1); + final Map result = jsonDecode(data); + exit(result['result'] == 'true' ? 0 : 1); } diff --git a/packages/device_info/CHANGELOG.md b/packages/device_info/CHANGELOG.md index 057638d01cac..97c1e1f52221 100644 --- a/packages/device_info/CHANGELOG.md +++ b/packages/device_info/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.4.2+5 + +* Update package:e2e reference to use the local version in the flutter/plugins + repository. + ## 0.4.2+4 Update lower bound of dart dependency to 2.1.0. diff --git a/packages/device_info/example/android/app/src/main/java/io/flutter/plugins/deviceinfoexample/EmbeddingV1ActivityTest.java b/packages/device_info/example/android/app/src/main/java/io/flutter/plugins/deviceinfoexample/EmbeddingV1ActivityTest.java index 2bec9fb8e254..c8fb26e7f70f 100644 --- a/packages/device_info/example/android/app/src/main/java/io/flutter/plugins/deviceinfoexample/EmbeddingV1ActivityTest.java +++ b/packages/device_info/example/android/app/src/main/java/io/flutter/plugins/deviceinfoexample/EmbeddingV1ActivityTest.java @@ -1,11 +1,11 @@ package io.flutter.plugins.deviceinfoexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class EmbeddingV1ActivityTest { @Rule public ActivityTestRule rule = diff --git a/packages/device_info/example/pubspec.yaml b/packages/device_info/example/pubspec.yaml index dc63d8b66126..0546cb650256 100644 --- a/packages/device_info/example/pubspec.yaml +++ b/packages/device_info/example/pubspec.yaml @@ -10,7 +10,8 @@ dependencies: dev_dependencies: flutter_driver: sdk: flutter - e2e: ^0.2.0 + e2e: + path: ../../e2e pedantic: ^1.8.0 flutter: diff --git a/packages/device_info/example/test_driver/device_info_e2e_test.dart b/packages/device_info/example/test_driver/device_info_e2e_test.dart index f3aa9e218d82..7a2c21338786 100644 --- a/packages/device_info/example/test_driver/device_info_e2e_test.dart +++ b/packages/device_info/example/test_driver/device_info_e2e_test.dart @@ -3,13 +3,15 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:async'; +import 'dart:convert'; import 'dart:io'; import 'package:flutter_driver/flutter_driver.dart'; Future main() async { final FlutterDriver driver = await FlutterDriver.connect(); - final String result = + final String data = await driver.requestData(null, timeout: const Duration(minutes: 1)); await driver.close(); - exit(result == 'pass' ? 0 : 1); + final Map result = jsonDecode(data); + exit(result['result'] == 'true' ? 0 : 1); } diff --git a/packages/device_info/pubspec.yaml b/packages/device_info/pubspec.yaml index 8ad768a3c031..f1883a79fdc0 100644 --- a/packages/device_info/pubspec.yaml +++ b/packages/device_info/pubspec.yaml @@ -5,7 +5,7 @@ homepage: https://github.com/flutter/plugins/tree/master/packages/device_info # 0.4.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.4.2+4 +version: 0.4.2+5 flutter: plugin: @@ -24,7 +24,6 @@ dev_dependencies: test: ^1.3.0 flutter_test: sdk: flutter - e2e: ^0.2.0 pedantic: ^1.8.0 environment: diff --git a/packages/e2e/CHANGELOG.md b/packages/e2e/CHANGELOG.md index 255d7ce08c2d..2df897d9ab5f 100644 --- a/packages/e2e/CHANGELOG.md +++ b/packages/e2e/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.6.2 + +* Fix `setSurfaceSize` for e2e tests. + ## 0.6.1 * Added `data` in the reported json. diff --git a/packages/e2e/lib/e2e.dart b/packages/e2e/lib/e2e.dart index a9bf83041e40..d773b9b7a43b 100644 --- a/packages/e2e/lib/e2e.dart +++ b/packages/e2e/lib/e2e.dart @@ -51,9 +51,33 @@ class E2EWidgetsFlutterBinding extends LiveTestWidgetsFlutterBinding { @override bool get registerTestTextInput => false; + Size _surfaceSize; + + /// Artificially changes the surface size to `size` on the Widget binding, + /// then flushes microtasks. + /// + /// Set to null to use the default surface size. @override - ViewConfiguration createViewConfiguration() => TestViewConfiguration( - size: window.physicalSize / window.devicePixelRatio); + Future setSurfaceSize(Size size) { + return TestAsyncUtils.guard(() async { + assert(inTest); + if (_surfaceSize == size) { + return; + } + _surfaceSize = size; + handleMetricsChanged(); + }); + } + + @override + ViewConfiguration createViewConfiguration() { + final double devicePixelRatio = window.devicePixelRatio; + final Size size = _surfaceSize ?? window.physicalSize / devicePixelRatio; + return TestViewConfiguration( + size: size, + window: window, + ); + } final Completer _allTestsPassed = Completer(); diff --git a/packages/e2e/pubspec.yaml b/packages/e2e/pubspec.yaml index 70e57d0cb4f7..956a23f2b930 100644 --- a/packages/e2e/pubspec.yaml +++ b/packages/e2e/pubspec.yaml @@ -1,6 +1,6 @@ name: e2e description: Runs tests that use the flutter_test API as integration tests. -version: 0.6.1 +version: 0.6.2 homepage: https://github.com/flutter/plugins/tree/master/packages/e2e environment: diff --git a/packages/e2e/test/binding_test.dart b/packages/e2e/test/binding_test.dart index 8c97e161b0fe..50ff42dba39c 100644 --- a/packages/e2e/test/binding_test.dart +++ b/packages/e2e/test/binding_test.dart @@ -10,11 +10,11 @@ void main() async { group('Test E2E binding', () { final WidgetsBinding binding = E2EWidgetsFlutterBinding.ensureInitialized(); assert(binding is E2EWidgetsFlutterBinding); - final E2EWidgetsFlutterBinding e2ebinding = + final E2EWidgetsFlutterBinding e2eBinding = binding as E2EWidgetsFlutterBinding; setUp(() { - request = e2ebinding.callback({ + request = e2eBinding.callback({ 'command': 'request_data', }); }); @@ -23,8 +23,34 @@ void main() async { runApp(MaterialApp( home: Text('Test'), )); - expect(tester.binding, e2ebinding); - e2ebinding.reportData = {'answer': 42}; + expect(tester.binding, e2eBinding); + e2eBinding.reportData = {'answer': 42}; + }); + + testWidgets('setSurfaceSize works', (WidgetTester tester) async { + await tester.pumpWidget(MaterialApp(home: Center(child: Text('Test')))); + + final Size windowCenter = tester.binding.window.physicalSize / + tester.binding.window.devicePixelRatio / + 2; + final double windowCenterX = windowCenter.width; + final double windowCenterY = windowCenter.height; + + Offset widgetCenter = tester.getRect(find.byType(Text)).center; + expect(widgetCenter.dx, windowCenterX); + expect(widgetCenter.dy, windowCenterY); + + await tester.binding.setSurfaceSize(const Size(200, 300)); + await tester.pump(); + widgetCenter = tester.getRect(find.byType(Text)).center; + expect(widgetCenter.dx, 100); + expect(widgetCenter.dy, 150); + + await tester.binding.setSurfaceSize(null); + await tester.pump(); + widgetCenter = tester.getRect(find.byType(Text)).center; + expect(widgetCenter.dx, windowCenterX); + expect(widgetCenter.dy, windowCenterY); }); }); diff --git a/packages/flutter_plugin_android_lifecycle/example/android/app/src/androidTest/java/io/flutter/plugins/flutter_plugin_android_lifecycle/EmbeddingV1ActivityTest.java b/packages/flutter_plugin_android_lifecycle/example/android/app/src/androidTest/java/io/flutter/plugins/flutter_plugin_android_lifecycle/EmbeddingV1ActivityTest.java index a5ad2176b4d0..cb699d587a99 100644 --- a/packages/flutter_plugin_android_lifecycle/example/android/app/src/androidTest/java/io/flutter/plugins/flutter_plugin_android_lifecycle/EmbeddingV1ActivityTest.java +++ b/packages/flutter_plugin_android_lifecycle/example/android/app/src/androidTest/java/io/flutter/plugins/flutter_plugin_android_lifecycle/EmbeddingV1ActivityTest.java @@ -5,11 +5,11 @@ package io.flutter.plugins.flutter_plugin_android_lifecycle_example; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class EmbeddingV1ActivityTest { @Rule public ActivityTestRule rule = diff --git a/packages/flutter_plugin_android_lifecycle/example/android/app/src/androidTest/java/io/flutter/plugins/flutter_plugin_android_lifecycle/MainActivityTest.java b/packages/flutter_plugin_android_lifecycle/example/android/app/src/androidTest/java/io/flutter/plugins/flutter_plugin_android_lifecycle/MainActivityTest.java index 05057c1a697e..7228115bf534 100644 --- a/packages/flutter_plugin_android_lifecycle/example/android/app/src/androidTest/java/io/flutter/plugins/flutter_plugin_android_lifecycle/MainActivityTest.java +++ b/packages/flutter_plugin_android_lifecycle/example/android/app/src/androidTest/java/io/flutter/plugins/flutter_plugin_android_lifecycle/MainActivityTest.java @@ -5,11 +5,11 @@ package io.flutter.plugins.flutter_plugin_android_lifecycle_example; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class MainActivityTest { @Rule public ActivityTestRule rule = new ActivityTestRule<>(MainActivity.class); } diff --git a/packages/flutter_plugin_android_lifecycle/example/pubspec.yaml b/packages/flutter_plugin_android_lifecycle/example/pubspec.yaml index 379e0b804f4e..cb5691b6ceb2 100644 --- a/packages/flutter_plugin_android_lifecycle/example/pubspec.yaml +++ b/packages/flutter_plugin_android_lifecycle/example/pubspec.yaml @@ -8,7 +8,8 @@ environment: dependencies: flutter: sdk: flutter - e2e: "^0.2.1" + e2e: + path: ../../e2e dev_dependencies: flutter_test: diff --git a/packages/google_maps_flutter/google_maps_flutter/example/android/app/src/androidTest/java/io/flutter/plugins/googlemaps/EmbeddingV1ActivityTest.java b/packages/google_maps_flutter/google_maps_flutter/example/android/app/src/androidTest/java/io/flutter/plugins/googlemaps/EmbeddingV1ActivityTest.java index ff39d1ddf55d..6ce846749799 100644 --- a/packages/google_maps_flutter/google_maps_flutter/example/android/app/src/androidTest/java/io/flutter/plugins/googlemaps/EmbeddingV1ActivityTest.java +++ b/packages/google_maps_flutter/google_maps_flutter/example/android/app/src/androidTest/java/io/flutter/plugins/googlemaps/EmbeddingV1ActivityTest.java @@ -1,12 +1,12 @@ package io.flutter.plugins.googlemaps; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import io.flutter.plugins.googlemapsexample.*; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class EmbeddingV1ActivityTest { @Rule public ActivityTestRule rule = diff --git a/packages/google_maps_flutter/google_maps_flutter/example/android/app/src/androidTest/java/io/flutter/plugins/googlemaps/MainActivityTest.java b/packages/google_maps_flutter/google_maps_flutter/example/android/app/src/androidTest/java/io/flutter/plugins/googlemaps/MainActivityTest.java index 525d2da8d665..6b52f1c87585 100644 --- a/packages/google_maps_flutter/google_maps_flutter/example/android/app/src/androidTest/java/io/flutter/plugins/googlemaps/MainActivityTest.java +++ b/packages/google_maps_flutter/google_maps_flutter/example/android/app/src/androidTest/java/io/flutter/plugins/googlemaps/MainActivityTest.java @@ -1,12 +1,12 @@ package io.flutter.plugins.googlemaps; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class MainActivityTest { @Rule public ActivityTestRule rule = new ActivityTestRule<>(FlutterActivity.class); diff --git a/packages/google_maps_flutter/google_maps_flutter/example/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter/example/pubspec.yaml index c7b2c5ff6715..a011cb126d5e 100644 --- a/packages/google_maps_flutter/google_maps_flutter/example/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter/example/pubspec.yaml @@ -16,7 +16,8 @@ dev_dependencies: flutter_driver: sdk: flutter test: ^1.6.0 - e2e: ^0.2.1 + e2e: + path: ../../../e2e pedantic: ^1.8.0 # For information on the generic Dart part of this file, see the @@ -58,5 +59,5 @@ flutter: # - asset: fonts/TrajanPro_Bold.ttf # weight: 700 # - # For details regarding fonts from package dependencies, + # For details regarding fonts from package dependencies, # see https://flutter.io/custom-fonts/#from-packages diff --git a/packages/google_maps_flutter/google_maps_flutter/example/test_driver/google_maps_e2e.dart b/packages/google_maps_flutter/google_maps_flutter/example/test_driver/google_maps_e2e.dart index c47862b2b4d1..69304d18778d 100644 --- a/packages/google_maps_flutter/google_maps_flutter/example/test_driver/google_maps_e2e.dart +++ b/packages/google_maps_flutter/google_maps_flutter/example/test_driver/google_maps_e2e.dart @@ -424,6 +424,7 @@ void main() { }); testWidgets('testInitialCenterLocationAtCenter', (WidgetTester tester) async { + await tester.binding.setSurfaceSize(const Size(800.0, 600.0)); final Completer mapControllerCompleter = Completer(); final Key key = GlobalKey(); @@ -443,6 +444,7 @@ void main() { await mapControllerCompleter.future; await tester.pumpAndSettle(); + // TODO(cyanglaz): Remove this after we added `mapRendered` callback, and `mapControllerCompleter.complete(controller)` above should happen // in `mapRendered`. // https://github.com/flutter/flutter/issues/54758 @@ -468,6 +470,7 @@ void main() { tester.binding.window.devicePixelRatio) .round()); } + await tester.binding.setSurfaceSize(null); }); testWidgets('testGetVisibleRegion', (WidgetTester tester) async { diff --git a/packages/google_maps_flutter/google_maps_flutter/example/test_driver/google_maps_e2e_test.dart b/packages/google_maps_flutter/google_maps_flutter/example/test_driver/google_maps_e2e_test.dart index f3aa9e218d82..7a2c21338786 100644 --- a/packages/google_maps_flutter/google_maps_flutter/example/test_driver/google_maps_e2e_test.dart +++ b/packages/google_maps_flutter/google_maps_flutter/example/test_driver/google_maps_e2e_test.dart @@ -3,13 +3,15 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:async'; +import 'dart:convert'; import 'dart:io'; import 'package:flutter_driver/flutter_driver.dart'; Future main() async { final FlutterDriver driver = await FlutterDriver.connect(); - final String result = + final String data = await driver.requestData(null, timeout: const Duration(minutes: 1)); await driver.close(); - exit(result == 'pass' ? 0 : 1); + final Map result = jsonDecode(data); + exit(result['result'] == 'true' ? 0 : 1); } diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/EmbeddingV1ActivityTest.java b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/EmbeddingV1ActivityTest.java index 8bddbff7ce27..92c29c5d2393 100644 --- a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/EmbeddingV1ActivityTest.java +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/EmbeddingV1ActivityTest.java @@ -5,11 +5,11 @@ package io.flutter.plugins.googlesigninexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class EmbeddingV1ActivityTest { @Rule public ActivityTestRule rule = diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/FlutterActivityTest.java b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/FlutterActivityTest.java index 77cdcee9bcdb..21fe2cb9467a 100644 --- a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/FlutterActivityTest.java +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/FlutterActivityTest.java @@ -5,12 +5,12 @@ package io.flutter.plugins.googlesigninexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class FlutterActivityTest { @Rule public ActivityTestRule rule = new ActivityTestRule<>(FlutterActivity.class); diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/pubspec.yaml b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/pubspec.yaml index aee073971d2c..fff936d9b5e0 100755 --- a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/pubspec.yaml +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/pubspec.yaml @@ -11,7 +11,8 @@ dependencies: dev_dependencies: pedantic: ^1.8.0 - e2e: ^0.2.1 + e2e: + path: ../../../e2e flutter_driver: sdk: flutter diff --git a/packages/google_sign_in/google_sign_in/CHANGELOG.md b/packages/google_sign_in/google_sign_in/CHANGELOG.md index 8fbba4944df7..761ba0476eff 100644 --- a/packages/google_sign_in/google_sign_in/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in/CHANGELOG.md @@ -1,3 +1,8 @@ +## 4.5.2 + +* Update package:e2e reference to use the local version in the flutter/plugins + repository. + ## 4.5.1 * Add note on Apple sign in requirement in README. diff --git a/packages/google_sign_in/google_sign_in/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/EmbeddingV1ActivityTest.java b/packages/google_sign_in/google_sign_in/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/EmbeddingV1ActivityTest.java index 8bddbff7ce27..92c29c5d2393 100644 --- a/packages/google_sign_in/google_sign_in/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/EmbeddingV1ActivityTest.java +++ b/packages/google_sign_in/google_sign_in/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/EmbeddingV1ActivityTest.java @@ -5,11 +5,11 @@ package io.flutter.plugins.googlesigninexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class EmbeddingV1ActivityTest { @Rule public ActivityTestRule rule = diff --git a/packages/google_sign_in/google_sign_in/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/FlutterActivityTest.java b/packages/google_sign_in/google_sign_in/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/FlutterActivityTest.java index 77cdcee9bcdb..21fe2cb9467a 100644 --- a/packages/google_sign_in/google_sign_in/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/FlutterActivityTest.java +++ b/packages/google_sign_in/google_sign_in/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/FlutterActivityTest.java @@ -5,12 +5,12 @@ package io.flutter.plugins.googlesigninexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class FlutterActivityTest { @Rule public ActivityTestRule rule = new ActivityTestRule<>(FlutterActivity.class); diff --git a/packages/google_sign_in/google_sign_in/example/pubspec.yaml b/packages/google_sign_in/google_sign_in/example/pubspec.yaml index e3ab95e618f7..37d109649c8a 100755 --- a/packages/google_sign_in/google_sign_in/example/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in/example/pubspec.yaml @@ -10,7 +10,8 @@ dependencies: dev_dependencies: pedantic: ^1.8.0 - e2e: ^0.2.1 + e2e: + path: ../../../e2e flutter_driver: sdk: flutter diff --git a/packages/google_sign_in/google_sign_in/pubspec.yaml b/packages/google_sign_in/google_sign_in/pubspec.yaml index 8e520334192c..e76dbedfa116 100644 --- a/packages/google_sign_in/google_sign_in/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in/pubspec.yaml @@ -2,7 +2,7 @@ name: google_sign_in description: Flutter plugin for Google Sign-In, a secure authentication system for signing in with a Google account on Android and iOS. homepage: https://github.com/flutter/plugins/tree/master/packages/google_sign_in/google_sign_in -version: 4.5.1 +version: 4.5.2 flutter: plugin: @@ -34,7 +34,8 @@ dev_dependencies: flutter_test: sdk: flutter pedantic: ^1.8.0 - e2e: ^0.2.1 + e2e: + path: ../../e2e environment: sdk: ">=2.1.0 <3.0.0" diff --git a/packages/google_sign_in/google_sign_in/test_driver/google_sign_in_e2e_test.dart b/packages/google_sign_in/google_sign_in/test_driver/google_sign_in_e2e_test.dart index 9f1704fc4003..f07dba382187 100644 --- a/packages/google_sign_in/google_sign_in/test_driver/google_sign_in_e2e_test.dart +++ b/packages/google_sign_in/google_sign_in/test_driver/google_sign_in_e2e_test.dart @@ -3,13 +3,15 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:async'; +import 'dart:convert'; import 'dart:io'; import 'package:flutter_driver/flutter_driver.dart'; Future main() async { final FlutterDriver driver = await FlutterDriver.connect(); - final String result = + final String data = await driver.requestData(null, timeout: const Duration(minutes: 1)); await driver.close(); - exit(result == 'pass' ? 0 : 1); + final Map result = jsonDecode(data); + exit(result['result'] == 'true' ? 0 : 1); } diff --git a/packages/google_sign_in/google_sign_in_web/CHANGELOG.md b/packages/google_sign_in/google_sign_in_web/CHANGELOG.md index af6b1a08b122..35a6934f9d4e 100644 --- a/packages/google_sign_in/google_sign_in_web/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in_web/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.9.1+2 + +* Update package:e2e reference to use the local version in the flutter/plugins + repository. + ## 0.9.1+1 * Remove Android folder from `google_sign_in_web`. diff --git a/packages/google_sign_in/google_sign_in_web/pubspec.yaml b/packages/google_sign_in/google_sign_in_web/pubspec.yaml index 76922d9eb8e6..8b48d36fde3c 100644 --- a/packages/google_sign_in/google_sign_in_web/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in_web/pubspec.yaml @@ -2,7 +2,7 @@ name: google_sign_in_web description: Flutter plugin for Google Sign-In, a secure authentication system for signing in with a Google account on Android, iOS and Web. homepage: https://github.com/flutter/plugins/tree/master/packages/google_sign_in/google_sign_in_web -version: 0.9.1+1 +version: 0.9.1+2 flutter: plugin: diff --git a/packages/image_picker/image_picker/CHANGELOG.md b/packages/image_picker/image_picker/CHANGELOG.md index 0cec3a32b5f1..82bb5f37cf97 100644 --- a/packages/image_picker/image_picker/CHANGELOG.md +++ b/packages/image_picker/image_picker/CHANGELOG.md @@ -1,3 +1,9 @@ +## 0.6.7+5 + +* Update package:e2e reference to use the local version in the flutter/plugins + repository. + + ## 0.6.7+4 * Support iOS simulator x86_64 architecture. diff --git a/packages/image_picker/image_picker/example/android/app/src/main/java/io/flutter/plugins/imagepickerexample/EmbeddingV1ActivityTest.java b/packages/image_picker/image_picker/example/android/app/src/main/java/io/flutter/plugins/imagepickerexample/EmbeddingV1ActivityTest.java index 924cf2fdb93c..a9146dfa5716 100644 --- a/packages/image_picker/image_picker/example/android/app/src/main/java/io/flutter/plugins/imagepickerexample/EmbeddingV1ActivityTest.java +++ b/packages/image_picker/image_picker/example/android/app/src/main/java/io/flutter/plugins/imagepickerexample/EmbeddingV1ActivityTest.java @@ -5,11 +5,11 @@ package io.flutter.plugins.imagepickerexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class EmbeddingV1ActivityTest { @Rule public ActivityTestRule rule = diff --git a/packages/image_picker/image_picker/example/android/app/src/main/java/io/flutter/plugins/imagepickerexample/FlutterActivityTest.java b/packages/image_picker/image_picker/example/android/app/src/main/java/io/flutter/plugins/imagepickerexample/FlutterActivityTest.java index df9794c8748f..6afe01481ea4 100644 --- a/packages/image_picker/image_picker/example/android/app/src/main/java/io/flutter/plugins/imagepickerexample/FlutterActivityTest.java +++ b/packages/image_picker/image_picker/example/android/app/src/main/java/io/flutter/plugins/imagepickerexample/FlutterActivityTest.java @@ -1,12 +1,12 @@ package io.flutter.plugins.imagepickerexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class FlutterActivityTest { @Rule public ActivityTestRule rule = new ActivityTestRule<>(FlutterActivity.class); diff --git a/packages/image_picker/image_picker/example/pubspec.yaml b/packages/image_picker/image_picker/example/pubspec.yaml index 93df8dfdc010..63e42a121d80 100755 --- a/packages/image_picker/image_picker/example/pubspec.yaml +++ b/packages/image_picker/image_picker/example/pubspec.yaml @@ -14,7 +14,8 @@ dependencies: dev_dependencies: flutter_driver: sdk: flutter - e2e: ^0.2.1 + e2e: + path: ../../../e2e pedantic: ^1.8.0 flutter: diff --git a/packages/image_picker/image_picker/example/test_driver/test/image_picker_e2e_test.dart b/packages/image_picker/image_picker/example/test_driver/test/image_picker_e2e_test.dart index f3aa9e218d82..7a2c21338786 100644 --- a/packages/image_picker/image_picker/example/test_driver/test/image_picker_e2e_test.dart +++ b/packages/image_picker/image_picker/example/test_driver/test/image_picker_e2e_test.dart @@ -3,13 +3,15 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:async'; +import 'dart:convert'; import 'dart:io'; import 'package:flutter_driver/flutter_driver.dart'; Future main() async { final FlutterDriver driver = await FlutterDriver.connect(); - final String result = + final String data = await driver.requestData(null, timeout: const Duration(minutes: 1)); await driver.close(); - exit(result == 'pass' ? 0 : 1); + final Map result = jsonDecode(data); + exit(result['result'] == 'true' ? 0 : 1); } diff --git a/packages/image_picker/image_picker/pubspec.yaml b/packages/image_picker/image_picker/pubspec.yaml index 06da5297d80c..94fa53be135e 100755 --- a/packages/image_picker/image_picker/pubspec.yaml +++ b/packages/image_picker/image_picker/pubspec.yaml @@ -2,7 +2,7 @@ name: image_picker description: Flutter plugin for selecting images from the Android and iOS image library, and taking new pictures with the camera. homepage: https://github.com/flutter/plugins/tree/master/packages/image_picker/image_picker -version: 0.6.7+4 +version: 0.6.7+5 flutter: plugin: @@ -23,7 +23,8 @@ dev_dependencies: video_player: ^0.10.3 flutter_test: sdk: flutter - e2e: ^0.2.1 + e2e: + path: ../../e2e pedantic: ^1.8.0 environment: diff --git a/packages/in_app_purchase/CHANGELOG.md b/packages/in_app_purchase/CHANGELOG.md index c159b094fb47..3f6bd8e7829e 100644 --- a/packages/in_app_purchase/CHANGELOG.md +++ b/packages/in_app_purchase/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.3.4+2 + +* Update package:e2e reference to use the local version in the flutter/plugins + repository. + ## 0.3.4+1 * iOS: Fix the bug that `SKPaymentQueueWrapper.transactions` doesn't return all transactions. diff --git a/packages/in_app_purchase/example/android/app/src/main/java/io/flutter/plugins/inapppurchaseexample/EmbeddingV1ActivityTest.java b/packages/in_app_purchase/example/android/app/src/main/java/io/flutter/plugins/inapppurchaseexample/EmbeddingV1ActivityTest.java index 1cac72300228..aaed781653da 100644 --- a/packages/in_app_purchase/example/android/app/src/main/java/io/flutter/plugins/inapppurchaseexample/EmbeddingV1ActivityTest.java +++ b/packages/in_app_purchase/example/android/app/src/main/java/io/flutter/plugins/inapppurchaseexample/EmbeddingV1ActivityTest.java @@ -5,11 +5,11 @@ package io.flutter.plugins.inapppurchaseexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class EmbeddingV1ActivityTest { @Rule public ActivityTestRule rule = diff --git a/packages/in_app_purchase/example/android/app/src/main/java/io/flutter/plugins/inapppurchaseexample/FlutterActivityTest.java b/packages/in_app_purchase/example/android/app/src/main/java/io/flutter/plugins/inapppurchaseexample/FlutterActivityTest.java index 1ebb9d212edb..1a6203bcd7a8 100644 --- a/packages/in_app_purchase/example/android/app/src/main/java/io/flutter/plugins/inapppurchaseexample/FlutterActivityTest.java +++ b/packages/in_app_purchase/example/android/app/src/main/java/io/flutter/plugins/inapppurchaseexample/FlutterActivityTest.java @@ -5,12 +5,12 @@ package io.flutter.plugins.inapppurchaseexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class FlutterActivityTest { @Rule public ActivityTestRule rule = new ActivityTestRule<>(FlutterActivity.class); diff --git a/packages/in_app_purchase/example/pubspec.yaml b/packages/in_app_purchase/example/pubspec.yaml index 0d595bd41fd4..6d8fd0e90739 100644 --- a/packages/in_app_purchase/example/pubspec.yaml +++ b/packages/in_app_purchase/example/pubspec.yaml @@ -14,7 +14,8 @@ dev_dependencies: sdk: flutter in_app_purchase: path: ../ - e2e: ^0.2.0 + e2e: + path: ../../e2e pedantic: ^1.8.0 flutter: diff --git a/packages/in_app_purchase/example/test_driver/test/in_app_purchase_e2e_test.dart b/packages/in_app_purchase/example/test_driver/test/in_app_purchase_e2e_test.dart index 449af666b605..7a2c21338786 100644 --- a/packages/in_app_purchase/example/test_driver/test/in_app_purchase_e2e_test.dart +++ b/packages/in_app_purchase/example/test_driver/test/in_app_purchase_e2e_test.dart @@ -2,14 +2,16 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'dart:io'; import 'dart:async'; +import 'dart:convert'; +import 'dart:io'; import 'package:flutter_driver/flutter_driver.dart'; Future main() async { final FlutterDriver driver = await FlutterDriver.connect(); - final String result = + final String data = await driver.requestData(null, timeout: const Duration(minutes: 1)); await driver.close(); - exit(result == 'pass' ? 0 : 1); + final Map result = jsonDecode(data); + exit(result['result'] == 'true' ? 0 : 1); } diff --git a/packages/in_app_purchase/pubspec.yaml b/packages/in_app_purchase/pubspec.yaml index 58f8e1174618..907c8ce5fe50 100644 --- a/packages/in_app_purchase/pubspec.yaml +++ b/packages/in_app_purchase/pubspec.yaml @@ -1,7 +1,7 @@ name: in_app_purchase description: A Flutter plugin for in-app purchases. Exposes APIs for making in-app purchases through the App Store and Google Play. homepage: https://github.com/flutter/plugins/tree/master/packages/in_app_purchase -version: 0.3.4+1 +version: 0.3.4+2 dependencies: async: ^2.0.8 @@ -22,7 +22,8 @@ dev_dependencies: path: example/ test: ^1.5.2 shared_preferences: ^0.5.2 - e2e: ^0.2.0 + e2e: + path: ../e2e pedantic: ^1.8.0 flutter: diff --git a/packages/local_auth/CHANGELOG.md b/packages/local_auth/CHANGELOG.md index 8fec727bd10e..d6c5f618dcd6 100644 --- a/packages/local_auth/CHANGELOG.md +++ b/packages/local_auth/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.6.2+4 + +* Update package:e2e reference to use the local version in the flutter/plugins + repository. + ## 0.6.2+3 * Post-v2 Android embedding cleanup. diff --git a/packages/local_auth/example/android/app/src/androidTest/java/io/flutter/plugins/localauth/EmbeddingV1ActivityTest.java b/packages/local_auth/example/android/app/src/androidTest/java/io/flutter/plugins/localauth/EmbeddingV1ActivityTest.java index b2cea8dc57a2..354f86b10ac6 100644 --- a/packages/local_auth/example/android/app/src/androidTest/java/io/flutter/plugins/localauth/EmbeddingV1ActivityTest.java +++ b/packages/local_auth/example/android/app/src/androidTest/java/io/flutter/plugins/localauth/EmbeddingV1ActivityTest.java @@ -1,12 +1,12 @@ package io.flutter.plugins.localauth; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import io.flutter.plugins.localauthexample.EmbeddingV1Activity; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class EmbeddingV1ActivityTest { @Rule public ActivityTestRule rule = diff --git a/packages/local_auth/example/android/app/src/androidTest/java/io/flutter/plugins/localauth/MainActivityTest.java b/packages/local_auth/example/android/app/src/androidTest/java/io/flutter/plugins/localauth/MainActivityTest.java index f717ac97dd52..222316395505 100644 --- a/packages/local_auth/example/android/app/src/androidTest/java/io/flutter/plugins/localauth/MainActivityTest.java +++ b/packages/local_auth/example/android/app/src/androidTest/java/io/flutter/plugins/localauth/MainActivityTest.java @@ -1,12 +1,12 @@ package io.flutter.plugins.localauth; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import io.flutter.embedding.android.FlutterFragmentActivity; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class FlutterFragmentActivityTest { @Rule public ActivityTestRule rule = diff --git a/packages/local_auth/example/pubspec.yaml b/packages/local_auth/example/pubspec.yaml index f6e7f669656f..478b37409f3e 100644 --- a/packages/local_auth/example/pubspec.yaml +++ b/packages/local_auth/example/pubspec.yaml @@ -8,7 +8,8 @@ dependencies: path: ../ dev_dependencies: - e2e: ^0.2.1 + e2e: + path: ../../e2e flutter_driver: sdk: flutter pedantic: ^1.8.0 diff --git a/packages/local_auth/pubspec.yaml b/packages/local_auth/pubspec.yaml index d80ebeb304c3..3546cb9de3d9 100644 --- a/packages/local_auth/pubspec.yaml +++ b/packages/local_auth/pubspec.yaml @@ -2,7 +2,7 @@ name: local_auth description: Flutter plugin for Android and iOS device authentication sensors such as Fingerprint Reader and Touch ID. homepage: https://github.com/flutter/plugins/tree/master/packages/local_auth -version: 0.6.2+3 +version: 0.6.2+4 flutter: plugin: @@ -22,7 +22,8 @@ dependencies: flutter_plugin_android_lifecycle: ^1.0.2 dev_dependencies: - e2e: ^0.2.1 + e2e: + path: ../e2e flutter_driver: sdk: flutter flutter_test: diff --git a/packages/package_info/CHANGELOG.md b/packages/package_info/CHANGELOG.md index 2344f37484bc..5b5c78144efc 100644 --- a/packages/package_info/CHANGELOG.md +++ b/packages/package_info/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.4.2 + +* Update package:e2e reference to use the local version in the flutter/plugins + repository. + ## 0.4.1 * Add support for macOS. diff --git a/packages/package_info/example/android/app/src/androidTest/java/io/flutter/plugins/packageinfoexample/EmbedderV1ActivityTest.java b/packages/package_info/example/android/app/src/androidTest/java/io/flutter/plugins/packageinfoexample/EmbedderV1ActivityTest.java index 47362ba64a9d..2da6799c19c4 100644 --- a/packages/package_info/example/android/app/src/androidTest/java/io/flutter/plugins/packageinfoexample/EmbedderV1ActivityTest.java +++ b/packages/package_info/example/android/app/src/androidTest/java/io/flutter/plugins/packageinfoexample/EmbedderV1ActivityTest.java @@ -5,11 +5,11 @@ package io.flutter.plugins.packageinfoexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class EmbedderV1ActivityTest { @Rule public ActivityTestRule rule = diff --git a/packages/package_info/example/android/app/src/androidTest/java/io/flutter/plugins/packageinfoexample/MainActivityTest.java b/packages/package_info/example/android/app/src/androidTest/java/io/flutter/plugins/packageinfoexample/MainActivityTest.java index 7a1dfdb775f1..363ccecd5ebd 100644 --- a/packages/package_info/example/android/app/src/androidTest/java/io/flutter/plugins/packageinfoexample/MainActivityTest.java +++ b/packages/package_info/example/android/app/src/androidTest/java/io/flutter/plugins/packageinfoexample/MainActivityTest.java @@ -5,12 +5,12 @@ package io.flutter.plugins.packageinfoexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class MainActivityTest { @Rule public ActivityTestRule rule = new ActivityTestRule<>(FlutterActivity.class); diff --git a/packages/package_info/example/pubspec.yaml b/packages/package_info/example/pubspec.yaml index f6ea2f40527e..8b4bd88c9acf 100644 --- a/packages/package_info/example/pubspec.yaml +++ b/packages/package_info/example/pubspec.yaml @@ -6,7 +6,8 @@ dependencies: sdk: flutter package_info: path: ../ - e2e: "^0.2.1" + e2e: + path: ../../e2e dev_dependencies: flutter_driver: diff --git a/packages/package_info/example/test_driver/package_info_e2e_test.dart b/packages/package_info/example/test_driver/package_info_e2e_test.dart index 1bcd0d37f450..f532c389a02b 100644 --- a/packages/package_info/example/test_driver/package_info_e2e_test.dart +++ b/packages/package_info/example/test_driver/package_info_e2e_test.dart @@ -2,14 +2,18 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'dart:convert'; import 'dart:io'; import 'package:flutter_driver/flutter_driver.dart'; Future main() async { final FlutterDriver driver = await FlutterDriver.connect(); - final String result = - await driver.requestData(null, timeout: const Duration(minutes: 1)); + final String data = await driver.requestData( + null, + timeout: const Duration(minutes: 1), + ); await driver.close(); - exit(result == 'pass' ? 0 : 1); + final Map result = jsonDecode(data); + exit(result['result'] == 'true' ? 0 : 1); } diff --git a/packages/package_info/pubspec.yaml b/packages/package_info/pubspec.yaml index bb18407fd862..0634da129370 100644 --- a/packages/package_info/pubspec.yaml +++ b/packages/package_info/pubspec.yaml @@ -5,7 +5,7 @@ homepage: https://github.com/flutter/plugins/tree/master/packages/package_info # 0.4.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.4.1 +version: 0.4.2 flutter: plugin: @@ -28,7 +28,8 @@ dev_dependencies: flutter_driver: sdk: flutter test: any - e2e: "^0.2.1" + e2e: + path: ../e2e pedantic: ^1.8.0 environment: diff --git a/packages/path_provider/path_provider/CHANGELOG.md b/packages/path_provider/path_provider/CHANGELOG.md index 07c82ca83b2a..eab5b5f62a2d 100644 --- a/packages/path_provider/path_provider/CHANGELOG.md +++ b/packages/path_provider/path_provider/CHANGELOG.md @@ -1,11 +1,18 @@ +## 1.6.13 + +* Update package:e2e reference to use the local version in the flutter/plugins + repository. + ## 1.6.12 * Fixed a Java lint in a test. ## 1.6.11 + * Updated documentation to reflect the need for changes in testing for federated plugins ## 1.6.10 + * Linux implementation endorsement ## 1.6.9 diff --git a/packages/path_provider/path_provider/example/android/app/src/androidTest/java/EmbeddingV1ActivityTest.java b/packages/path_provider/path_provider/example/android/app/src/androidTest/java/EmbeddingV1ActivityTest.java index cce04b79f516..00ebeffe038a 100644 --- a/packages/path_provider/path_provider/example/android/app/src/androidTest/java/EmbeddingV1ActivityTest.java +++ b/packages/path_provider/path_provider/example/android/app/src/androidTest/java/EmbeddingV1ActivityTest.java @@ -2,12 +2,12 @@ package io.flutter.plugins.pathprovider; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import io.flutter.plugins.pathproviderexample.EmbeddingV1Activity; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class EmbeddingV1ActivityTest { @Rule public ActivityTestRule rule = diff --git a/packages/path_provider/path_provider/example/android/app/src/androidTest/java/MainActivityTest.java b/packages/path_provider/path_provider/example/android/app/src/androidTest/java/MainActivityTest.java index 5c37b59bf25a..59725c7123a5 100644 --- a/packages/path_provider/path_provider/example/android/app/src/androidTest/java/MainActivityTest.java +++ b/packages/path_provider/path_provider/example/android/app/src/androidTest/java/MainActivityTest.java @@ -2,12 +2,12 @@ package io.flutter.plugins.pathprovider; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class MainActivityTest { @Rule public ActivityTestRule rule = new ActivityTestRule<>(FlutterActivity.class); diff --git a/packages/path_provider/path_provider/example/pubspec.yaml b/packages/path_provider/path_provider/example/pubspec.yaml index 1d6a50c2ca0f..367c6c68df45 100644 --- a/packages/path_provider/path_provider/example/pubspec.yaml +++ b/packages/path_provider/path_provider/example/pubspec.yaml @@ -8,7 +8,8 @@ dependencies: path: ../ dev_dependencies: - e2e: ^0.2.1 + e2e: + path: ../../../e2e flutter_driver: sdk: flutter test: any diff --git a/packages/path_provider/path_provider/example/test_driver/path_provider_e2e_test.dart b/packages/path_provider/path_provider/example/test_driver/path_provider_e2e_test.dart index f3aa9e218d82..7a2c21338786 100644 --- a/packages/path_provider/path_provider/example/test_driver/path_provider_e2e_test.dart +++ b/packages/path_provider/path_provider/example/test_driver/path_provider_e2e_test.dart @@ -3,13 +3,15 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:async'; +import 'dart:convert'; import 'dart:io'; import 'package:flutter_driver/flutter_driver.dart'; Future main() async { final FlutterDriver driver = await FlutterDriver.connect(); - final String result = + final String data = await driver.requestData(null, timeout: const Duration(minutes: 1)); await driver.close(); - exit(result == 'pass' ? 0 : 1); + final Map result = jsonDecode(data); + exit(result['result'] == 'true' ? 0 : 1); } diff --git a/packages/path_provider/path_provider/pubspec.yaml b/packages/path_provider/path_provider/pubspec.yaml index db2da41d40c2..cac4ff2656f4 100644 --- a/packages/path_provider/path_provider/pubspec.yaml +++ b/packages/path_provider/path_provider/pubspec.yaml @@ -2,7 +2,7 @@ name: path_provider description: Flutter plugin for getting commonly used locations on the Android & iOS file systems, such as the temp and app data directories. homepage: https://github.com/flutter/plugins/tree/master/packages/path_provider/path_provider -version: 1.6.12 +version: 1.6.13 flutter: plugin: @@ -25,7 +25,8 @@ dependencies: path_provider_linux: ^0.0.1 dev_dependencies: - e2e: ^0.2.1 + e2e: + path: ../../e2e flutter_test: sdk: flutter flutter_driver: diff --git a/packages/path_provider/path_provider_linux/example/pubspec.yaml b/packages/path_provider/path_provider_linux/example/pubspec.yaml index 4d758b78733a..186142d1d3a7 100644 --- a/packages/path_provider/path_provider_linux/example/pubspec.yaml +++ b/packages/path_provider/path_provider_linux/example/pubspec.yaml @@ -24,7 +24,8 @@ dev_dependencies: sdk: flutter flutter_driver: sdk: flutter - e2e: ^0.2.1 + e2e: + path: ../../../e2e # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/packages/path_provider/path_provider_linux/example/test_driver/path_provider_e2e_test.dart b/packages/path_provider/path_provider_linux/example/test_driver/path_provider_e2e_test.dart index f3aa9e218d82..7a2c21338786 100644 --- a/packages/path_provider/path_provider_linux/example/test_driver/path_provider_e2e_test.dart +++ b/packages/path_provider/path_provider_linux/example/test_driver/path_provider_e2e_test.dart @@ -3,13 +3,15 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:async'; +import 'dart:convert'; import 'dart:io'; import 'package:flutter_driver/flutter_driver.dart'; Future main() async { final FlutterDriver driver = await FlutterDriver.connect(); - final String result = + final String data = await driver.requestData(null, timeout: const Duration(minutes: 1)); await driver.close(); - exit(result == 'pass' ? 0 : 1); + final Map result = jsonDecode(data); + exit(result['result'] == 'true' ? 0 : 1); } diff --git a/packages/path_provider/path_provider_macos/example/android/app/src/androidTest/java/EmbeddingV1ActivityTest.java b/packages/path_provider/path_provider_macos/example/android/app/src/androidTest/java/EmbeddingV1ActivityTest.java index cce04b79f516..00ebeffe038a 100644 --- a/packages/path_provider/path_provider_macos/example/android/app/src/androidTest/java/EmbeddingV1ActivityTest.java +++ b/packages/path_provider/path_provider_macos/example/android/app/src/androidTest/java/EmbeddingV1ActivityTest.java @@ -2,12 +2,12 @@ package io.flutter.plugins.pathprovider; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import io.flutter.plugins.pathproviderexample.EmbeddingV1Activity; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class EmbeddingV1ActivityTest { @Rule public ActivityTestRule rule = diff --git a/packages/path_provider/path_provider_macos/example/android/app/src/androidTest/java/MainActivityTest.java b/packages/path_provider/path_provider_macos/example/android/app/src/androidTest/java/MainActivityTest.java index 7bdd449981f5..9f8e2c272a9a 100644 --- a/packages/path_provider/path_provider_macos/example/android/app/src/androidTest/java/MainActivityTest.java +++ b/packages/path_provider/path_provider_macos/example/android/app/src/androidTest/java/MainActivityTest.java @@ -2,12 +2,12 @@ package io.flutter.plugins.pathprovider; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import io.flutter.plugins.pathproviderexample.MainActivity; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class MainActivityTest { @Rule public ActivityTestRule rule = new ActivityTestRule<>(MainActivity.class); } diff --git a/packages/path_provider/path_provider_macos/example/pubspec.yaml b/packages/path_provider/path_provider_macos/example/pubspec.yaml index e3242b83ad99..e80768763e8b 100644 --- a/packages/path_provider/path_provider_macos/example/pubspec.yaml +++ b/packages/path_provider/path_provider_macos/example/pubspec.yaml @@ -9,7 +9,8 @@ dependencies: path: ../ dev_dependencies: - e2e: ^0.2.1 + e2e: + path: ../../../e2e flutter_driver: sdk: flutter test: any diff --git a/packages/path_provider/path_provider_macos/example/test_driver/path_provider_e2e_test.dart b/packages/path_provider/path_provider_macos/example/test_driver/path_provider_e2e_test.dart index f3aa9e218d82..7a2c21338786 100644 --- a/packages/path_provider/path_provider_macos/example/test_driver/path_provider_e2e_test.dart +++ b/packages/path_provider/path_provider_macos/example/test_driver/path_provider_e2e_test.dart @@ -3,13 +3,15 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:async'; +import 'dart:convert'; import 'dart:io'; import 'package:flutter_driver/flutter_driver.dart'; Future main() async { final FlutterDriver driver = await FlutterDriver.connect(); - final String result = + final String data = await driver.requestData(null, timeout: const Duration(minutes: 1)); await driver.close(); - exit(result == 'pass' ? 0 : 1); + final Map result = jsonDecode(data); + exit(result['result'] == 'true' ? 0 : 1); } diff --git a/packages/quick_actions/CHANGELOG.md b/packages/quick_actions/CHANGELOG.md index 1afc92af7c06..f1f7f85de08b 100644 --- a/packages/quick_actions/CHANGELOG.md +++ b/packages/quick_actions/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.4.0+7 + +* Update package:e2e reference to use the local version in the flutter/plugins + repository. + ## 0.4.0+6 * Post-v2 Android embedding cleanup. diff --git a/packages/quick_actions/example/android/app/src/main/java/io/flutter/plugins/quickactionsexample/EmbeddingV1ActivityTest.java b/packages/quick_actions/example/android/app/src/main/java/io/flutter/plugins/quickactionsexample/EmbeddingV1ActivityTest.java index b3e2a08c44b4..8a3d6bee2354 100644 --- a/packages/quick_actions/example/android/app/src/main/java/io/flutter/plugins/quickactionsexample/EmbeddingV1ActivityTest.java +++ b/packages/quick_actions/example/android/app/src/main/java/io/flutter/plugins/quickactionsexample/EmbeddingV1ActivityTest.java @@ -5,11 +5,11 @@ package io.flutter.plugins.quickactionsexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class EmbeddingV1ActivityTest { @Rule public ActivityTestRule rule = diff --git a/packages/quick_actions/example/android/app/src/main/java/io/flutter/plugins/quickactionsexample/FlutterActivityTest.java b/packages/quick_actions/example/android/app/src/main/java/io/flutter/plugins/quickactionsexample/FlutterActivityTest.java index d80914056b35..84b0c3e6ea42 100644 --- a/packages/quick_actions/example/android/app/src/main/java/io/flutter/plugins/quickactionsexample/FlutterActivityTest.java +++ b/packages/quick_actions/example/android/app/src/main/java/io/flutter/plugins/quickactionsexample/FlutterActivityTest.java @@ -5,12 +5,12 @@ package io.flutter.plugins.quickactionsexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class FlutterActivityTest { @Rule public ActivityTestRule rule = new ActivityTestRule<>(FlutterActivity.class); diff --git a/packages/quick_actions/example/pubspec.yaml b/packages/quick_actions/example/pubspec.yaml index 058d208a7690..38427fcdadf0 100644 --- a/packages/quick_actions/example/pubspec.yaml +++ b/packages/quick_actions/example/pubspec.yaml @@ -10,7 +10,8 @@ dependencies: dev_dependencies: flutter_driver: sdk: flutter - e2e: ^0.2.0 + e2e: + path: ../../e2e pedantic: ^1.8.0 flutter: diff --git a/packages/quick_actions/example/test_driver/quick_actions_e2e_test.dart b/packages/quick_actions/example/test_driver/quick_actions_e2e_test.dart index f3aa9e218d82..7a2c21338786 100644 --- a/packages/quick_actions/example/test_driver/quick_actions_e2e_test.dart +++ b/packages/quick_actions/example/test_driver/quick_actions_e2e_test.dart @@ -3,13 +3,15 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:async'; +import 'dart:convert'; import 'dart:io'; import 'package:flutter_driver/flutter_driver.dart'; Future main() async { final FlutterDriver driver = await FlutterDriver.connect(); - final String result = + final String data = await driver.requestData(null, timeout: const Duration(minutes: 1)); await driver.close(); - exit(result == 'pass' ? 0 : 1); + final Map result = jsonDecode(data); + exit(result['result'] == 'true' ? 0 : 1); } diff --git a/packages/quick_actions/pubspec.yaml b/packages/quick_actions/pubspec.yaml index 570c864ffe38..be720f65be6c 100644 --- a/packages/quick_actions/pubspec.yaml +++ b/packages/quick_actions/pubspec.yaml @@ -2,7 +2,7 @@ name: quick_actions description: Flutter plugin for creating shortcuts on home screen, also known as Quick Actions on iOS and App Shortcuts on Android. homepage: https://github.com/flutter/plugins/tree/master/packages/quick_actions -version: 0.4.0+6 +version: 0.4.0+7 flutter: plugin: @@ -23,7 +23,8 @@ dev_dependencies: mockito: ^3.0.0 flutter_test: sdk: flutter - e2e: ^0.2.0 + e2e: + path: ../e2e pedantic: ^1.8.0 environment: diff --git a/packages/sensors/CHANGELOG.md b/packages/sensors/CHANGELOG.md index 55501436c45e..236618d3d34a 100644 --- a/packages/sensors/CHANGELOG.md +++ b/packages/sensors/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.4.2+3 + +* Update package:e2e reference to use the local version in the flutter/plugins + repository. + ## 0.4.2+2 * Post-v2 Android embedding cleanup. diff --git a/packages/sensors/example/android/app/src/main/java/io/flutter/plugins/sensorsexample/EmbeddingV1ActivityTest.java b/packages/sensors/example/android/app/src/main/java/io/flutter/plugins/sensorsexample/EmbeddingV1ActivityTest.java index 6d0274f50e2c..92f0564ecc9e 100644 --- a/packages/sensors/example/android/app/src/main/java/io/flutter/plugins/sensorsexample/EmbeddingV1ActivityTest.java +++ b/packages/sensors/example/android/app/src/main/java/io/flutter/plugins/sensorsexample/EmbeddingV1ActivityTest.java @@ -1,11 +1,11 @@ package io.flutter.plugins.sensorsexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class EmbeddingV1ActivityTest { @Rule public ActivityTestRule rule = diff --git a/packages/sensors/example/android/app/src/main/java/io/flutter/plugins/sensorsexample/FlutterActivityTest.java b/packages/sensors/example/android/app/src/main/java/io/flutter/plugins/sensorsexample/FlutterActivityTest.java index a0fff8201676..c5d0c9392934 100644 --- a/packages/sensors/example/android/app/src/main/java/io/flutter/plugins/sensorsexample/FlutterActivityTest.java +++ b/packages/sensors/example/android/app/src/main/java/io/flutter/plugins/sensorsexample/FlutterActivityTest.java @@ -5,12 +5,12 @@ package io.flutter.plugins.sensorsexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class FlutterActivityTest { @Rule public ActivityTestRule rule = new ActivityTestRule<>(FlutterActivity.class); diff --git a/packages/sensors/example/pubspec.yaml b/packages/sensors/example/pubspec.yaml index 69aa54ca94e4..02bca30f8f0b 100644 --- a/packages/sensors/example/pubspec.yaml +++ b/packages/sensors/example/pubspec.yaml @@ -10,7 +10,8 @@ dependencies: dev_dependencies: flutter_driver: sdk: flutter - e2e: ^0.2.0 + e2e: + path: ../../e2e pedantic: ^1.8.0 flutter: diff --git a/packages/sensors/example/test_driver/test/sensors_e2e_test.dart b/packages/sensors/example/test_driver/test/sensors_e2e_test.dart index f3aa9e218d82..7a2c21338786 100644 --- a/packages/sensors/example/test_driver/test/sensors_e2e_test.dart +++ b/packages/sensors/example/test_driver/test/sensors_e2e_test.dart @@ -3,13 +3,15 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:async'; +import 'dart:convert'; import 'dart:io'; import 'package:flutter_driver/flutter_driver.dart'; Future main() async { final FlutterDriver driver = await FlutterDriver.connect(); - final String result = + final String data = await driver.requestData(null, timeout: const Duration(minutes: 1)); await driver.close(); - exit(result == 'pass' ? 0 : 1); + final Map result = jsonDecode(data); + exit(result['result'] == 'true' ? 0 : 1); } diff --git a/packages/sensors/pubspec.yaml b/packages/sensors/pubspec.yaml index 3e3aed165a8e..9abbe6ba5d18 100644 --- a/packages/sensors/pubspec.yaml +++ b/packages/sensors/pubspec.yaml @@ -5,7 +5,7 @@ homepage: https://github.com/flutter/plugins/tree/master/packages/sensors # 0.4.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.4.2+2 +version: 0.4.2+3 flutter: plugin: @@ -24,7 +24,8 @@ dev_dependencies: test: ^1.3.0 flutter_test: sdk: flutter - e2e: ^0.2.0 + e2e: + path: ../e2e mockito: ^4.1.1 pedantic: ^1.8.0 diff --git a/packages/share/CHANGELOG.md b/packages/share/CHANGELOG.md index b06f8de45f4a..e18933d1be0f 100644 --- a/packages/share/CHANGELOG.md +++ b/packages/share/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.6.4+4 + +* Update package:e2e reference to use the local version in the flutter/plugins + repository. + ## 0.6.4+3 * Post-v2 Android embedding cleanup. diff --git a/packages/share/example/android/app/src/main/java/io/flutter/plugins/shareexample/EmbeddingV1ActivityTest.java b/packages/share/example/android/app/src/main/java/io/flutter/plugins/shareexample/EmbeddingV1ActivityTest.java index 958541165806..83e7cf020174 100644 --- a/packages/share/example/android/app/src/main/java/io/flutter/plugins/shareexample/EmbeddingV1ActivityTest.java +++ b/packages/share/example/android/app/src/main/java/io/flutter/plugins/shareexample/EmbeddingV1ActivityTest.java @@ -1,11 +1,11 @@ package io.flutter.plugins.shareexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class EmbeddingV1ActivityTest { @Rule public ActivityTestRule rule = diff --git a/packages/share/example/android/app/src/main/java/io/flutter/plugins/shareexample/FlutterActivityTest.java b/packages/share/example/android/app/src/main/java/io/flutter/plugins/shareexample/FlutterActivityTest.java index 58c9edf6762a..0ad24ddc4824 100644 --- a/packages/share/example/android/app/src/main/java/io/flutter/plugins/shareexample/FlutterActivityTest.java +++ b/packages/share/example/android/app/src/main/java/io/flutter/plugins/shareexample/FlutterActivityTest.java @@ -5,12 +5,12 @@ package io.flutter.plugins.shareexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class FlutterActivityTest { @Rule public ActivityTestRule rule = new ActivityTestRule<>(FlutterActivity.class); diff --git a/packages/share/example/pubspec.yaml b/packages/share/example/pubspec.yaml index f69de96283b3..4c0bb731c8a9 100644 --- a/packages/share/example/pubspec.yaml +++ b/packages/share/example/pubspec.yaml @@ -10,7 +10,8 @@ dependencies: dev_dependencies: flutter_driver: sdk: flutter - e2e: ^0.2.0 + e2e: + path: ../../e2e pedantic: ^1.8.0 flutter: @@ -19,4 +20,4 @@ flutter: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" flutter: ">=1.9.1+hotfix.2 <2.0.0" - + diff --git a/packages/share/example/test_driver/test/share_e2e_test.dart b/packages/share/example/test_driver/test/share_e2e_test.dart index f3aa9e218d82..7a2c21338786 100644 --- a/packages/share/example/test_driver/test/share_e2e_test.dart +++ b/packages/share/example/test_driver/test/share_e2e_test.dart @@ -3,13 +3,15 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:async'; +import 'dart:convert'; import 'dart:io'; import 'package:flutter_driver/flutter_driver.dart'; Future main() async { final FlutterDriver driver = await FlutterDriver.connect(); - final String result = + final String data = await driver.requestData(null, timeout: const Duration(minutes: 1)); await driver.close(); - exit(result == 'pass' ? 0 : 1); + final Map result = jsonDecode(data); + exit(result['result'] == 'true' ? 0 : 1); } diff --git a/packages/share/pubspec.yaml b/packages/share/pubspec.yaml index f695dbd936c8..8da4d85bf842 100644 --- a/packages/share/pubspec.yaml +++ b/packages/share/pubspec.yaml @@ -5,7 +5,7 @@ homepage: https://github.com/flutter/plugins/tree/master/packages/share # 0.6.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.6.4+3 +version: 0.6.4+4 flutter: plugin: @@ -26,7 +26,8 @@ dev_dependencies: mockito: ^3.0.0 flutter_test: sdk: flutter - e2e: ^0.2.0 + e2e: + path: ../e2e pedantic: ^1.8.0 environment: diff --git a/packages/shared_preferences/shared_preferences/CHANGELOG.md b/packages/shared_preferences/shared_preferences/CHANGELOG.md index d17bbb96289b..52f1c1e28ac6 100644 --- a/packages/shared_preferences/shared_preferences/CHANGELOG.md +++ b/packages/shared_preferences/shared_preferences/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.5.9 + +* Update package:e2e reference to use the local version in the flutter/plugins + repository. + ## 0.5.8 * Support Linux by default. diff --git a/packages/shared_preferences/shared_preferences/example/android/app/src/main/java/io/flutter/plugins/sharedpreferencesexample/EmbeddingV1ActivityTest.java b/packages/shared_preferences/shared_preferences/example/android/app/src/main/java/io/flutter/plugins/sharedpreferencesexample/EmbeddingV1ActivityTest.java index 3eb677b21163..6917efbc69a6 100644 --- a/packages/shared_preferences/shared_preferences/example/android/app/src/main/java/io/flutter/plugins/sharedpreferencesexample/EmbeddingV1ActivityTest.java +++ b/packages/shared_preferences/shared_preferences/example/android/app/src/main/java/io/flutter/plugins/sharedpreferencesexample/EmbeddingV1ActivityTest.java @@ -2,11 +2,11 @@ package io.flutter.plugins.sharedpreferencesexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class EmbeddingV1ActivityTest { @Rule public ActivityTestRule rule = diff --git a/packages/shared_preferences/shared_preferences/example/android/app/src/main/java/io/flutter/plugins/sharedpreferencesexample/FlutterActivityTest.java b/packages/shared_preferences/shared_preferences/example/android/app/src/main/java/io/flutter/plugins/sharedpreferencesexample/FlutterActivityTest.java index e1ec837fa99a..62a00b901081 100644 --- a/packages/shared_preferences/shared_preferences/example/android/app/src/main/java/io/flutter/plugins/sharedpreferencesexample/FlutterActivityTest.java +++ b/packages/shared_preferences/shared_preferences/example/android/app/src/main/java/io/flutter/plugins/sharedpreferencesexample/FlutterActivityTest.java @@ -5,12 +5,12 @@ package io.flutter.plugins.sharedpreferencesexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class FlutterActivityTest { @Rule public ActivityTestRule rule = new ActivityTestRule<>(FlutterActivity.class); diff --git a/packages/shared_preferences/shared_preferences/example/pubspec.yaml b/packages/shared_preferences/shared_preferences/example/pubspec.yaml index 1e6df16e581b..7a24c3f6f495 100644 --- a/packages/shared_preferences/shared_preferences/example/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences/example/pubspec.yaml @@ -11,7 +11,8 @@ dev_dependencies: flutter_driver: sdk: flutter test: any - e2e: ^0.2.0 + e2e: + path: ../../../e2e pedantic: ^1.8.0 flutter: diff --git a/packages/shared_preferences/shared_preferences/example/test_driver/shared_preferences_e2e_test.dart b/packages/shared_preferences/shared_preferences/example/test_driver/shared_preferences_e2e_test.dart index f3aa9e218d82..7a2c21338786 100644 --- a/packages/shared_preferences/shared_preferences/example/test_driver/shared_preferences_e2e_test.dart +++ b/packages/shared_preferences/shared_preferences/example/test_driver/shared_preferences_e2e_test.dart @@ -3,13 +3,15 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:async'; +import 'dart:convert'; import 'dart:io'; import 'package:flutter_driver/flutter_driver.dart'; Future main() async { final FlutterDriver driver = await FlutterDriver.connect(); - final String result = + final String data = await driver.requestData(null, timeout: const Duration(minutes: 1)); await driver.close(); - exit(result == 'pass' ? 0 : 1); + final Map result = jsonDecode(data); + exit(result['result'] == 'true' ? 0 : 1); } diff --git a/packages/shared_preferences/shared_preferences/pubspec.yaml b/packages/shared_preferences/shared_preferences/pubspec.yaml index ca8c443cd753..6477b33361ab 100644 --- a/packages/shared_preferences/shared_preferences/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences/pubspec.yaml @@ -5,7 +5,7 @@ homepage: https://github.com/flutter/plugins/tree/master/packages/shared_prefere # 0.5.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.5.8 +version: 0.5.9 flutter: plugin: @@ -42,7 +42,8 @@ dev_dependencies: flutter_driver: sdk: flutter test: any - e2e: ^0.2.0 + e2e: + path: ../../e2e pedantic: ^1.8.0 environment: diff --git a/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml b/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml index 8e726d642274..6f0683776e05 100644 --- a/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml @@ -18,7 +18,8 @@ dev_dependencies: flutter_driver: sdk: flutter test: any - e2e: ^0.2.0 + e2e: + path: ../../../e2e pedantic: ^1.8.0 flutter: diff --git a/packages/shared_preferences/shared_preferences_linux/example/test_driver/shared_preferences_e2e_test.dart b/packages/shared_preferences/shared_preferences_linux/example/test_driver/shared_preferences_e2e_test.dart index f3aa9e218d82..7a2c21338786 100644 --- a/packages/shared_preferences/shared_preferences_linux/example/test_driver/shared_preferences_e2e_test.dart +++ b/packages/shared_preferences/shared_preferences_linux/example/test_driver/shared_preferences_e2e_test.dart @@ -3,13 +3,15 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:async'; +import 'dart:convert'; import 'dart:io'; import 'package:flutter_driver/flutter_driver.dart'; Future main() async { final FlutterDriver driver = await FlutterDriver.connect(); - final String result = + final String data = await driver.requestData(null, timeout: const Duration(minutes: 1)); await driver.close(); - exit(result == 'pass' ? 0 : 1); + final Map result = jsonDecode(data); + exit(result['result'] == 'true' ? 0 : 1); } diff --git a/packages/shared_preferences/shared_preferences_macos/example/pubspec.yaml b/packages/shared_preferences/shared_preferences_macos/example/pubspec.yaml index c31a0637253c..c6f2026b59bb 100644 --- a/packages/shared_preferences/shared_preferences_macos/example/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_macos/example/pubspec.yaml @@ -12,7 +12,8 @@ dev_dependencies: flutter_driver: sdk: flutter test: any - e2e: ^0.2.0 + e2e: + path: ../../../e2e pedantic: ^1.8.0 flutter: diff --git a/packages/shared_preferences/shared_preferences_macos/example/test_driver/shared_preferences_e2e_test.dart b/packages/shared_preferences/shared_preferences_macos/example/test_driver/shared_preferences_e2e_test.dart index f3aa9e218d82..7a2c21338786 100644 --- a/packages/shared_preferences/shared_preferences_macos/example/test_driver/shared_preferences_e2e_test.dart +++ b/packages/shared_preferences/shared_preferences_macos/example/test_driver/shared_preferences_e2e_test.dart @@ -3,13 +3,15 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:async'; +import 'dart:convert'; import 'dart:io'; import 'package:flutter_driver/flutter_driver.dart'; Future main() async { final FlutterDriver driver = await FlutterDriver.connect(); - final String result = + final String data = await driver.requestData(null, timeout: const Duration(minutes: 1)); await driver.close(); - exit(result == 'pass' ? 0 : 1); + final Map result = jsonDecode(data); + exit(result['result'] == 'true' ? 0 : 1); } diff --git a/packages/url_launcher/url_launcher/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/EmbeddingV1ActivityTest.java b/packages/url_launcher/url_launcher/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/EmbeddingV1ActivityTest.java index bae2957ab81e..9ce8eb281f69 100644 --- a/packages/url_launcher/url_launcher/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/EmbeddingV1ActivityTest.java +++ b/packages/url_launcher/url_launcher/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/EmbeddingV1ActivityTest.java @@ -1,11 +1,11 @@ package io.flutter.plugins.urllauncherexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class EmbeddingV1ActivityTest { @Rule public ActivityTestRule rule = diff --git a/packages/url_launcher/url_launcher/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/MainActivityTest.java b/packages/url_launcher/url_launcher/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/MainActivityTest.java index a9000fb29228..927ff1dbac74 100644 --- a/packages/url_launcher/url_launcher/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/MainActivityTest.java +++ b/packages/url_launcher/url_launcher/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/MainActivityTest.java @@ -1,12 +1,12 @@ package io.flutter.plugins.urllauncherexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class FlutterActivityTest { @Rule public ActivityTestRule rule = new ActivityTestRule<>(FlutterActivity.class); diff --git a/packages/url_launcher/url_launcher/example/pubspec.yaml b/packages/url_launcher/url_launcher/example/pubspec.yaml index 1eb3e603696f..576b1041129b 100644 --- a/packages/url_launcher/url_launcher/example/pubspec.yaml +++ b/packages/url_launcher/url_launcher/example/pubspec.yaml @@ -8,7 +8,8 @@ dependencies: path: ../ dev_dependencies: - e2e: "^0.2.0" + e2e: + path: ../../../e2e flutter_driver: sdk: flutter pedantic: ^1.8.0 diff --git a/packages/url_launcher/url_launcher/example/test_driver/url_launcher_e2e_test.dart b/packages/url_launcher/url_launcher/example/test_driver/url_launcher_e2e_test.dart index 1bcd0d37f450..7a2c21338786 100644 --- a/packages/url_launcher/url_launcher/example/test_driver/url_launcher_e2e_test.dart +++ b/packages/url_launcher/url_launcher/example/test_driver/url_launcher_e2e_test.dart @@ -2,14 +2,16 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'dart:async'; +import 'dart:convert'; import 'dart:io'; - import 'package:flutter_driver/flutter_driver.dart'; Future main() async { final FlutterDriver driver = await FlutterDriver.connect(); - final String result = + final String data = await driver.requestData(null, timeout: const Duration(minutes: 1)); await driver.close(); - exit(result == 'pass' ? 0 : 1); + final Map result = jsonDecode(data); + exit(result['result'] == 'true' ? 0 : 1); } diff --git a/packages/url_launcher/url_launcher_linux/example/pubspec.yaml b/packages/url_launcher/url_launcher_linux/example/pubspec.yaml index a4d08f30d6b4..2d99a8c2df9c 100644 --- a/packages/url_launcher/url_launcher_linux/example/pubspec.yaml +++ b/packages/url_launcher/url_launcher_linux/example/pubspec.yaml @@ -9,7 +9,8 @@ dependencies: path: ../ dev_dependencies: - e2e: "^0.2.0" + e2e: + path: ../../../e2e flutter_driver: sdk: flutter pedantic: ^1.8.0 diff --git a/packages/url_launcher/url_launcher_linux/example/test_driver/url_launcher_e2e_test.dart b/packages/url_launcher/url_launcher_linux/example/test_driver/url_launcher_e2e_test.dart index 1bcd0d37f450..7a2c21338786 100644 --- a/packages/url_launcher/url_launcher_linux/example/test_driver/url_launcher_e2e_test.dart +++ b/packages/url_launcher/url_launcher_linux/example/test_driver/url_launcher_e2e_test.dart @@ -2,14 +2,16 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'dart:async'; +import 'dart:convert'; import 'dart:io'; - import 'package:flutter_driver/flutter_driver.dart'; Future main() async { final FlutterDriver driver = await FlutterDriver.connect(); - final String result = + final String data = await driver.requestData(null, timeout: const Duration(minutes: 1)); await driver.close(); - exit(result == 'pass' ? 0 : 1); + final Map result = jsonDecode(data); + exit(result['result'] == 'true' ? 0 : 1); } diff --git a/packages/url_launcher/url_launcher_macos/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/EmbeddingV1ActivityTest.java b/packages/url_launcher/url_launcher_macos/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/EmbeddingV1ActivityTest.java index bae2957ab81e..9ce8eb281f69 100644 --- a/packages/url_launcher/url_launcher_macos/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/EmbeddingV1ActivityTest.java +++ b/packages/url_launcher/url_launcher_macos/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/EmbeddingV1ActivityTest.java @@ -1,11 +1,11 @@ package io.flutter.plugins.urllauncherexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class EmbeddingV1ActivityTest { @Rule public ActivityTestRule rule = diff --git a/packages/url_launcher/url_launcher_macos/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/FlutterActivityTest.java b/packages/url_launcher/url_launcher_macos/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/FlutterActivityTest.java index a9000fb29228..927ff1dbac74 100644 --- a/packages/url_launcher/url_launcher_macos/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/FlutterActivityTest.java +++ b/packages/url_launcher/url_launcher_macos/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/FlutterActivityTest.java @@ -1,12 +1,12 @@ package io.flutter.plugins.urllauncherexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class FlutterActivityTest { @Rule public ActivityTestRule rule = new ActivityTestRule<>(FlutterActivity.class); diff --git a/packages/url_launcher/url_launcher_macos/example/pubspec.yaml b/packages/url_launcher/url_launcher_macos/example/pubspec.yaml index 1125b6da73e9..a03bce7ad9f5 100644 --- a/packages/url_launcher/url_launcher_macos/example/pubspec.yaml +++ b/packages/url_launcher/url_launcher_macos/example/pubspec.yaml @@ -9,7 +9,8 @@ dependencies: path: ../ dev_dependencies: - e2e: "^0.2.0" + e2e: + path: ../../../e2e flutter_driver: sdk: flutter pedantic: ^1.8.0 diff --git a/packages/url_launcher/url_launcher_macos/example/test_driver/url_launcher_e2e_test.dart b/packages/url_launcher/url_launcher_macos/example/test_driver/url_launcher_e2e_test.dart index 1bcd0d37f450..7a2c21338786 100644 --- a/packages/url_launcher/url_launcher_macos/example/test_driver/url_launcher_e2e_test.dart +++ b/packages/url_launcher/url_launcher_macos/example/test_driver/url_launcher_e2e_test.dart @@ -2,14 +2,16 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'dart:async'; +import 'dart:convert'; import 'dart:io'; - import 'package:flutter_driver/flutter_driver.dart'; Future main() async { final FlutterDriver driver = await FlutterDriver.connect(); - final String result = + final String data = await driver.requestData(null, timeout: const Duration(minutes: 1)); await driver.close(); - exit(result == 'pass' ? 0 : 1); + final Map result = jsonDecode(data); + exit(result['result'] == 'true' ? 0 : 1); } diff --git a/packages/video_player/video_player/example/pubspec.yaml b/packages/video_player/video_player/example/pubspec.yaml index 29f1c91e4af3..1fb4f5b8e089 100644 --- a/packages/video_player/video_player/example/pubspec.yaml +++ b/packages/video_player/video_player/example/pubspec.yaml @@ -12,7 +12,8 @@ dev_dependencies: sdk: flutter flutter_driver: sdk: flutter - e2e: "^0.2.0" + e2e: + path: ../../../e2e test: any pedantic: ^1.8.0 diff --git a/packages/video_player/video_player/example/test_driver/video_player_e2e_test.dart b/packages/video_player/video_player/example/test_driver/video_player_e2e_test.dart index f3aa9e218d82..7a2c21338786 100644 --- a/packages/video_player/video_player/example/test_driver/video_player_e2e_test.dart +++ b/packages/video_player/video_player/example/test_driver/video_player_e2e_test.dart @@ -3,13 +3,15 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:async'; +import 'dart:convert'; import 'dart:io'; import 'package:flutter_driver/flutter_driver.dart'; Future main() async { final FlutterDriver driver = await FlutterDriver.connect(); - final String result = + final String data = await driver.requestData(null, timeout: const Duration(minutes: 1)); await driver.close(); - exit(result == 'pass' ? 0 : 1); + final Map result = jsonDecode(data); + exit(result['result'] == 'true' ? 0 : 1); } diff --git a/packages/webview_flutter/CHANGELOG.md b/packages/webview_flutter/CHANGELOG.md index 04155a509b80..baa485ba5b17 100644 --- a/packages/webview_flutter/CHANGELOG.md +++ b/packages/webview_flutter/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.3.22+2 + +* Update package:e2e reference to use the local version in the flutter/plugins + repository. + ## 0.3.22+1 * Update the `setAndGetScrollPosition` to use hard coded values and add a `pumpAndSettle` call. diff --git a/packages/webview_flutter/example/android/app/src/androidTestDebug/java/io/flutter/plugins/webviewflutterexample/EmbeddingV1ActivityTest.java b/packages/webview_flutter/example/android/app/src/androidTestDebug/java/io/flutter/plugins/webviewflutterexample/EmbeddingV1ActivityTest.java index fe10c6155e5a..80c7318e397e 100644 --- a/packages/webview_flutter/example/android/app/src/androidTestDebug/java/io/flutter/plugins/webviewflutterexample/EmbeddingV1ActivityTest.java +++ b/packages/webview_flutter/example/android/app/src/androidTestDebug/java/io/flutter/plugins/webviewflutterexample/EmbeddingV1ActivityTest.java @@ -1,11 +1,11 @@ package io.flutter.plugins.webviewflutterexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class EmbeddingV1ActivityTest { @Rule public ActivityTestRule rule = diff --git a/packages/webview_flutter/example/android/app/src/androidTestDebug/java/io/flutter/plugins/webviewflutterexample/MainActivityTest.java b/packages/webview_flutter/example/android/app/src/androidTestDebug/java/io/flutter/plugins/webviewflutterexample/MainActivityTest.java index 73387b8d1160..de7998186981 100644 --- a/packages/webview_flutter/example/android/app/src/androidTestDebug/java/io/flutter/plugins/webviewflutterexample/MainActivityTest.java +++ b/packages/webview_flutter/example/android/app/src/androidTestDebug/java/io/flutter/plugins/webviewflutterexample/MainActivityTest.java @@ -1,12 +1,12 @@ package io.flutter.plugins.webviewflutterexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterRunner; +import dev.flutter.plugins.e2e.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; -@RunWith(FlutterRunner.class) +@RunWith(FlutterTestRunner.class) public class MainActivityTest { @Rule public ActivityTestRule rule = new ActivityTestRule<>(FlutterActivity.class); diff --git a/packages/webview_flutter/example/pubspec.yaml b/packages/webview_flutter/example/pubspec.yaml index f5842fc6c163..f33076406f5f 100644 --- a/packages/webview_flutter/example/pubspec.yaml +++ b/packages/webview_flutter/example/pubspec.yaml @@ -15,7 +15,8 @@ dev_dependencies: sdk: flutter flutter_driver: sdk: flutter - e2e: "^0.2.0" + e2e: + path: ../../e2e pedantic: ^1.8.0 flutter: diff --git a/packages/webview_flutter/example/test_driver/webview_flutter_e2e_test.dart b/packages/webview_flutter/example/test_driver/webview_flutter_e2e_test.dart index ccd716607d60..7a2c21338786 100644 --- a/packages/webview_flutter/example/test_driver/webview_flutter_e2e_test.dart +++ b/packages/webview_flutter/example/test_driver/webview_flutter_e2e_test.dart @@ -3,14 +3,15 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:async'; +import 'dart:convert'; import 'dart:io'; - import 'package:flutter_driver/flutter_driver.dart'; Future main() async { final FlutterDriver driver = await FlutterDriver.connect(); - final String result = + final String data = await driver.requestData(null, timeout: const Duration(minutes: 1)); await driver.close(); - exit(result == 'pass' ? 0 : 1); + final Map result = jsonDecode(data); + exit(result['result'] == 'true' ? 0 : 1); } diff --git a/packages/webview_flutter/pubspec.yaml b/packages/webview_flutter/pubspec.yaml index 2ccc3efcccef..ec811833c9b8 100644 --- a/packages/webview_flutter/pubspec.yaml +++ b/packages/webview_flutter/pubspec.yaml @@ -1,6 +1,6 @@ name: webview_flutter description: A Flutter plugin that provides a WebView widget on Android and iOS. -version: 0.3.22+1 +version: 0.3.22+2 homepage: https://github.com/flutter/plugins/tree/master/packages/webview_flutter environment: From 14608ca5ed0fa54fb6b2abccbd68b120bfe8e283 Mon Sep 17 00:00:00 2001 From: Jia Hao Date: Sat, 25 Jul 2020 09:46:00 +0800 Subject: [PATCH 022/233] [e2e] Fix incorrect test results when one test passes then another fails (#2866) * [e2e] Fix incorrect test results when one test passes then another fails For example, the following test will result in an error reported for the first test case. ``` void main() { testWidgets('a test that passes', (tester) async { expect(true, true); }); testWidgets('a test that fails', (tester) async { expect(true, false); }); } ``` We need to reset `reportTestException` back to the previous value after completion of `runTest`, or repeated failures will cause the exception handler for a previous test to be invoked, as they "stack". Instead of reseting it, however, do this once in the constructor because the test description is already provided by the function signature. * Add a mechanism for testing test results --- packages/e2e/CHANGELOG.md | 6 +- packages/e2e/lib/e2e.dart | 36 +++++---- packages/e2e/pubspec.yaml | 2 +- packages/e2e/test/binding_fail_test.dart | 81 +++++++++++++++++++ packages/e2e/test/data/README.md | 4 + packages/e2e/test/data/fail_test_script.dart | 22 +++++ packages/e2e/test/data/pass_test_script.dart | 22 +++++ .../test/data/pass_then_fail_test_script.dart | 22 +++++ 8 files changed, 178 insertions(+), 17 deletions(-) create mode 100644 packages/e2e/test/binding_fail_test.dart create mode 100644 packages/e2e/test/data/README.md create mode 100644 packages/e2e/test/data/fail_test_script.dart create mode 100644 packages/e2e/test/data/pass_test_script.dart create mode 100644 packages/e2e/test/data/pass_then_fail_test_script.dart diff --git a/packages/e2e/CHANGELOG.md b/packages/e2e/CHANGELOG.md index 2df897d9ab5f..bc844ce72086 100644 --- a/packages/e2e/CHANGELOG.md +++ b/packages/e2e/CHANGELOG.md @@ -1,6 +1,10 @@ +## 0.6.2+1 + +* Fix incorrect test results when one test passes then another fails + ## 0.6.2 -* Fix `setSurfaceSize` for e2e tests. +* Fix `setSurfaceSize` for e2e tests ## 0.6.1 diff --git a/packages/e2e/lib/e2e.dart b/packages/e2e/lib/e2e.dart index d773b9b7a43b..93ce1f2c6cac 100644 --- a/packages/e2e/lib/e2e.dart +++ b/packages/e2e/lib/e2e.dart @@ -32,13 +32,26 @@ class E2EWidgetsFlutterBinding extends LiveTestWidgetsFlutterBinding { } await _channel.invokeMethod( 'allTestsFinished', - {'results': _results}, + {'results': results}, ); } on MissingPluginException { print('Warning: E2E test plugin was not detected.'); } if (!_allTestsPassed.isCompleted) _allTestsPassed.complete(true); }); + + // TODO(jackson): Report the results individually instead of all at once + // See https://github.com/flutter/flutter/issues/38985 + final TestExceptionReporter oldTestExceptionReporter = reportTestException; + reportTestException = + (FlutterErrorDetails details, String testDescription) { + results[testDescription] = 'failed'; + _failureMethodsDetails.add(Failure(testDescription, details.toString())); + if (!_allTestsPassed.isCompleted) { + _allTestsPassed.complete(false); + } + oldTestExceptionReporter(details, testDescription); + }; } // TODO(dnfield): Remove the ignore once we bump the minimum Flutter version @@ -100,7 +113,12 @@ class E2EWidgetsFlutterBinding extends LiveTestWidgetsFlutterBinding { static const MethodChannel _channel = MethodChannel('plugins.flutter.io/e2e'); - static Map _results = {}; + /// Test results that will be populated after the tests have completed. + /// + /// Keys are the test descriptions, and values are either `success` or + /// `failed`. + @visibleForTesting + Map results = {}; /// The extra data for the reported result. /// @@ -158,24 +176,12 @@ class E2EWidgetsFlutterBinding extends LiveTestWidgetsFlutterBinding { String description = '', Duration timeout, }) async { - // TODO(jackson): Report the results individually instead of all at once - // See https://github.com/flutter/flutter/issues/38985 - final TestExceptionReporter oldTestExceptionReporter = reportTestException; - reportTestException = - (FlutterErrorDetails details, String testDescription) { - _results[description] = 'failed'; - _failureMethodsDetails.add(Failure(testDescription, details.toString())); - if (!_allTestsPassed.isCompleted) { - _allTestsPassed.complete(false); - } - oldTestExceptionReporter(details, testDescription); - }; await super.runTest( testBody, invariantTester, description: description, timeout: timeout, ); - _results[description] ??= 'success'; + results[description] ??= 'success'; } } diff --git a/packages/e2e/pubspec.yaml b/packages/e2e/pubspec.yaml index 956a23f2b930..e3f39c05334b 100644 --- a/packages/e2e/pubspec.yaml +++ b/packages/e2e/pubspec.yaml @@ -1,6 +1,6 @@ name: e2e description: Runs tests that use the flutter_test API as integration tests. -version: 0.6.2 +version: 0.6.2+1 homepage: https://github.com/flutter/plugins/tree/master/packages/e2e environment: diff --git a/packages/e2e/test/binding_fail_test.dart b/packages/e2e/test/binding_fail_test.dart new file mode 100644 index 000000000000..0b00e1177e55 --- /dev/null +++ b/packages/e2e/test/binding_fail_test.dart @@ -0,0 +1,81 @@ +import 'dart:async'; +import 'dart:io'; +import 'dart:convert'; + +import 'package:flutter_test/flutter_test.dart'; + +// Assumes that the flutter command is in `$PATH`. +const String _flutterBin = 'flutter'; +const String _e2eResultsPrefix = 'E2EWidgetsFlutterBinding test results:'; + +void main() async { + group('E2E binding result', () { + test('when multiple tests pass', () async { + final Map results = + await _runTest('test/data/pass_test_script.dart'); + + expect( + results, + equals({ + 'passing test 1': 'success', + 'passing test 2': 'success', + })); + }); + + test('when multiple tests fail', () async { + final Map results = + await _runTest('test/data/fail_test_script.dart'); + + expect( + results, + equals({ + 'failing test 1': 'failed', + 'failing test 2': 'failed', + })); + }); + + test('when one test passes, then another fails', () async { + final Map results = + await _runTest('test/data/pass_then_fail_test_script.dart'); + + expect( + results, + equals({ + 'passing test': 'success', + 'failing test': 'failed', + })); + }); + }); +} + +/// Runs a test script and returns the [E2EWidgetsFlutterBinding.result]. +/// +/// [scriptPath] is relative to the package root. +Future> _runTest(String scriptPath) async { + final Process process = + await Process.start(_flutterBin, ['test', '--machine', scriptPath]); + + // In the test [tearDownAll] block, the test results are encoded into JSON and + // are printed with the [_e2eResultsPrefix] prefix. + // + // See the following for the test event spec which we parse the printed lines + // out of: https://github.com/dart-lang/test/blob/master/pkgs/test/doc/json_reporter.md + final String testResults = (await process.stdout + .transform(utf8.decoder) + .expand((String text) => text.split('\n')) + .map((String line) { + try { + return jsonDecode(line); + } on FormatException { + // Only interested in test events which are JSON. + } + }) + .where((dynamic testEvent) => + testEvent != null && testEvent['type'] == 'print') + .map((dynamic printEvent) => printEvent['message'] as String) + .firstWhere( + (String message) => message.startsWith(_e2eResultsPrefix))) + .replaceAll(_e2eResultsPrefix, ''); + + return jsonDecode(testResults); +} diff --git a/packages/e2e/test/data/README.md b/packages/e2e/test/data/README.md new file mode 100644 index 000000000000..e52aca112ce4 --- /dev/null +++ b/packages/e2e/test/data/README.md @@ -0,0 +1,4 @@ +Files in this directory are not invoked directly by the test command. + +They are used as inputs for the other test files outside of this directory, so +that failures can be tested. \ No newline at end of file diff --git a/packages/e2e/test/data/fail_test_script.dart b/packages/e2e/test/data/fail_test_script.dart new file mode 100644 index 000000000000..cbca5900fe29 --- /dev/null +++ b/packages/e2e/test/data/fail_test_script.dart @@ -0,0 +1,22 @@ +import 'dart:convert'; + +import 'package:e2e/e2e.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() async { + final E2EWidgetsFlutterBinding binding = + E2EWidgetsFlutterBinding.ensureInitialized(); + + testWidgets('failing test 1', (WidgetTester tester) async { + expect(true, false); + }); + + testWidgets('failing test 2', (WidgetTester tester) async { + expect(true, false); + }); + + tearDownAll(() { + print( + 'E2EWidgetsFlutterBinding test results: ${jsonEncode(binding.results)}'); + }); +} diff --git a/packages/e2e/test/data/pass_test_script.dart b/packages/e2e/test/data/pass_test_script.dart new file mode 100644 index 000000000000..194f71cdfe9b --- /dev/null +++ b/packages/e2e/test/data/pass_test_script.dart @@ -0,0 +1,22 @@ +import 'dart:convert'; + +import 'package:e2e/e2e.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() async { + final E2EWidgetsFlutterBinding binding = + E2EWidgetsFlutterBinding.ensureInitialized(); + + testWidgets('passing test 1', (WidgetTester tester) async { + expect(true, true); + }); + + testWidgets('passing test 2', (WidgetTester tester) async { + expect(true, true); + }); + + tearDownAll(() { + print( + 'E2EWidgetsFlutterBinding test results: ${jsonEncode(binding.results)}'); + }); +} diff --git a/packages/e2e/test/data/pass_then_fail_test_script.dart b/packages/e2e/test/data/pass_then_fail_test_script.dart new file mode 100644 index 000000000000..ffb7cac5cd5d --- /dev/null +++ b/packages/e2e/test/data/pass_then_fail_test_script.dart @@ -0,0 +1,22 @@ +import 'dart:convert'; + +import 'package:e2e/e2e.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() async { + final E2EWidgetsFlutterBinding binding = + E2EWidgetsFlutterBinding.ensureInitialized(); + + testWidgets('passing test', (WidgetTester tester) async { + expect(true, true); + }); + + testWidgets('failing test', (WidgetTester tester) async { + expect(true, false); + }); + + tearDownAll(() { + print( + 'E2EWidgetsFlutterBinding test results: ${jsonEncode(binding.results)}'); + }); +} From f6660a99fd0d6d454cbd4a95dc50dd69d3135dc8 Mon Sep 17 00:00:00 2001 From: "Ming Lyu (CareF)" Date: Wed, 29 Jul 2020 14:52:57 -0400 Subject: [PATCH 023/233] Clarify e2e readme for running on firebase test lab (#2898) * clarify e2e on firebase --- packages/e2e/README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/e2e/README.md b/packages/e2e/README.md index 76440bbd079e..a9ebed1130a4 100644 --- a/packages/e2e/README.md +++ b/packages/e2e/README.md @@ -130,10 +130,12 @@ documentation](https://firebase.google.com/docs/test-lab/?gclid=EAIaIQobChMIs5qV to set up a project. To run an e2e test on Android devices using Firebase Test Lab, use gradle commands to build an -instrumentation test for Android. +instrumentation test for Android, after creating `androidTest` as suggested in the last section. -``` +```bash pushd android +# flutter build generates files in android/ for building the app +flutter build apk ./gradlew app:assembleAndroidTest ./gradlew app:assembleDebug -Ptarget=.dart popd @@ -142,7 +144,7 @@ popd Upload the build apks Firebase Test Lab, making sure to replace , , , and with your values. -``` +```bash gcloud auth activate-service-account --key-file= gcloud --quiet config set project gcloud firebase test android run --type instrumentation \ From f903d4cf0342b894e44143b02d993bf298b8abe4 Mon Sep 17 00:00:00 2001 From: Mauricio Zepeda Date: Fri, 31 Jul 2020 19:05:17 -0500 Subject: [PATCH 024/233] Fixed typo manuelly for manually (#2902) --- packages/in_app_purchase/CHANGELOG.md | 4 ++++ packages/in_app_purchase/ios/Classes/InAppPurchasePlugin.m | 2 +- packages/in_app_purchase/ios/Tests/InAppPurchasePluginTest.m | 2 +- packages/in_app_purchase/pubspec.yaml | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/in_app_purchase/CHANGELOG.md b/packages/in_app_purchase/CHANGELOG.md index 3f6bd8e7829e..7e2eb3079396 100644 --- a/packages/in_app_purchase/CHANGELOG.md +++ b/packages/in_app_purchase/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.3.4+3 + +* Fixed typo 'manuelly' for 'manually'. + ## 0.3.4+2 * Update package:e2e reference to use the local version in the flutter/plugins diff --git a/packages/in_app_purchase/ios/Classes/InAppPurchasePlugin.m b/packages/in_app_purchase/ios/Classes/InAppPurchasePlugin.m index bfe29f981396..06fe74a613ae 100644 --- a/packages/in_app_purchase/ios/Classes/InAppPurchasePlugin.m +++ b/packages/in_app_purchase/ios/Classes/InAppPurchasePlugin.m @@ -187,7 +187,7 @@ - (void)addPayment:(FlutterMethodCall *)call result:(FlutterResult)result { result([FlutterError errorWithCode:@"storekit_duplicate_product_object" message:@"There is a pending transaction for the same product identifier. Please " - @"either wait for it to be finished or finish it manuelly using " + @"either wait for it to be finished or finish it manually using " @"`completePurchase` to avoid edge cases." details:call.arguments]); diff --git a/packages/in_app_purchase/ios/Tests/InAppPurchasePluginTest.m b/packages/in_app_purchase/ios/Tests/InAppPurchasePluginTest.m index 20543a203a97..f1290b074ad9 100644 --- a/packages/in_app_purchase/ios/Tests/InAppPurchasePluginTest.m +++ b/packages/in_app_purchase/ios/Tests/InAppPurchasePluginTest.m @@ -146,7 +146,7 @@ - (void)testAddPaymentWithSameProductIDWillFail { XCTAssertEqualObjects( error.message, @"There is a pending transaction for the same product identifier. Please " - @"either wait for it to be finished or finish it manuelly using " + @"either wait for it to be finished or finish it manually using " @"`completePurchase` to avoid edge cases."); [expectation fulfill]; }]; diff --git a/packages/in_app_purchase/pubspec.yaml b/packages/in_app_purchase/pubspec.yaml index 907c8ce5fe50..4b50721bf22b 100644 --- a/packages/in_app_purchase/pubspec.yaml +++ b/packages/in_app_purchase/pubspec.yaml @@ -1,7 +1,7 @@ name: in_app_purchase description: A Flutter plugin for in-app purchases. Exposes APIs for making in-app purchases through the App Store and Google Play. homepage: https://github.com/flutter/plugins/tree/master/packages/in_app_purchase -version: 0.3.4+2 +version: 0.3.4+3 dependencies: async: ^2.0.8 From b4b6e9e0f1c9dcd33fe59bfe272ca98c0fe8b65a Mon Sep 17 00:00:00 2001 From: David Iglesias Date: Tue, 4 Aug 2020 18:06:55 -0700 Subject: [PATCH 025/233] [google_maps_flutter + platform] Tweaks to enable a web implementation. (#2903) This change tweaks slightly the core maps plugin and the platform interface package to make the web implementation possible. The most important changes are two: * The core plugin now passes a constant identifier to the buildView platform call, so the web version can cache effectively the contents of the platform view, so it doesn't repaint. This might go away once Scenelets for web come online. * The platform interface now encodes the (optional) width and height of custom Icons for Markers, so the web can render High DPI assets at the correct size. The rest are some examples to the 'example' app so it can be run on web. --- .../google_maps_flutter/CHANGELOG.md | 5 ++ .../example/lib/marker_icons.dart | 2 +- .../example/lib/place_polyline.dart | 7 +- .../lib/src/google_map.dart | 10 +++ .../google_maps_flutter/pubspec.yaml | 4 +- .../test/map_creation_test.dart | 64 +++++++++++++++++++ .../CHANGELOG.md | 4 ++ .../lib/src/types/bitmap.dart | 7 ++ .../pubspec.yaml | 4 +- 9 files changed, 100 insertions(+), 7 deletions(-) create mode 100644 packages/google_maps_flutter/google_maps_flutter/test/map_creation_test.dart diff --git a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md index 8ad0c02d3f77..5d62a5179fd4 100644 --- a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.5.29 + +* Pass a constant `_web_only_mapCreationId` to `platform.buildView`, so web can return a cached widget DOM when flutter attempts to repaint there. +* Modify some examples slightly so they're more web-friendly. + ## 0.5.28+2 * Move test introduced in #2449 to its right location. diff --git a/packages/google_maps_flutter/google_maps_flutter/example/lib/marker_icons.dart b/packages/google_maps_flutter/google_maps_flutter/example/lib/marker_icons.dart index e0fcc427c1d6..b62d898c3a3b 100644 --- a/packages/google_maps_flutter/google_maps_flutter/example/lib/marker_icons.dart +++ b/packages/google_maps_flutter/google_maps_flutter/example/lib/marker_icons.dart @@ -73,7 +73,7 @@ class MarkerIconsBodyState extends State { Future _createMarkerImageFromAsset(BuildContext context) async { if (_markerIcon == null) { final ImageConfiguration imageConfiguration = - createLocalImageConfiguration(context); + createLocalImageConfiguration(context, size: Size.square(48)); BitmapDescriptor.fromAssetImage( imageConfiguration, 'assets/red_square.png') .then(_updateBitmap); diff --git a/packages/google_maps_flutter/google_maps_flutter/example/lib/place_polyline.dart b/packages/google_maps_flutter/google_maps_flutter/example/lib/place_polyline.dart index 0c9da634faa7..35ffd33a53c2 100644 --- a/packages/google_maps_flutter/google_maps_flutter/example/lib/place_polyline.dart +++ b/packages/google_maps_flutter/google_maps_flutter/example/lib/place_polyline.dart @@ -4,8 +4,7 @@ // ignore_for_file: public_member_api_docs -import 'dart:io' show Platform; - +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; @@ -202,7 +201,9 @@ class PlacePolylineBodyState extends State { @override Widget build(BuildContext context) { - final bool iOSorNotSelected = Platform.isIOS || (selectedPolyline == null); + final bool iOSorNotSelected = + (!kIsWeb && defaultTargetPlatform == TargetPlatform.iOS) || + (selectedPolyline == null); return Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, diff --git a/packages/google_maps_flutter/google_maps_flutter/lib/src/google_map.dart b/packages/google_maps_flutter/google_maps_flutter/lib/src/google_map.dart index a45a1c8e3fe4..5cf3db120ccd 100644 --- a/packages/google_maps_flutter/google_maps_flutter/lib/src/google_map.dart +++ b/packages/google_maps_flutter/google_maps_flutter/lib/src/google_map.dart @@ -10,6 +10,12 @@ part of google_maps_flutter; /// map is created. typedef void MapCreatedCallback(GoogleMapController controller); +// This counter is used to provide a stable "constant" initialization id +// to the buildView function, so the web implementation can use it as a +// cache key. This needs to be provided from the outside, because web +// views seem to re-render much more often that mobile platform views. +int _webOnlyMapId = 0; + /// A widget which displays a map with data obtained from the Google Maps service. class GoogleMap extends StatefulWidget { /// Creates a widget displaying data from Google Maps services. @@ -205,6 +211,8 @@ class GoogleMap extends StatefulWidget { } class _GoogleMapState extends State { + final _webOnlyMapCreationId = _webOnlyMapId++; + final Completer _controller = Completer(); @@ -223,7 +231,9 @@ class _GoogleMapState extends State { 'polygonsToAdd': serializePolygonSet(widget.polygons), 'polylinesToAdd': serializePolylineSet(widget.polylines), 'circlesToAdd': serializeCircleSet(widget.circles), + '_webOnlyMapCreationId': _webOnlyMapCreationId, }; + return _googleMapsFlutterPlatform.buildView( creationParams, widget.gestureRecognizers, diff --git a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml index 5e3cf226f03d..120600a9823c 100644 --- a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml @@ -1,7 +1,7 @@ name: google_maps_flutter description: A Flutter plugin for integrating Google Maps in iOS and Android applications. homepage: https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter/google_maps_flutter -version: 0.5.28+2 +version: 0.5.29 dependencies: flutter: @@ -19,6 +19,8 @@ dev_dependencies: sdk: flutter test: ^1.6.0 pedantic: ^1.8.0 + plugin_platform_interface: ^1.0.2 + mockito: ^4.1.1 flutter: plugin: diff --git a/packages/google_maps_flutter/google_maps_flutter/test/map_creation_test.dart b/packages/google_maps_flutter/google_maps_flutter/test/map_creation_test.dart new file mode 100644 index 000000000000..7861c86e9709 --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter/test/map_creation_test.dart @@ -0,0 +1,64 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:flutter/widgets.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; +import 'package:google_maps_flutter_platform_interface/google_maps_flutter_platform_interface.dart'; +import 'package:plugin_platform_interface/plugin_platform_interface.dart'; +import 'package:mockito/mockito.dart'; + +class MockGoogleMapsFlutterPlatform extends Mock + with MockPlatformInterfaceMixin + implements GoogleMapsFlutterPlatform {} + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + final platform = MockGoogleMapsFlutterPlatform(); + + setUp(() { + // Use a mock platform so we never need to hit the MethodChannel code. + GoogleMapsFlutterPlatform.instance = platform; + when(platform.buildView(any, any, any)).thenReturn(Container()); + }); + + testWidgets('_webOnlyMapCreationId increments with each GoogleMap widget', ( + WidgetTester tester, + ) async { + // Inject two map widgets... + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: Column( + children: const [ + GoogleMap( + initialCameraPosition: CameraPosition( + target: LatLng(43.362, -5.849), + ), + ), + GoogleMap( + initialCameraPosition: CameraPosition( + target: LatLng(47.649, -122.350), + ), + ), + ], + ), + ), + ); + + // Verify that each one was created with a different _webOnlyMapCreationId. + verifyInOrder([ + platform.buildView( + argThat(containsPair('_webOnlyMapCreationId', 0)), + any, + any, + ), + platform.buildView( + argThat(containsPair('_webOnlyMapCreationId', 1)), + any, + any, + ), + ]); + }); +} diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md index eca5c914a603..47cb8ecc15ad 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.3 + +* Pass icon width/height if present on `fromAssetImage` BitmapDescriptors (web only) + ## 1.0.2 * Update lower bound of dart dependency to 2.1.0. diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/bitmap.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/bitmap.dart index 40581b43e065..a6fdcc1b7e33 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/bitmap.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/bitmap.dart @@ -9,6 +9,8 @@ import 'package:flutter/material.dart' show ImageConfiguration, AssetImage, AssetBundleImageKey; import 'package:flutter/services.dart' show AssetBundle; +import 'package:flutter/foundation.dart' show kIsWeb; + /// Defines a bitmap image. For a marker, this class can be used to set the /// image of the marker icon. For a ground overlay, it can be used to set the /// image to place on the surface of the earth. @@ -100,6 +102,11 @@ class BitmapDescriptor { 'fromAssetImage', assetBundleImageKey.name, assetBundleImageKey.scale, + if (kIsWeb && configuration?.size != null) + [ + configuration.size.width, + configuration.size.height, + ], ]); } diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml index b28b7f47652d..f062b25c79ea 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml @@ -3,7 +3,7 @@ description: A common platform interface for the google_maps_flutter plugin. homepage: https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter/google_maps_flutter_platform_interface # NOTE: We strongly prefer non-breaking changes, even at the expense of a # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes -version: 1.0.2 +version: 1.0.3 dependencies: flutter: @@ -19,5 +19,5 @@ dev_dependencies: pedantic: ^1.8.0 environment: - sdk: ">=2.1.0 <3.0.0" + sdk: ">=2.3.0 <3.0.0" flutter: ">=1.9.1+hotfix.4 <2.0.0" From 9d77f5dda56bfce6c681665a8c4f2ef45a2869cd Mon Sep 17 00:00:00 2001 From: "Ming Lyu (CareF)" Date: Wed, 5 Aug 2020 15:57:32 -0400 Subject: [PATCH 026/233] [e2e] Add new e2e_driver for handling response data and performance watcher (#2906) --- packages/e2e/CHANGELOG.md | 5 + .../example/test_driver/example_e2e_test.dart | 2 +- packages/e2e/lib/e2e_driver.dart | 80 ++++++- packages/e2e/lib/e2e_perf.dart | 199 ++++++++++++++++++ packages/e2e/pubspec.yaml | 3 +- .../test/frame_timing_summarizer_test.dart | 35 +++ 6 files changed, 318 insertions(+), 6 deletions(-) create mode 100644 packages/e2e/lib/e2e_perf.dart create mode 100644 packages/e2e/test/frame_timing_summarizer_test.dart diff --git a/packages/e2e/CHANGELOG.md b/packages/e2e/CHANGELOG.md index bc844ce72086..e48b95d099a7 100644 --- a/packages/e2e/CHANGELOG.md +++ b/packages/e2e/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.6.3 + +* Add customizable `flutter_driver` adaptor. +* Add utilities for tracking frame performance in an e2e test. + ## 0.6.2+1 * Fix incorrect test results when one test passes then another fails diff --git a/packages/e2e/example/test_driver/example_e2e_test.dart b/packages/e2e/example/test_driver/example_e2e_test.dart index 983c3863dea5..cc3ea1572a52 100644 --- a/packages/e2e/example/test_driver/example_e2e_test.dart +++ b/packages/e2e/example/test_driver/example_e2e_test.dart @@ -2,4 +2,4 @@ import 'dart:async'; import 'package:e2e/e2e_driver.dart' as e2e; -Future main() async => e2e.main(); +Future main() async => e2e.e2eDriver(); diff --git a/packages/e2e/lib/e2e_driver.dart b/packages/e2e/lib/e2e_driver.dart index 2e43c5a36e55..c33083e07574 100644 --- a/packages/e2e/lib/e2e_driver.dart +++ b/packages/e2e/lib/e2e_driver.dart @@ -1,21 +1,93 @@ +// Copyright 2014 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + import 'dart:async'; +import 'dart:convert'; import 'dart:io'; -import 'package:e2e/common.dart' as e2e; import 'package:flutter_driver/flutter_driver.dart'; -Future main() async { +import 'package:e2e/common.dart' as e2e; +import 'package:path/path.dart' as path; + +/// This method remains for backword compatibility. +Future main() => e2eDriver(); + +/// Flutter Driver test output directory. +/// +/// Tests should write any output files to this directory. Defaults to the path +/// set in the FLUTTER_TEST_OUTPUTS_DIR environment variable, or `build` if +/// unset. +String testOutputsDirectory = + Platform.environment['FLUTTER_TEST_OUTPUTS_DIR'] ?? 'build'; + +/// The callback type to handle [e2e.Response.data] after the test succcess. +typedef ResponseDataCallback = FutureOr Function(Map); + +/// Writes a json-serializable json data to to +/// [testOutputsDirectory]/`testOutputFilename.json`. +/// +/// This is the default `responseDataCallback` in [e2eDriver]. +Future writeResponseData( + Map data, { + String testOutputFilename = 'e2e_response_data', + String destinationDirectory, +}) async { + assert(testOutputFilename != null); + destinationDirectory ??= testOutputsDirectory; + await fs.directory(destinationDirectory).create(recursive: true); + final File file = fs.file(path.join( + destinationDirectory, + '$testOutputFilename.json', + )); + final String resultString = _encodeJson(data, true); + await file.writeAsString(resultString); +} + +/// Adaptor to run E2E test using `flutter drive`. +/// +/// `timeout` controls the longest time waited before the test ends. +/// It is not necessarily the execution time for the test app: the test may +/// finish sooner than the `timeout`. +/// +/// `responseDataCallback` is the handler for processing [e2e.Response.data]. +/// The default value is `writeResponseData`. +/// +/// To an E2E test `.dart` using `flutter drive`, put a file named +/// `_test.dart` in the app's `test_driver` directory: +/// +/// ```dart +/// import 'dart:async'; +/// +/// import 'package:e2e/e2e_driver.dart' as e2e; +/// +/// Future main() async => e2e.e2eDriver(); +/// +/// ``` +Future e2eDriver({ + Duration timeout = const Duration(minutes: 1), + ResponseDataCallback responseDataCallback = writeResponseData, +}) async { final FlutterDriver driver = await FlutterDriver.connect(); - final String jsonResult = - await driver.requestData(null, timeout: const Duration(minutes: 1)); + final String jsonResult = await driver.requestData(null, timeout: timeout); final e2e.Response response = e2e.Response.fromJson(jsonResult); await driver.close(); if (response.allTestsPassed) { print('All tests passed.'); + if (responseDataCallback != null) { + await responseDataCallback(response.data); + } exit(0); } else { print('Failure Details:\n${response.formattedFailureDetails}'); exit(1); } } + +const JsonEncoder _prettyEncoder = JsonEncoder.withIndent(' '); + +String _encodeJson(Map jsonObject, bool pretty) { + return pretty ? _prettyEncoder.convert(jsonObject) : json.encode(jsonObject); +} diff --git a/packages/e2e/lib/e2e_perf.dart b/packages/e2e/lib/e2e_perf.dart new file mode 100644 index 000000000000..1b2ddd74c336 --- /dev/null +++ b/packages/e2e/lib/e2e_perf.dart @@ -0,0 +1,199 @@ +// Copyright 2014 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:async'; +import 'dart:ui'; + +import 'package:flutter/scheduler.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:flutter/widgets.dart'; + +import 'package:e2e/e2e.dart'; + +/// The maximum amount of time considered safe to spend for a frame's build +/// phase. Anything past that is in the danger of missing the frame as 60FPS. +/// +/// Changing this doesn't re-evaluate existing summary. +Duration kBuildBudget = const Duration(milliseconds: 16); +// TODO(CareF): Automatically calculate the refresh budget (#61958) + +bool _firstRun = true; + +/// The warning message to show when a benchmark is performed with assert on. +/// TODO(CareF) remove this and update pubspect when flutter/flutter#61509 is +/// in released version. +const String kDebugWarning = ''' +┏╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍┓ +┇ ⚠ THIS BENCHMARK IS BEING RUN IN DEBUG MODE ⚠ ┇ +┡╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍┦ +│ │ +│ Numbers obtained from a benchmark while asserts are │ +│ enabled will not accurately reflect the performance │ +│ that will be experienced by end users using release ╎ +│ builds. Benchmarks should be run using this command ╎ +│ line: "flutter run --profile test.dart" or ┊ +│ or "flutter drive --profile -t test.dart". ┊ +│ ┊ +└─────────────────────────────────────────────────╌┄┈ 🐢 +'''; + +/// watches the [FrameTiming] of `action` and report it to the e2e binding. +Future watchPerformance( + E2EWidgetsFlutterBinding binding, + Future action(), { + String reportKey = 'performance', +}) async { + assert(() { + if (_firstRun) { + debugPrint(kDebugWarning); + _firstRun = false; + } + return true; + }()); + final List frameTimings = []; + final TimingsCallback watcher = frameTimings.addAll; + binding.addTimingsCallback(watcher); + await action(); + binding.removeTimingsCallback(watcher); + final FrameTimingSummarizer frameTimes = FrameTimingSummarizer(frameTimings); + binding.reportData = {reportKey: frameTimes.summary}; +} + +/// This class and summarizes a list of [FrameTiming] for the performance +/// metrics. +class FrameTimingSummarizer { + /// Summarize `data` to frame build time and frame rasterizer time statistics. + /// + /// See [TimelineSummary.summaryJson] for detail. + factory FrameTimingSummarizer(List data) { + assert(data != null); + assert(data.isNotEmpty); + final List frameBuildTime = List.unmodifiable( + data.map((FrameTiming datum) => datum.buildDuration), + ); + final List frameBuildTimeSorted = + List.from(frameBuildTime)..sort(); + final List frameRasterizerTime = List.unmodifiable( + data.map((FrameTiming datum) => datum.rasterDuration), + ); + final List frameRasterizerTimeSorted = + List.from(frameRasterizerTime)..sort(); + final Duration Function(Duration, Duration) add = + (Duration a, Duration b) => a + b; + return FrameTimingSummarizer._( + frameBuildTime: frameBuildTime, + frameRasterizerTime: frameRasterizerTime, + // This avarage calculation is microsecond precision, which is fine + // because typical values of these times are milliseconds. + averageFrameBuildTime: frameBuildTime.reduce(add) ~/ data.length, + p90FrameBuildTime: _findPercentile(frameBuildTimeSorted, 0.90), + p99FrameBuildTime: _findPercentile(frameBuildTimeSorted, 0.99), + worstFrameBuildTime: frameBuildTimeSorted.last, + missedFrameBuildBudget: _countExceed(frameBuildTimeSorted, kBuildBudget), + averageFrameRasterizerTime: + frameRasterizerTime.reduce(add) ~/ data.length, + p90FrameRasterizerTime: _findPercentile(frameRasterizerTimeSorted, 0.90), + p99FrameRasterizerTime: _findPercentile(frameRasterizerTimeSorted, 0.99), + worstFrameRasterizerTime: frameRasterizerTimeSorted.last, + missedFrameRasterizerBudget: + _countExceed(frameRasterizerTimeSorted, kBuildBudget), + ); + } + + const FrameTimingSummarizer._({ + @required this.frameBuildTime, + @required this.frameRasterizerTime, + @required this.averageFrameBuildTime, + @required this.p90FrameBuildTime, + @required this.p99FrameBuildTime, + @required this.worstFrameBuildTime, + @required this.missedFrameBuildBudget, + @required this.averageFrameRasterizerTime, + @required this.p90FrameRasterizerTime, + @required this.p99FrameRasterizerTime, + @required this.worstFrameRasterizerTime, + @required this.missedFrameRasterizerBudget, + }); + + /// List of frame build time in microseconds + final List frameBuildTime; + + /// List of frame rasterizer time in microseconds + final List frameRasterizerTime; + + /// The average value of [frameBuildTime] in milliseconds. + final Duration averageFrameBuildTime; + + /// The 90-th percentile value of [frameBuildTime] in milliseconds + final Duration p90FrameBuildTime; + + /// The 99-th percentile value of [frameBuildTime] in milliseconds + final Duration p99FrameBuildTime; + + /// The largest value of [frameBuildTime] in milliseconds + final Duration worstFrameBuildTime; + + /// Number of items in [frameBuildTime] that's greater than [kBuildBudget] + final int missedFrameBuildBudget; + + /// The average value of [frameRasterizerTime] in milliseconds. + final Duration averageFrameRasterizerTime; + + /// The 90-th percentile value of [frameRasterizerTime] in milliseconds. + final Duration p90FrameRasterizerTime; + + /// The 99-th percentile value of [frameRasterizerTime] in milliseconds. + final Duration p99FrameRasterizerTime; + + /// The largest value of [frameRasterizerTime] in milliseconds. + final Duration worstFrameRasterizerTime; + + /// Number of items in [frameRasterizerTime] that's greater than [kBuildBudget] + final int missedFrameRasterizerBudget; + + /// Convert the summary result to a json object. + /// + /// See [TimelineSummary.summaryJson] for detail. + Map get summary => { + 'average_frame_build_time_millis': + averageFrameBuildTime.inMicroseconds / 1E3, + '90th_percentile_frame_build_time_millis': + p90FrameBuildTime.inMicroseconds / 1E3, + '99th_percentile_frame_build_time_millis': + p99FrameBuildTime.inMicroseconds / 1E3, + 'worst_frame_build_time_millis': + worstFrameBuildTime.inMicroseconds / 1E3, + 'missed_frame_build_budget_count': missedFrameBuildBudget, + 'average_frame_rasterizer_time_millis': + averageFrameRasterizerTime.inMicroseconds / 1E3, + '90th_percentile_frame_rasterizer_time_millis': + p90FrameRasterizerTime.inMicroseconds / 1E3, + '99th_percentile_frame_rasterizer_time_millis': + p99FrameRasterizerTime.inMicroseconds / 1E3, + 'worst_frame_rasterizer_time_millis': + worstFrameRasterizerTime.inMicroseconds / 1E3, + 'missed_frame_rasterizer_budget_count': missedFrameRasterizerBudget, + 'frame_count': frameBuildTime.length, + 'frame_build_times': frameBuildTime + .map((Duration datum) => datum.inMicroseconds) + .toList(), + 'frame_rasterizer_times': frameRasterizerTime + .map((Duration datum) => datum.inMicroseconds) + .toList(), + }; +} + +// The following helper functions require data sorted + +// return the 100*p-th percentile of the data +T _findPercentile(List data, double p) { + assert(p >= 0 && p <= 1); + return data[((data.length - 1) * p).round()]; +} + +// return the number of items in data that > threshold +int _countExceed>(List data, T threshold) { + return data.length - + data.indexWhere((T datum) => datum.compareTo(threshold) > 0); +} diff --git a/packages/e2e/pubspec.yaml b/packages/e2e/pubspec.yaml index e3f39c05334b..e4e476d146d3 100644 --- a/packages/e2e/pubspec.yaml +++ b/packages/e2e/pubspec.yaml @@ -1,6 +1,6 @@ name: e2e description: Runs tests that use the flutter_test API as integration tests. -version: 0.6.2+1 +version: 0.6.3 homepage: https://github.com/flutter/plugins/tree/master/packages/e2e environment: @@ -14,6 +14,7 @@ dependencies: sdk: flutter flutter_test: sdk: flutter + path: ^1.6.4 dev_dependencies: pedantic: ^1.8.0 diff --git a/packages/e2e/test/frame_timing_summarizer_test.dart b/packages/e2e/test/frame_timing_summarizer_test.dart new file mode 100644 index 000000000000..f3a12850122d --- /dev/null +++ b/packages/e2e/test/frame_timing_summarizer_test.dart @@ -0,0 +1,35 @@ +import 'dart:ui'; + +import 'package:flutter_test/flutter_test.dart'; + +import 'package:e2e/e2e_perf.dart'; + +void main() { + test('Test FrameTimingSummarizer', () { + List buildTimes = [ + for (int i = 1; i <= 100; i += 1) 1000 * i, + ]; + buildTimes = buildTimes.reversed.toList(); + List rasterTimes = [ + for (int i = 1; i <= 100; i += 1) 1000 * i + 1000, + ]; + rasterTimes = rasterTimes.reversed.toList(); + List inputData = [ + for (int i = 0; i < 100; i += 1) + FrameTiming([0, buildTimes[i], 500, rasterTimes[i]]), + ]; + FrameTimingSummarizer summary = FrameTimingSummarizer(inputData); + expect(summary.averageFrameBuildTime.inMicroseconds, 50500); + expect(summary.p90FrameBuildTime.inMicroseconds, 90000); + expect(summary.p99FrameBuildTime.inMicroseconds, 99000); + expect(summary.worstFrameBuildTime.inMicroseconds, 100000); + expect(summary.missedFrameBuildBudget, 84); + + expect(summary.averageFrameRasterizerTime.inMicroseconds, 51000); + expect(summary.p90FrameRasterizerTime.inMicroseconds, 90500); + expect(summary.p99FrameRasterizerTime.inMicroseconds, 99500); + expect(summary.worstFrameRasterizerTime.inMicroseconds, 100500); + expect(summary.missedFrameRasterizerBudget, 85); + expect(summary.frameBuildTime.length, 100); + }); +} From 740481e727160ab03f8a4aa023a35de17df993c1 Mon Sep 17 00:00:00 2001 From: David Iglesias Date: Mon, 10 Aug 2020 10:43:31 -0700 Subject: [PATCH 027/233] [google_maps_flutter_platform_interface] Add dispose method. (#2908) This method gives the plugin writers a chance to release the resources that they've acquired throughout the operation of the plugin (think of it as an "inverse" of the "init" method). --- .../google_maps_flutter_platform_interface/CHANGELOG.md | 4 ++++ .../method_channel/method_channel_google_maps_flutter.dart | 6 ++++++ .../platform_interface/google_maps_flutter_platform.dart | 5 +++++ .../google_maps_flutter_platform_interface/pubspec.yaml | 2 +- 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md index 47cb8ecc15ad..dc8eddf8b557 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.4 + +* Add a `dispose` method to the interface, so implementations may cleanup resources acquired on `init`. + ## 1.0.3 * Pass icon width/height if present on `fromAssetImage` BitmapDescriptors (web only) diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/method_channel/method_channel_google_maps_flutter.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/method_channel/method_channel_google_maps_flutter.dart index edbc51ab5afd..31392354d946 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/method_channel/method_channel_google_maps_flutter.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/method_channel/method_channel_google_maps_flutter.dart @@ -48,6 +48,12 @@ class MethodChannelGoogleMapsFlutter extends GoogleMapsFlutterPlatform { return channel.invokeMethod('map#waitForMap'); } + /// Dispose of the native resources. + @override + void dispose({int mapId}) { + // Noop! + } + // The controller we need to broadcast the different events coming // from handleMethodCall. // diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/platform_interface/google_maps_flutter_platform.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/platform_interface/google_maps_flutter_platform.dart index b89d3420c68e..a4f487740811 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/platform_interface/google_maps_flutter_platform.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/platform_interface/google_maps_flutter_platform.dart @@ -304,6 +304,11 @@ abstract class GoogleMapsFlutterPlatform extends PlatformInterface { throw UnimplementedError('onLongPress() has not been implemented.'); } + /// Dispose of whatever resources the `mapId` is holding on to. + void dispose({@required int mapId}) { + throw UnimplementedError('dispose() has not been implemented.'); + } + /// Returns a widget displaying the map view Widget buildView( Map creationParams, diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml index f062b25c79ea..fd3a1c434960 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml @@ -3,7 +3,7 @@ description: A common platform interface for the google_maps_flutter plugin. homepage: https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter/google_maps_flutter_platform_interface # NOTE: We strongly prefer non-breaking changes, even at the expense of a # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes -version: 1.0.3 +version: 1.0.4 dependencies: flutter: From 1c9529a6e0a7143b530e7eeb5bfa19b2a995cb25 Mon Sep 17 00:00:00 2001 From: Panmari Date: Tue, 11 Aug 2020 17:48:10 +0200 Subject: [PATCH 028/233] [camera] Improving handling when camera permissions are not granted. (#2848) --- packages/camera/CHANGELOG.md | 4 ++++ .../java/io/flutter/plugins/camera/MethodCallHandlerImpl.java | 2 ++ packages/camera/pubspec.yaml | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/camera/CHANGELOG.md b/packages/camera/CHANGELOG.md index 43e5f463604c..88c0ed8c7625 100644 --- a/packages/camera/CHANGELOG.md +++ b/packages/camera/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.5.8+4 + +* Fixed bug caused by casting a `CameraAccessException` on Android. + ## 0.5.8+3 * Fix bug in usage example in README.md diff --git a/packages/camera/android/src/main/java/io/flutter/plugins/camera/MethodCallHandlerImpl.java b/packages/camera/android/src/main/java/io/flutter/plugins/camera/MethodCallHandlerImpl.java index cb58d19a9a02..132075555f26 100644 --- a/packages/camera/android/src/main/java/io/flutter/plugins/camera/MethodCallHandlerImpl.java +++ b/packages/camera/android/src/main/java/io/flutter/plugins/camera/MethodCallHandlerImpl.java @@ -167,8 +167,10 @@ private void instantiateCamera(MethodCall call, Result result) throws CameraAcce private void handleException(Exception exception, Result result) { if (exception instanceof CameraAccessException) { result.error("CameraAccess", exception.getMessage(), null); + return; } + // CameraAccessException can not be cast to a RuntimeException. throw (RuntimeException) exception; } } diff --git a/packages/camera/pubspec.yaml b/packages/camera/pubspec.yaml index a1ce42370191..a93c016e1f10 100644 --- a/packages/camera/pubspec.yaml +++ b/packages/camera/pubspec.yaml @@ -2,7 +2,7 @@ name: camera description: A Flutter plugin for getting information about and controlling the camera on Android and iOS. Supports previewing the camera feed, capturing images, capturing video, and streaming image buffers to dart. -version: 0.5.8+3 +version: 0.5.8+4 homepage: https://github.com/flutter/plugins/tree/master/packages/camera From 3ae30be4994c256c48b212a31f54a5b2b80a8b32 Mon Sep 17 00:00:00 2001 From: "Ming Lyu (CareF)" Date: Tue, 11 Aug 2020 13:58:42 -0400 Subject: [PATCH 029/233] [e2e] Revert performance tracker utilities (#2917) (To be moved to flutter_test) --- packages/e2e/CHANGELOG.md | 4 + packages/e2e/lib/e2e_perf.dart | 199 ------------------ packages/e2e/pubspec.yaml | 2 +- .../test/frame_timing_summarizer_test.dart | 35 --- 4 files changed, 5 insertions(+), 235 deletions(-) delete mode 100644 packages/e2e/lib/e2e_perf.dart delete mode 100644 packages/e2e/test/frame_timing_summarizer_test.dart diff --git a/packages/e2e/CHANGELOG.md b/packages/e2e/CHANGELOG.md index e48b95d099a7..2ccf9573a17d 100644 --- a/packages/e2e/CHANGELOG.md +++ b/packages/e2e/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.7.0 + +* Move utilities for tracking frame performance in an e2e test to `flutter_test`. + ## 0.6.3 * Add customizable `flutter_driver` adaptor. diff --git a/packages/e2e/lib/e2e_perf.dart b/packages/e2e/lib/e2e_perf.dart deleted file mode 100644 index 1b2ddd74c336..000000000000 --- a/packages/e2e/lib/e2e_perf.dart +++ /dev/null @@ -1,199 +0,0 @@ -// Copyright 2014 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; -import 'dart:ui'; - -import 'package:flutter/scheduler.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:flutter/widgets.dart'; - -import 'package:e2e/e2e.dart'; - -/// The maximum amount of time considered safe to spend for a frame's build -/// phase. Anything past that is in the danger of missing the frame as 60FPS. -/// -/// Changing this doesn't re-evaluate existing summary. -Duration kBuildBudget = const Duration(milliseconds: 16); -// TODO(CareF): Automatically calculate the refresh budget (#61958) - -bool _firstRun = true; - -/// The warning message to show when a benchmark is performed with assert on. -/// TODO(CareF) remove this and update pubspect when flutter/flutter#61509 is -/// in released version. -const String kDebugWarning = ''' -┏╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍┓ -┇ ⚠ THIS BENCHMARK IS BEING RUN IN DEBUG MODE ⚠ ┇ -┡╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍┦ -│ │ -│ Numbers obtained from a benchmark while asserts are │ -│ enabled will not accurately reflect the performance │ -│ that will be experienced by end users using release ╎ -│ builds. Benchmarks should be run using this command ╎ -│ line: "flutter run --profile test.dart" or ┊ -│ or "flutter drive --profile -t test.dart". ┊ -│ ┊ -└─────────────────────────────────────────────────╌┄┈ 🐢 -'''; - -/// watches the [FrameTiming] of `action` and report it to the e2e binding. -Future watchPerformance( - E2EWidgetsFlutterBinding binding, - Future action(), { - String reportKey = 'performance', -}) async { - assert(() { - if (_firstRun) { - debugPrint(kDebugWarning); - _firstRun = false; - } - return true; - }()); - final List frameTimings = []; - final TimingsCallback watcher = frameTimings.addAll; - binding.addTimingsCallback(watcher); - await action(); - binding.removeTimingsCallback(watcher); - final FrameTimingSummarizer frameTimes = FrameTimingSummarizer(frameTimings); - binding.reportData = {reportKey: frameTimes.summary}; -} - -/// This class and summarizes a list of [FrameTiming] for the performance -/// metrics. -class FrameTimingSummarizer { - /// Summarize `data` to frame build time and frame rasterizer time statistics. - /// - /// See [TimelineSummary.summaryJson] for detail. - factory FrameTimingSummarizer(List data) { - assert(data != null); - assert(data.isNotEmpty); - final List frameBuildTime = List.unmodifiable( - data.map((FrameTiming datum) => datum.buildDuration), - ); - final List frameBuildTimeSorted = - List.from(frameBuildTime)..sort(); - final List frameRasterizerTime = List.unmodifiable( - data.map((FrameTiming datum) => datum.rasterDuration), - ); - final List frameRasterizerTimeSorted = - List.from(frameRasterizerTime)..sort(); - final Duration Function(Duration, Duration) add = - (Duration a, Duration b) => a + b; - return FrameTimingSummarizer._( - frameBuildTime: frameBuildTime, - frameRasterizerTime: frameRasterizerTime, - // This avarage calculation is microsecond precision, which is fine - // because typical values of these times are milliseconds. - averageFrameBuildTime: frameBuildTime.reduce(add) ~/ data.length, - p90FrameBuildTime: _findPercentile(frameBuildTimeSorted, 0.90), - p99FrameBuildTime: _findPercentile(frameBuildTimeSorted, 0.99), - worstFrameBuildTime: frameBuildTimeSorted.last, - missedFrameBuildBudget: _countExceed(frameBuildTimeSorted, kBuildBudget), - averageFrameRasterizerTime: - frameRasterizerTime.reduce(add) ~/ data.length, - p90FrameRasterizerTime: _findPercentile(frameRasterizerTimeSorted, 0.90), - p99FrameRasterizerTime: _findPercentile(frameRasterizerTimeSorted, 0.99), - worstFrameRasterizerTime: frameRasterizerTimeSorted.last, - missedFrameRasterizerBudget: - _countExceed(frameRasterizerTimeSorted, kBuildBudget), - ); - } - - const FrameTimingSummarizer._({ - @required this.frameBuildTime, - @required this.frameRasterizerTime, - @required this.averageFrameBuildTime, - @required this.p90FrameBuildTime, - @required this.p99FrameBuildTime, - @required this.worstFrameBuildTime, - @required this.missedFrameBuildBudget, - @required this.averageFrameRasterizerTime, - @required this.p90FrameRasterizerTime, - @required this.p99FrameRasterizerTime, - @required this.worstFrameRasterizerTime, - @required this.missedFrameRasterizerBudget, - }); - - /// List of frame build time in microseconds - final List frameBuildTime; - - /// List of frame rasterizer time in microseconds - final List frameRasterizerTime; - - /// The average value of [frameBuildTime] in milliseconds. - final Duration averageFrameBuildTime; - - /// The 90-th percentile value of [frameBuildTime] in milliseconds - final Duration p90FrameBuildTime; - - /// The 99-th percentile value of [frameBuildTime] in milliseconds - final Duration p99FrameBuildTime; - - /// The largest value of [frameBuildTime] in milliseconds - final Duration worstFrameBuildTime; - - /// Number of items in [frameBuildTime] that's greater than [kBuildBudget] - final int missedFrameBuildBudget; - - /// The average value of [frameRasterizerTime] in milliseconds. - final Duration averageFrameRasterizerTime; - - /// The 90-th percentile value of [frameRasterizerTime] in milliseconds. - final Duration p90FrameRasterizerTime; - - /// The 99-th percentile value of [frameRasterizerTime] in milliseconds. - final Duration p99FrameRasterizerTime; - - /// The largest value of [frameRasterizerTime] in milliseconds. - final Duration worstFrameRasterizerTime; - - /// Number of items in [frameRasterizerTime] that's greater than [kBuildBudget] - final int missedFrameRasterizerBudget; - - /// Convert the summary result to a json object. - /// - /// See [TimelineSummary.summaryJson] for detail. - Map get summary => { - 'average_frame_build_time_millis': - averageFrameBuildTime.inMicroseconds / 1E3, - '90th_percentile_frame_build_time_millis': - p90FrameBuildTime.inMicroseconds / 1E3, - '99th_percentile_frame_build_time_millis': - p99FrameBuildTime.inMicroseconds / 1E3, - 'worst_frame_build_time_millis': - worstFrameBuildTime.inMicroseconds / 1E3, - 'missed_frame_build_budget_count': missedFrameBuildBudget, - 'average_frame_rasterizer_time_millis': - averageFrameRasterizerTime.inMicroseconds / 1E3, - '90th_percentile_frame_rasterizer_time_millis': - p90FrameRasterizerTime.inMicroseconds / 1E3, - '99th_percentile_frame_rasterizer_time_millis': - p99FrameRasterizerTime.inMicroseconds / 1E3, - 'worst_frame_rasterizer_time_millis': - worstFrameRasterizerTime.inMicroseconds / 1E3, - 'missed_frame_rasterizer_budget_count': missedFrameRasterizerBudget, - 'frame_count': frameBuildTime.length, - 'frame_build_times': frameBuildTime - .map((Duration datum) => datum.inMicroseconds) - .toList(), - 'frame_rasterizer_times': frameRasterizerTime - .map((Duration datum) => datum.inMicroseconds) - .toList(), - }; -} - -// The following helper functions require data sorted - -// return the 100*p-th percentile of the data -T _findPercentile(List data, double p) { - assert(p >= 0 && p <= 1); - return data[((data.length - 1) * p).round()]; -} - -// return the number of items in data that > threshold -int _countExceed>(List data, T threshold) { - return data.length - - data.indexWhere((T datum) => datum.compareTo(threshold) > 0); -} diff --git a/packages/e2e/pubspec.yaml b/packages/e2e/pubspec.yaml index e4e476d146d3..221dd3a8b047 100644 --- a/packages/e2e/pubspec.yaml +++ b/packages/e2e/pubspec.yaml @@ -1,6 +1,6 @@ name: e2e description: Runs tests that use the flutter_test API as integration tests. -version: 0.6.3 +version: 0.7.0 homepage: https://github.com/flutter/plugins/tree/master/packages/e2e environment: diff --git a/packages/e2e/test/frame_timing_summarizer_test.dart b/packages/e2e/test/frame_timing_summarizer_test.dart deleted file mode 100644 index f3a12850122d..000000000000 --- a/packages/e2e/test/frame_timing_summarizer_test.dart +++ /dev/null @@ -1,35 +0,0 @@ -import 'dart:ui'; - -import 'package:flutter_test/flutter_test.dart'; - -import 'package:e2e/e2e_perf.dart'; - -void main() { - test('Test FrameTimingSummarizer', () { - List buildTimes = [ - for (int i = 1; i <= 100; i += 1) 1000 * i, - ]; - buildTimes = buildTimes.reversed.toList(); - List rasterTimes = [ - for (int i = 1; i <= 100; i += 1) 1000 * i + 1000, - ]; - rasterTimes = rasterTimes.reversed.toList(); - List inputData = [ - for (int i = 0; i < 100; i += 1) - FrameTiming([0, buildTimes[i], 500, rasterTimes[i]]), - ]; - FrameTimingSummarizer summary = FrameTimingSummarizer(inputData); - expect(summary.averageFrameBuildTime.inMicroseconds, 50500); - expect(summary.p90FrameBuildTime.inMicroseconds, 90000); - expect(summary.p99FrameBuildTime.inMicroseconds, 99000); - expect(summary.worstFrameBuildTime.inMicroseconds, 100000); - expect(summary.missedFrameBuildBudget, 84); - - expect(summary.averageFrameRasterizerTime.inMicroseconds, 51000); - expect(summary.p90FrameRasterizerTime.inMicroseconds, 90500); - expect(summary.p99FrameRasterizerTime.inMicroseconds, 99500); - expect(summary.worstFrameRasterizerTime.inMicroseconds, 100500); - expect(summary.missedFrameRasterizerBudget, 85); - expect(summary.frameBuildTime.length, 100); - }); -} From 5c5f79a08b1e6d1ad6b60b2cfed3314d467b2f8e Mon Sep 17 00:00:00 2001 From: David Iglesias Date: Tue, 11 Aug 2020 22:56:13 -0700 Subject: [PATCH 030/233] [google_maps_flutter] Pin GoogleMaps cocoapod dep to last good known version (#2924) --- packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md | 4 ++++ .../google_maps_flutter/ios/google_maps_flutter.podspec | 3 ++- packages/google_maps_flutter/google_maps_flutter/pubspec.yaml | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md index 5d62a5179fd4..d26663fe9ccb 100644 --- a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.5.29+1 + +* (ios) Pin dependency on GoogleMaps pod to `< 3.10`, to address https://github.com/flutter/flutter/issues/63447 + ## 0.5.29 * Pass a constant `_web_only_mapCreationId` to `platform.buildView`, so web can return a cached widget DOM when flutter attempts to repaint there. diff --git a/packages/google_maps_flutter/google_maps_flutter/ios/google_maps_flutter.podspec b/packages/google_maps_flutter/google_maps_flutter/ios/google_maps_flutter.podspec index 9a1f04d59759..021abfee71ab 100644 --- a/packages/google_maps_flutter/google_maps_flutter/ios/google_maps_flutter.podspec +++ b/packages/google_maps_flutter/google_maps_flutter/ios/google_maps_flutter.podspec @@ -17,7 +17,8 @@ Downloaded by pub (not CocoaPods). s.source_files = 'Classes/**/*' s.public_header_files = 'Classes/**/*.h' s.dependency 'Flutter' - s.dependency 'GoogleMaps' + # TODO: Unpin this once the fix for b/163474612 or b/163359804 rolls (avoid v3.10!) + s.dependency 'GoogleMaps', '< 3.10' s.static_framework = true s.platform = :ios, '8.0' s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' } diff --git a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml index 120600a9823c..a33efb9d8e2c 100644 --- a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml @@ -1,7 +1,7 @@ name: google_maps_flutter description: A Flutter plugin for integrating Google Maps in iOS and Android applications. homepage: https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter/google_maps_flutter -version: 0.5.29 +version: 0.5.29+1 dependencies: flutter: From 0d5dd3a2d93ec545653ee26a3c59b72459fb51ac Mon Sep 17 00:00:00 2001 From: David Iglesias Date: Wed, 12 Aug 2020 10:19:51 -0700 Subject: [PATCH 031/233] [google_maps_flutter] Call platform.dispose from widget. (#2909) --- .../google_maps_flutter/CHANGELOG.md | 5 ++ .../lib/src/controller.dart | 5 ++ .../lib/src/google_map.dart | 7 +++ .../google_maps_flutter/pubspec.yaml | 4 +- .../test/map_creation_test.dart | 59 ++++++++++++++++++- 5 files changed, 77 insertions(+), 3 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md index d26663fe9ccb..02b257d6b168 100644 --- a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.5.30 + +* Add a `dispose` method to the controller to let the native side know that we're done with said controller. +* Call `controller.dispose()` from the `dispose` method of the `GoogleMap` widget. + ## 0.5.29+1 * (ios) Pin dependency on GoogleMaps pod to `< 3.10`, to address https://github.com/flutter/flutter/issues/63447 diff --git a/packages/google_maps_flutter/google_maps_flutter/lib/src/controller.dart b/packages/google_maps_flutter/google_maps_flutter/lib/src/controller.dart index f5ee180ab1fd..f47b8e57b049 100644 --- a/packages/google_maps_flutter/google_maps_flutter/lib/src/controller.dart +++ b/packages/google_maps_flutter/google_maps_flutter/lib/src/controller.dart @@ -258,4 +258,9 @@ class GoogleMapController { Future takeSnapshot() { return _googleMapsFlutterPlatform.takeSnapshot(mapId: mapId); } + + /// Disposes of the platform resources + void dispose() { + _googleMapsFlutterPlatform.dispose(mapId: mapId); + } } diff --git a/packages/google_maps_flutter/google_maps_flutter/lib/src/google_map.dart b/packages/google_maps_flutter/google_maps_flutter/lib/src/google_map.dart index 5cf3db120ccd..d7f0f1a4e280 100644 --- a/packages/google_maps_flutter/google_maps_flutter/lib/src/google_map.dart +++ b/packages/google_maps_flutter/google_maps_flutter/lib/src/google_map.dart @@ -251,6 +251,13 @@ class _GoogleMapState extends State { _circles = keyByCircleId(widget.circles); } + @override + void dispose() async { + super.dispose(); + GoogleMapController controller = await _controller.future; + controller.dispose(); + } + @override void didUpdateWidget(GoogleMap oldWidget) { super.didUpdateWidget(oldWidget); diff --git a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml index a33efb9d8e2c..e7e3aeeb3327 100644 --- a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml @@ -1,13 +1,13 @@ name: google_maps_flutter description: A Flutter plugin for integrating Google Maps in iOS and Android applications. homepage: https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter/google_maps_flutter -version: 0.5.29+1 +version: 0.5.30 dependencies: flutter: sdk: flutter flutter_plugin_android_lifecycle: ^1.0.0 - google_maps_flutter_platform_interface: ^1.0.1 + google_maps_flutter_platform_interface: ^1.0.4 dev_dependencies: flutter_test: diff --git a/packages/google_maps_flutter/google_maps_flutter/test/map_creation_test.dart b/packages/google_maps_flutter/google_maps_flutter/test/map_creation_test.dart index 7861c86e9709..5ea9a679a1be 100644 --- a/packages/google_maps_flutter/google_maps_flutter/test/map_creation_test.dart +++ b/packages/google_maps_flutter/google_maps_flutter/test/map_creation_test.dart @@ -20,7 +20,8 @@ void main() { setUp(() { // Use a mock platform so we never need to hit the MethodChannel code. GoogleMapsFlutterPlatform.instance = platform; - when(platform.buildView(any, any, any)).thenReturn(Container()); + resetMockitoState(); + _setupMock(platform); }); testWidgets('_webOnlyMapCreationId increments with each GoogleMap widget', ( @@ -61,4 +62,60 @@ void main() { ), ]); }); + + testWidgets('Calls platform.dispose when GoogleMap is disposed of', ( + WidgetTester tester, + ) async { + await tester.pumpWidget(GoogleMap( + initialCameraPosition: CameraPosition( + target: LatLng(43.3608, -5.8702), + ), + )); + + // Now dispose of the map... + await tester.pumpWidget(Container()); + + verify(platform.dispose(mapId: anyNamed('mapId'))); + }); +} + +// Some test setup classes below... + +class _MockStream extends Mock implements Stream {} + +typedef _CreationCallback = void Function(int); + +// Installs test mocks on the platform +void _setupMock(MockGoogleMapsFlutterPlatform platform) { + // Used to create the view of the map... + when(platform.buildView(any, any, any)).thenAnswer((realInvocation) { + // Call the onPlatformViewCreated callback so the controller gets created. + _CreationCallback onPlatformViewCreatedCb = + realInvocation.positionalArguments[2]; + onPlatformViewCreatedCb.call(0); + return Container(); + }); + // Used to create the Controller + when(platform.onCameraIdle(mapId: anyNamed('mapId'))) + .thenAnswer((_) => _MockStream()); + when(platform.onCameraMove(mapId: anyNamed('mapId'))) + .thenAnswer((_) => _MockStream()); + when(platform.onCameraMoveStarted(mapId: anyNamed('mapId'))) + .thenAnswer((_) => _MockStream()); + when(platform.onCircleTap(mapId: anyNamed('mapId'))) + .thenAnswer((_) => _MockStream()); + when(platform.onInfoWindowTap(mapId: anyNamed('mapId'))) + .thenAnswer((_) => _MockStream()); + when(platform.onLongPress(mapId: anyNamed('mapId'))) + .thenAnswer((_) => _MockStream()); + when(platform.onMarkerDragEnd(mapId: anyNamed('mapId'))) + .thenAnswer((_) => _MockStream()); + when(platform.onMarkerTap(mapId: anyNamed('mapId'))) + .thenAnswer((_) => _MockStream()); + when(platform.onPolygonTap(mapId: anyNamed('mapId'))) + .thenAnswer((_) => _MockStream()); + when(platform.onPolylineTap(mapId: anyNamed('mapId'))) + .thenAnswer((_) => _MockStream()); + when(platform.onTap(mapId: anyNamed('mapId'))) + .thenAnswer((_) => _MockStream()); } From 10966b70b8dce1f22af955f68e5a6d9860701fa1 Mon Sep 17 00:00:00 2001 From: Ben Bieker Date: Wed, 12 Aug 2020 22:51:11 +0200 Subject: [PATCH 032/233] [video_player_platform_interface] Add interface changes for audio mix mode (#2927) --- .../CHANGELOG.md | 4 ++ .../lib/messages.dart | 42 ++++++++++++++++++- .../lib/method_channel_video_player.dart | 7 ++++ .../lib/video_player_platform_interface.dart | 15 +++++++ .../pubspec.yaml | 2 +- 5 files changed, 68 insertions(+), 2 deletions(-) diff --git a/packages/video_player/video_player_platform_interface/CHANGELOG.md b/packages/video_player/video_player_platform_interface/CHANGELOG.md index f5aa5208e93c..0920582abad0 100644 --- a/packages/video_player/video_player_platform_interface/CHANGELOG.md +++ b/packages/video_player/video_player_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.1.0 + +* Add VideoPlayerOptions with audo mix mode + ## 2.0.2 * Migrated tests to use pigeon correctly. diff --git a/packages/video_player/video_player_platform_interface/lib/messages.dart b/packages/video_player/video_player_platform_interface/lib/messages.dart index ea117a51bb07..a75ece0db850 100644 --- a/packages/video_player/video_player_platform_interface/lib/messages.dart +++ b/packages/video_player/video_player_platform_interface/lib/messages.dart @@ -1,4 +1,4 @@ -// Autogenerated from Pigeon (v0.1.0-experimental.10), do not edit directly. +// Autogenerated from Pigeon (v0.1.0-experimental.11), do not edit directly. // See also: https://pub.dev/packages/pigeon // ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import import 'dart:async'; @@ -107,6 +107,23 @@ class PositionMessage { } } +class MixWithOthersMessage { + bool mixWithOthers; + // ignore: unused_element + Map _toMap() { + final Map pigeonMap = {}; + pigeonMap['mixWithOthers'] = mixWithOthers; + return pigeonMap; + } + + // ignore: unused_element + static MixWithOthersMessage _fromMap(Map pigeonMap) { + final MixWithOthersMessage result = MixWithOthersMessage(); + result.mixWithOthers = pigeonMap['mixWithOthers']; + return result; + } +} + abstract class VideoPlayerApiTest { void initialize(); TextureMessage create(CreateMessage arg); @@ -407,4 +424,27 @@ class VideoPlayerApi { // noop } } + + Future setMixWithOthers(MixWithOthersMessage arg) async { + final Map requestMap = arg._toMap(); + const BasicMessageChannel channel = BasicMessageChannel( + 'dev.flutter.pigeon.VideoPlayerApi.setMixWithOthers', + StandardMessageCodec()); + + final Map replyMap = await channel.send(requestMap); + if (replyMap == null) { + throw PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel.', + details: null); + } else if (replyMap['error'] != null) { + final Map error = replyMap['error']; + throw PlatformException( + code: error['code'], + message: error['message'], + details: error['details']); + } else { + // noop + } + } } diff --git a/packages/video_player/video_player_platform_interface/lib/method_channel_video_player.dart b/packages/video_player/video_player_platform_interface/lib/method_channel_video_player.dart index 4b28100e1642..8c0f1de39661 100644 --- a/packages/video_player/video_player_platform_interface/lib/method_channel_video_player.dart +++ b/packages/video_player/video_player_platform_interface/lib/method_channel_video_player.dart @@ -125,6 +125,13 @@ class MethodChannelVideoPlayer extends VideoPlayerPlatform { return Texture(textureId: textureId); } + @override + Future setMixWithOthers(bool mixWithOthers) { + return _api.setMixWithOthers( + MixWithOthersMessage()..mixWithOthers = mixWithOthers, + ); + } + EventChannel _eventChannelFor(int textureId) { return EventChannel('flutter.io/videoPlayer/videoEvents$textureId'); } diff --git a/packages/video_player/video_player_platform_interface/lib/video_player_platform_interface.dart b/packages/video_player/video_player_platform_interface/lib/video_player_platform_interface.dart index 4c1f2b67c4fc..279810aaaf63 100644 --- a/packages/video_player/video_player_platform_interface/lib/video_player_platform_interface.dart +++ b/packages/video_player/video_player_platform_interface/lib/video_player_platform_interface.dart @@ -110,6 +110,11 @@ abstract class VideoPlayerPlatform { throw UnimplementedError('buildView() has not been implemented.'); } + /// Sets the audio mode to mix with other sources + Future setMixWithOthers(bool mixWithOthers) { + throw UnimplementedError('setMixWithOthers() has not been implemented.'); + } + // This method makes sure that VideoPlayer isn't implemented with `implements`. // // See class doc for more details on why implementing this class is forbidden. @@ -331,3 +336,13 @@ class DurationRange { @override int get hashCode => start.hashCode ^ end.hashCode; } + +/// [VideoPlayerOptions] can be optionally used to set additional player settings +class VideoPlayerOptions { + /// Set this to true to mix the video players audio with other audio sources. + /// The default value is false + final bool mixWithOthers; + + /// set additional optional player settings + VideoPlayerOptions({this.mixWithOthers = false}); +} diff --git a/packages/video_player/video_player_platform_interface/pubspec.yaml b/packages/video_player/video_player_platform_interface/pubspec.yaml index b4462679fcfc..4740605d7669 100644 --- a/packages/video_player/video_player_platform_interface/pubspec.yaml +++ b/packages/video_player/video_player_platform_interface/pubspec.yaml @@ -3,7 +3,7 @@ description: A common platform interface for the video_player plugin. homepage: https://github.com/flutter/plugins/tree/master/packages/video_player/video_player_platform_interface # NOTE: We strongly prefer non-breaking changes, even at the expense of a # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes -version: 2.0.2 +version: 2.1.0 dependencies: flutter: From 42b33ec8ed3265607df5accf45bc68aa9e4e5592 Mon Sep 17 00:00:00 2001 From: Yash Johri Date: Thu, 13 Aug 2020 04:01:18 +0530 Subject: [PATCH 033/233] [device_info] Moved device_info to a subdir (#2923) (This is preparation for the federation of the plugin) --- .../device_info/{ => device_info}/CHANGELOG.md | 4 ++++ packages/device_info/{ => device_info}/LICENSE | 0 packages/device_info/{ => device_info}/README.md | 0 .../{ => device_info}/android/build.gradle | 0 .../{ => device_info}/android/gradle.properties | 0 .../{ => device_info}/android/settings.gradle | 0 .../android/src/main/AndroidManifest.xml | 0 .../plugins/deviceinfo/DeviceInfoPlugin.java | 0 .../deviceinfo/MethodCallHandlerImpl.java | 0 .../{ => device_info}/example/README.md | 0 .../example/android/app/build.gradle | 0 .../app/gradle/wrapper/gradle-wrapper.properties | 0 .../android/app/src/main/AndroidManifest.xml | 0 .../deviceinfoexample/EmbeddingV1Activity.java | 0 .../EmbeddingV1ActivityTest.java | 0 .../app/src/main/res/mipmap-hdpi/ic_launcher.png | Bin .../app/src/main/res/mipmap-mdpi/ic_launcher.png | Bin .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin .../src/main/res/mipmap-xxhdpi/ic_launcher.png | Bin .../src/main/res/mipmap-xxxhdpi/ic_launcher.png | Bin .../example/android/build.gradle | 0 .../example/android/gradle.properties | 0 .../gradle/wrapper/gradle-wrapper.properties | 0 .../example/android/settings.gradle | 0 .../example/ios/Flutter/AppFrameworkInfo.plist | 0 .../example/ios/Flutter/Debug.xcconfig | 0 .../example/ios/Flutter/Release.xcconfig | 0 .../example/ios/Runner.xcodeproj/project.pbxproj | 0 .../project.xcworkspace/contents.xcworkspacedata | 0 .../xcshareddata/xcschemes/Runner.xcscheme | 0 .../Runner.xcworkspace/contents.xcworkspacedata | 0 .../example/ios/Runner/AppDelegate.h | 0 .../example/ios/Runner/AppDelegate.m | 0 .../AppIcon.appiconset/Contents.json | 0 .../AppIcon.appiconset/Icon-App-20x20@1x.png | Bin .../AppIcon.appiconset/Icon-App-20x20@2x.png | Bin .../AppIcon.appiconset/Icon-App-20x20@3x.png | Bin .../AppIcon.appiconset/Icon-App-29x29@1x.png | Bin .../AppIcon.appiconset/Icon-App-29x29@2x.png | Bin .../AppIcon.appiconset/Icon-App-29x29@3x.png | Bin .../AppIcon.appiconset/Icon-App-40x40@1x.png | Bin .../AppIcon.appiconset/Icon-App-40x40@2x.png | Bin .../AppIcon.appiconset/Icon-App-40x40@3x.png | Bin .../AppIcon.appiconset/Icon-App-60x60@2x.png | Bin .../AppIcon.appiconset/Icon-App-60x60@3x.png | Bin .../AppIcon.appiconset/Icon-App-76x76@1x.png | Bin .../AppIcon.appiconset/Icon-App-76x76@2x.png | Bin .../AppIcon.appiconset/Icon-App-83.5x83.5@2x.png | Bin .../Runner/Base.lproj/LaunchScreen.storyboard | 0 .../ios/Runner/Base.lproj/Main.storyboard | 0 .../example/ios/Runner/Info.plist | 0 .../{ => device_info}/example/ios/Runner/main.m | 0 .../{ => device_info}/example/lib/main.dart | 0 .../{ => device_info}/example/pubspec.yaml | 2 +- .../example/test_driver/device_info_e2e.dart | 0 .../test_driver/device_info_e2e_test.dart | 0 .../{ => device_info}/ios/Assets/.gitkeep | 0 .../ios/Classes/FLTDeviceInfoPlugin.h | 0 .../ios/Classes/FLTDeviceInfoPlugin.m | 0 .../{ => device_info}/ios/device_info.podspec | 0 .../{ => device_info}/lib/device_info.dart | 0 .../device_info/{ => device_info}/pubspec.yaml | 2 +- packages/device_info/device_info_android.iml | 12 ------------ packages/device_info/example/android.iml | 12 ------------ .../device_info/example/device_info_example.iml | 15 --------------- .../example/device_info_example_android.iml | 12 ------------ 66 files changed, 6 insertions(+), 53 deletions(-) rename packages/device_info/{ => device_info}/CHANGELOG.md (97%) rename packages/device_info/{ => device_info}/LICENSE (100%) rename packages/device_info/{ => device_info}/README.md (100%) rename packages/device_info/{ => device_info}/android/build.gradle (100%) rename packages/device_info/{ => device_info}/android/gradle.properties (100%) rename packages/device_info/{ => device_info}/android/settings.gradle (100%) rename packages/device_info/{ => device_info}/android/src/main/AndroidManifest.xml (100%) rename packages/device_info/{ => device_info}/android/src/main/java/io/flutter/plugins/deviceinfo/DeviceInfoPlugin.java (100%) rename packages/device_info/{ => device_info}/android/src/main/java/io/flutter/plugins/deviceinfo/MethodCallHandlerImpl.java (100%) rename packages/device_info/{ => device_info}/example/README.md (100%) rename packages/device_info/{ => device_info}/example/android/app/build.gradle (100%) rename packages/device_info/{ => device_info}/example/android/app/gradle/wrapper/gradle-wrapper.properties (100%) rename packages/device_info/{ => device_info}/example/android/app/src/main/AndroidManifest.xml (100%) rename packages/device_info/{ => device_info}/example/android/app/src/main/java/io/flutter/plugins/deviceinfoexample/EmbeddingV1Activity.java (100%) rename packages/device_info/{ => device_info}/example/android/app/src/main/java/io/flutter/plugins/deviceinfoexample/EmbeddingV1ActivityTest.java (100%) rename packages/device_info/{ => device_info}/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png (100%) rename packages/device_info/{ => device_info}/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png (100%) rename packages/device_info/{ => device_info}/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png (100%) rename packages/device_info/{ => device_info}/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png (100%) rename packages/device_info/{ => device_info}/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png (100%) rename packages/device_info/{ => device_info}/example/android/build.gradle (100%) rename packages/device_info/{ => device_info}/example/android/gradle.properties (100%) rename packages/device_info/{ => device_info}/example/android/gradle/wrapper/gradle-wrapper.properties (100%) rename packages/device_info/{ => device_info}/example/android/settings.gradle (100%) rename packages/device_info/{ => device_info}/example/ios/Flutter/AppFrameworkInfo.plist (100%) rename packages/device_info/{ => device_info}/example/ios/Flutter/Debug.xcconfig (100%) rename packages/device_info/{ => device_info}/example/ios/Flutter/Release.xcconfig (100%) rename packages/device_info/{ => device_info}/example/ios/Runner.xcodeproj/project.pbxproj (100%) rename packages/device_info/{ => device_info}/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata (100%) rename packages/device_info/{ => device_info}/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme (100%) rename packages/device_info/{ => device_info}/example/ios/Runner.xcworkspace/contents.xcworkspacedata (100%) rename packages/device_info/{ => device_info}/example/ios/Runner/AppDelegate.h (100%) rename packages/device_info/{ => device_info}/example/ios/Runner/AppDelegate.m (100%) rename packages/device_info/{ => device_info}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json (100%) rename packages/device_info/{ => device_info}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png (100%) rename packages/device_info/{ => device_info}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png (100%) rename packages/device_info/{ => device_info}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png (100%) rename packages/device_info/{ => device_info}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png (100%) rename packages/device_info/{ => device_info}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png (100%) rename packages/device_info/{ => device_info}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png (100%) rename packages/device_info/{ => device_info}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png (100%) rename packages/device_info/{ => device_info}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png (100%) rename packages/device_info/{ => device_info}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png (100%) rename packages/device_info/{ => device_info}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png (100%) rename packages/device_info/{ => device_info}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png (100%) rename packages/device_info/{ => device_info}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png (100%) rename packages/device_info/{ => device_info}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png (100%) rename packages/device_info/{ => device_info}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png (100%) rename packages/device_info/{ => device_info}/example/ios/Runner/Base.lproj/LaunchScreen.storyboard (100%) rename packages/device_info/{ => device_info}/example/ios/Runner/Base.lproj/Main.storyboard (100%) rename packages/device_info/{ => device_info}/example/ios/Runner/Info.plist (100%) rename packages/device_info/{ => device_info}/example/ios/Runner/main.m (100%) rename packages/device_info/{ => device_info}/example/lib/main.dart (100%) rename packages/device_info/{ => device_info}/example/pubspec.yaml (92%) rename packages/device_info/{ => device_info}/example/test_driver/device_info_e2e.dart (100%) rename packages/device_info/{ => device_info}/example/test_driver/device_info_e2e_test.dart (100%) rename packages/device_info/{ => device_info}/ios/Assets/.gitkeep (100%) rename packages/device_info/{ => device_info}/ios/Classes/FLTDeviceInfoPlugin.h (100%) rename packages/device_info/{ => device_info}/ios/Classes/FLTDeviceInfoPlugin.m (100%) rename packages/device_info/{ => device_info}/ios/device_info.podspec (100%) rename packages/device_info/{ => device_info}/lib/device_info.dart (100%) rename packages/device_info/{ => device_info}/pubspec.yaml (97%) delete mode 100644 packages/device_info/device_info_android.iml delete mode 100644 packages/device_info/example/android.iml delete mode 100644 packages/device_info/example/device_info_example.iml delete mode 100644 packages/device_info/example/device_info_example_android.iml diff --git a/packages/device_info/CHANGELOG.md b/packages/device_info/device_info/CHANGELOG.md similarity index 97% rename from packages/device_info/CHANGELOG.md rename to packages/device_info/device_info/CHANGELOG.md index 97c1e1f52221..9af729780914 100644 --- a/packages/device_info/CHANGELOG.md +++ b/packages/device_info/device_info/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.4.2+6 + +* Moved everything from device_info to device_info/device_info + ## 0.4.2+5 * Update package:e2e reference to use the local version in the flutter/plugins diff --git a/packages/device_info/LICENSE b/packages/device_info/device_info/LICENSE similarity index 100% rename from packages/device_info/LICENSE rename to packages/device_info/device_info/LICENSE diff --git a/packages/device_info/README.md b/packages/device_info/device_info/README.md similarity index 100% rename from packages/device_info/README.md rename to packages/device_info/device_info/README.md diff --git a/packages/device_info/android/build.gradle b/packages/device_info/device_info/android/build.gradle similarity index 100% rename from packages/device_info/android/build.gradle rename to packages/device_info/device_info/android/build.gradle diff --git a/packages/device_info/android/gradle.properties b/packages/device_info/device_info/android/gradle.properties similarity index 100% rename from packages/device_info/android/gradle.properties rename to packages/device_info/device_info/android/gradle.properties diff --git a/packages/device_info/android/settings.gradle b/packages/device_info/device_info/android/settings.gradle similarity index 100% rename from packages/device_info/android/settings.gradle rename to packages/device_info/device_info/android/settings.gradle diff --git a/packages/device_info/android/src/main/AndroidManifest.xml b/packages/device_info/device_info/android/src/main/AndroidManifest.xml similarity index 100% rename from packages/device_info/android/src/main/AndroidManifest.xml rename to packages/device_info/device_info/android/src/main/AndroidManifest.xml diff --git a/packages/device_info/android/src/main/java/io/flutter/plugins/deviceinfo/DeviceInfoPlugin.java b/packages/device_info/device_info/android/src/main/java/io/flutter/plugins/deviceinfo/DeviceInfoPlugin.java similarity index 100% rename from packages/device_info/android/src/main/java/io/flutter/plugins/deviceinfo/DeviceInfoPlugin.java rename to packages/device_info/device_info/android/src/main/java/io/flutter/plugins/deviceinfo/DeviceInfoPlugin.java diff --git a/packages/device_info/android/src/main/java/io/flutter/plugins/deviceinfo/MethodCallHandlerImpl.java b/packages/device_info/device_info/android/src/main/java/io/flutter/plugins/deviceinfo/MethodCallHandlerImpl.java similarity index 100% rename from packages/device_info/android/src/main/java/io/flutter/plugins/deviceinfo/MethodCallHandlerImpl.java rename to packages/device_info/device_info/android/src/main/java/io/flutter/plugins/deviceinfo/MethodCallHandlerImpl.java diff --git a/packages/device_info/example/README.md b/packages/device_info/device_info/example/README.md similarity index 100% rename from packages/device_info/example/README.md rename to packages/device_info/device_info/example/README.md diff --git a/packages/device_info/example/android/app/build.gradle b/packages/device_info/device_info/example/android/app/build.gradle similarity index 100% rename from packages/device_info/example/android/app/build.gradle rename to packages/device_info/device_info/example/android/app/build.gradle diff --git a/packages/device_info/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/device_info/device_info/example/android/app/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from packages/device_info/example/android/app/gradle/wrapper/gradle-wrapper.properties rename to packages/device_info/device_info/example/android/app/gradle/wrapper/gradle-wrapper.properties diff --git a/packages/device_info/example/android/app/src/main/AndroidManifest.xml b/packages/device_info/device_info/example/android/app/src/main/AndroidManifest.xml similarity index 100% rename from packages/device_info/example/android/app/src/main/AndroidManifest.xml rename to packages/device_info/device_info/example/android/app/src/main/AndroidManifest.xml diff --git a/packages/device_info/example/android/app/src/main/java/io/flutter/plugins/deviceinfoexample/EmbeddingV1Activity.java b/packages/device_info/device_info/example/android/app/src/main/java/io/flutter/plugins/deviceinfoexample/EmbeddingV1Activity.java similarity index 100% rename from packages/device_info/example/android/app/src/main/java/io/flutter/plugins/deviceinfoexample/EmbeddingV1Activity.java rename to packages/device_info/device_info/example/android/app/src/main/java/io/flutter/plugins/deviceinfoexample/EmbeddingV1Activity.java diff --git a/packages/device_info/example/android/app/src/main/java/io/flutter/plugins/deviceinfoexample/EmbeddingV1ActivityTest.java b/packages/device_info/device_info/example/android/app/src/main/java/io/flutter/plugins/deviceinfoexample/EmbeddingV1ActivityTest.java similarity index 100% rename from packages/device_info/example/android/app/src/main/java/io/flutter/plugins/deviceinfoexample/EmbeddingV1ActivityTest.java rename to packages/device_info/device_info/example/android/app/src/main/java/io/flutter/plugins/deviceinfoexample/EmbeddingV1ActivityTest.java diff --git a/packages/device_info/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/device_info/device_info/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from packages/device_info/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png rename to packages/device_info/device_info/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/packages/device_info/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/device_info/device_info/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from packages/device_info/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png rename to packages/device_info/device_info/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/packages/device_info/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/device_info/device_info/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from packages/device_info/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png rename to packages/device_info/device_info/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/packages/device_info/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/device_info/device_info/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from packages/device_info/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to packages/device_info/device_info/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/packages/device_info/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/device_info/device_info/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from packages/device_info/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to packages/device_info/device_info/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/packages/device_info/example/android/build.gradle b/packages/device_info/device_info/example/android/build.gradle similarity index 100% rename from packages/device_info/example/android/build.gradle rename to packages/device_info/device_info/example/android/build.gradle diff --git a/packages/device_info/example/android/gradle.properties b/packages/device_info/device_info/example/android/gradle.properties similarity index 100% rename from packages/device_info/example/android/gradle.properties rename to packages/device_info/device_info/example/android/gradle.properties diff --git a/packages/device_info/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/device_info/device_info/example/android/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from packages/device_info/example/android/gradle/wrapper/gradle-wrapper.properties rename to packages/device_info/device_info/example/android/gradle/wrapper/gradle-wrapper.properties diff --git a/packages/device_info/example/android/settings.gradle b/packages/device_info/device_info/example/android/settings.gradle similarity index 100% rename from packages/device_info/example/android/settings.gradle rename to packages/device_info/device_info/example/android/settings.gradle diff --git a/packages/device_info/example/ios/Flutter/AppFrameworkInfo.plist b/packages/device_info/device_info/example/ios/Flutter/AppFrameworkInfo.plist similarity index 100% rename from packages/device_info/example/ios/Flutter/AppFrameworkInfo.plist rename to packages/device_info/device_info/example/ios/Flutter/AppFrameworkInfo.plist diff --git a/packages/device_info/example/ios/Flutter/Debug.xcconfig b/packages/device_info/device_info/example/ios/Flutter/Debug.xcconfig similarity index 100% rename from packages/device_info/example/ios/Flutter/Debug.xcconfig rename to packages/device_info/device_info/example/ios/Flutter/Debug.xcconfig diff --git a/packages/device_info/example/ios/Flutter/Release.xcconfig b/packages/device_info/device_info/example/ios/Flutter/Release.xcconfig similarity index 100% rename from packages/device_info/example/ios/Flutter/Release.xcconfig rename to packages/device_info/device_info/example/ios/Flutter/Release.xcconfig diff --git a/packages/device_info/example/ios/Runner.xcodeproj/project.pbxproj b/packages/device_info/device_info/example/ios/Runner.xcodeproj/project.pbxproj similarity index 100% rename from packages/device_info/example/ios/Runner.xcodeproj/project.pbxproj rename to packages/device_info/device_info/example/ios/Runner.xcodeproj/project.pbxproj diff --git a/packages/device_info/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/device_info/device_info/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from packages/device_info/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to packages/device_info/device_info/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/packages/device_info/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/device_info/device_info/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme similarity index 100% rename from packages/device_info/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme rename to packages/device_info/device_info/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme diff --git a/packages/device_info/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/device_info/device_info/example/ios/Runner.xcworkspace/contents.xcworkspacedata similarity index 100% rename from packages/device_info/example/ios/Runner.xcworkspace/contents.xcworkspacedata rename to packages/device_info/device_info/example/ios/Runner.xcworkspace/contents.xcworkspacedata diff --git a/packages/device_info/example/ios/Runner/AppDelegate.h b/packages/device_info/device_info/example/ios/Runner/AppDelegate.h similarity index 100% rename from packages/device_info/example/ios/Runner/AppDelegate.h rename to packages/device_info/device_info/example/ios/Runner/AppDelegate.h diff --git a/packages/device_info/example/ios/Runner/AppDelegate.m b/packages/device_info/device_info/example/ios/Runner/AppDelegate.m similarity index 100% rename from packages/device_info/example/ios/Runner/AppDelegate.m rename to packages/device_info/device_info/example/ios/Runner/AppDelegate.m diff --git a/packages/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/device_info/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from packages/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json rename to packages/device_info/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/packages/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/device_info/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png similarity index 100% rename from packages/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png rename to packages/device_info/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png diff --git a/packages/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/device_info/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png similarity index 100% rename from packages/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png rename to packages/device_info/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png diff --git a/packages/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/device_info/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png similarity index 100% rename from packages/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png rename to packages/device_info/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png diff --git a/packages/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/device_info/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png similarity index 100% rename from packages/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png rename to packages/device_info/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png diff --git a/packages/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/device_info/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png similarity index 100% rename from packages/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png rename to packages/device_info/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png diff --git a/packages/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/device_info/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png similarity index 100% rename from packages/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png rename to packages/device_info/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png diff --git a/packages/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/device_info/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png similarity index 100% rename from packages/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png rename to packages/device_info/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png diff --git a/packages/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/device_info/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png similarity index 100% rename from packages/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png rename to packages/device_info/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png diff --git a/packages/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/device_info/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png similarity index 100% rename from packages/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png rename to packages/device_info/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png diff --git a/packages/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/device_info/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png similarity index 100% rename from packages/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png rename to packages/device_info/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png diff --git a/packages/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/device_info/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png similarity index 100% rename from packages/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png rename to packages/device_info/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png diff --git a/packages/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/device_info/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png similarity index 100% rename from packages/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png rename to packages/device_info/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png diff --git a/packages/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/device_info/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png similarity index 100% rename from packages/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png rename to packages/device_info/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png diff --git a/packages/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/device_info/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png similarity index 100% rename from packages/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png rename to packages/device_info/device_info/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png diff --git a/packages/device_info/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/device_info/device_info/example/ios/Runner/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from packages/device_info/example/ios/Runner/Base.lproj/LaunchScreen.storyboard rename to packages/device_info/device_info/example/ios/Runner/Base.lproj/LaunchScreen.storyboard diff --git a/packages/device_info/example/ios/Runner/Base.lproj/Main.storyboard b/packages/device_info/device_info/example/ios/Runner/Base.lproj/Main.storyboard similarity index 100% rename from packages/device_info/example/ios/Runner/Base.lproj/Main.storyboard rename to packages/device_info/device_info/example/ios/Runner/Base.lproj/Main.storyboard diff --git a/packages/device_info/example/ios/Runner/Info.plist b/packages/device_info/device_info/example/ios/Runner/Info.plist similarity index 100% rename from packages/device_info/example/ios/Runner/Info.plist rename to packages/device_info/device_info/example/ios/Runner/Info.plist diff --git a/packages/device_info/example/ios/Runner/main.m b/packages/device_info/device_info/example/ios/Runner/main.m similarity index 100% rename from packages/device_info/example/ios/Runner/main.m rename to packages/device_info/device_info/example/ios/Runner/main.m diff --git a/packages/device_info/example/lib/main.dart b/packages/device_info/device_info/example/lib/main.dart similarity index 100% rename from packages/device_info/example/lib/main.dart rename to packages/device_info/device_info/example/lib/main.dart diff --git a/packages/device_info/example/pubspec.yaml b/packages/device_info/device_info/example/pubspec.yaml similarity index 92% rename from packages/device_info/example/pubspec.yaml rename to packages/device_info/device_info/example/pubspec.yaml index 0546cb650256..f26ee033d4be 100644 --- a/packages/device_info/example/pubspec.yaml +++ b/packages/device_info/device_info/example/pubspec.yaml @@ -11,7 +11,7 @@ dev_dependencies: flutter_driver: sdk: flutter e2e: - path: ../../e2e + path: ../../../e2e pedantic: ^1.8.0 flutter: diff --git a/packages/device_info/example/test_driver/device_info_e2e.dart b/packages/device_info/device_info/example/test_driver/device_info_e2e.dart similarity index 100% rename from packages/device_info/example/test_driver/device_info_e2e.dart rename to packages/device_info/device_info/example/test_driver/device_info_e2e.dart diff --git a/packages/device_info/example/test_driver/device_info_e2e_test.dart b/packages/device_info/device_info/example/test_driver/device_info_e2e_test.dart similarity index 100% rename from packages/device_info/example/test_driver/device_info_e2e_test.dart rename to packages/device_info/device_info/example/test_driver/device_info_e2e_test.dart diff --git a/packages/device_info/ios/Assets/.gitkeep b/packages/device_info/device_info/ios/Assets/.gitkeep similarity index 100% rename from packages/device_info/ios/Assets/.gitkeep rename to packages/device_info/device_info/ios/Assets/.gitkeep diff --git a/packages/device_info/ios/Classes/FLTDeviceInfoPlugin.h b/packages/device_info/device_info/ios/Classes/FLTDeviceInfoPlugin.h similarity index 100% rename from packages/device_info/ios/Classes/FLTDeviceInfoPlugin.h rename to packages/device_info/device_info/ios/Classes/FLTDeviceInfoPlugin.h diff --git a/packages/device_info/ios/Classes/FLTDeviceInfoPlugin.m b/packages/device_info/device_info/ios/Classes/FLTDeviceInfoPlugin.m similarity index 100% rename from packages/device_info/ios/Classes/FLTDeviceInfoPlugin.m rename to packages/device_info/device_info/ios/Classes/FLTDeviceInfoPlugin.m diff --git a/packages/device_info/ios/device_info.podspec b/packages/device_info/device_info/ios/device_info.podspec similarity index 100% rename from packages/device_info/ios/device_info.podspec rename to packages/device_info/device_info/ios/device_info.podspec diff --git a/packages/device_info/lib/device_info.dart b/packages/device_info/device_info/lib/device_info.dart similarity index 100% rename from packages/device_info/lib/device_info.dart rename to packages/device_info/device_info/lib/device_info.dart diff --git a/packages/device_info/pubspec.yaml b/packages/device_info/device_info/pubspec.yaml similarity index 97% rename from packages/device_info/pubspec.yaml rename to packages/device_info/device_info/pubspec.yaml index f1883a79fdc0..8792bdaf5c40 100644 --- a/packages/device_info/pubspec.yaml +++ b/packages/device_info/device_info/pubspec.yaml @@ -5,7 +5,7 @@ homepage: https://github.com/flutter/plugins/tree/master/packages/device_info # 0.4.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.4.2+5 +version: 0.4.2+6 flutter: plugin: diff --git a/packages/device_info/device_info_android.iml b/packages/device_info/device_info_android.iml deleted file mode 100644 index 462b903e05b6..000000000000 --- a/packages/device_info/device_info_android.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/packages/device_info/example/android.iml b/packages/device_info/example/android.iml deleted file mode 100644 index 462b903e05b6..000000000000 --- a/packages/device_info/example/android.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/packages/device_info/example/device_info_example.iml b/packages/device_info/example/device_info_example.iml deleted file mode 100644 index 9d5dae19540c..000000000000 --- a/packages/device_info/example/device_info_example.iml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/packages/device_info/example/device_info_example_android.iml b/packages/device_info/example/device_info_example_android.iml deleted file mode 100644 index 462b903e05b6..000000000000 --- a/packages/device_info/example/device_info_example_android.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - From 235283b8c979982342d3b622d7a4116e66b0f1fa Mon Sep 17 00:00:00 2001 From: Dan Field Date: Wed, 12 Aug 2020 23:23:58 -0700 Subject: [PATCH 034/233] Fix unguarded availability in Camera plugin (#2928) * Fix unguarded availability in Camera plugin --- .cirrus.yml | 2 +- packages/camera/CHANGELOG.md | 6 +- packages/camera/ios/Classes/CameraPlugin.m | 115 ++++++++++----------- packages/camera/ios/camera.podspec | 16 +-- packages/camera/pubspec.yaml | 2 +- 5 files changed, 71 insertions(+), 70 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 8120b79842d3..d27ce6865e55 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -157,7 +157,7 @@ task: - find . -name "*.podspec" | xargs grep -l "osx" | xargs rm # Skip the dummy podspecs used to placate the tool. - find . -name "*_web*.podspec" -o -name "*_mac*.podspec" | xargs rm - - ./script/incremental_build.sh podspecs --no-analyze camera --ignore-warnings camera + - ./script/incremental_build.sh podspecs - name: build-ipas+drive-examples env: PATH: $PATH:/usr/local/bin diff --git a/packages/camera/CHANGELOG.md b/packages/camera/CHANGELOG.md index 88c0ed8c7625..2cf34dd55588 100644 --- a/packages/camera/CHANGELOG.md +++ b/packages/camera/CHANGELOG.md @@ -1,10 +1,14 @@ +## 0.5.8+5 + +* Fix compilation/availability issues on iOS. + ## 0.5.8+4 * Fixed bug caused by casting a `CameraAccessException` on Android. ## 0.5.8+3 -* Fix bug in usage example in README.md +* Fix bug in usage example in README.md ## 0.5.8+2 diff --git a/packages/camera/ios/Classes/CameraPlugin.m b/packages/camera/ios/Classes/CameraPlugin.m index 42cdb6d5fdf9..525c1286717a 100644 --- a/packages/camera/ios/Classes/CameraPlugin.m +++ b/packages/camera/ios/Classes/CameraPlugin.m @@ -19,11 +19,6 @@ @interface FLTSavePhotoDelegate : NSObject @property(readonly, nonatomic) FlutterResult result; @property(readonly, nonatomic) CMMotionManager *motionManager; @property(readonly, nonatomic) AVCaptureDevicePosition cameraPosition; - -- initWithPath:(NSString *)filename - result:(FlutterResult)result - motionManager:(CMMotionManager *)motionManager - cameraPosition:(AVCaptureDevicePosition)cameraPosition; @end @interface FLTImageStreamHandler : NSObject @@ -68,7 +63,7 @@ - (void)captureOutput:(AVCapturePhotoOutput *)output previewPhotoSampleBuffer:(CMSampleBufferRef)previewPhotoSampleBuffer resolvedSettings:(AVCaptureResolvedPhotoSettings *)resolvedSettings bracketSettings:(AVCaptureBracketedStillImageSettings *)bracketSettings - error:(NSError *)error { + error:(NSError *)error API_AVAILABLE(ios(10)) { selfReference = nil; if (error) { _result(getFlutterError(error)); @@ -160,14 +155,14 @@ @interface FLTCam : NSObject @property(readonly, nonatomic) int64_t textureId; -@property(nonatomic, copy) void (^onFrameAvailable)(); +@property(nonatomic, copy) void (^onFrameAvailable)(void); @property BOOL enableAudio; @property(nonatomic) FlutterEventChannel *eventChannel; @property(nonatomic) FLTImageStreamHandler *imageStreamHandler; @property(nonatomic) FlutterEventSink eventSink; @property(readonly, nonatomic) AVCaptureSession *captureSession; @property(readonly, nonatomic) AVCaptureDevice *captureDevice; -@property(readonly, nonatomic) AVCapturePhotoOutput *capturePhotoOutput; +@property(readonly, nonatomic) AVCapturePhotoOutput *capturePhotoOutput API_AVAILABLE(ios(10)); @property(readonly, nonatomic) AVCaptureVideoDataOutput *captureVideoOutput; @property(readonly, nonatomic) AVCaptureInput *captureVideoInput; @property(readonly) CVPixelBufferRef volatile latestPixelBuffer; @@ -192,19 +187,6 @@ @interface FLTCam : NSObject *)messenger; -- (void)stopImageStream; -- (void)captureToFile:(NSString *)filename result:(FlutterResult)result; @end @implementation FLTCam { @@ -254,9 +236,12 @@ - (instancetype)initWithCameraName:(NSString *)cameraName [_captureSession addInputWithNoConnections:_captureVideoInput]; [_captureSession addOutputWithNoConnections:_captureVideoOutput]; [_captureSession addConnection:connection]; - _capturePhotoOutput = [AVCapturePhotoOutput new]; - [_capturePhotoOutput setHighResolutionCaptureEnabled:YES]; - [_captureSession addOutput:_capturePhotoOutput]; + + if (@available(iOS 10.0, *)) { + _capturePhotoOutput = [AVCapturePhotoOutput new]; + [_capturePhotoOutput setHighResolutionCaptureEnabled:YES]; + [_captureSession addOutput:_capturePhotoOutput]; + } _motionManager = [[CMMotionManager alloc] init]; [_motionManager startAccelerometerUpdates]; @@ -272,7 +257,7 @@ - (void)stop { [_captureSession stopRunning]; } -- (void)captureToFile:(NSString *)path result:(FlutterResult)result { +- (void)captureToFile:(NSString *)path result:(FlutterResult)result API_AVAILABLE(ios(10)) { AVCapturePhotoSettings *settings = [AVCapturePhotoSettings photoSettings]; if (_resolutionPreset == max) { [settings setHighResolutionPhotoEnabled:YES]; @@ -288,6 +273,14 @@ - (void)captureToFile:(NSString *)path result:(FlutterResult)result { - (void)setCaptureSessionPreset:(ResolutionPreset)resolutionPreset { switch (resolutionPreset) { case max: + case ultraHigh: + if (@available(iOS 9.0, *)) { + if ([_captureSession canSetSessionPreset:AVCaptureSessionPreset3840x2160]) { + _captureSession.sessionPreset = AVCaptureSessionPreset3840x2160; + _previewSize = CGSizeMake(3840, 2160); + break; + } + } if ([_captureSession canSetSessionPreset:AVCaptureSessionPresetHigh]) { _captureSession.sessionPreset = AVCaptureSessionPresetHigh; _previewSize = @@ -295,12 +288,6 @@ - (void)setCaptureSessionPreset:(ResolutionPreset)resolutionPreset { _captureDevice.activeFormat.highResolutionStillImageDimensions.height); break; } - case ultraHigh: - if ([_captureSession canSetSessionPreset:AVCaptureSessionPreset3840x2160]) { - _captureSession.sessionPreset = AVCaptureSessionPreset3840x2160; - _previewSize = CGSizeMake(3840, 2160); - break; - } case veryHigh: if ([_captureSession canSetSessionPreset:AVCaptureSessionPreset1920x1080]) { _captureSession.sessionPreset = AVCaptureSessionPreset1920x1080; @@ -495,7 +482,7 @@ - (void)captureOutput:(AVCaptureOutput *)output } } -- (CMSampleBufferRef)adjustTime:(CMSampleBufferRef)sample by:(CMTime)offset { +- (CMSampleBufferRef)adjustTime:(CMSampleBufferRef)sample by:(CMTime)offset CF_RETURNS_RETAINED { CMItemCount count; CMSampleBufferGetSampleTimingInfoArray(sample, 0, nil, &count); CMSampleTimingInfo *pInfo = malloc(sizeof(CMSampleTimingInfo) * count); @@ -801,33 +788,37 @@ - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result - (void)handleMethodCallAsync:(FlutterMethodCall *)call result:(FlutterResult)result { if ([@"availableCameras" isEqualToString:call.method]) { - AVCaptureDeviceDiscoverySession *discoverySession = [AVCaptureDeviceDiscoverySession - discoverySessionWithDeviceTypes:@[ AVCaptureDeviceTypeBuiltInWideAngleCamera ] - mediaType:AVMediaTypeVideo - position:AVCaptureDevicePositionUnspecified]; - NSArray *devices = discoverySession.devices; - NSMutableArray *> *reply = - [[NSMutableArray alloc] initWithCapacity:devices.count]; - for (AVCaptureDevice *device in devices) { - NSString *lensFacing; - switch ([device position]) { - case AVCaptureDevicePositionBack: - lensFacing = @"back"; - break; - case AVCaptureDevicePositionFront: - lensFacing = @"front"; - break; - case AVCaptureDevicePositionUnspecified: - lensFacing = @"external"; - break; + if (@available(iOS 10.0, *)) { + AVCaptureDeviceDiscoverySession *discoverySession = [AVCaptureDeviceDiscoverySession + discoverySessionWithDeviceTypes:@[ AVCaptureDeviceTypeBuiltInWideAngleCamera ] + mediaType:AVMediaTypeVideo + position:AVCaptureDevicePositionUnspecified]; + NSArray *devices = discoverySession.devices; + NSMutableArray *> *reply = + [[NSMutableArray alloc] initWithCapacity:devices.count]; + for (AVCaptureDevice *device in devices) { + NSString *lensFacing; + switch ([device position]) { + case AVCaptureDevicePositionBack: + lensFacing = @"back"; + break; + case AVCaptureDevicePositionFront: + lensFacing = @"front"; + break; + case AVCaptureDevicePositionUnspecified: + lensFacing = @"external"; + break; + } + [reply addObject:@{ + @"name" : [device uniqueID], + @"lensFacing" : lensFacing, + @"sensorOrientation" : @90, + }]; } - [reply addObject:@{ - @"name" : [device uniqueID], - @"lensFacing" : lensFacing, - @"sensorOrientation" : @90, - }]; + result(reply); + } else { + result(FlutterMethodNotImplemented); } - result(reply); } else if ([@"initialize" isEqualToString:call.method]) { NSString *cameraName = call.arguments[@"cameraName"]; NSString *resolutionPreset = call.arguments[@"resolutionPreset"]; @@ -846,8 +837,9 @@ - (void)handleMethodCallAsync:(FlutterMethodCall *)call result:(FlutterResult)re } int64_t textureId = [_registry registerTexture:cam]; _camera = cam; + __weak CameraPlugin *weakSelf = self; cam.onFrameAvailable = ^{ - [_registry textureFrameAvailable:textureId]; + [weakSelf.registry textureFrameAvailable:textureId]; }; FlutterEventChannel *eventChannel = [FlutterEventChannel eventChannelWithName:[NSString @@ -880,9 +872,12 @@ - (void)handleMethodCallAsync:(FlutterMethodCall *)call result:(FlutterResult)re } else { NSDictionary *argsMap = call.arguments; NSUInteger textureId = ((NSNumber *)argsMap[@"textureId"]).unsignedIntegerValue; - if ([@"takePicture" isEqualToString:call.method]) { - [_camera captureToFile:call.arguments[@"path"] result:result]; + if (@available(iOS 10.0, *)) { + [_camera captureToFile:call.arguments[@"path"] result:result]; + } else { + result(FlutterMethodNotImplemented); + } } else if ([@"dispose" isEqualToString:call.method]) { [_registry unregisterTexture:textureId]; [_camera close]; diff --git a/packages/camera/ios/camera.podspec b/packages/camera/ios/camera.podspec index dfe566ca79cc..960f102e7706 100644 --- a/packages/camera/ios/camera.podspec +++ b/packages/camera/ios/camera.podspec @@ -4,19 +4,21 @@ Pod::Spec.new do |s| s.name = 'camera' s.version = '0.0.1' - s.summary = 'A new flutter plugin project.' + s.summary = 'Flutter Camera' s.description = <<-DESC -A new flutter plugin project. +A Flutter plugin to use the camera from your Flutter app. DESC - s.homepage = 'http://example.com' - s.license = { :file => '../LICENSE' } - s.author = { 'Your Company' => 'email@example.com' } - s.source = { :path => '.' } + s.homepage = 'https://github.com/flutter/plugins' + s.license = { :type => 'BSD', :file => '../LICENSE' } + s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } + s.source = { :http => 'https://github.com/flutter/plugins/tree/master/packages/camera' } + s.documentation_url = 'https://pub.dev/packages/camera' s.source_files = 'Classes/**/*' s.public_header_files = 'Classes/**/*.h' s.dependency 'Flutter' + s.platform = :ios, '8.0' - s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS' => 'armv7 arm64 x86_64' } + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' } s.test_spec 'Tests' do |test_spec| test_spec.source_files = 'Tests/**/*' diff --git a/packages/camera/pubspec.yaml b/packages/camera/pubspec.yaml index a93c016e1f10..01c7907792b2 100644 --- a/packages/camera/pubspec.yaml +++ b/packages/camera/pubspec.yaml @@ -2,7 +2,7 @@ name: camera description: A Flutter plugin for getting information about and controlling the camera on Android and iOS. Supports previewing the camera feed, capturing images, capturing video, and streaming image buffers to dart. -version: 0.5.8+4 +version: 0.5.8+5 homepage: https://github.com/flutter/plugins/tree/master/packages/camera From 6f6b786a8163d08402336e25315973805601ee49 Mon Sep 17 00:00:00 2001 From: Taha Tesser Date: Fri, 14 Aug 2020 21:29:48 +0530 Subject: [PATCH 035/233] [url_launcher_web] Fix link in README (#2932) Co-authored-by: Markus Aksli <68219924+markusaksli-nc@users.noreply.github.com> --- packages/url_launcher/url_launcher_web/CHANGELOG.md | 4 ++++ packages/url_launcher/url_launcher_web/README.md | 2 +- packages/url_launcher/url_launcher_web/pubspec.yaml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/url_launcher/url_launcher_web/CHANGELOG.md b/packages/url_launcher/url_launcher_web/CHANGELOG.md index e9f7bde63fda..ed8014297776 100644 --- a/packages/url_launcher/url_launcher_web/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_web/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.1.2+1 + +- Update docs + # 0.1.2 - Adds "tel" and "sms" support diff --git a/packages/url_launcher/url_launcher_web/README.md b/packages/url_launcher/url_launcher_web/README.md index 374301032778..21ab2fc52927 100644 --- a/packages/url_launcher/url_launcher_web/README.md +++ b/packages/url_launcher/url_launcher_web/README.md @@ -34,4 +34,4 @@ dependencies: Once you have the `url_launcher_web` dependency in your pubspec, you should be able to use `package:url_launcher` as normal. -[1]: ../url_launcher/url_launcher +[1]: ../url_launcher diff --git a/packages/url_launcher/url_launcher_web/pubspec.yaml b/packages/url_launcher/url_launcher_web/pubspec.yaml index 9a5beac00b94..727b396ba2e6 100644 --- a/packages/url_launcher/url_launcher_web/pubspec.yaml +++ b/packages/url_launcher/url_launcher_web/pubspec.yaml @@ -4,7 +4,7 @@ homepage: https://github.com/flutter/plugins/tree/master/packages/url_launcher/u # 0.1.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.1.2 +version: 0.1.2+1 flutter: plugin: From 77fbfcd801f7717b681c9b9981bd31c2ce10a2c4 Mon Sep 17 00:00:00 2001 From: Ben Bieker Date: Mon, 17 Aug 2020 18:46:09 +0200 Subject: [PATCH 036/233] [video_player] Set audio mix options (#2922) --- .../video_player/video_player/CHANGELOG.md | 4 ++ .../flutter/plugins/videoplayer/Messages.java | 52 +++++++++++++++++++ .../plugins/videoplayer/VideoPlayer.java | 12 +++-- .../videoplayer/VideoPlayerOptions.java | 5 ++ .../videoplayer/VideoPlayerPlugin.java | 13 ++++- .../video_player/example/lib/main.dart | 1 + .../ios/Classes/FLTVideoPlayerPlugin.m | 11 ++++ .../video_player/ios/Classes/messages.h | 7 +++ .../video_player/ios/Classes/messages.m | 35 +++++++++++++ .../video_player/lib/video_player.dart | 18 +++++-- .../video_player/pigeons/messages.dart | 5 ++ .../video_player/video_player/pubspec.yaml | 2 +- .../video_player/test/video_player_test.dart | 13 ++++- 13 files changed, 166 insertions(+), 12 deletions(-) create mode 100644 packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerOptions.java diff --git a/packages/video_player/video_player/CHANGELOG.md b/packages/video_player/video_player/CHANGELOG.md index e3f49e736411..1fdfad6256f4 100644 --- a/packages/video_player/video_player/CHANGELOG.md +++ b/packages/video_player/video_player/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.10.12 + +* Introduce VideoPlayerOptions to set the audio mix mode. + ## 0.10.11+2 * Fix aspectRatio calculation when size.width or size.height are zero. diff --git a/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/Messages.java b/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/Messages.java index 7bba51b21f98..003ca18f23cb 100644 --- a/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/Messages.java +++ b/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/Messages.java @@ -223,6 +223,31 @@ static PositionMessage fromMap(HashMap map) { } } + /** Generated class from Pigeon that represents data sent in messages. */ + public static class MixWithOthersMessage { + private Boolean mixWithOthers; + + public Boolean getMixWithOthers() { + return mixWithOthers; + } + + public void setMixWithOthers(Boolean setterArg) { + this.mixWithOthers = setterArg; + } + + HashMap toMap() { + HashMap toMapResult = new HashMap(); + toMapResult.put("mixWithOthers", mixWithOthers); + return toMapResult; + } + + static MixWithOthersMessage fromMap(HashMap map) { + MixWithOthersMessage fromMapResult = new MixWithOthersMessage(); + fromMapResult.mixWithOthers = (Boolean) map.get("mixWithOthers"); + return fromMapResult; + } + } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface VideoPlayerApi { void initialize(); @@ -243,6 +268,8 @@ public interface VideoPlayerApi { void pause(TextureMessage arg); + void setMixWithOthers(MixWithOthersMessage arg); + /** Sets up an instance of `VideoPlayerApi` to handle messages through the `binaryMessenger` */ public static void setup(BinaryMessenger binaryMessenger, VideoPlayerApi api) { { @@ -469,6 +496,31 @@ public void onMessage(Object message, BasicMessageChannel.Reply reply) { channel.setMessageHandler(null); } } + { + BasicMessageChannel channel = + new BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.VideoPlayerApi.setMixWithOthers", + new StandardMessageCodec()); + if (api != null) { + channel.setMessageHandler( + new BasicMessageChannel.MessageHandler() { + public void onMessage(Object message, BasicMessageChannel.Reply reply) { + MixWithOthersMessage input = MixWithOthersMessage.fromMap((HashMap) message); + HashMap wrapped = new HashMap(); + try { + api.setMixWithOthers(input); + wrapped.put("result", null); + } catch (Exception exception) { + wrapped.put("error", wrapError(exception)); + } + reply.reply(wrapped); + } + }); + } else { + channel.setMessageHandler(null); + } + } } } diff --git a/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java b/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java index 9db281d38b86..801c2ca3bff2 100644 --- a/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java +++ b/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java @@ -56,14 +56,18 @@ final class VideoPlayer { private boolean isInitialized = false; + private final VideoPlayerOptions options; + VideoPlayer( Context context, EventChannel eventChannel, TextureRegistry.SurfaceTextureEntry textureEntry, String dataSource, - String formatHint) { + String formatHint, + VideoPlayerOptions options) { this.eventChannel = eventChannel; this.textureEntry = textureEntry; + this.options = options; TrackSelector trackSelector = new DefaultTrackSelector(); exoPlayer = ExoPlayerFactory.newSimpleInstance(context, trackSelector); @@ -163,7 +167,7 @@ public void onCancel(Object o) { surface = new Surface(textureEntry.surfaceTexture()); exoPlayer.setVideoSurface(surface); - setAudioAttributes(exoPlayer); + setAudioAttributes(exoPlayer, options.mixWithOthers); exoPlayer.addListener( new EventListener() { @@ -203,10 +207,10 @@ void sendBufferingUpdate() { } @SuppressWarnings("deprecation") - private static void setAudioAttributes(SimpleExoPlayer exoPlayer) { + private static void setAudioAttributes(SimpleExoPlayer exoPlayer, boolean isMixMode) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { exoPlayer.setAudioAttributes( - new AudioAttributes.Builder().setContentType(C.CONTENT_TYPE_MOVIE).build()); + new AudioAttributes.Builder().setContentType(C.CONTENT_TYPE_MOVIE).build(), !isMixMode); } else { exoPlayer.setAudioStreamType(C.STREAM_TYPE_MUSIC); } diff --git a/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerOptions.java b/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerOptions.java new file mode 100644 index 000000000000..7381f4a941a5 --- /dev/null +++ b/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerOptions.java @@ -0,0 +1,5 @@ +package io.flutter.plugins.videoplayer; + +class VideoPlayerOptions { + public boolean mixWithOthers; +} diff --git a/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java b/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java index 3ec40e5fa2c4..a22a4f2d7ae4 100644 --- a/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java +++ b/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java @@ -13,6 +13,7 @@ import io.flutter.plugin.common.PluginRegistry.Registrar; import io.flutter.plugins.videoplayer.Messages.CreateMessage; import io.flutter.plugins.videoplayer.Messages.LoopingMessage; +import io.flutter.plugins.videoplayer.Messages.MixWithOthersMessage; import io.flutter.plugins.videoplayer.Messages.PositionMessage; import io.flutter.plugins.videoplayer.Messages.TextureMessage; import io.flutter.plugins.videoplayer.Messages.VideoPlayerApi; @@ -25,6 +26,7 @@ public class VideoPlayerPlugin implements FlutterPlugin, VideoPlayerApi { private static final String TAG = "VideoPlayerPlugin"; private final LongSparseArray videoPlayers = new LongSparseArray<>(); private FlutterState flutterState; + private VideoPlayerOptions options = new VideoPlayerOptions(); /** Register this with the v2 embedding for the plugin to respond to lifecycle callbacks. */ public VideoPlayerPlugin() {} @@ -113,7 +115,8 @@ public TextureMessage create(CreateMessage arg) { eventChannel, handle, "asset:///" + assetLookupKey, - null); + null, + options); videoPlayers.put(handle.id(), player); } else { player = @@ -122,7 +125,8 @@ public TextureMessage create(CreateMessage arg) { eventChannel, handle, arg.getUri(), - arg.getFormatHint()); + arg.getFormatHint(), + options); videoPlayers.put(handle.id(), player); } @@ -170,6 +174,11 @@ public void pause(TextureMessage arg) { player.pause(); } + @Override + public void setMixWithOthers(MixWithOthersMessage arg) { + options.mixWithOthers = arg.getMixWithOthers(); + } + private interface KeyForAssetFn { String get(String asset); } diff --git a/packages/video_player/video_player/example/lib/main.dart b/packages/video_player/video_player/example/lib/main.dart index bfe81b9056fb..ee2fcbdc9632 100644 --- a/packages/video_player/video_player/example/lib/main.dart +++ b/packages/video_player/video_player/example/lib/main.dart @@ -220,6 +220,7 @@ class _BumbleBeeRemoteVideoState extends State<_BumbleBeeRemoteVideo> { _controller = VideoPlayerController.network( 'https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4', closedCaptionFile: _loadCaptions(), + videoPlayerOptions: VideoPlayerOptions(mixWithOthers: true), ); _controller.addListener(() { diff --git a/packages/video_player/video_player/ios/Classes/FLTVideoPlayerPlugin.m b/packages/video_player/video_player/ios/Classes/FLTVideoPlayerPlugin.m index 7dbc1b0bfd11..a834fe32b87b 100644 --- a/packages/video_player/video_player/ios/Classes/FLTVideoPlayerPlugin.m +++ b/packages/video_player/video_player/ios/Classes/FLTVideoPlayerPlugin.m @@ -560,4 +560,15 @@ - (void)pause:(FLTTextureMessage*)input error:(FlutterError**)error { [player pause]; } +- (void)setMixWithOthers:(FLTMixWithOthersMessage*)input + error:(FlutterError* _Nullable __autoreleasing*)error { + if ([input.mixWithOthers boolValue]) { + [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback + withOptions:AVAudioSessionCategoryOptionMixWithOthers + error:nil]; + } else { + [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil]; + } +} + @end diff --git a/packages/video_player/video_player/ios/Classes/messages.h b/packages/video_player/video_player/ios/Classes/messages.h index 3c89b1f203d1..27025ef27413 100644 --- a/packages/video_player/video_player/ios/Classes/messages.h +++ b/packages/video_player/video_player/ios/Classes/messages.h @@ -12,6 +12,7 @@ NS_ASSUME_NONNULL_BEGIN @class FLTLoopingMessage; @class FLTVolumeMessage; @class FLTPositionMessage; +@class FLTMixWithOthersMessage; @interface FLTTextureMessage : NSObject @property(nonatomic, strong, nullable) NSNumber *textureId; @@ -39,6 +40,10 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, strong, nullable) NSNumber *position; @end +@interface FLTMixWithOthersMessage : NSObject +@property(nonatomic, strong, nullable) NSNumber *mixWithOthers; +@end + @protocol FLTVideoPlayerApi - (void)initialize:(FlutterError *_Nullable *_Nonnull)error; - (nullable FLTTextureMessage *)create:(FLTCreateMessage *)input @@ -51,6 +56,8 @@ NS_ASSUME_NONNULL_BEGIN error:(FlutterError *_Nullable *_Nonnull)error; - (void)seekTo:(FLTPositionMessage *)input error:(FlutterError *_Nullable *_Nonnull)error; - (void)pause:(FLTTextureMessage *)input error:(FlutterError *_Nullable *_Nonnull)error; +- (void)setMixWithOthers:(FLTMixWithOthersMessage *)input + error:(FlutterError *_Nullable *_Nonnull)error; @end extern void FLTVideoPlayerApiSetup(id binaryMessenger, diff --git a/packages/video_player/video_player/ios/Classes/messages.m b/packages/video_player/video_player/ios/Classes/messages.m index 3694a11622dc..64fcd75cc6bf 100644 --- a/packages/video_player/video_player/ios/Classes/messages.m +++ b/packages/video_player/video_player/ios/Classes/messages.m @@ -40,6 +40,10 @@ @interface FLTPositionMessage () + (FLTPositionMessage *)fromMap:(NSDictionary *)dict; - (NSDictionary *)toMap; @end +@interface FLTMixWithOthersMessage () ++ (FLTMixWithOthersMessage *)fromMap:(NSDictionary *)dict; +- (NSDictionary *)toMap; +@end @implementation FLTTextureMessage + (FLTTextureMessage *)fromMap:(NSDictionary *)dict { @@ -154,6 +158,22 @@ - (NSDictionary *)toMap { } @end +@implementation FLTMixWithOthersMessage ++ (FLTMixWithOthersMessage *)fromMap:(NSDictionary *)dict { + FLTMixWithOthersMessage *result = [[FLTMixWithOthersMessage alloc] init]; + result.mixWithOthers = dict[@"mixWithOthers"]; + if ((NSNull *)result.mixWithOthers == [NSNull null]) { + result.mixWithOthers = nil; + } + return result; +} +- (NSDictionary *)toMap { + return [NSDictionary + dictionaryWithObjectsAndKeys:(self.mixWithOthers != nil ? self.mixWithOthers : [NSNull null]), + @"mixWithOthers", nil]; +} +@end + void FLTVideoPlayerApiSetup(id binaryMessenger, id api) { { FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel @@ -289,4 +309,19 @@ void FLTVideoPlayerApiSetup(id binaryMessenger, id { /// null. The [package] argument must be non-null when the asset comes from a /// package and null otherwise. VideoPlayerController.asset(this.dataSource, - {this.package, this.closedCaptionFile}) + {this.package, this.closedCaptionFile, this.videoPlayerOptions}) : dataSourceType = DataSourceType.asset, formatHint = null, super(VideoPlayerValue(duration: null)); @@ -181,7 +181,7 @@ class VideoPlayerController extends ValueNotifier { /// **Android only**: The [formatHint] option allows the caller to override /// the video format detection code. VideoPlayerController.network(this.dataSource, - {this.formatHint, this.closedCaptionFile}) + {this.formatHint, this.closedCaptionFile, this.videoPlayerOptions}) : dataSourceType = DataSourceType.network, package = null, super(VideoPlayerValue(duration: null)); @@ -190,7 +190,8 @@ class VideoPlayerController extends ValueNotifier { /// /// This will load the file from the file-URI given by: /// `'file://${file.path}'`. - VideoPlayerController.file(File file, {this.closedCaptionFile}) + VideoPlayerController.file(File file, + {this.closedCaptionFile, this.videoPlayerOptions}) : dataSource = 'file://${file.path}', dataSourceType = DataSourceType.file, package = null, @@ -211,6 +212,9 @@ class VideoPlayerController extends ValueNotifier { /// is constructed with. final DataSourceType dataSourceType; + /// Provide additional configuration options (optional). Like setting the audio mode to mix + final VideoPlayerOptions videoPlayerOptions; + /// Only set for [asset] videos. The package that the asset was loaded from. final String package; @@ -262,6 +266,12 @@ class VideoPlayerController extends ValueNotifier { ); break; } + + if (videoPlayerOptions?.mixWithOthers != null) { + await _videoPlayerPlatform + .setMixWithOthers(videoPlayerOptions.mixWithOthers); + } + _textureId = await _videoPlayerPlatform.create(dataSourceDescription); _creatingCompleter.complete(null); final Completer initializingCompleter = Completer(); diff --git a/packages/video_player/video_player/pigeons/messages.dart b/packages/video_player/video_player/pigeons/messages.dart index 2df5b78f13f8..074eef023b94 100644 --- a/packages/video_player/video_player/pigeons/messages.dart +++ b/packages/video_player/video_player/pigeons/messages.dart @@ -26,6 +26,10 @@ class CreateMessage { String formatHint; } +class MixWithOthersMessage { + bool mixWithOthers; +} + @HostApi() abstract class VideoPlayerApi { void initialize(); @@ -37,6 +41,7 @@ abstract class VideoPlayerApi { PositionMessage position(TextureMessage msg); void seekTo(PositionMessage msg); void pause(TextureMessage msg); + void setMixWithOthers(MixWithOthersMessage msg); } void configurePigeon(PigeonOptions opts) { diff --git a/packages/video_player/video_player/pubspec.yaml b/packages/video_player/video_player/pubspec.yaml index 03f71bf4f412..a62f6f09a202 100644 --- a/packages/video_player/video_player/pubspec.yaml +++ b/packages/video_player/video_player/pubspec.yaml @@ -4,7 +4,7 @@ description: Flutter plugin for displaying inline video with other Flutter # 0.10.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.10.11+2 +version: 0.10.12 homepage: https://github.com/flutter/plugins/tree/master/packages/video_player/video_player flutter: diff --git a/packages/video_player/video_player/test/video_player_test.dart b/packages/video_player/video_player/test/video_player_test.dart index ae236def4e57..67722594989c 100644 --- a/packages/video_player/video_player/test/video_player_test.dart +++ b/packages/video_player/video_player/test/video_player_test.dart @@ -10,8 +10,8 @@ import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'package:video_player/video_player.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:video_player_platform_interface/video_player_platform_interface.dart'; import 'package:video_player_platform_interface/messages.dart'; +import 'package:video_player_platform_interface/video_player_platform_interface.dart'; class FakeController extends ValueNotifier implements VideoPlayerController { @@ -52,6 +52,9 @@ class FakeController extends ValueNotifier @override Future get closedCaptionFile => _loadClosedCaption(); + + @override + VideoPlayerOptions get videoPlayerOptions => null; } Future _loadClosedCaption() async => @@ -575,6 +578,14 @@ void main() { expect(colors.bufferedColor, bufferedColor); expect(colors.backgroundColor, backgroundColor); }); + + test('setMixWithOthers', () { + final VideoPlayerController controller = VideoPlayerController.file( + File(''), + videoPlayerOptions: VideoPlayerOptions(mixWithOthers: true)); + controller.initialize(); + expect(controller.videoPlayerOptions.mixWithOthers, true); + }); } class FakeVideoPlayerPlatform extends VideoPlayerApiTest { From 0e467690b73aa060bbd06956233de56227913585 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Mon, 17 Aug 2020 10:04:01 -0700 Subject: [PATCH 037/233] [versions] increase package:platform constraint (#2934) package:platform required a breaking change in the behavior of FakePlatform in order to enable null safety, but there will be no other breaking changes in 3.X Since this does not affect path provider or local_auth, the pubspec constraint can be increased. --- packages/local_auth/CHANGELOG.md | 4 ++++ packages/local_auth/pubspec.yaml | 4 ++-- .../path_provider_platform_interface/CHANGELOG.md | 4 ++++ .../path_provider_platform_interface/pubspec.yaml | 4 ++-- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/local_auth/CHANGELOG.md b/packages/local_auth/CHANGELOG.md index d6c5f618dcd6..280de9ffbce6 100644 --- a/packages/local_auth/CHANGELOG.md +++ b/packages/local_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.6.3 + +* Increase upper range of `package:platform` constraint to allow 3.X versions. + ## 0.6.2+4 * Update package:e2e reference to use the local version in the flutter/plugins diff --git a/packages/local_auth/pubspec.yaml b/packages/local_auth/pubspec.yaml index 3546cb9de3d9..2b11d7187f98 100644 --- a/packages/local_auth/pubspec.yaml +++ b/packages/local_auth/pubspec.yaml @@ -2,7 +2,7 @@ name: local_auth description: Flutter plugin for Android and iOS device authentication sensors such as Fingerprint Reader and Touch ID. homepage: https://github.com/flutter/plugins/tree/master/packages/local_auth -version: 0.6.2+4 +version: 0.6.3 flutter: plugin: @@ -18,7 +18,7 @@ dependencies: sdk: flutter meta: ^1.0.5 intl: ">=0.15.1 <0.17.0" - platform: ^2.0.0 + platform: ">=2.0.0 <4.0.0" flutter_plugin_android_lifecycle: ^1.0.2 dev_dependencies: diff --git a/packages/path_provider/path_provider_platform_interface/CHANGELOG.md b/packages/path_provider/path_provider_platform_interface/CHANGELOG.md index 605ab6560ac5..23f71c99a678 100644 --- a/packages/path_provider/path_provider_platform_interface/CHANGELOG.md +++ b/packages/path_provider/path_provider_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.3 + +* Increase upper range of `package:platform` constraint to allow 3.X versions. + ## 1.0.2 * Update lower bound of dart dependency to 2.1.0. diff --git a/packages/path_provider/path_provider_platform_interface/pubspec.yaml b/packages/path_provider/path_provider_platform_interface/pubspec.yaml index d87224717221..9f1293883826 100644 --- a/packages/path_provider/path_provider_platform_interface/pubspec.yaml +++ b/packages/path_provider/path_provider_platform_interface/pubspec.yaml @@ -3,13 +3,13 @@ description: A common platform interface for the path_provider plugin. homepage: https://github.com/flutter/plugins/tree/master/packages/path_provider/path_provider_platform_interface # NOTE: We strongly prefer non-breaking changes, even at the expense of a # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes -version: 1.0.2 +version: 1.0.3 dependencies: flutter: sdk: flutter meta: ^1.0.5 - platform: ^2.0.0 + platform: ">=2.0.0 <4.0.0" plugin_platform_interface: ^1.0.1 dev_dependencies: From d4750ea86657bf8b35f96c8f3d9bcd5a025d189b Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Mon, 17 Aug 2020 17:41:30 -0700 Subject: [PATCH 038/233] Revert "[video_player] Set audio mix options (#2922)" (#2938) This reverts commit 77fbfcd801f7717b681c9b9981bd31c2ce10a2c4. --- .../video_player/video_player/CHANGELOG.md | 4 -- .../flutter/plugins/videoplayer/Messages.java | 52 ------------------- .../plugins/videoplayer/VideoPlayer.java | 12 ++--- .../videoplayer/VideoPlayerOptions.java | 5 -- .../videoplayer/VideoPlayerPlugin.java | 13 +---- .../video_player/example/lib/main.dart | 1 - .../ios/Classes/FLTVideoPlayerPlugin.m | 11 ---- .../video_player/ios/Classes/messages.h | 7 --- .../video_player/ios/Classes/messages.m | 35 ------------- .../video_player/lib/video_player.dart | 18 ++----- .../video_player/pigeons/messages.dart | 5 -- .../video_player/video_player/pubspec.yaml | 2 +- .../video_player/test/video_player_test.dart | 13 +---- 13 files changed, 12 insertions(+), 166 deletions(-) delete mode 100644 packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerOptions.java diff --git a/packages/video_player/video_player/CHANGELOG.md b/packages/video_player/video_player/CHANGELOG.md index 1fdfad6256f4..e3f49e736411 100644 --- a/packages/video_player/video_player/CHANGELOG.md +++ b/packages/video_player/video_player/CHANGELOG.md @@ -1,7 +1,3 @@ -## 0.10.12 - -* Introduce VideoPlayerOptions to set the audio mix mode. - ## 0.10.11+2 * Fix aspectRatio calculation when size.width or size.height are zero. diff --git a/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/Messages.java b/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/Messages.java index 003ca18f23cb..7bba51b21f98 100644 --- a/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/Messages.java +++ b/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/Messages.java @@ -223,31 +223,6 @@ static PositionMessage fromMap(HashMap map) { } } - /** Generated class from Pigeon that represents data sent in messages. */ - public static class MixWithOthersMessage { - private Boolean mixWithOthers; - - public Boolean getMixWithOthers() { - return mixWithOthers; - } - - public void setMixWithOthers(Boolean setterArg) { - this.mixWithOthers = setterArg; - } - - HashMap toMap() { - HashMap toMapResult = new HashMap(); - toMapResult.put("mixWithOthers", mixWithOthers); - return toMapResult; - } - - static MixWithOthersMessage fromMap(HashMap map) { - MixWithOthersMessage fromMapResult = new MixWithOthersMessage(); - fromMapResult.mixWithOthers = (Boolean) map.get("mixWithOthers"); - return fromMapResult; - } - } - /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface VideoPlayerApi { void initialize(); @@ -268,8 +243,6 @@ public interface VideoPlayerApi { void pause(TextureMessage arg); - void setMixWithOthers(MixWithOthersMessage arg); - /** Sets up an instance of `VideoPlayerApi` to handle messages through the `binaryMessenger` */ public static void setup(BinaryMessenger binaryMessenger, VideoPlayerApi api) { { @@ -496,31 +469,6 @@ public void onMessage(Object message, BasicMessageChannel.Reply reply) { channel.setMessageHandler(null); } } - { - BasicMessageChannel channel = - new BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.VideoPlayerApi.setMixWithOthers", - new StandardMessageCodec()); - if (api != null) { - channel.setMessageHandler( - new BasicMessageChannel.MessageHandler() { - public void onMessage(Object message, BasicMessageChannel.Reply reply) { - MixWithOthersMessage input = MixWithOthersMessage.fromMap((HashMap) message); - HashMap wrapped = new HashMap(); - try { - api.setMixWithOthers(input); - wrapped.put("result", null); - } catch (Exception exception) { - wrapped.put("error", wrapError(exception)); - } - reply.reply(wrapped); - } - }); - } else { - channel.setMessageHandler(null); - } - } } } diff --git a/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java b/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java index 801c2ca3bff2..9db281d38b86 100644 --- a/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java +++ b/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java @@ -56,18 +56,14 @@ final class VideoPlayer { private boolean isInitialized = false; - private final VideoPlayerOptions options; - VideoPlayer( Context context, EventChannel eventChannel, TextureRegistry.SurfaceTextureEntry textureEntry, String dataSource, - String formatHint, - VideoPlayerOptions options) { + String formatHint) { this.eventChannel = eventChannel; this.textureEntry = textureEntry; - this.options = options; TrackSelector trackSelector = new DefaultTrackSelector(); exoPlayer = ExoPlayerFactory.newSimpleInstance(context, trackSelector); @@ -167,7 +163,7 @@ public void onCancel(Object o) { surface = new Surface(textureEntry.surfaceTexture()); exoPlayer.setVideoSurface(surface); - setAudioAttributes(exoPlayer, options.mixWithOthers); + setAudioAttributes(exoPlayer); exoPlayer.addListener( new EventListener() { @@ -207,10 +203,10 @@ void sendBufferingUpdate() { } @SuppressWarnings("deprecation") - private static void setAudioAttributes(SimpleExoPlayer exoPlayer, boolean isMixMode) { + private static void setAudioAttributes(SimpleExoPlayer exoPlayer) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { exoPlayer.setAudioAttributes( - new AudioAttributes.Builder().setContentType(C.CONTENT_TYPE_MOVIE).build(), !isMixMode); + new AudioAttributes.Builder().setContentType(C.CONTENT_TYPE_MOVIE).build()); } else { exoPlayer.setAudioStreamType(C.STREAM_TYPE_MUSIC); } diff --git a/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerOptions.java b/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerOptions.java deleted file mode 100644 index 7381f4a941a5..000000000000 --- a/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerOptions.java +++ /dev/null @@ -1,5 +0,0 @@ -package io.flutter.plugins.videoplayer; - -class VideoPlayerOptions { - public boolean mixWithOthers; -} diff --git a/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java b/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java index a22a4f2d7ae4..3ec40e5fa2c4 100644 --- a/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java +++ b/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java @@ -13,7 +13,6 @@ import io.flutter.plugin.common.PluginRegistry.Registrar; import io.flutter.plugins.videoplayer.Messages.CreateMessage; import io.flutter.plugins.videoplayer.Messages.LoopingMessage; -import io.flutter.plugins.videoplayer.Messages.MixWithOthersMessage; import io.flutter.plugins.videoplayer.Messages.PositionMessage; import io.flutter.plugins.videoplayer.Messages.TextureMessage; import io.flutter.plugins.videoplayer.Messages.VideoPlayerApi; @@ -26,7 +25,6 @@ public class VideoPlayerPlugin implements FlutterPlugin, VideoPlayerApi { private static final String TAG = "VideoPlayerPlugin"; private final LongSparseArray videoPlayers = new LongSparseArray<>(); private FlutterState flutterState; - private VideoPlayerOptions options = new VideoPlayerOptions(); /** Register this with the v2 embedding for the plugin to respond to lifecycle callbacks. */ public VideoPlayerPlugin() {} @@ -115,8 +113,7 @@ public TextureMessage create(CreateMessage arg) { eventChannel, handle, "asset:///" + assetLookupKey, - null, - options); + null); videoPlayers.put(handle.id(), player); } else { player = @@ -125,8 +122,7 @@ public TextureMessage create(CreateMessage arg) { eventChannel, handle, arg.getUri(), - arg.getFormatHint(), - options); + arg.getFormatHint()); videoPlayers.put(handle.id(), player); } @@ -174,11 +170,6 @@ public void pause(TextureMessage arg) { player.pause(); } - @Override - public void setMixWithOthers(MixWithOthersMessage arg) { - options.mixWithOthers = arg.getMixWithOthers(); - } - private interface KeyForAssetFn { String get(String asset); } diff --git a/packages/video_player/video_player/example/lib/main.dart b/packages/video_player/video_player/example/lib/main.dart index ee2fcbdc9632..bfe81b9056fb 100644 --- a/packages/video_player/video_player/example/lib/main.dart +++ b/packages/video_player/video_player/example/lib/main.dart @@ -220,7 +220,6 @@ class _BumbleBeeRemoteVideoState extends State<_BumbleBeeRemoteVideo> { _controller = VideoPlayerController.network( 'https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4', closedCaptionFile: _loadCaptions(), - videoPlayerOptions: VideoPlayerOptions(mixWithOthers: true), ); _controller.addListener(() { diff --git a/packages/video_player/video_player/ios/Classes/FLTVideoPlayerPlugin.m b/packages/video_player/video_player/ios/Classes/FLTVideoPlayerPlugin.m index a834fe32b87b..7dbc1b0bfd11 100644 --- a/packages/video_player/video_player/ios/Classes/FLTVideoPlayerPlugin.m +++ b/packages/video_player/video_player/ios/Classes/FLTVideoPlayerPlugin.m @@ -560,15 +560,4 @@ - (void)pause:(FLTTextureMessage*)input error:(FlutterError**)error { [player pause]; } -- (void)setMixWithOthers:(FLTMixWithOthersMessage*)input - error:(FlutterError* _Nullable __autoreleasing*)error { - if ([input.mixWithOthers boolValue]) { - [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback - withOptions:AVAudioSessionCategoryOptionMixWithOthers - error:nil]; - } else { - [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil]; - } -} - @end diff --git a/packages/video_player/video_player/ios/Classes/messages.h b/packages/video_player/video_player/ios/Classes/messages.h index 27025ef27413..3c89b1f203d1 100644 --- a/packages/video_player/video_player/ios/Classes/messages.h +++ b/packages/video_player/video_player/ios/Classes/messages.h @@ -12,7 +12,6 @@ NS_ASSUME_NONNULL_BEGIN @class FLTLoopingMessage; @class FLTVolumeMessage; @class FLTPositionMessage; -@class FLTMixWithOthersMessage; @interface FLTTextureMessage : NSObject @property(nonatomic, strong, nullable) NSNumber *textureId; @@ -40,10 +39,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, strong, nullable) NSNumber *position; @end -@interface FLTMixWithOthersMessage : NSObject -@property(nonatomic, strong, nullable) NSNumber *mixWithOthers; -@end - @protocol FLTVideoPlayerApi - (void)initialize:(FlutterError *_Nullable *_Nonnull)error; - (nullable FLTTextureMessage *)create:(FLTCreateMessage *)input @@ -56,8 +51,6 @@ NS_ASSUME_NONNULL_BEGIN error:(FlutterError *_Nullable *_Nonnull)error; - (void)seekTo:(FLTPositionMessage *)input error:(FlutterError *_Nullable *_Nonnull)error; - (void)pause:(FLTTextureMessage *)input error:(FlutterError *_Nullable *_Nonnull)error; -- (void)setMixWithOthers:(FLTMixWithOthersMessage *)input - error:(FlutterError *_Nullable *_Nonnull)error; @end extern void FLTVideoPlayerApiSetup(id binaryMessenger, diff --git a/packages/video_player/video_player/ios/Classes/messages.m b/packages/video_player/video_player/ios/Classes/messages.m index 64fcd75cc6bf..3694a11622dc 100644 --- a/packages/video_player/video_player/ios/Classes/messages.m +++ b/packages/video_player/video_player/ios/Classes/messages.m @@ -40,10 +40,6 @@ @interface FLTPositionMessage () + (FLTPositionMessage *)fromMap:(NSDictionary *)dict; - (NSDictionary *)toMap; @end -@interface FLTMixWithOthersMessage () -+ (FLTMixWithOthersMessage *)fromMap:(NSDictionary *)dict; -- (NSDictionary *)toMap; -@end @implementation FLTTextureMessage + (FLTTextureMessage *)fromMap:(NSDictionary *)dict { @@ -158,22 +154,6 @@ - (NSDictionary *)toMap { } @end -@implementation FLTMixWithOthersMessage -+ (FLTMixWithOthersMessage *)fromMap:(NSDictionary *)dict { - FLTMixWithOthersMessage *result = [[FLTMixWithOthersMessage alloc] init]; - result.mixWithOthers = dict[@"mixWithOthers"]; - if ((NSNull *)result.mixWithOthers == [NSNull null]) { - result.mixWithOthers = nil; - } - return result; -} -- (NSDictionary *)toMap { - return [NSDictionary - dictionaryWithObjectsAndKeys:(self.mixWithOthers != nil ? self.mixWithOthers : [NSNull null]), - @"mixWithOthers", nil]; -} -@end - void FLTVideoPlayerApiSetup(id binaryMessenger, id api) { { FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel @@ -309,19 +289,4 @@ void FLTVideoPlayerApiSetup(id binaryMessenger, id { /// null. The [package] argument must be non-null when the asset comes from a /// package and null otherwise. VideoPlayerController.asset(this.dataSource, - {this.package, this.closedCaptionFile, this.videoPlayerOptions}) + {this.package, this.closedCaptionFile}) : dataSourceType = DataSourceType.asset, formatHint = null, super(VideoPlayerValue(duration: null)); @@ -181,7 +181,7 @@ class VideoPlayerController extends ValueNotifier { /// **Android only**: The [formatHint] option allows the caller to override /// the video format detection code. VideoPlayerController.network(this.dataSource, - {this.formatHint, this.closedCaptionFile, this.videoPlayerOptions}) + {this.formatHint, this.closedCaptionFile}) : dataSourceType = DataSourceType.network, package = null, super(VideoPlayerValue(duration: null)); @@ -190,8 +190,7 @@ class VideoPlayerController extends ValueNotifier { /// /// This will load the file from the file-URI given by: /// `'file://${file.path}'`. - VideoPlayerController.file(File file, - {this.closedCaptionFile, this.videoPlayerOptions}) + VideoPlayerController.file(File file, {this.closedCaptionFile}) : dataSource = 'file://${file.path}', dataSourceType = DataSourceType.file, package = null, @@ -212,9 +211,6 @@ class VideoPlayerController extends ValueNotifier { /// is constructed with. final DataSourceType dataSourceType; - /// Provide additional configuration options (optional). Like setting the audio mode to mix - final VideoPlayerOptions videoPlayerOptions; - /// Only set for [asset] videos. The package that the asset was loaded from. final String package; @@ -266,12 +262,6 @@ class VideoPlayerController extends ValueNotifier { ); break; } - - if (videoPlayerOptions?.mixWithOthers != null) { - await _videoPlayerPlatform - .setMixWithOthers(videoPlayerOptions.mixWithOthers); - } - _textureId = await _videoPlayerPlatform.create(dataSourceDescription); _creatingCompleter.complete(null); final Completer initializingCompleter = Completer(); diff --git a/packages/video_player/video_player/pigeons/messages.dart b/packages/video_player/video_player/pigeons/messages.dart index 074eef023b94..2df5b78f13f8 100644 --- a/packages/video_player/video_player/pigeons/messages.dart +++ b/packages/video_player/video_player/pigeons/messages.dart @@ -26,10 +26,6 @@ class CreateMessage { String formatHint; } -class MixWithOthersMessage { - bool mixWithOthers; -} - @HostApi() abstract class VideoPlayerApi { void initialize(); @@ -41,7 +37,6 @@ abstract class VideoPlayerApi { PositionMessage position(TextureMessage msg); void seekTo(PositionMessage msg); void pause(TextureMessage msg); - void setMixWithOthers(MixWithOthersMessage msg); } void configurePigeon(PigeonOptions opts) { diff --git a/packages/video_player/video_player/pubspec.yaml b/packages/video_player/video_player/pubspec.yaml index a62f6f09a202..03f71bf4f412 100644 --- a/packages/video_player/video_player/pubspec.yaml +++ b/packages/video_player/video_player/pubspec.yaml @@ -4,7 +4,7 @@ description: Flutter plugin for displaying inline video with other Flutter # 0.10.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.10.12 +version: 0.10.11+2 homepage: https://github.com/flutter/plugins/tree/master/packages/video_player/video_player flutter: diff --git a/packages/video_player/video_player/test/video_player_test.dart b/packages/video_player/video_player/test/video_player_test.dart index 67722594989c..ae236def4e57 100644 --- a/packages/video_player/video_player/test/video_player_test.dart +++ b/packages/video_player/video_player/test/video_player_test.dart @@ -10,8 +10,8 @@ import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'package:video_player/video_player.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:video_player_platform_interface/messages.dart'; import 'package:video_player_platform_interface/video_player_platform_interface.dart'; +import 'package:video_player_platform_interface/messages.dart'; class FakeController extends ValueNotifier implements VideoPlayerController { @@ -52,9 +52,6 @@ class FakeController extends ValueNotifier @override Future get closedCaptionFile => _loadClosedCaption(); - - @override - VideoPlayerOptions get videoPlayerOptions => null; } Future _loadClosedCaption() async => @@ -578,14 +575,6 @@ void main() { expect(colors.bufferedColor, bufferedColor); expect(colors.backgroundColor, backgroundColor); }); - - test('setMixWithOthers', () { - final VideoPlayerController controller = VideoPlayerController.file( - File(''), - videoPlayerOptions: VideoPlayerOptions(mixWithOthers: true)); - controller.initialize(); - expect(controller.videoPlayerOptions.mixWithOthers, true); - }); } class FakeVideoPlayerPlatform extends VideoPlayerApiTest { From db329d71fca07eb1c24d576f8d1dc2bdc0792a55 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Mon, 17 Aug 2020 20:20:03 -0700 Subject: [PATCH 039/233] Revert "Revert "[video_player] Set audio mix options (#2922)" (#2938)" (#2939) This reverts commit d4750ea86657bf8b35f96c8f3d9bcd5a025d189b. --- .../video_player/video_player/CHANGELOG.md | 4 ++ .../flutter/plugins/videoplayer/Messages.java | 52 +++++++++++++++++++ .../plugins/videoplayer/VideoPlayer.java | 12 +++-- .../videoplayer/VideoPlayerOptions.java | 5 ++ .../videoplayer/VideoPlayerPlugin.java | 13 ++++- .../video_player/example/lib/main.dart | 1 + .../ios/Classes/FLTVideoPlayerPlugin.m | 11 ++++ .../video_player/ios/Classes/messages.h | 7 +++ .../video_player/ios/Classes/messages.m | 35 +++++++++++++ .../video_player/lib/video_player.dart | 18 +++++-- .../video_player/pigeons/messages.dart | 5 ++ .../video_player/video_player/pubspec.yaml | 2 +- .../video_player/test/video_player_test.dart | 13 ++++- 13 files changed, 166 insertions(+), 12 deletions(-) create mode 100644 packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerOptions.java diff --git a/packages/video_player/video_player/CHANGELOG.md b/packages/video_player/video_player/CHANGELOG.md index e3f49e736411..1fdfad6256f4 100644 --- a/packages/video_player/video_player/CHANGELOG.md +++ b/packages/video_player/video_player/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.10.12 + +* Introduce VideoPlayerOptions to set the audio mix mode. + ## 0.10.11+2 * Fix aspectRatio calculation when size.width or size.height are zero. diff --git a/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/Messages.java b/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/Messages.java index 7bba51b21f98..003ca18f23cb 100644 --- a/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/Messages.java +++ b/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/Messages.java @@ -223,6 +223,31 @@ static PositionMessage fromMap(HashMap map) { } } + /** Generated class from Pigeon that represents data sent in messages. */ + public static class MixWithOthersMessage { + private Boolean mixWithOthers; + + public Boolean getMixWithOthers() { + return mixWithOthers; + } + + public void setMixWithOthers(Boolean setterArg) { + this.mixWithOthers = setterArg; + } + + HashMap toMap() { + HashMap toMapResult = new HashMap(); + toMapResult.put("mixWithOthers", mixWithOthers); + return toMapResult; + } + + static MixWithOthersMessage fromMap(HashMap map) { + MixWithOthersMessage fromMapResult = new MixWithOthersMessage(); + fromMapResult.mixWithOthers = (Boolean) map.get("mixWithOthers"); + return fromMapResult; + } + } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface VideoPlayerApi { void initialize(); @@ -243,6 +268,8 @@ public interface VideoPlayerApi { void pause(TextureMessage arg); + void setMixWithOthers(MixWithOthersMessage arg); + /** Sets up an instance of `VideoPlayerApi` to handle messages through the `binaryMessenger` */ public static void setup(BinaryMessenger binaryMessenger, VideoPlayerApi api) { { @@ -469,6 +496,31 @@ public void onMessage(Object message, BasicMessageChannel.Reply reply) { channel.setMessageHandler(null); } } + { + BasicMessageChannel channel = + new BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.VideoPlayerApi.setMixWithOthers", + new StandardMessageCodec()); + if (api != null) { + channel.setMessageHandler( + new BasicMessageChannel.MessageHandler() { + public void onMessage(Object message, BasicMessageChannel.Reply reply) { + MixWithOthersMessage input = MixWithOthersMessage.fromMap((HashMap) message); + HashMap wrapped = new HashMap(); + try { + api.setMixWithOthers(input); + wrapped.put("result", null); + } catch (Exception exception) { + wrapped.put("error", wrapError(exception)); + } + reply.reply(wrapped); + } + }); + } else { + channel.setMessageHandler(null); + } + } } } diff --git a/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java b/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java index 9db281d38b86..801c2ca3bff2 100644 --- a/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java +++ b/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java @@ -56,14 +56,18 @@ final class VideoPlayer { private boolean isInitialized = false; + private final VideoPlayerOptions options; + VideoPlayer( Context context, EventChannel eventChannel, TextureRegistry.SurfaceTextureEntry textureEntry, String dataSource, - String formatHint) { + String formatHint, + VideoPlayerOptions options) { this.eventChannel = eventChannel; this.textureEntry = textureEntry; + this.options = options; TrackSelector trackSelector = new DefaultTrackSelector(); exoPlayer = ExoPlayerFactory.newSimpleInstance(context, trackSelector); @@ -163,7 +167,7 @@ public void onCancel(Object o) { surface = new Surface(textureEntry.surfaceTexture()); exoPlayer.setVideoSurface(surface); - setAudioAttributes(exoPlayer); + setAudioAttributes(exoPlayer, options.mixWithOthers); exoPlayer.addListener( new EventListener() { @@ -203,10 +207,10 @@ void sendBufferingUpdate() { } @SuppressWarnings("deprecation") - private static void setAudioAttributes(SimpleExoPlayer exoPlayer) { + private static void setAudioAttributes(SimpleExoPlayer exoPlayer, boolean isMixMode) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { exoPlayer.setAudioAttributes( - new AudioAttributes.Builder().setContentType(C.CONTENT_TYPE_MOVIE).build()); + new AudioAttributes.Builder().setContentType(C.CONTENT_TYPE_MOVIE).build(), !isMixMode); } else { exoPlayer.setAudioStreamType(C.STREAM_TYPE_MUSIC); } diff --git a/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerOptions.java b/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerOptions.java new file mode 100644 index 000000000000..7381f4a941a5 --- /dev/null +++ b/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerOptions.java @@ -0,0 +1,5 @@ +package io.flutter.plugins.videoplayer; + +class VideoPlayerOptions { + public boolean mixWithOthers; +} diff --git a/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java b/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java index 3ec40e5fa2c4..a22a4f2d7ae4 100644 --- a/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java +++ b/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java @@ -13,6 +13,7 @@ import io.flutter.plugin.common.PluginRegistry.Registrar; import io.flutter.plugins.videoplayer.Messages.CreateMessage; import io.flutter.plugins.videoplayer.Messages.LoopingMessage; +import io.flutter.plugins.videoplayer.Messages.MixWithOthersMessage; import io.flutter.plugins.videoplayer.Messages.PositionMessage; import io.flutter.plugins.videoplayer.Messages.TextureMessage; import io.flutter.plugins.videoplayer.Messages.VideoPlayerApi; @@ -25,6 +26,7 @@ public class VideoPlayerPlugin implements FlutterPlugin, VideoPlayerApi { private static final String TAG = "VideoPlayerPlugin"; private final LongSparseArray videoPlayers = new LongSparseArray<>(); private FlutterState flutterState; + private VideoPlayerOptions options = new VideoPlayerOptions(); /** Register this with the v2 embedding for the plugin to respond to lifecycle callbacks. */ public VideoPlayerPlugin() {} @@ -113,7 +115,8 @@ public TextureMessage create(CreateMessage arg) { eventChannel, handle, "asset:///" + assetLookupKey, - null); + null, + options); videoPlayers.put(handle.id(), player); } else { player = @@ -122,7 +125,8 @@ public TextureMessage create(CreateMessage arg) { eventChannel, handle, arg.getUri(), - arg.getFormatHint()); + arg.getFormatHint(), + options); videoPlayers.put(handle.id(), player); } @@ -170,6 +174,11 @@ public void pause(TextureMessage arg) { player.pause(); } + @Override + public void setMixWithOthers(MixWithOthersMessage arg) { + options.mixWithOthers = arg.getMixWithOthers(); + } + private interface KeyForAssetFn { String get(String asset); } diff --git a/packages/video_player/video_player/example/lib/main.dart b/packages/video_player/video_player/example/lib/main.dart index bfe81b9056fb..ee2fcbdc9632 100644 --- a/packages/video_player/video_player/example/lib/main.dart +++ b/packages/video_player/video_player/example/lib/main.dart @@ -220,6 +220,7 @@ class _BumbleBeeRemoteVideoState extends State<_BumbleBeeRemoteVideo> { _controller = VideoPlayerController.network( 'https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4', closedCaptionFile: _loadCaptions(), + videoPlayerOptions: VideoPlayerOptions(mixWithOthers: true), ); _controller.addListener(() { diff --git a/packages/video_player/video_player/ios/Classes/FLTVideoPlayerPlugin.m b/packages/video_player/video_player/ios/Classes/FLTVideoPlayerPlugin.m index 7dbc1b0bfd11..a834fe32b87b 100644 --- a/packages/video_player/video_player/ios/Classes/FLTVideoPlayerPlugin.m +++ b/packages/video_player/video_player/ios/Classes/FLTVideoPlayerPlugin.m @@ -560,4 +560,15 @@ - (void)pause:(FLTTextureMessage*)input error:(FlutterError**)error { [player pause]; } +- (void)setMixWithOthers:(FLTMixWithOthersMessage*)input + error:(FlutterError* _Nullable __autoreleasing*)error { + if ([input.mixWithOthers boolValue]) { + [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback + withOptions:AVAudioSessionCategoryOptionMixWithOthers + error:nil]; + } else { + [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil]; + } +} + @end diff --git a/packages/video_player/video_player/ios/Classes/messages.h b/packages/video_player/video_player/ios/Classes/messages.h index 3c89b1f203d1..27025ef27413 100644 --- a/packages/video_player/video_player/ios/Classes/messages.h +++ b/packages/video_player/video_player/ios/Classes/messages.h @@ -12,6 +12,7 @@ NS_ASSUME_NONNULL_BEGIN @class FLTLoopingMessage; @class FLTVolumeMessage; @class FLTPositionMessage; +@class FLTMixWithOthersMessage; @interface FLTTextureMessage : NSObject @property(nonatomic, strong, nullable) NSNumber *textureId; @@ -39,6 +40,10 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, strong, nullable) NSNumber *position; @end +@interface FLTMixWithOthersMessage : NSObject +@property(nonatomic, strong, nullable) NSNumber *mixWithOthers; +@end + @protocol FLTVideoPlayerApi - (void)initialize:(FlutterError *_Nullable *_Nonnull)error; - (nullable FLTTextureMessage *)create:(FLTCreateMessage *)input @@ -51,6 +56,8 @@ NS_ASSUME_NONNULL_BEGIN error:(FlutterError *_Nullable *_Nonnull)error; - (void)seekTo:(FLTPositionMessage *)input error:(FlutterError *_Nullable *_Nonnull)error; - (void)pause:(FLTTextureMessage *)input error:(FlutterError *_Nullable *_Nonnull)error; +- (void)setMixWithOthers:(FLTMixWithOthersMessage *)input + error:(FlutterError *_Nullable *_Nonnull)error; @end extern void FLTVideoPlayerApiSetup(id binaryMessenger, diff --git a/packages/video_player/video_player/ios/Classes/messages.m b/packages/video_player/video_player/ios/Classes/messages.m index 3694a11622dc..64fcd75cc6bf 100644 --- a/packages/video_player/video_player/ios/Classes/messages.m +++ b/packages/video_player/video_player/ios/Classes/messages.m @@ -40,6 +40,10 @@ @interface FLTPositionMessage () + (FLTPositionMessage *)fromMap:(NSDictionary *)dict; - (NSDictionary *)toMap; @end +@interface FLTMixWithOthersMessage () ++ (FLTMixWithOthersMessage *)fromMap:(NSDictionary *)dict; +- (NSDictionary *)toMap; +@end @implementation FLTTextureMessage + (FLTTextureMessage *)fromMap:(NSDictionary *)dict { @@ -154,6 +158,22 @@ - (NSDictionary *)toMap { } @end +@implementation FLTMixWithOthersMessage ++ (FLTMixWithOthersMessage *)fromMap:(NSDictionary *)dict { + FLTMixWithOthersMessage *result = [[FLTMixWithOthersMessage alloc] init]; + result.mixWithOthers = dict[@"mixWithOthers"]; + if ((NSNull *)result.mixWithOthers == [NSNull null]) { + result.mixWithOthers = nil; + } + return result; +} +- (NSDictionary *)toMap { + return [NSDictionary + dictionaryWithObjectsAndKeys:(self.mixWithOthers != nil ? self.mixWithOthers : [NSNull null]), + @"mixWithOthers", nil]; +} +@end + void FLTVideoPlayerApiSetup(id binaryMessenger, id api) { { FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel @@ -289,4 +309,19 @@ void FLTVideoPlayerApiSetup(id binaryMessenger, id { /// null. The [package] argument must be non-null when the asset comes from a /// package and null otherwise. VideoPlayerController.asset(this.dataSource, - {this.package, this.closedCaptionFile}) + {this.package, this.closedCaptionFile, this.videoPlayerOptions}) : dataSourceType = DataSourceType.asset, formatHint = null, super(VideoPlayerValue(duration: null)); @@ -181,7 +181,7 @@ class VideoPlayerController extends ValueNotifier { /// **Android only**: The [formatHint] option allows the caller to override /// the video format detection code. VideoPlayerController.network(this.dataSource, - {this.formatHint, this.closedCaptionFile}) + {this.formatHint, this.closedCaptionFile, this.videoPlayerOptions}) : dataSourceType = DataSourceType.network, package = null, super(VideoPlayerValue(duration: null)); @@ -190,7 +190,8 @@ class VideoPlayerController extends ValueNotifier { /// /// This will load the file from the file-URI given by: /// `'file://${file.path}'`. - VideoPlayerController.file(File file, {this.closedCaptionFile}) + VideoPlayerController.file(File file, + {this.closedCaptionFile, this.videoPlayerOptions}) : dataSource = 'file://${file.path}', dataSourceType = DataSourceType.file, package = null, @@ -211,6 +212,9 @@ class VideoPlayerController extends ValueNotifier { /// is constructed with. final DataSourceType dataSourceType; + /// Provide additional configuration options (optional). Like setting the audio mode to mix + final VideoPlayerOptions videoPlayerOptions; + /// Only set for [asset] videos. The package that the asset was loaded from. final String package; @@ -262,6 +266,12 @@ class VideoPlayerController extends ValueNotifier { ); break; } + + if (videoPlayerOptions?.mixWithOthers != null) { + await _videoPlayerPlatform + .setMixWithOthers(videoPlayerOptions.mixWithOthers); + } + _textureId = await _videoPlayerPlatform.create(dataSourceDescription); _creatingCompleter.complete(null); final Completer initializingCompleter = Completer(); diff --git a/packages/video_player/video_player/pigeons/messages.dart b/packages/video_player/video_player/pigeons/messages.dart index 2df5b78f13f8..074eef023b94 100644 --- a/packages/video_player/video_player/pigeons/messages.dart +++ b/packages/video_player/video_player/pigeons/messages.dart @@ -26,6 +26,10 @@ class CreateMessage { String formatHint; } +class MixWithOthersMessage { + bool mixWithOthers; +} + @HostApi() abstract class VideoPlayerApi { void initialize(); @@ -37,6 +41,7 @@ abstract class VideoPlayerApi { PositionMessage position(TextureMessage msg); void seekTo(PositionMessage msg); void pause(TextureMessage msg); + void setMixWithOthers(MixWithOthersMessage msg); } void configurePigeon(PigeonOptions opts) { diff --git a/packages/video_player/video_player/pubspec.yaml b/packages/video_player/video_player/pubspec.yaml index 03f71bf4f412..a62f6f09a202 100644 --- a/packages/video_player/video_player/pubspec.yaml +++ b/packages/video_player/video_player/pubspec.yaml @@ -4,7 +4,7 @@ description: Flutter plugin for displaying inline video with other Flutter # 0.10.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.10.11+2 +version: 0.10.12 homepage: https://github.com/flutter/plugins/tree/master/packages/video_player/video_player flutter: diff --git a/packages/video_player/video_player/test/video_player_test.dart b/packages/video_player/video_player/test/video_player_test.dart index ae236def4e57..67722594989c 100644 --- a/packages/video_player/video_player/test/video_player_test.dart +++ b/packages/video_player/video_player/test/video_player_test.dart @@ -10,8 +10,8 @@ import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'package:video_player/video_player.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:video_player_platform_interface/video_player_platform_interface.dart'; import 'package:video_player_platform_interface/messages.dart'; +import 'package:video_player_platform_interface/video_player_platform_interface.dart'; class FakeController extends ValueNotifier implements VideoPlayerController { @@ -52,6 +52,9 @@ class FakeController extends ValueNotifier @override Future get closedCaptionFile => _loadClosedCaption(); + + @override + VideoPlayerOptions get videoPlayerOptions => null; } Future _loadClosedCaption() async => @@ -575,6 +578,14 @@ void main() { expect(colors.bufferedColor, bufferedColor); expect(colors.backgroundColor, backgroundColor); }); + + test('setMixWithOthers', () { + final VideoPlayerController controller = VideoPlayerController.file( + File(''), + videoPlayerOptions: VideoPlayerOptions(mixWithOthers: true)); + controller.initialize(); + expect(controller.videoPlayerOptions.mixWithOthers, true); + }); } class FakeVideoPlayerPlatform extends VideoPlayerApiTest { From d93d4088eaa2392d74e69f271fdc829a7b7c5330 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Mon, 17 Aug 2020 23:49:31 -0700 Subject: [PATCH 040/233] Fix sharding and shard count on apk tests (#2936) * Use shard variables correctly in incremental_build.sh * Add more shards for the apk tasks. --- .cirrus.yml | 6 ++++-- script/incremental_build.sh | 11 ++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index d27ce6865e55..915f9f80a6a6 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -63,8 +63,10 @@ task: - name: build-apks+java-test+firebase-test-lab env: matrix: - PLUGIN_SHARDING: "--shardIndex 0 --shardCount 2" - PLUGIN_SHARDING: "--shardIndex 1 --shardCount 2" + PLUGIN_SHARDING: "--shardIndex 0 --shardCount 4" + PLUGIN_SHARDING: "--shardIndex 1 --shardCount 4" + PLUGIN_SHARDING: "--shardIndex 2 --shardCount 4" + PLUGIN_SHARDING: "--shardIndex 3 --shardCount 4" matrix: CHANNEL: "master" CHANNEL: "stable" diff --git a/script/incremental_build.sh b/script/incremental_build.sh index 3b0b97f0dbe6..ba8bf938d593 100755 --- a/script/incremental_build.sh +++ b/script/incremental_build.sh @@ -29,9 +29,14 @@ elif [[ "${ACTIONS[@]}" == "analyze" ]]; then fi BRANCH_NAME="${BRANCH_NAME:-"$(git rev-parse --abbrev-ref HEAD)"}" + +# This has to be turned into a list and then split out to the command line, +# otherwise it gets treated as a single argument. +PLUGIN_SHARDING=($PLUGIN_SHARDING) + if [[ "${BRANCH_NAME}" == "master" ]]; then echo "Running for all packages" - (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" $PLUGIN_SHARDING) + (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" ${PLUGIN_SHARDING[@]}) else # Sets CHANGED_PACKAGES check_changed_packages @@ -39,10 +44,10 @@ else if [[ "$CHANGED_PACKAGES" == "" ]]; then echo "No changes detected in packages." echo "Running for all packages" - (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" $PLUGIN_SHARDING) + (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" ${PLUGIN_SHARDING[@]}) else echo running "${ACTIONS[@]}" - (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" --plugins="$CHANGED_PACKAGES" $PLUGIN_SHARDING) + (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" --plugins="$CHANGED_PACKAGES" ${PLUGIN_SHARDING[@]}) echo "Running version check for changed packages" (cd "$REPO_DIR" && pub global run flutter_plugin_tools version-check --base_sha="$(get_branch_base_sha)") fi From e3ffd87e30626be469fa4f18e0fff7e515148779 Mon Sep 17 00:00:00 2001 From: Yash Johri Date: Tue, 18 Aug 2020 23:02:22 +0530 Subject: [PATCH 041/233] [device_info_platform_interface] Introduce package (#2929) This is the platform interface package of the federated device_info plugin. --- .../CHANGELOG.md | 3 + .../device_info_platform_interface/LICENSE | 27 +++ .../device_info_platform_interface/README.md | 26 +++ .../lib/device_info_platform_interface.dart | 55 +++++ .../method_channel_device_info.dart | 28 +++ .../lib/model/android_device_info.dart | 198 ++++++++++++++++++ .../lib/model/ios_device_info.dart | 97 +++++++++ .../pubspec.yaml | 22 ++ .../test/method_channel_device_info_test.dart | 49 +++++ 9 files changed, 505 insertions(+) create mode 100644 packages/device_info/device_info_platform_interface/CHANGELOG.md create mode 100644 packages/device_info/device_info_platform_interface/LICENSE create mode 100644 packages/device_info/device_info_platform_interface/README.md create mode 100644 packages/device_info/device_info_platform_interface/lib/device_info_platform_interface.dart create mode 100644 packages/device_info/device_info_platform_interface/lib/method_channel/method_channel_device_info.dart create mode 100644 packages/device_info/device_info_platform_interface/lib/model/android_device_info.dart create mode 100644 packages/device_info/device_info_platform_interface/lib/model/ios_device_info.dart create mode 100644 packages/device_info/device_info_platform_interface/pubspec.yaml create mode 100644 packages/device_info/device_info_platform_interface/test/method_channel_device_info_test.dart diff --git a/packages/device_info/device_info_platform_interface/CHANGELOG.md b/packages/device_info/device_info_platform_interface/CHANGELOG.md new file mode 100644 index 000000000000..6fadda91b380 --- /dev/null +++ b/packages/device_info/device_info_platform_interface/CHANGELOG.md @@ -0,0 +1,3 @@ +## 1.0.0 + +- Initial open-source release. diff --git a/packages/device_info/device_info_platform_interface/LICENSE b/packages/device_info/device_info_platform_interface/LICENSE new file mode 100644 index 000000000000..c89293372cf3 --- /dev/null +++ b/packages/device_info/device_info_platform_interface/LICENSE @@ -0,0 +1,27 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/device_info/device_info_platform_interface/README.md b/packages/device_info/device_info_platform_interface/README.md new file mode 100644 index 000000000000..1391ffded5ee --- /dev/null +++ b/packages/device_info/device_info_platform_interface/README.md @@ -0,0 +1,26 @@ +# device_info_platform_interface + +A common platform interface for the [`device_info`][1] plugin. + +This interface allows platform-specific implementations of the `device_info` +plugin, as well as the plugin itself, to ensure they are supporting the +same interface. + +# Usage + +To implement a new platform-specific implementation of `device_info`, extend +[`DeviceInfoPlatform`][2] with an implementation that performs the +platform-specific behavior, and when you register your plugin, set the default +`DeviceInfoPlatform` by calling +`DeviceInfoPlatform.instance = MyPlatformDeviceInfo()`. + +# Note on breaking changes + +Strongly prefer non-breaking changes (such as adding a method to the interface) +over breaking changes for this package. + +See https://flutter.dev/go/platform-interface-breaking-changes for a discussion +on why a less-clean interface is preferable to a breaking change. + +[1]: ../device_info +[2]: lib/device_info_platform_interface.dart diff --git a/packages/device_info/device_info_platform_interface/lib/device_info_platform_interface.dart b/packages/device_info/device_info_platform_interface/lib/device_info_platform_interface.dart new file mode 100644 index 000000000000..253d6d036123 --- /dev/null +++ b/packages/device_info/device_info_platform_interface/lib/device_info_platform_interface.dart @@ -0,0 +1,55 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:async'; + +import 'package:plugin_platform_interface/plugin_platform_interface.dart'; + +import 'method_channel/method_channel_device_info.dart'; + +import 'model/android_device_info.dart'; +import 'model/ios_device_info.dart'; + +export 'model/android_device_info.dart'; +export 'model/ios_device_info.dart'; + +/// The interface that implementations of device_info must implement. +/// +/// Platform implementations should extend this class rather than implement it as `device_info` +/// does not consider newly added methods to be breaking changes. Extending this class +/// (using `extends`) ensures that the subclass will get the default implementation, while +/// platform implementations that `implements` this interface will be broken by newly added +/// [DeviceInfoPlatform] methods. +abstract class DeviceInfoPlatform extends PlatformInterface { + /// Constructs a UrlLauncherPlatform. + DeviceInfoPlatform() : super(token: _token); + + static final Object _token = Object(); + + static DeviceInfoPlatform _instance = MethodChannelDeviceInfo(); + + /// The default instance of [DeviceInfoPlatform] to use. + /// + /// Defaults to [MethodChannelDeviceInfo]. + static DeviceInfoPlatform get instance => _instance; + + /// Platform-specific plugins should set this with their own platform-specific + /// class that extends [DeviceInfoPlatform] when they register themselves. + static set instance(DeviceInfoPlatform instance) { + PlatformInterface.verifyToken(instance, _token); + _instance = instance; + } + + // Gets the Android device information. + // ignore: public_member_api_docs + Future androidInfo() { + throw UnimplementedError('androidInfo() has not been implemented.'); + } + + // Gets the iOS device information. + // ignore: public_member_api_docs + Future iosInfo() { + throw UnimplementedError('iosInfo() has not been implemented.'); + } +} diff --git a/packages/device_info/device_info_platform_interface/lib/method_channel/method_channel_device_info.dart b/packages/device_info/device_info_platform_interface/lib/method_channel/method_channel_device_info.dart new file mode 100644 index 000000000000..7bd02e97436d --- /dev/null +++ b/packages/device_info/device_info_platform_interface/lib/method_channel/method_channel_device_info.dart @@ -0,0 +1,28 @@ +import 'dart:async'; + +import 'package:flutter/services.dart'; +import 'package:meta/meta.dart'; + +import 'package:device_info_platform_interface/device_info_platform_interface.dart'; + +/// An implementation of [DeviceInfoPlatform] that uses method channels. +class MethodChannelDeviceInfo extends DeviceInfoPlatform { + /// The method channel used to interact with the native platform. + @visibleForTesting + MethodChannel channel = MethodChannel('plugins.flutter.io/device_info'); + + // Method channel for Android devices + Future androidInfo() async { + return AndroidDeviceInfo.fromMap( + (await channel.invokeMethod('getAndroidDeviceInfo')) + .cast(), + ); + } + + // Method channel for iOS devices + Future iosInfo() async { + return IosDeviceInfo.fromMap( + (await channel.invokeMethod('getIosDeviceInfo')).cast(), + ); + } +} diff --git a/packages/device_info/device_info_platform_interface/lib/model/android_device_info.dart b/packages/device_info/device_info_platform_interface/lib/model/android_device_info.dart new file mode 100644 index 000000000000..5b326cc5350a --- /dev/null +++ b/packages/device_info/device_info_platform_interface/lib/model/android_device_info.dart @@ -0,0 +1,198 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/// Information derived from `android.os.Build`. +/// +/// See: https://developer.android.com/reference/android/os/Build.html +class AndroidDeviceInfo { + /// Android device Info class. + AndroidDeviceInfo({ + this.version, + this.board, + this.bootloader, + this.brand, + this.device, + this.display, + this.fingerprint, + this.hardware, + this.host, + this.id, + this.manufacturer, + this.model, + this.product, + List supported32BitAbis, + List supported64BitAbis, + List supportedAbis, + this.tags, + this.type, + this.isPhysicalDevice, + this.androidId, + List systemFeatures, + }) : supported32BitAbis = List.unmodifiable(supported32BitAbis), + supported64BitAbis = List.unmodifiable(supported64BitAbis), + supportedAbis = List.unmodifiable(supportedAbis), + systemFeatures = List.unmodifiable(systemFeatures); + + /// Android operating system version values derived from `android.os.Build.VERSION`. + final AndroidBuildVersion version; + + /// The name of the underlying board, like "goldfish". + final String board; + + /// The system bootloader version number. + final String bootloader; + + /// The consumer-visible brand with which the product/hardware will be associated, if any. + final String brand; + + /// The name of the industrial design. + final String device; + + /// A build ID string meant for displaying to the user. + final String display; + + /// A string that uniquely identifies this build. + final String fingerprint; + + /// The name of the hardware (from the kernel command line or /proc). + final String hardware; + + /// Hostname. + final String host; + + /// Either a changelist number, or a label like "M4-rc20". + final String id; + + /// The manufacturer of the product/hardware. + final String manufacturer; + + /// The end-user-visible name for the end product. + final String model; + + /// The name of the overall product. + final String product; + + /// An ordered list of 32 bit ABIs supported by this device. + final List supported32BitAbis; + + /// An ordered list of 64 bit ABIs supported by this device. + final List supported64BitAbis; + + /// An ordered list of ABIs supported by this device. + final List supportedAbis; + + /// Comma-separated tags describing the build, like "unsigned,debug". + final String tags; + + /// The type of build, like "user" or "eng". + final String type; + + /// `false` if the application is running in an emulator, `true` otherwise. + final bool isPhysicalDevice; + + /// The Android hardware device ID that is unique between the device + user and app signing. + final String androidId; + + /// Describes what features are available on the current device. + /// + /// This can be used to check if the device has, for example, a front-facing + /// camera, or a touchscreen. However, in many cases this is not the best + /// API to use. For example, if you are interested in bluetooth, this API + /// can tell you if the device has a bluetooth radio, but it cannot tell you + /// if bluetooth is currently enabled, or if you have been granted the + /// necessary permissions to use it. Please *only* use this if there is no + /// other way to determine if a feature is supported. + /// + /// This data comes from Android's PackageManager.getSystemAvailableFeatures, + /// and many of the common feature strings to look for are available in + /// PackageManager's public documentation: + /// https://developer.android.com/reference/android/content/pm/PackageManager + final List systemFeatures; + + /// Deserializes from the message received from [_kChannel]. + static AndroidDeviceInfo fromMap(Map map) { + return AndroidDeviceInfo( + version: AndroidBuildVersion._fromMap( + map['version']?.cast() ?? {}), + board: map['board'], + bootloader: map['bootloader'], + brand: map['brand'], + device: map['device'], + display: map['display'], + fingerprint: map['fingerprint'], + hardware: map['hardware'], + host: map['host'], + id: map['id'], + manufacturer: map['manufacturer'], + model: map['model'], + product: map['product'], + supported32BitAbis: _fromList(map['supported32BitAbis'] ?? []), + supported64BitAbis: _fromList(map['supported64BitAbis'] ?? []), + supportedAbis: _fromList(map['supportedAbis'] ?? []), + tags: map['tags'], + type: map['type'], + isPhysicalDevice: map['isPhysicalDevice'], + androidId: map['androidId'], + systemFeatures: _fromList(map['systemFeatures'] ?? []), + ); + } + + /// Deserializes message as List + static List _fromList(dynamic message) { + final List list = message; + return List.from(list); + } +} + +/// Version values of the current Android operating system build derived from +/// `android.os.Build.VERSION`. +/// +/// See: https://developer.android.com/reference/android/os/Build.VERSION.html +class AndroidBuildVersion { + AndroidBuildVersion._({ + this.baseOS, + this.codename, + this.incremental, + this.previewSdkInt, + this.release, + this.sdkInt, + this.securityPatch, + }); + + /// The base OS build the product is based on. + final String baseOS; + + /// The current development codename, or the string "REL" if this is a release build. + final String codename; + + /// The internal value used by the underlying source control to represent this build. + final String incremental; + + /// The developer preview revision of a prerelease SDK. + final int previewSdkInt; + + /// The user-visible version string. + final String release; + + /// The user-visible SDK version of the framework. + /// + /// Possible values are defined in: https://developer.android.com/reference/android/os/Build.VERSION_CODES.html + final int sdkInt; + + /// The user-visible security patch level. + final String securityPatch; + + /// Deserializes from the map message received from [_kChannel]. + static AndroidBuildVersion _fromMap(Map map) { + return AndroidBuildVersion._( + baseOS: map['baseOS'], + codename: map['codename'], + incremental: map['incremental'], + previewSdkInt: map['previewSdkInt'], + release: map['release'], + sdkInt: map['sdkInt'], + securityPatch: map['securityPatch'], + ); + } +} diff --git a/packages/device_info/device_info_platform_interface/lib/model/ios_device_info.dart b/packages/device_info/device_info_platform_interface/lib/model/ios_device_info.dart new file mode 100644 index 000000000000..d41202492101 --- /dev/null +++ b/packages/device_info/device_info_platform_interface/lib/model/ios_device_info.dart @@ -0,0 +1,97 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/// Information derived from `UIDevice`. +/// +/// See: https://developer.apple.com/documentation/uikit/uidevice +class IosDeviceInfo { + /// IOS device info class. + IosDeviceInfo({ + this.name, + this.systemName, + this.systemVersion, + this.model, + this.localizedModel, + this.identifierForVendor, + this.isPhysicalDevice, + this.utsname, + }); + + /// Device name. + final String name; + + /// The name of the current operating system. + final String systemName; + + /// The current operating system version. + final String systemVersion; + + /// Device model. + final String model; + + /// Localized name of the device model. + final String localizedModel; + + /// Unique UUID value identifying the current device. + final String identifierForVendor; + + /// `false` if the application is running in a simulator, `true` otherwise. + final bool isPhysicalDevice; + + /// Operating system information derived from `sys/utsname.h`. + final IosUtsname utsname; + + /// Deserializes from the map message received from [_kChannel]. + static IosDeviceInfo fromMap(Map map) { + return IosDeviceInfo( + name: map['name'], + systemName: map['systemName'], + systemVersion: map['systemVersion'], + model: map['model'], + localizedModel: map['localizedModel'], + identifierForVendor: map['identifierForVendor'], + isPhysicalDevice: map['isPhysicalDevice'] == 'true', + utsname: + IosUtsname._fromMap(map['utsname']?.cast() ?? {}), + ); + } +} + +/// Information derived from `utsname`. +/// See http://pubs.opengroup.org/onlinepubs/7908799/xsh/sysutsname.h.html for details. +class IosUtsname { + IosUtsname._({ + this.sysname, + this.nodename, + this.release, + this.version, + this.machine, + }); + + /// Operating system name. + final String sysname; + + /// Network node name. + final String nodename; + + /// Release level. + final String release; + + /// Version level. + final String version; + + /// Hardware type (e.g. 'iPhone7,1' for iPhone 6 Plus). + final String machine; + + /// Deserializes from the map message received from [_kChannel]. + static IosUtsname _fromMap(Map map) { + return IosUtsname._( + sysname: map['sysname'], + nodename: map['nodename'], + release: map['release'], + version: map['version'], + machine: map['machine'], + ); + } +} diff --git a/packages/device_info/device_info_platform_interface/pubspec.yaml b/packages/device_info/device_info_platform_interface/pubspec.yaml new file mode 100644 index 000000000000..3adfb93fa27a --- /dev/null +++ b/packages/device_info/device_info_platform_interface/pubspec.yaml @@ -0,0 +1,22 @@ +name: device_info_platform_interface +description: A common platform interface for the device_info plugin. +homepage: https://github.com/flutter/plugins/tree/master/packages/device_info +# NOTE: We strongly prefer non-breaking changes, even at the expense of a +# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes +version: 1.0.0 + +dependencies: + flutter: + sdk: flutter + meta: ^1.1.8 + plugin_platform_interface: ^1.0.2 + +dev_dependencies: + flutter_test: + sdk: flutter + mockito: ^4.1.1 + pedantic: ^1.8.0 + +environment: + sdk: ">=2.7.0 <3.0.0" + flutter: ">=1.9.1+hotfix.4 <2.0.0" diff --git a/packages/device_info/device_info_platform_interface/test/method_channel_device_info_test.dart b/packages/device_info/device_info_platform_interface/test/method_channel_device_info_test.dart new file mode 100644 index 000000000000..1da52e2cf39f --- /dev/null +++ b/packages/device_info/device_info_platform_interface/test/method_channel_device_info_test.dart @@ -0,0 +1,49 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:flutter/services.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:device_info_platform_interface/device_info_platform_interface.dart'; + +import 'package:device_info_platform_interface/method_channel/method_channel_device_info.dart'; + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + + group("$MethodChannelDeviceInfo", () { + MethodChannelDeviceInfo methodChannelDeviceInfo; + + setUp(() async { + methodChannelDeviceInfo = MethodChannelDeviceInfo(); + + methodChannelDeviceInfo.channel + .setMockMethodCallHandler((MethodCall methodCall) async { + switch (methodCall.method) { + case 'getAndroidDeviceInfo': + return ({ + "brand": "Google", + }); + case 'getIosDeviceInfo': + return ({ + "name": "iPhone 10", + }); + default: + return null; + } + }); + }); + + test("androidInfo", () async { + final AndroidDeviceInfo result = + await methodChannelDeviceInfo.androidInfo(); + expect(result.brand, "Google"); + }); + + test("iosInfo", () async { + final IosDeviceInfo result = await methodChannelDeviceInfo.iosInfo(); + expect(result.name, "iPhone 10"); + }); + }); +} From 027827f93e40da8dad4dda70ec8f993ec1337028 Mon Sep 17 00:00:00 2001 From: David Iglesias Date: Tue, 18 Aug 2020 19:06:45 -0700 Subject: [PATCH 042/233] [google_maps_flutter_web] First version of the plugin. (#2933) This package introduces the first version of the google_maps_flutter_web plugin. See README for installation instructions. Co-authored-by: chung2012 --- .../google_maps_flutter_web/CHANGELOG.md | 3 + .../google_maps_flutter_web/LICENSE | 26 + .../google_maps_flutter_web/README.md | 51 ++ .../analysis_options.yaml | 10 + .../ios/google_maps_flutter_web.podspec | 23 + .../lib/google_maps_flutter_web.dart | 39 ++ .../lib/src/circle.dart | 46 ++ .../lib/src/circles.dart | 79 +++ .../lib/src/convert.dart | 544 ++++++++++++++++++ .../lib/src/google_maps_controller.dart | 330 +++++++++++ .../lib/src/google_maps_flutter_web.dart | 291 ++++++++++ .../lib/src/marker.dart | 82 +++ .../lib/src/markers.dart | 144 +++++ .../lib/src/polygon.dart | 45 ++ .../lib/src/polygons.dart | 85 +++ .../lib/src/polyline.dart | 45 ++ .../lib/src/polylines.dart | 83 +++ .../lib/src/types.dart | 30 + .../google_maps_flutter_web/pubspec.yaml | 34 ++ .../google_maps_flutter_web/test/README.md | 17 + .../test/lib/main.dart | 22 + .../google_maps_flutter_web/test/pubspec.yaml | 22 + .../google_maps_flutter_web/test/run_test | 17 + .../google_maps_controller_e2e.dart | 513 +++++++++++++++++ .../google_maps_controller_e2e_test.dart | 7 + .../test_driver/google_maps_plugin_e2e.dart | 392 +++++++++++++ .../google_maps_plugin_e2e_test.dart | 7 + .../test/test_driver/marker_e2e.dart | 99 ++++ .../test/test_driver/marker_e2e_test.dart | 7 + .../test/test_driver/markers_e2e.dart | 102 ++++ .../test/test_driver/markers_e2e_test.dart | 7 + .../test/test_driver/shape_e2e.dart | 113 ++++ .../test/test_driver/shape_e2e_test.dart | 7 + .../test/test_driver/shapes_e2e.dart | 214 +++++++ .../test/test_driver/shapes_e2e_test.dart | 7 + .../test/web/index.html | 14 + script/incremental_build.sh | 1 + 37 files changed, 3558 insertions(+) create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/LICENSE create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/README.md create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/analysis_options.yaml create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/ios/google_maps_flutter_web.podspec create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/lib/google_maps_flutter_web.dart create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/lib/src/circle.dart create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/lib/src/circles.dart create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/lib/src/google_maps_controller.dart create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/lib/src/google_maps_flutter_web.dart create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/lib/src/marker.dart create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/lib/src/markers.dart create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/lib/src/polygon.dart create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/lib/src/polygons.dart create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/lib/src/polyline.dart create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/lib/src/polylines.dart create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/lib/src/types.dart create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/test/README.md create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/test/lib/main.dart create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/test/pubspec.yaml create mode 100755 packages/google_maps_flutter/google_maps_flutter_web/test/run_test create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_controller_e2e.dart create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_controller_e2e_test.dart create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_plugin_e2e.dart create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_plugin_e2e_test.dart create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/marker_e2e.dart create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/marker_e2e_test.dart create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/markers_e2e.dart create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/markers_e2e_test.dart create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shape_e2e.dart create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shape_e2e_test.dart create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shapes_e2e.dart create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shapes_e2e_test.dart create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/test/web/index.html diff --git a/packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md new file mode 100644 index 000000000000..d989279aac42 --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.1.0 + +* First open-source version diff --git a/packages/google_maps_flutter/google_maps_flutter_web/LICENSE b/packages/google_maps_flutter/google_maps_flutter_web/LICENSE new file mode 100644 index 000000000000..282a0f51aa4a --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/LICENSE @@ -0,0 +1,26 @@ +Copyright 2017, the Flutter project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/google_maps_flutter/google_maps_flutter_web/README.md b/packages/google_maps_flutter/google_maps_flutter_web/README.md new file mode 100644 index 000000000000..e1c1a5330c56 --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/README.md @@ -0,0 +1,51 @@ +# google_maps_flutter_web + +This is an implementation of the [google_maps_flutter](https://pub.dev/packages/google_maps_flutter) plugin for web. Behind the scenes, it uses a14n's [google_maps](https://pub.dev/packages/google_maps) dart JS interop layer. + +## Usage + +### Depend on the package + +This package is not an endorsed implementation of the google_maps_flutter plugin yet, so you'll need to modify the `pubspec.yaml` file of your app to depend on this package: + +```yaml +dependencies: + google_maps_flutter: ^0.5.28 + google_maps_flutter_web: ^0.1.0 +``` + +### Modify web/index.html + +Get an API Key for Google Maps JavaScript API. Get started [here](https://developers.google.com/maps/documentation/javascript/get-api-key). + +Modify the `` tag of your `web/index.html` to load the Google Maps JavaScript API, like so: + +```html + + + + + + +``` + +Now you should be able to use the Google Maps plugin normally. + +## Limitations of the web version + +The following map options are not available in web, because the map doesn't rotate there: + +* `compassEnabled` +* `rotateGesturesEnabled` +* `tiltGesturesEnabled` + +There's no "Map Toolbar" in web, so the `mapToolbarEnabled` option is unused. + +There's no "My Location" widget in web ([tracking issue](https://github.com/flutter/flutter/issues/64073)), so the following options are ignored, for now: + +* `myLocationButtonEnabled` +* `myLocationEnabled` + +There's no `defaultMarkerWithHue` in web. If you need colored pins/markers, you may need to use your own asset images. + +Indoor and building layers are still not available on the web. Traffic is. diff --git a/packages/google_maps_flutter/google_maps_flutter_web/analysis_options.yaml b/packages/google_maps_flutter/google_maps_flutter_web/analysis_options.yaml new file mode 100644 index 000000000000..443b16551ec9 --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/analysis_options.yaml @@ -0,0 +1,10 @@ +# This is a temporary file to allow us to unblock the flutter/plugins repo CI. +# It disables some of lints that were disabled inline. Disabling lints inline +# is no longer possible, so this file is required. +# TODO(ditman) https://github.com/flutter/flutter/issues/55000 (clean this up) + +include: ../../../analysis_options.yaml + +analyzer: + errors: + undefined_prefixed_name: ignore diff --git a/packages/google_maps_flutter/google_maps_flutter_web/ios/google_maps_flutter_web.podspec b/packages/google_maps_flutter/google_maps_flutter_web/ios/google_maps_flutter_web.podspec new file mode 100644 index 000000000000..18db6ced01b6 --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/ios/google_maps_flutter_web.podspec @@ -0,0 +1,23 @@ +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. +# Run `pod lib lint google_maps_flutter_web.podspec' to validate before publishing. +# +Pod::Spec.new do |s| + s.name = 'google_maps_flutter_web' + s.version = '0.1.0' + s.summary = 'No-op implementation of google maps flutter web plugin to avoid build issues on iOS' + s.description = <<-DESC +temp fake google_maps_flutter_web plugin + DESC + s.homepage = 'https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter/google_maps_flutter_web' + s.license = { :file => '../LICENSE' } + s.author = { 'Flutter Team' => 'flutter-dev@googlegroups.com' } + s.source = { :path => '.' } + s.source_files = 'Classes/**/*' + s.dependency 'Flutter' + s.platform = :ios, '8.0' + + # Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported. + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' } + s.swift_version = '5.0' +end diff --git a/packages/google_maps_flutter/google_maps_flutter_web/lib/google_maps_flutter_web.dart b/packages/google_maps_flutter/google_maps_flutter_web/lib/google_maps_flutter_web.dart new file mode 100644 index 000000000000..cf133fb9e533 --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/lib/google_maps_flutter_web.dart @@ -0,0 +1,39 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +library google_maps_flutter_web; + +import 'dart:async'; +import 'dart:html'; +import 'dart:ui' as ui; +import 'dart:convert'; + +import 'package:flutter/rendering.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter/gestures.dart'; + +import 'package:sanitize_html/sanitize_html.dart'; + +import 'package:stream_transform/stream_transform.dart'; + +import 'package:google_maps_flutter_platform_interface/google_maps_flutter_platform_interface.dart'; +import 'package:flutter_web_plugins/flutter_web_plugins.dart'; +import 'package:google_maps/google_maps.dart' as gmaps; + +import 'src/types.dart'; + +part 'src/google_maps_flutter_web.dart'; +part 'src/google_maps_controller.dart'; +part 'src/circle.dart'; +part 'src/circles.dart'; +part 'src/polygon.dart'; +part 'src/polygons.dart'; +part 'src/polyline.dart'; +part 'src/polylines.dart'; +part 'src/marker.dart'; +part 'src/markers.dart'; +part 'src/convert.dart'; diff --git a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/circle.dart b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/circle.dart new file mode 100644 index 000000000000..96f9be7aa001 --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/circle.dart @@ -0,0 +1,46 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +part of google_maps_flutter_web; + +/// The `CircleController` class wraps a [gmaps.Circle] and its `onTap` behavior. +class CircleController { + gmaps.Circle _circle; + + final bool _consumeTapEvents; + + /// Creates a `CircleController`, which wraps a [gmaps.Circle] object and its `onTap` behavior. + CircleController({ + @required gmaps.Circle circle, + bool consumeTapEvents = false, + ui.VoidCallback onTap, + }) : _circle = circle, + _consumeTapEvents = consumeTapEvents { + if (onTap != null) { + circle.onClick.listen((_) { + onTap.call(); + }); + } + } + + /// Returns the wrapped [gmaps.Circle]. Only used for testing. + @visibleForTesting + gmaps.Circle get circle => _circle; + + /// Returns `true` if this Controller will use its own `onTap` handler to consume events. + bool get consumeTapEvents => _consumeTapEvents; + + /// Updates the options of the wrapped [gmaps.Circle] object. + void update(gmaps.CircleOptions options) { + _circle.options = options; + } + + /// Disposes of the currently wrapped [gmaps.Circle]. + void remove() { + _circle.visible = false; + _circle.radius = 0; + _circle.map = null; + _circle = null; + } +} diff --git a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/circles.dart b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/circles.dart new file mode 100644 index 000000000000..c7c33ed1811f --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/circles.dart @@ -0,0 +1,79 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +part of google_maps_flutter_web; + +/// This class manages all the [CircleController]s associated to a [GoogleMapController]. +class CirclesController extends GeometryController { + // A cache of [CircleController]s indexed by their [CircleId]. + final Map _circleIdToController; + + // The stream over which circles broadcast their events + StreamController _streamController; + + /// Initialize the cache. The [StreamController] comes from the [GoogleMapController], and is shared with other controllers. + CirclesController({ + @required StreamController stream, + }) : _streamController = stream, + _circleIdToController = Map(); + + /// Returns the cache of [CircleController]s. Test only. + @visibleForTesting + Map get circles => _circleIdToController; + + /// Adds a set of [Circle] objects to the cache. + /// + /// Wraps each [Circle] into its corresponding [CircleController]. + void addCircles(Set circlesToAdd) { + circlesToAdd?.forEach((circle) { + _addCircle(circle); + }); + } + + void _addCircle(Circle circle) { + if (circle == null) { + return; + } + + final populationOptions = _circleOptionsFromCircle(circle); + gmaps.Circle gmCircle = gmaps.Circle(populationOptions); + gmCircle.map = googleMap; + CircleController controller = CircleController( + circle: gmCircle, + consumeTapEvents: circle.consumeTapEvents, + onTap: () { + _onCircleTap(circle.circleId); + }); + _circleIdToController[circle.circleId] = controller; + } + + /// Updates a set of [Circle] objects with new options. + void changeCircles(Set circlesToChange) { + circlesToChange?.forEach((circleToChange) { + _changeCircle(circleToChange); + }); + } + + void _changeCircle(Circle circle) { + final circleController = _circleIdToController[circle?.circleId]; + circleController?.update(_circleOptionsFromCircle(circle)); + } + + /// Removes a set of [CircleId]s from the cache. + void removeCircles(Set circleIdsToRemove) { + circleIdsToRemove?.forEach((circleId) { + final CircleController circleController = _circleIdToController[circleId]; + circleController?.remove(); + _circleIdToController.remove(circleId); + }); + } + + // Handles the global onCircleTap function to funnel events from circles into the stream. + bool _onCircleTap(CircleId circleId) { + // Have you ended here on your debugging? Is this wrong? + // Comment here: https://github.com/flutter/flutter/issues/64084 + _streamController.add(CircleTapEvent(mapId, circleId)); + return _circleIdToController[circleId]?.consumeTapEvents ?? false; + } +} diff --git a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart new file mode 100644 index 000000000000..2eeaa0202995 --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart @@ -0,0 +1,544 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +part of google_maps_flutter_web; + +final _nullLatLng = LatLng(0, 0); +final _nullLatLngBounds = LatLngBounds( + northeast: _nullLatLng, + southwest: _nullLatLng, +); + +// Defaults taken from the Google Maps Platform SDK documentation. +final _defaultStrokeColor = Colors.black.value; +final _defaultFillColor = Colors.transparent.value; + +// Indices in the plugin side don't match with the ones +// in the gmaps lib. This translates from plugin -> gmaps. +final _mapTypeToMapTypeId = { + 0: gmaps.MapTypeId.ROADMAP, // "none" in the plugin + 1: gmaps.MapTypeId.ROADMAP, + 2: gmaps.MapTypeId.SATELLITE, + 3: gmaps.MapTypeId.TERRAIN, + 4: gmaps.MapTypeId.HYBRID, +}; + +// Converts options from the plugin into gmaps.MapOptions that can be used by the JS SDK. +// The following options are not handled here, for various reasons: +// The following are not available in web, because the map doesn't rotate there: +// compassEnabled +// rotateGesturesEnabled +// tiltGesturesEnabled +// mapToolbarEnabled is unused in web, there's no "map toolbar" +// myLocationButtonEnabled Widget not available in web yet, it needs to be built on top of the maps widget +// See: https://developers.google.com/maps/documentation/javascript/examples/control-custom +// myLocationEnabled needs to be built through dart:html navigator.geolocation +// See: https://api.dart.dev/stable/2.8.4/dart-html/Geolocation-class.html +// trafficEnabled is handled when creating the GMap object, since it needs to be added as a layer. +// trackCameraPosition is just a boolan value that indicates if the map has an onCameraMove handler. +// indoorViewEnabled seems to not have an equivalent in web +// buildingsEnabled seems to not have an equivalent in web +// padding seems to behave differently in web than mobile. You can't move UI elements in web. +gmaps.MapOptions _rawOptionsToGmapsOptions(Map rawOptions) { + Map optionsUpdate = rawOptions['options'] ?? {}; + + gmaps.MapOptions options = gmaps.MapOptions(); + + if (_mapTypeToMapTypeId.containsKey(optionsUpdate['mapType'])) { + options.mapTypeId = _mapTypeToMapTypeId[optionsUpdate['mapType']]; + } + + if (optionsUpdate['minMaxZoomPreference'] != null) { + options + ..minZoom = optionsUpdate['minMaxZoomPreference'][0] + ..maxZoom = optionsUpdate['minMaxZoomPreference'][1]; + } + + if (optionsUpdate['cameraTargetBounds'] != null) { + // Needs gmaps.MapOptions.restriction and gmaps.MapRestriction + // see: https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions.restriction + } + + if (optionsUpdate['zoomControlsEnabled'] != null) { + options.zoomControl = optionsUpdate['zoomControlsEnabled']; + } + + if (optionsUpdate['styles'] != null) { + options.styles = optionsUpdate['styles']; + } + + if (optionsUpdate['scrollGesturesEnabled'] == false || + optionsUpdate['zoomGesturesEnabled'] == false) { + options.gestureHandling = 'none'; + } else { + options.gestureHandling = 'auto'; + } + + // These don't have any optionUpdate entry, but they seem to be off in the native maps. + options.mapTypeControl = false; + options.fullscreenControl = false; + options.streetViewControl = false; + + return options; +} + +gmaps.MapOptions _applyInitialPosition( + Map rawOptions, + gmaps.MapOptions options, +) { + // Adjust the initial position, if passed... + Map initialPosition = rawOptions['initialCameraPosition']; + if (initialPosition != null) { + final position = CameraPosition.fromMap(initialPosition); + options.zoom = position.zoom; + options.center = + gmaps.LatLng(position.target.latitude, position.target.longitude); + } + return options; +} + +// Extracts the status of the traffic layer from the rawOptions map. +bool _isTrafficLayerEnabled(Map rawOptions) { + if (rawOptions['options'] == null) { + return false; + } + return rawOptions['options']['trafficEnabled'] ?? false; +} + +// Coverts the incoming JSON object into a List of MapTypeStyler objects. +List _parseStylers(List stylerJsons) { + return stylerJsons?.map((styler) { + return gmaps.MapTypeStyler() + ..color = styler['color'] + ..gamma = styler['gamma'] + ..hue = styler['hue'] + ..invertLightness = styler['invertLightness'] + ..lightness = styler['lightness'] + ..saturation = styler['saturation'] + ..visibility = styler['visibility'] + ..weight = styler['weight']; + })?.toList(); +} + +// Converts a String to its corresponding MapTypeStyleElementType enum value. +final _elementTypeToEnum = { + 'all': gmaps.MapTypeStyleElementType.ALL, + 'geometry': gmaps.MapTypeStyleElementType.GEOMETRY, + 'geometry.fill': gmaps.MapTypeStyleElementType.GEOMETRY_FILL, + 'geometry.stroke': gmaps.MapTypeStyleElementType.GEOMETRY_STROKE, + 'labels': gmaps.MapTypeStyleElementType.LABELS, + 'labels.icon': gmaps.MapTypeStyleElementType.LABELS_ICON, + 'labels.text': gmaps.MapTypeStyleElementType.LABELS_TEXT, + 'labels.text.fill': gmaps.MapTypeStyleElementType.LABELS_TEXT_FILL, + 'labels.text.stroke': gmaps.MapTypeStyleElementType.LABELS_TEXT_STROKE, +}; + +// Converts a String to its corresponding MapTypeStyleFeatureType enum value. +final _featureTypeToEnum = { + 'administrative': gmaps.MapTypeStyleFeatureType.ADMINISTRATIVE, + 'administrative.country': + gmaps.MapTypeStyleFeatureType.ADMINISTRATIVE_COUNTRY, + 'administrative.land_parcel': + gmaps.MapTypeStyleFeatureType.ADMINISTRATIVE_LAND_PARCEL, + 'administrative.locality': + gmaps.MapTypeStyleFeatureType.ADMINISTRATIVE_LOCALITY, + 'administrative.neighborhood': + gmaps.MapTypeStyleFeatureType.ADMINISTRATIVE_NEIGHBORHOOD, + 'administrative.province': + gmaps.MapTypeStyleFeatureType.ADMINISTRATIVE_PROVINCE, + 'all': gmaps.MapTypeStyleFeatureType.ALL, + 'landscape': gmaps.MapTypeStyleFeatureType.LANDSCAPE, + 'landscape.man_made': gmaps.MapTypeStyleFeatureType.LANDSCAPE_MAN_MADE, + 'landscape.natural': gmaps.MapTypeStyleFeatureType.LANDSCAPE_NATURAL, + 'landscape.natural.landcover': + gmaps.MapTypeStyleFeatureType.LANDSCAPE_NATURAL_LANDCOVER, + 'landscape.natural.terrain': + gmaps.MapTypeStyleFeatureType.LANDSCAPE_NATURAL_TERRAIN, + 'poi': gmaps.MapTypeStyleFeatureType.POI, + 'poi.attraction': gmaps.MapTypeStyleFeatureType.POI_ATTRACTION, + 'poi.business': gmaps.MapTypeStyleFeatureType.POI_BUSINESS, + 'poi.government': gmaps.MapTypeStyleFeatureType.POI_GOVERNMENT, + 'poi.medical': gmaps.MapTypeStyleFeatureType.POI_MEDICAL, + 'poi.park': gmaps.MapTypeStyleFeatureType.POI_PARK, + 'poi.place_of_worship': gmaps.MapTypeStyleFeatureType.POI_PLACE_OF_WORSHIP, + 'poi.school': gmaps.MapTypeStyleFeatureType.POI_SCHOOL, + 'poi.sports_complex': gmaps.MapTypeStyleFeatureType.POI_SPORTS_COMPLEX, + 'road': gmaps.MapTypeStyleFeatureType.ROAD, + 'road.arterial': gmaps.MapTypeStyleFeatureType.ROAD_ARTERIAL, + 'road.highway': gmaps.MapTypeStyleFeatureType.ROAD_HIGHWAY, + 'road.highway.controlled_access': + gmaps.MapTypeStyleFeatureType.ROAD_HIGHWAY_CONTROLLED_ACCESS, + 'road.local': gmaps.MapTypeStyleFeatureType.ROAD_LOCAL, + 'transit': gmaps.MapTypeStyleFeatureType.TRANSIT, + 'transit.line': gmaps.MapTypeStyleFeatureType.TRANSIT_LINE, + 'transit.station': gmaps.MapTypeStyleFeatureType.TRANSIT_STATION, + 'transit.station.airport': + gmaps.MapTypeStyleFeatureType.TRANSIT_STATION_AIRPORT, + 'transit.station.bus': gmaps.MapTypeStyleFeatureType.TRANSIT_STATION_BUS, + 'transit.station.rail': gmaps.MapTypeStyleFeatureType.TRANSIT_STATION_RAIL, + 'water': gmaps.MapTypeStyleFeatureType.WATER, +}; + +// The keys we'd expect to see in a serialized MapTypeStyle JSON object. +final _mapStyleKeys = { + 'elementType', + 'featureType', + 'stylers', +}; + +// Checks if the passed in Map contains some of the _mapStyleKeys. +bool _isJsonMapStyle(Map value) { + return _mapStyleKeys.intersection(value.keys.toSet()).isNotEmpty; +} + +// Converts an incoming JSON-encoded Style info, into the correct gmaps array. +List _mapStyles(String mapStyleJson) { + List styles = []; + if (mapStyleJson != null) { + styles = json.decode(mapStyleJson, reviver: (key, value) { + if (value is Map && _isJsonMapStyle(value)) { + return gmaps.MapTypeStyle() + ..elementType = _elementTypeToEnum[value['elementType']] + ..featureType = _featureTypeToEnum[value['featureType']] + ..stylers = _parseStylers(value['stylers']); + } + return value; + }).cast(); + } + return styles; +} + +gmaps.LatLng _latLngToGmLatLng(LatLng latLng) { + if (latLng == null) return null; + return gmaps.LatLng(latLng.latitude, latLng.longitude); +} + +LatLng _gmLatLngToLatLng(gmaps.LatLng latLng) { + if (latLng == null) return _nullLatLng; + return LatLng(latLng.lat, latLng.lng); +} + +LatLngBounds _gmLatLngBoundsTolatLngBounds(gmaps.LatLngBounds latLngBounds) { + if (latLngBounds == null) { + return _nullLatLngBounds; + } + + return LatLngBounds( + southwest: _gmLatLngToLatLng(latLngBounds.southWest), + northeast: _gmLatLngToLatLng(latLngBounds.northEast), + ); +} + +CameraPosition _gmViewportToCameraPosition(gmaps.GMap map) { + return CameraPosition( + target: _gmLatLngToLatLng(map.center), + bearing: map.heading ?? 0, + tilt: map.tilt ?? 0, + zoom: map.zoom?.toDouble() ?? 10, + ); +} + +Set _rawOptionsToInitialMarkers(Map rawOptions) { + final List> list = rawOptions['markersToAdd']; + Set markers = {}; + markers.addAll(list?.map((rawMarker) { + Offset offset; + LatLng position; + InfoWindow infoWindow; + if (rawMarker['anchor'] != null) { + offset = Offset((rawMarker['anchor'][0]), (rawMarker['anchor'][1])); + } + if (rawMarker['position'] != null) { + position = LatLng.fromJson(rawMarker['position']); + } + if (rawMarker['infoWindow'] != null || rawMarker['snippet'] != null) { + String title = rawMarker['infoWindow'] != null + ? rawMarker['infoWindow']['title'] + : null; + infoWindow = InfoWindow( + title: title ?? '', + snippet: rawMarker['snippet'] ?? '', + ); + } + return Marker( + markerId: MarkerId(rawMarker['markerId']), + alpha: rawMarker['alpha'], + anchor: offset, + consumeTapEvents: rawMarker['consumeTapEvents'], + draggable: rawMarker['draggable'], + flat: rawMarker['flat'], + // TODO: Doesn't this support custom icons? + icon: BitmapDescriptor.defaultMarker, + infoWindow: infoWindow, + position: position ?? _nullLatLng, + rotation: rawMarker['rotation'], + visible: rawMarker['visible'], + zIndex: rawMarker['zIndex'], + ); + }) ?? + []); + return markers; +} + +Set _rawOptionsToInitialCircles(Map rawOptions) { + final List> list = rawOptions['circlesToAdd']; + Set circles = {}; + circles.addAll(list?.map((rawCircle) { + LatLng center; + if (rawCircle['center'] != null) { + center = LatLng.fromJson(rawCircle['center']); + } + return Circle( + circleId: CircleId(rawCircle['circleId']), + consumeTapEvents: rawCircle['consumeTapEvents'], + fillColor: Color(rawCircle['fillColor'] ?? _defaultFillColor), + center: center ?? _nullLatLng, + radius: rawCircle['radius'], + strokeColor: Color(rawCircle['strokeColor'] ?? _defaultStrokeColor), + strokeWidth: rawCircle['strokeWidth'], + visible: rawCircle['visible'], + zIndex: rawCircle['zIndex'], + ); + }) ?? + []); + return circles; +} + +// Unsupported on the web: endCap, jointType, patterns and startCap. +Set _rawOptionsToInitialPolylines(Map rawOptions) { + final List> list = rawOptions['polylinesToAdd']; + Set polylines = {}; + polylines.addAll(list?.map((rawPolyline) { + return Polyline( + polylineId: PolylineId(rawPolyline['polylineId']), + consumeTapEvents: rawPolyline['consumeTapEvents'], + color: Color(rawPolyline['color'] ?? _defaultStrokeColor), + geodesic: rawPolyline['geodesic'], + visible: rawPolyline['visible'], + zIndex: rawPolyline['zIndex'], + width: rawPolyline['width'], + points: rawPolyline['points'] + ?.map((rawPoint) => LatLng.fromJson(rawPoint)) + ?.toList(), + ); + }) ?? + []); + return polylines; +} + +Set _rawOptionsToInitialPolygons(Map rawOptions) { + final List> list = rawOptions['polygonsToAdd']; + Set polygons = {}; + + polygons.addAll(list?.map((rawPolygon) { + return Polygon( + polygonId: PolygonId(rawPolygon['polygonId']), + consumeTapEvents: rawPolygon['consumeTapEvents'], + fillColor: Color(rawPolygon['fillColor'] ?? _defaultFillColor), + geodesic: rawPolygon['geodesic'], + strokeColor: Color(rawPolygon['strokeColor'] ?? _defaultStrokeColor), + strokeWidth: rawPolygon['strokeWidth'], + visible: rawPolygon['visible'], + zIndex: rawPolygon['zIndex'], + points: rawPolygon['points'] + ?.map((rawPoint) => LatLng.fromJson(rawPoint)) + ?.toList(), + ); + }) ?? + []); + return polygons; +} + +// Convert plugin objects to gmaps.Options objects +// TODO: Move to their appropriate objects, maybe make these copy constructors: +// Marker.fromMarker(anotherMarker, moreOptions); + +gmaps.InfoWindowOptions _infoWindowOptionsFromMarker(Marker marker) { + if ((marker.infoWindow?.title?.isEmpty ?? true) && + (marker.infoWindow?.snippet?.isEmpty ?? true)) { + return null; + } + + final content = '

' + + sanitizeHtml(marker.infoWindow.title ?? "") + + '

' + + sanitizeHtml(marker.infoWindow.snippet ?? ""); + + return gmaps.InfoWindowOptions() + ..content = content + ..zIndex = marker.zIndex; + // TODO: Compute the pixelOffset of the infoWindow, from the size of the Marker, + // and the marker.infoWindow.anchor property. +} + +// Computes the options for a new [gmaps.Marker] from an incoming set of options +// [marker], and the existing marker registered with the map: [currentMarker]. +// Preserves the position from the [currentMarker], if set. +gmaps.MarkerOptions _markerOptionsFromMarker( + Marker marker, + gmaps.Marker currentMarker, +) { + final iconConfig = marker.icon.toJson() as List; + gmaps.Icon icon; + + if (iconConfig[0] == 'fromAssetImage') { + // iconConfig[2] contains the DPIs of the screen, but that information is + // already encoded in the iconConfig[1] + + icon = gmaps.Icon() + ..url = ui.webOnlyAssetManager.getAssetUrl(iconConfig[1]); + + // iconConfig[3] may contain the [width, height] of the image, if passed! + if (iconConfig.length >= 4 && iconConfig[3] != null) { + final size = gmaps.Size(iconConfig[3][0], iconConfig[3][1]); + icon + ..size = size + ..scaledSize = size; + } + } + return gmaps.MarkerOptions() + ..position = currentMarker?.position ?? + gmaps.LatLng( + marker.position.latitude, + marker.position.longitude, + ) + ..title = sanitizeHtml(marker.infoWindow?.title ?? "") + ..zIndex = marker.zIndex + ..visible = marker.visible + ..opacity = marker.alpha + ..draggable = marker.draggable + ..icon = icon; + // TODO: Compute anchor properly, otherwise infowindows attach to the wrong spot. + // Flat and Rotation are not supported directly on the web. +} + +gmaps.CircleOptions _circleOptionsFromCircle(Circle circle) { + final populationOptions = gmaps.CircleOptions() + ..strokeColor = '#' + circle.strokeColor.value.toRadixString(16) + ..strokeOpacity = 0.8 + ..strokeWeight = circle.strokeWidth + ..fillColor = '#' + circle.fillColor.value.toRadixString(16) + ..fillOpacity = 0.6 + ..center = gmaps.LatLng(circle.center.latitude, circle.center.longitude) + ..radius = circle.radius + ..visible = circle.visible; + return populationOptions; +} + +gmaps.PolygonOptions _polygonOptionsFromPolygon( + gmaps.GMap googleMap, Polygon polygon) { + List paths = []; + polygon.points.forEach((point) { + paths.add(_latLngToGmLatLng(point)); + }); + return gmaps.PolygonOptions() + ..paths = paths + ..strokeColor = '#' + polygon.strokeColor.value.toRadixString(16) + ..strokeOpacity = 0.8 + ..strokeWeight = polygon.strokeWidth + ..fillColor = '#' + polygon.fillColor.value.toRadixString(16) + ..fillOpacity = 0.35 + ..visible = polygon.visible + ..zIndex = polygon.zIndex + ..geodesic = polygon.geodesic; +} + +gmaps.PolylineOptions _polylineOptionsFromPolyline( + gmaps.GMap googleMap, Polyline polyline) { + List paths = []; + polyline.points.forEach((point) { + paths.add(_latLngToGmLatLng(point)); + }); + + return gmaps.PolylineOptions() + ..path = paths + ..strokeOpacity = 1.0 + ..strokeWeight = polyline.width + ..strokeColor = '#' + polyline.color.value.toRadixString(16).substring(0, 6) + ..visible = polyline.visible + ..zIndex = polyline.zIndex + ..geodesic = polyline.geodesic; +// this.endCap = Cap.buttCap, +// this.jointType = JointType.mitered, +// this.patterns = const [], +// this.startCap = Cap.buttCap, +// this.width = 10, +} + +// Translates a [CameraUpdate] into operations on a [gmaps.GMap]. +void _applyCameraUpdate(gmaps.GMap map, CameraUpdate update) { + final json = update.toJson(); + switch (json[0]) { + case 'newCameraPosition': + map.heading = json[1]['bearing']; + map.zoom = json[1]['zoom']; + map.panTo(gmaps.LatLng(json[1]['target'][0], json[1]['target'][1])); + map.tilt = json[1]['tilt']; + break; + case 'newLatLng': + map.panTo(gmaps.LatLng(json[1][0], json[1][1])); + break; + case 'newLatLngZoom': + map.zoom = json[2]; + map.panTo(gmaps.LatLng(json[1][0], json[1][1])); + break; + case 'newLatLngBounds': + map.fitBounds(gmaps.LatLngBounds( + gmaps.LatLng(json[1][0][0], json[1][0][1]), + gmaps.LatLng(json[1][1][0], json[1][1][1]))); + // padding = json[2]; + // Needs package:google_maps ^4.0.0 to adjust the padding in fitBounds + break; + case 'scrollBy': + map.panBy(json[1], json[2]); + break; + case 'zoomBy': + gmaps.LatLng focusLatLng; + double zoomDelta = json[1] ?? 0; + // Web only supports integer changes... + int newZoomDelta = zoomDelta < 0 ? zoomDelta.floor() : zoomDelta.ceil(); + if (json.length == 3) { + // With focus + try { + focusLatLng = _pixelToLatLng(map, json[2][0], json[2][1]); + } catch (e) { + // https://github.com/a14n/dart-google-maps/issues/87 + // print('Error computing new focus LatLng. JS Error: ' + e.toString()); + } + } + map.zoom = map.zoom + newZoomDelta; + if (focusLatLng != null) { + map.panTo(focusLatLng); + } + break; + case 'zoomIn': + map.zoom++; + break; + case 'zoomOut': + map.zoom--; + break; + case 'zoomTo': + map.zoom = json[1]; + break; + default: + throw UnimplementedError('Unimplemented CameraMove: ${json[0]}.'); + } +} + +// original JS by: Byron Singh (https://stackoverflow.com/a/30541162) +gmaps.LatLng _pixelToLatLng(gmaps.GMap map, int x, int y) { + final ne = map.bounds.northEast; + final sw = map.bounds.southWest; + final projection = map.projection; + + final topRight = projection.fromLatLngToPoint(ne); + final bottomLeft = projection.fromLatLngToPoint(sw); + + final scale = 1 << map.zoom; // 2 ^ zoom + + final point = + gmaps.Point((x / scale) + bottomLeft.x, (y / scale) + topRight.y); + + return projection.fromPointToLatLng(point); +} diff --git a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/google_maps_controller.dart b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/google_maps_controller.dart new file mode 100644 index 000000000000..707af828e2c6 --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/google_maps_controller.dart @@ -0,0 +1,330 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +part of google_maps_flutter_web; + +/// Type used when passing an override to the _createMap function. +@visibleForTesting +typedef DebugCreateMapFunction = gmaps.GMap Function( + HtmlElement div, gmaps.MapOptions options); + +/// Encapsulates a [gmaps.GMap], its events, and where in the DOM it's rendered. +class GoogleMapController { + // The internal ID of the map. Used to broadcast events, DOM IDs and everything where a unique ID is needed. + final int _mapId; + + // The raw options passed by the user, before converting to gmaps. + // Caching this allows us to re-create the map faithfully when needed. + Map _rawOptions = { + 'options': {}, + }; + + // Creates the 'viewType' for the _widget + String _getViewType(int mapId) => 'plugins.flutter.io/google_maps_$mapId'; + + // The Flutter widget that contains the rendered Map. + HtmlElementView _widget; + HtmlElement _div; + + /// The Flutter widget that will contain the rendered Map. Used for caching. + HtmlElementView get widget { + if (_widget == null && !_streamController.isClosed) { + _widget = HtmlElementView( + viewType: _getViewType(_mapId), + ); + } + return _widget; + } + + // The currently-enabled traffic layer. + gmaps.TrafficLayer _trafficLayer; + + /// A getter for the current traffic layer. Only for tests. + @visibleForTesting + gmaps.TrafficLayer get trafficLayer => _trafficLayer; + + // The underlying GMap instance. This is the interface with the JS SDK. + gmaps.GMap _googleMap; + + // The StreamController used by this controller and the geometry ones. + final StreamController _streamController; + + /// The Stream over which this controller broadcasts events. + Stream get events => _streamController.stream; + + // Geometry controllers, for different features of the map. + CirclesController _circlesController; + PolygonsController _polygonsController; + PolylinesController _polylinesController; + MarkersController _markersController; + // Keeps track if _attachGeometryControllers has been called or not. + bool _controllersBoundToMap = false; + + // Keeps track if the map is moving or not. + bool _mapIsMoving = false; + + /// Initializes the GMap, and the sub-controllers related to it. Wires events. + GoogleMapController({ + @required int mapId, + @required StreamController streamController, + @required Map rawOptions, + }) : this._mapId = mapId, + this._streamController = streamController, + this._rawOptions = rawOptions { + _circlesController = CirclesController(stream: this._streamController); + _polygonsController = PolygonsController(stream: this._streamController); + _polylinesController = PolylinesController(stream: this._streamController); + _markersController = MarkersController(stream: this._streamController); + + // Register the view factory that will hold the `_div` that holds the map in the DOM. + // The `_div` needs to be created outside of the ViewFactory (and cached!) so we can + // use it to create the [gmaps.GMap] in the `init()` method of this class. + _div = DivElement()..id = _getViewType(mapId); + + ui.platformViewRegistry.registerViewFactory( + _getViewType(mapId), + (int viewId) => _div, + ); + } + + /// Overrides certain properties to install mocks defined during testing. + @visibleForTesting + void debugSetOverrides({ + DebugCreateMapFunction createMap, + MarkersController markers, + CirclesController circles, + PolygonsController polygons, + PolylinesController polylines, + }) { + _overrideCreateMap = createMap; + _markersController = markers ?? _markersController; + _circlesController = circles ?? _circlesController; + _polygonsController = polygons ?? _polygonsController; + _polylinesController = polylines ?? _polylinesController; + } + + DebugCreateMapFunction _overrideCreateMap; + + gmaps.GMap _createMap(HtmlElement div, gmaps.MapOptions options) { + if (_overrideCreateMap != null) { + return _overrideCreateMap(div, options); + } + return gmaps.GMap(div, options); + } + + /// Initializes the [gmaps.GMap] instance from the stored `rawOptions`. + /// + /// This method actually renders the GMap into the cached `_div`. This is + /// called by the [GoogleMapsPlugin.init] method when appropriate. + /// + /// Failure to call this method would result in the GMap not rendering at all, + /// and most of the public methods on this class no-op'ing. + void init() { + var options = _rawOptionsToGmapsOptions(_rawOptions); + // Initial position can only to be set here! + options = _applyInitialPosition(_rawOptions, options); + + // Create the map... + _googleMap = _createMap(_div, options); + + _attachMapEvents(_googleMap); + _attachGeometryControllers(_googleMap); + + _renderInitialGeometry( + markers: _rawOptionsToInitialMarkers(_rawOptions), + circles: _rawOptionsToInitialCircles(_rawOptions), + polygons: _rawOptionsToInitialPolygons(_rawOptions), + polylines: _rawOptionsToInitialPolylines(_rawOptions), + ); + + _setTrafficLayer(_googleMap, _isTrafficLayerEnabled(_rawOptions)); + } + + // Funnels map gmap events into the plugin's stream controller. + void _attachMapEvents(gmaps.GMap map) { + map.onClick.listen((event) { + _streamController.add( + MapTapEvent(_mapId, _gmLatLngToLatLng(event.latLng)), + ); + }); + map.onRightclick.listen((event) { + _streamController.add( + MapLongPressEvent(_mapId, _gmLatLngToLatLng(event.latLng)), + ); + }); + map.onBoundsChanged.listen((event) { + if (!_mapIsMoving) { + _mapIsMoving = true; + _streamController.add(CameraMoveStartedEvent(_mapId)); + } + _streamController.add( + CameraMoveEvent(_mapId, _gmViewportToCameraPosition(map)), + ); + }); + map.onIdle.listen((event) { + _mapIsMoving = false; + _streamController.add(CameraIdleEvent(_mapId)); + }); + } + + // Binds the Geometry controllers to a map instance + void _attachGeometryControllers(gmaps.GMap map) { + // Now we can add the initial geometry. + // And bind the (ready) map instance to the other geometry controllers. + _circlesController.bindToMap(_mapId, map); + _polygonsController.bindToMap(_mapId, map); + _polylinesController.bindToMap(_mapId, map); + _markersController.bindToMap(_mapId, map); + _controllersBoundToMap = true; + } + + // Renders the initial sets of geometry. + void _renderInitialGeometry({ + Set markers, + Set circles, + Set polygons, + Set polylines, + }) { + assert( + _controllersBoundToMap, + 'Geometry controllers must be bound to a map before any geometry can ' + + 'be added to them. Ensure _attachGeometryControllers is called first.'); + _markersController.addMarkers(markers); + _circlesController.addCircles(circles); + _polygonsController.addPolygons(polygons); + _polylinesController.addPolylines(polylines); + } + + // Merges new options coming from the plugin into the `key` entry of the _rawOptions map. + // + // By default: `key` is 'options'. + // + // Returns the updated _rawOptions object. + Map _mergeRawOptions( + Map newOptions, { + String key = 'options', + }) { + _rawOptions[key] = { + ...(_rawOptions[key] ?? {}), + ...newOptions, + }; + return _rawOptions; + } + + /// Updates the map options from a `Map`. + /// + /// This method converts the map into the proper [gmaps.MapOptions] + void updateRawOptions(Map optionsUpdate) { + final newOptions = _mergeRawOptions(optionsUpdate); + + _setOptions(_rawOptionsToGmapsOptions(newOptions)); + _setTrafficLayer(_googleMap, _isTrafficLayerEnabled(newOptions)); + } + + // Sets new [gmaps.MapOptions] on the wrapped map. + void _setOptions(gmaps.MapOptions options) { + _googleMap?.options = options; + } + + // Attaches/detaches a Traffic Layer on the passed `map` if `attach` is true/false. + void _setTrafficLayer(gmaps.GMap map, bool attach) { + if (attach && _trafficLayer == null) { + _trafficLayer = gmaps.TrafficLayer(); + _trafficLayer.set('map', map); + } + if (!attach && _trafficLayer != null) { + _trafficLayer.set('map', null); + _trafficLayer = null; + } + } + + // _googleMap manipulation + // Viewport + + /// Returns the [LatLngBounds] of the current viewport. + Future getVisibleRegion() async { + return _gmLatLngBoundsTolatLngBounds(await _googleMap.bounds); + } + + /// Returns the [ScreenCoordinate] for a given viewport [LatLng]. + Future getScreenCoordinate(LatLng latLng) async { + final point = + _googleMap.projection.fromLatLngToPoint(_latLngToGmLatLng(latLng)); + return ScreenCoordinate(x: point.x, y: point.y); + } + + /// Returns the [LatLng] for a `screenCoordinate` (in pixels) of the viewport. + Future getLatLng(ScreenCoordinate screenCoordinate) async { + final latLng = _googleMap.projection.fromPointToLatLng( + gmaps.Point(screenCoordinate.x, screenCoordinate.y), + ); + return _gmLatLngToLatLng(latLng); + } + + /// Applies a `cameraUpdate` to the current viewport. + Future moveCamera(CameraUpdate cameraUpdate) async { + return _applyCameraUpdate(_googleMap, cameraUpdate); + } + + /// Returns the zoom level of the current viewport. + Future getZoomLevel() async => _googleMap.zoom.toDouble(); + + // Geometry manipulation + + /// Applies [CircleUpdates] to the currently managed circles. + void updateCircles(CircleUpdates updates) { + _circlesController?.addCircles(updates.circlesToAdd); + _circlesController?.changeCircles(updates.circlesToChange); + _circlesController?.removeCircles(updates.circleIdsToRemove); + } + + /// Applies [PolygonUpdates] to the currently managed polygons. + void updatePolygons(PolygonUpdates updates) { + _polygonsController?.addPolygons(updates.polygonsToAdd); + _polygonsController?.changePolygons(updates.polygonsToChange); + _polygonsController?.removePolygons(updates.polygonIdsToRemove); + } + + /// Applies [PolylineUpdates] to the currently managed lines. + void updatePolylines(PolylineUpdates updates) { + _polylinesController?.addPolylines(updates.polylinesToAdd); + _polylinesController?.changePolylines(updates.polylinesToChange); + _polylinesController?.removePolylines(updates.polylineIdsToRemove); + } + + /// Applies [MarkerUpdates] to the currently managed markers. + void updateMarkers(MarkerUpdates updates) { + _markersController?.addMarkers(updates.markersToAdd); + _markersController?.changeMarkers(updates.markersToChange); + _markersController?.removeMarkers(updates.markerIdsToRemove); + } + + /// Shows the [InfoWindow] of the marker identified by its [MarkerId]. + void showInfoWindow(MarkerId markerId) { + _markersController?.showMarkerInfoWindow(markerId); + } + + /// Hides the [InfoWindow] of the marker identified by its [MarkerId]. + void hideInfoWindow(MarkerId markerId) { + _markersController?.hideMarkerInfoWindow(markerId); + } + + /// Returns true if the [InfoWindow] of the marker identified by [MarkerId] is shown. + bool isInfoWindowShown(MarkerId markerId) { + return _markersController?.isInfoWindowShown(markerId); + } + + // Cleanup + + /// Disposes of this controller and its resources. + void dispose() { + _widget = null; + _googleMap = null; + _circlesController = null; + _polygonsController = null; + _polylinesController = null; + _markersController = null; + _streamController.close(); + } +} diff --git a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/google_maps_flutter_web.dart b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/google_maps_flutter_web.dart new file mode 100644 index 000000000000..cf549e8e375e --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/google_maps_flutter_web.dart @@ -0,0 +1,291 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +part of google_maps_flutter_web; + +/// The web implementation of [GoogleMapsFlutterPlatform]. +/// +/// This class implements the `package:google_maps_flutter` functionality for the web. +class GoogleMapsPlugin extends GoogleMapsFlutterPlatform { + /// Registers this class as the default instance of [GoogleMapsFlutterPlatform]. + static void registerWith(Registrar registrar) { + GoogleMapsFlutterPlatform.instance = GoogleMapsPlugin(); + } + + // A cache of map controllers by map Id. + Map _mapById = Map(); + + /// Allows tests to inject controllers without going through the buildView flow. + @visibleForTesting + void debugSetMapById(Map mapById) { + _mapById = mapById; + } + + // Convenience getter for a stream of events filtered by their mapId. + Stream _events(int mapId) => _map(mapId).events; + + // Convenience getter for a map controller by its mapId. + GoogleMapController _map(int mapId) { + final controller = _mapById[mapId]; + assert(controller != null, + 'Maps cannot be retrieved before calling buildView!'); + return controller; + } + + @override + Future init(int mapId) async { + _map(mapId).init(); + } + + /// Updates the options of a given `mapId`. + /// + /// This attempts to merge the new `optionsUpdate` passed in, with the previous + /// options passed to the map (in other updates, or when creating it). + @override + Future updateMapOptions( + Map optionsUpdate, { + @required int mapId, + }) async { + _map(mapId).updateRawOptions(optionsUpdate); + } + + /// Applies the passed in `markerUpdates` to the `mapId`. + @override + Future updateMarkers( + MarkerUpdates markerUpdates, { + @required int mapId, + }) async { + _map(mapId).updateMarkers(markerUpdates); + } + + /// Applies the passed in `polygonUpdates` to the `mapId`. + @override + Future updatePolygons( + PolygonUpdates polygonUpdates, { + @required int mapId, + }) async { + _map(mapId).updatePolygons(polygonUpdates); + } + + /// Applies the passed in `polylineUpdates` to the `mapId`. + @override + Future updatePolylines( + PolylineUpdates polylineUpdates, { + @required int mapId, + }) async { + _map(mapId).updatePolylines(polylineUpdates); + } + + /// Applies the passed in `circleUpdates` to the `mapId`. + @override + Future updateCircles( + CircleUpdates circleUpdates, { + @required int mapId, + }) async { + _map(mapId).updateCircles(circleUpdates); + } + + /// Applies the given `cameraUpdate` to the current viewport (with animation). + @override + Future animateCamera( + CameraUpdate cameraUpdate, { + @required int mapId, + }) async { + return moveCamera(cameraUpdate, mapId: mapId); + } + + /// Applies the given `cameraUpdate` to the current viewport. + @override + Future moveCamera( + CameraUpdate cameraUpdate, { + @required int mapId, + }) async { + return _map(mapId).moveCamera(cameraUpdate); + } + + /// Sets the passed-in `mapStyle` to the map. + /// + /// This function just adds a 'styles' option to the current map options. + /// + /// Subsequent calls to this method override previous calls, you need to + /// pass full styles. + @override + Future setMapStyle( + String mapStyle, { + @required int mapId, + }) async { + _map(mapId).updateRawOptions({ + 'styles': _mapStyles(mapStyle), + }); + } + + /// Returns the bounds of the current viewport. + @override + Future getVisibleRegion({ + @required int mapId, + }) { + return _map(mapId).getVisibleRegion(); + } + + /// Returns the screen coordinate (in pixels) of a given `latLng`. + @override + Future getScreenCoordinate( + LatLng latLng, { + @required int mapId, + }) { + return _map(mapId).getScreenCoordinate(latLng); + } + + /// Returns the [LatLng] of a [ScreenCoordinate] of the viewport. + @override + Future getLatLng( + ScreenCoordinate screenCoordinate, { + @required int mapId, + }) { + return _map(mapId).getLatLng(screenCoordinate); + } + + /// Shows the [InfoWindow] (if any) of the [Marker] identified by `markerId`. + /// + /// See also: + /// * [hideMarkerInfoWindow] to hide the info window. + /// * [isMarkerInfoWindowShown] to check if the info window is visible/hidden. + @override + Future showMarkerInfoWindow( + MarkerId markerId, { + @required int mapId, + }) async { + _map(mapId).showInfoWindow(markerId); + } + + /// Hides the [InfoWindow] (if any) of the [Marker] identified by `markerId`. + /// + /// See also: + /// * [showMarkerInfoWindow] to show the info window. + /// * [isMarkerInfoWindowShown] to check if the info window is shown. + @override + Future hideMarkerInfoWindow( + MarkerId markerId, { + @required int mapId, + }) async { + _map(mapId).hideInfoWindow(markerId); + } + + /// Returns true if the [InfoWindow] of the [Marker] identified by `markerId` is shown. + /// + /// See also: + /// * [showMarkerInfoWindow] to show the info window. + /// * [hideMarkerInfoWindow] to hide the info window. + @override + Future isMarkerInfoWindowShown( + MarkerId markerId, { + @required int mapId, + }) async { + return _map(mapId).isInfoWindowShown(markerId); + } + + /// Returns the zoom level of the `mapId`. + @override + Future getZoomLevel({ + @required int mapId, + }) { + return _map(mapId).getZoomLevel(); + } + + // The following are the 11 possible streams of data from the native side + // into the plugin + + @override + Stream onCameraMoveStarted({@required int mapId}) { + return _events(mapId).whereType(); + } + + @override + Stream onCameraMove({@required int mapId}) { + return _events(mapId).whereType(); + } + + @override + Stream onCameraIdle({@required int mapId}) { + return _events(mapId).whereType(); + } + + @override + Stream onMarkerTap({@required int mapId}) { + return _events(mapId).whereType(); + } + + @override + Stream onInfoWindowTap({@required int mapId}) { + return _events(mapId).whereType(); + } + + @override + Stream onMarkerDragEnd({@required int mapId}) { + return _events(mapId).whereType(); + } + + @override + Stream onPolylineTap({@required int mapId}) { + return _events(mapId).whereType(); + } + + @override + Stream onPolygonTap({@required int mapId}) { + return _events(mapId).whereType(); + } + + @override + Stream onCircleTap({@required int mapId}) { + return _events(mapId).whereType(); + } + + @override + Stream onTap({@required int mapId}) { + return _events(mapId).whereType(); + } + + @override + Stream onLongPress({@required int mapId}) { + return _events(mapId).whereType(); + } + + /// Disposes of the current map. It can't be used afterwards! + @override + void dispose({@required int mapId}) { + _map(mapId)?.dispose(); + _mapById.remove(mapId); + } + + @override + Widget buildView( + Map creationParams, + Set> gestureRecognizers, + PlatformViewCreatedCallback onPlatformViewCreated) { + int mapId = creationParams.remove('_webOnlyMapCreationId'); + + assert(mapId != null, + 'buildView needs a `_webOnlyMapCreationId` in its creationParams to prevent widget reloads in web.'); + + // Bail fast if we've already rendered this mapId... + if (_mapById[mapId]?.widget != null) { + return _mapById[mapId].widget; + } + + final StreamController controller = + StreamController.broadcast(); + + final mapController = GoogleMapController( + mapId: mapId, + streamController: controller, + rawOptions: creationParams, + ); + + _mapById[mapId] = mapController; + + onPlatformViewCreated.call(mapId); + + return mapController.widget; + } +} diff --git a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/marker.dart b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/marker.dart new file mode 100644 index 000000000000..a067e352732f --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/marker.dart @@ -0,0 +1,82 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +part of google_maps_flutter_web; + +/// The `MarkerController` class wraps a [gmaps.Marker], how it handles events, and its associated (optional) [gmaps.InfoWindow] widget. +class MarkerController { + gmaps.Marker _marker; + + final bool _consumeTapEvents; + + final gmaps.InfoWindow _infoWindow; + + bool _infoWindowShown = false; + + /// Creates a `MarkerController`, which wraps a [gmaps.Marker] object, its `onTap`/`onDrag` behavior, and its associated [gmaps.InfoWindow]. + MarkerController({ + @required gmaps.Marker marker, + gmaps.InfoWindow infoWindow, + bool consumeTapEvents = false, + LatLngCallback onDragEnd, + ui.VoidCallback onTap, + }) : _marker = marker, + _infoWindow = infoWindow, + _consumeTapEvents = consumeTapEvents { + if (onTap != null) { + _marker.onClick.listen((event) { + onTap.call(); + }); + } + if (onDragEnd != null) { + _marker.onDragend.listen((event) { + _marker.position = event.latLng; + onDragEnd.call(event.latLng); + }); + } + } + + /// Returns `true` if this Controller will use its own `onTap` handler to consume events. + bool get consumeTapEvents => _consumeTapEvents; + + /// Returns `true` if the [gmaps.InfoWindow] associated to this marker is being shown. + bool get infoWindowShown => _infoWindowShown; + + /// Returns the [gmaps.Marker] associated to this controller. + gmaps.Marker get marker => _marker; + + /// Updates the options of the wrapped [gmaps.Marker] object. + void update( + gmaps.MarkerOptions options, { + String newInfoWindowContent, + }) { + _marker.options = options; + if (_infoWindow != null && newInfoWindowContent != null) { + _infoWindow.content = newInfoWindowContent; + } + } + + /// Disposes of the currently wrapped [gmaps.Marker]. + void remove() { + _marker.visible = false; + _marker.map = null; + _marker = null; + } + + /// Hide the associated [gmaps.InfoWindow]. + void hideInfoWindow() { + if (_infoWindow != null) { + _infoWindow.close(); + _infoWindowShown = false; + } + } + + /// Show the associated [gmaps.InfoWindow]. + void showInfoWindow() { + if (_infoWindow != null) { + _infoWindow.open(_marker.map, _marker); + _infoWindowShown = true; + } + } +} diff --git a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/markers.dart b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/markers.dart new file mode 100644 index 000000000000..ebb478d20b06 --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/markers.dart @@ -0,0 +1,144 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +part of google_maps_flutter_web; + +/// This class manages a set of [MarkerController]s associated to a [GoogleMapController]. +class MarkersController extends GeometryController { + // A cache of [MarkerController]s indexed by their [MarkerId]. + final Map _markerIdToController; + + // The stream over which markers broadcast their events + StreamController _streamController; + + /// Initialize the cache. The [StreamController] comes from the [GoogleMapController], and is shared with other controllers. + MarkersController({ + @required StreamController stream, + }) : _streamController = stream, + _markerIdToController = Map(); + + /// Returns the cache of [MarkerController]s. Test only. + @visibleForTesting + Map get markers => _markerIdToController; + + /// Adds a set of [Marker] objects to the cache. + /// + /// Wraps each [Marker] into its corresponding [MarkerController]. + void addMarkers(Set markersToAdd) { + markersToAdd?.forEach(_addMarker); + } + + void _addMarker(Marker marker) { + if (marker == null) { + return; + } + + final infoWindowOptions = _infoWindowOptionsFromMarker(marker); + gmaps.InfoWindow gmInfoWindow; + + if (infoWindowOptions != null) { + gmInfoWindow = gmaps.InfoWindow(infoWindowOptions) + ..addListener('click', () { + _onInfoWindowTap(marker.markerId); + }); + } + + final currentMarker = _markerIdToController[marker.markerId]?.marker; + + final populationOptions = _markerOptionsFromMarker(marker, currentMarker); + gmaps.Marker gmMarker = gmaps.Marker(populationOptions); + gmMarker.map = googleMap; + MarkerController controller = MarkerController( + marker: gmMarker, + infoWindow: gmInfoWindow, + consumeTapEvents: marker.consumeTapEvents, + onTap: () { + this.showMarkerInfoWindow(marker.markerId); + _onMarkerTap(marker.markerId); + }, + onDragEnd: (gmaps.LatLng latLng) { + _onMarkerDragEnd(marker.markerId, latLng); + }, + ); + _markerIdToController[marker.markerId] = controller; + } + + /// Updates a set of [Marker] objects with new options. + void changeMarkers(Set markersToChange) { + markersToChange?.forEach(_changeMarker); + } + + void _changeMarker(Marker marker) { + MarkerController markerController = _markerIdToController[marker?.markerId]; + if (markerController != null) { + final markerOptions = _markerOptionsFromMarker( + marker, + markerController.marker, + ); + final infoWindow = _infoWindowOptionsFromMarker(marker); + markerController.update( + markerOptions, + newInfoWindowContent: infoWindow?.content, + ); + } + } + + /// Removes a set of [MarkerId]s from the cache. + void removeMarkers(Set markerIdsToRemove) { + markerIdsToRemove?.forEach(_removeMarker); + } + + void _removeMarker(MarkerId markerId) { + final MarkerController markerController = _markerIdToController[markerId]; + markerController?.remove(); + _markerIdToController.remove(markerId); + } + + // InfoWindow... + + /// Shows the [InfoWindow] of a [MarkerId]. + /// + /// See also [hideMarkerInfoWindow] and [isInfoWindowShown]. + void showMarkerInfoWindow(MarkerId markerId) { + MarkerController markerController = _markerIdToController[markerId]; + markerController?.showInfoWindow(); + } + + /// Hides the [InfoWindow] of a [MarkerId]. + /// + /// See also [showMarkerInfoWindow] and [isInfoWindowShown]. + void hideMarkerInfoWindow(MarkerId markerId) { + MarkerController markerController = _markerIdToController[markerId]; + markerController?.hideInfoWindow(); + } + + /// Returns whether or not the [InfoWindow] of a [MarkerId] is shown. + /// + /// See also [showMarkerInfoWindow] and [hideMarkerInfoWindow]. + bool isInfoWindowShown(MarkerId markerId) { + MarkerController markerController = _markerIdToController[markerId]; + return markerController?.infoWindowShown ?? false; + } + + // Handle internal events + + bool _onMarkerTap(MarkerId markerId) { + // Have you ended here on your debugging? Is this wrong? + // Comment here: https://github.com/flutter/flutter/issues/64084 + _streamController.add(MarkerTapEvent(mapId, markerId)); + return _markerIdToController[markerId]?.consumeTapEvents ?? false; + } + + void _onInfoWindowTap(MarkerId markerId) { + _streamController.add(InfoWindowTapEvent(mapId, markerId)); + } + + void _onMarkerDragEnd(MarkerId markerId, gmaps.LatLng latLng) { + _streamController.add(MarkerDragEndEvent( + mapId, + _gmLatLngToLatLng(latLng), + markerId, + )); + } +} diff --git a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/polygon.dart b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/polygon.dart new file mode 100644 index 000000000000..f4c692d2ee83 --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/polygon.dart @@ -0,0 +1,45 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +part of google_maps_flutter_web; + +/// The `PolygonController` class wraps a [gmaps.Polygon] and its `onTap` behavior. +class PolygonController { + gmaps.Polygon _polygon; + + final bool _consumeTapEvents; + + /// Creates a `PolygonController` that wraps a [gmaps.Polygon] object and its `onTap` behavior. + PolygonController({ + @required gmaps.Polygon polygon, + bool consumeTapEvents = false, + ui.VoidCallback onTap, + }) : _polygon = polygon, + _consumeTapEvents = consumeTapEvents { + if (onTap != null) { + polygon.onClick.listen((event) { + onTap.call(); + }); + } + } + + /// Returns the wrapped [gmaps.Polygon]. Only used for testing. + @visibleForTesting + gmaps.Polygon get polygon => _polygon; + + /// Returns `true` if this Controller will use its own `onTap` handler to consume events. + bool get consumeTapEvents => _consumeTapEvents; + + /// Updates the options of the wrapped [gmaps.Polygon] object. + void update(gmaps.PolygonOptions options) { + _polygon.options = options; + } + + /// Disposes of the currently wrapped [gmaps.Polygon]. + void remove() { + _polygon.visible = false; + _polygon.map = null; + _polygon = null; + } +} diff --git a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/polygons.dart b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/polygons.dart new file mode 100644 index 000000000000..5c078ea0aa7a --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/polygons.dart @@ -0,0 +1,85 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +part of google_maps_flutter_web; + +/// This class manages a set of [PolygonController]s associated to a [GoogleMapController]. +class PolygonsController extends GeometryController { + // A cache of [PolygonController]s indexed by their [PolygonId]. + final Map _polygonIdToController; + + // The stream over which polygons broadcast events + StreamController _streamController; + + /// Initializes the cache. The [StreamController] comes from the [GoogleMapController], and is shared with other controllers. + PolygonsController({ + @required StreamController stream, + }) : _streamController = stream, + _polygonIdToController = Map(); + + /// Returns the cache of [PolygonController]s. Test only. + @visibleForTesting + Map get polygons => _polygonIdToController; + + /// Adds a set of [Polygon] objects to the cache. + /// + /// Wraps each Polygon into its corresponding [PolygonController]. + void addPolygons(Set polygonsToAdd) { + if (polygonsToAdd != null) { + polygonsToAdd.forEach((polygon) { + _addPolygon(polygon); + }); + } + } + + void _addPolygon(Polygon polygon) { + if (polygon == null) { + return; + } + + final populationOptions = _polygonOptionsFromPolygon(googleMap, polygon); + gmaps.Polygon gmPolygon = gmaps.Polygon(populationOptions); + gmPolygon.map = googleMap; + PolygonController controller = PolygonController( + polygon: gmPolygon, + consumeTapEvents: polygon.consumeTapEvents, + onTap: () { + _onPolygonTap(polygon.polygonId); + }); + _polygonIdToController[polygon.polygonId] = controller; + } + + /// Updates a set of [Polygon] objects with new options. + void changePolygons(Set polygonsToChange) { + if (polygonsToChange != null) { + polygonsToChange.forEach((polygonToChange) { + _changePolygon(polygonToChange); + }); + } + } + + void _changePolygon(Polygon polygon) { + PolygonController polygonController = + _polygonIdToController[polygon?.polygonId]; + polygonController?.update(_polygonOptionsFromPolygon(googleMap, polygon)); + } + + /// Removes a set of [PolygonId]s from the cache. + void removePolygons(Set polygonIdsToRemove) { + polygonIdsToRemove?.forEach((polygonId) { + final PolygonController polygonController = + _polygonIdToController[polygonId]; + polygonController?.remove(); + _polygonIdToController.remove(polygonId); + }); + } + + // Handle internal events + bool _onPolygonTap(PolygonId polygonId) { + // Have you ended here on your debugging? Is this wrong? + // Comment here: https://github.com/flutter/flutter/issues/64084 + _streamController.add(PolygonTapEvent(mapId, polygonId)); + return _polygonIdToController[polygonId]?.consumeTapEvents ?? false; + } +} diff --git a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/polyline.dart b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/polyline.dart new file mode 100644 index 000000000000..f8ff2c62191d --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/polyline.dart @@ -0,0 +1,45 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +part of google_maps_flutter_web; + +/// The `PolygonController` class wraps a [gmaps.Polyline] and its `onTap` behavior. +class PolylineController { + gmaps.Polyline _polyline; + + final bool _consumeTapEvents; + + /// Creates a `PolylineController` that wraps a [gmaps.Polyline] object and its `onTap` behavior. + PolylineController({ + @required gmaps.Polyline polyline, + bool consumeTapEvents = false, + ui.VoidCallback onTap, + }) : _polyline = polyline, + _consumeTapEvents = consumeTapEvents { + if (onTap != null) { + polyline.onClick.listen((event) { + onTap.call(); + }); + } + } + + /// Returns the wrapped [gmaps.Polyline]. Only used for testing. + @visibleForTesting + gmaps.Polyline get line => _polyline; + + /// Returns `true` if this Controller will use its own `onTap` handler to consume events. + bool get consumeTapEvents => _consumeTapEvents; + + /// Updates the options of the wrapped [gmaps.Polyline] object. + void update(gmaps.PolylineOptions options) { + _polyline.options = options; + } + + /// Disposes of the currently wrapped [gmaps.Polyline]. + void remove() { + _polyline.visible = false; + _polyline.map = null; + _polyline = null; + } +} diff --git a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/polylines.dart b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/polylines.dart new file mode 100644 index 000000000000..f24ca4b1bb42 --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/polylines.dart @@ -0,0 +1,83 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +part of google_maps_flutter_web; + +/// This class manages a set of [PolylinesController]s associated to a [GoogleMapController]. +class PolylinesController extends GeometryController { + // A cache of [PolylineController]s indexed by their [PolylineId]. + final Map _polylineIdToController; + + // The stream over which polylines broadcast their events + StreamController _streamController; + + /// Initializes the cache. The [StreamController] comes from the [GoogleMapController], and is shared with other controllers. + PolylinesController({ + @required StreamController stream, + }) : _streamController = stream, + _polylineIdToController = Map(); + + /// Returns the cache of [PolylineContrller]s. Test only. + @visibleForTesting + Map get lines => _polylineIdToController; + + /// Adds a set of [Polyline] objects to the cache. + /// + /// Wraps each line into its corresponding [PolylineController]. + void addPolylines(Set polylinesToAdd) { + polylinesToAdd?.forEach((polyline) { + _addPolyline(polyline); + }); + } + + void _addPolyline(Polyline polyline) { + if (polyline == null) { + return; + } + + final polylineOptions = _polylineOptionsFromPolyline(googleMap, polyline); + gmaps.Polyline gmPolyline = gmaps.Polyline(polylineOptions); + gmPolyline.map = googleMap; + PolylineController controller = PolylineController( + polyline: gmPolyline, + consumeTapEvents: polyline.consumeTapEvents, + onTap: () { + _onPolylineTap(polyline.polylineId); + }); + _polylineIdToController[polyline.polylineId] = controller; + } + + /// Updates a set of [Polyline] objects with new options. + void changePolylines(Set polylinesToChange) { + polylinesToChange?.forEach((polylineToChange) { + _changePolyline(polylineToChange); + }); + } + + void _changePolyline(Polyline polyline) { + PolylineController polylineController = + _polylineIdToController[polyline?.polylineId]; + polylineController + ?.update(_polylineOptionsFromPolyline(googleMap, polyline)); + } + + /// Removes a set of [PolylineId]s from the cache. + void removePolylines(Set polylineIdsToRemove) { + polylineIdsToRemove?.forEach((polylineId) { + final PolylineController polylineController = + _polylineIdToController[polylineId]; + polylineController?.remove(); + _polylineIdToController.remove(polylineId); + }); + } + + // Handle internal events + + bool _onPolylineTap(PolylineId polylineId) { + // Have you ended here on your debugging? Is this wrong? + // Comment here: https://github.com/flutter/flutter/issues/64084 + _streamController.add(PolylineTapEvent(mapId, polylineId)); + return _polylineIdToController[polylineId]?.consumeTapEvents ?? false; + } +} diff --git a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/types.dart b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/types.dart new file mode 100644 index 000000000000..039cc473db5e --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/types.dart @@ -0,0 +1,30 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:google_maps_flutter_web/google_maps_flutter_web.dart'; +import 'package:google_maps/google_maps.dart' as gmaps; + +/// A void function that handles a [gmaps.LatLng] as a parameter. +/// +/// Similar to [ui.VoidCallback], but specific for Marker drag events. +typedef LatLngCallback = void Function(gmaps.LatLng latLng); + +/// The base class for all "geometry" group controllers. +/// +/// This lets all Geometry controllers ([MarkersController], [CirclesController], +/// [PolygonsController], [PolylinesController]) to be bound to a [gmaps.GMap] +/// instance and our internal `mapId` value. +abstract class GeometryController { + /// The GMap instance that this controller operates on. + gmaps.GMap googleMap; + + /// The map ID for events. + int mapId; + + /// Binds a `mapId` and the [gmaps.GMap] instance to this controller. + void bindToMap(int mapId, gmaps.GMap googleMap) { + this.mapId = mapId; + this.googleMap = googleMap; + } +} diff --git a/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml new file mode 100644 index 000000000000..a4a734ac773e --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml @@ -0,0 +1,34 @@ +name: google_maps_flutter_web +description: Web platform implementation of google_maps_flutter +homepage: https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter +version: 0.1.0 + +flutter: + plugin: + platforms: + web: + pluginClass: GoogleMapsPlugin + fileName: google_maps_flutter_web.dart + +dependencies: + flutter: + sdk: flutter + flutter_web_plugins: + sdk: flutter + meta: ^1.1.7 + google_maps_flutter_platform_interface: ^1.0.4 + google_maps: ^3.0.0 + stream_transform: ^1.2.0 + sanitize_html: ^1.3.0 + +dev_dependencies: + flutter_test: + sdk: flutter + url_launcher: ^5.2.5 + pedantic: ^1.8.0 + mockito: ^4.1.1 + e2e: ^0.6.1 + +environment: + sdk: ">=2.3.0 <3.0.0" + flutter: ">=1.10.0 <2.0.0" diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/README.md b/packages/google_maps_flutter/google_maps_flutter_web/test/README.md new file mode 100644 index 000000000000..6eae799ce11c --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/README.md @@ -0,0 +1,17 @@ +# Running browser_tests + +Make sure you have updated to the latest Flutter master. + +1. Check what version of Chrome is running on the machine you're running tests on. + +2. Download and install driver for that version from here: + * + +3. Start the driver using `chromedriver --port=4444` + +4. Change into the `test` directory of your clone. + +5. Run tests: `flutter drive -d web-server --browser-name=chrome --target=test_driver/TEST_NAME_e2e.dart`, or (in Linux): + + * Single: `./run_test test_driver/TEST_NAME_e2e.dart` + * All: `./run_test` diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/lib/main.dart b/packages/google_maps_flutter/google_maps_flutter_web/test/lib/main.dart new file mode 100644 index 000000000000..10415204570c --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/lib/main.dart @@ -0,0 +1,22 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:flutter/material.dart'; + +void main() { + runApp(MyApp()); +} + +/// App for testing +class MyApp extends StatefulWidget { + @override + _MyAppState createState() => _MyAppState(); +} + +class _MyAppState extends State { + @override + Widget build(BuildContext context) { + return Text('Testing... Look at the console output for results!'); + } +} diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_web/test/pubspec.yaml new file mode 100644 index 000000000000..ec091f00a56f --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/pubspec.yaml @@ -0,0 +1,22 @@ +name: regular_integration_tests +publish_to: none + +environment: + sdk: ">=2.2.2 <3.0.0" + +dependencies: + flutter: + sdk: flutter + +dev_dependencies: + google_maps_flutter_web: + path: ../ + google_maps: ^3.4.4 + flutter_driver: + sdk: flutter + flutter_test: + sdk: flutter + e2e: ^0.6.1 + http: ^0.12.2 + mockito: ^4.1.1 + diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/run_test b/packages/google_maps_flutter/google_maps_flutter_web/test/run_test new file mode 100755 index 000000000000..4b43cf0947dc --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/run_test @@ -0,0 +1,17 @@ +#!/usr/bin/bash +if pgrep -lf chromedriver > /dev/null; then + echo "chromedriver is running." + + if [ $# -eq 0 ]; then + echo "No target specified, running all tests..." + find test_driver/ -iname *_e2e.dart | xargs -n1 -i -t flutter drive -d web-server --web-port=7357 --browser-name=chrome --target='{}' + else + echo "Running test target: $1..." + set -x + flutter drive -d web-server --web-port=7357 --browser-name=chrome --target=$1 + fi + + else + echo "chromedriver is not running." +fi + diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_controller_e2e.dart b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_controller_e2e.dart new file mode 100644 index 000000000000..fac1956bb9f8 --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_controller_e2e.dart @@ -0,0 +1,513 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:async'; + +import 'package:e2e/e2e.dart'; +import 'package:google_maps/google_maps.dart' as gmaps; +import 'package:google_maps_flutter_web/google_maps_flutter_web.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/mockito.dart'; + +import 'package:google_maps_flutter_platform_interface/google_maps_flutter_platform_interface.dart'; + +class _MockCirclesController extends Mock implements CirclesController {} + +class _MockPolygonsController extends Mock implements PolygonsController {} + +class _MockPolylinesController extends Mock implements PolylinesController {} + +class _MockMarkersController extends Mock implements MarkersController {} + +class _MockGMap extends Mock implements gmaps.GMap { + final onClickController = StreamController.broadcast(); + @override + Stream get onClick => onClickController.stream; + + final onRightclickController = StreamController.broadcast(); + @override + Stream get onRightclick => onRightclickController.stream; + + final onBoundsChangedController = StreamController.broadcast(); + @override + Stream get onBoundsChanged => onBoundsChangedController.stream; + + final onIdleController = StreamController.broadcast(); + @override + Stream get onIdle => onIdleController.stream; +} + +/// Test Google Map Controller +void main() { + E2EWidgetsFlutterBinding.ensureInitialized() as E2EWidgetsFlutterBinding; + + group('GoogleMapController', () { + final int mapId = 33930; + GoogleMapController controller; + StreamController stream; + + // Creates a controller with the default mapId and stream controller, and any `options` needed. + GoogleMapController _createController({Map options}) { + return GoogleMapController( + mapId: mapId, + streamController: stream, + rawOptions: options ?? {}); + } + + setUp(() { + stream = StreamController.broadcast(); + }); + + group('construct/dispose', () { + setUp(() { + controller = _createController(); + }); + + testWidgets('constructor creates widget', (WidgetTester tester) async { + expect(controller.widget, isNotNull); + expect(controller.widget.viewType, endsWith('$mapId')); + }); + + testWidgets('widget is cached when reused', (WidgetTester tester) async { + final first = controller.widget; + final again = controller.widget; + expect(identical(first, again), isTrue); + }); + + testWidgets('dispose closes the stream and removes the widget', + (WidgetTester tester) async { + controller.dispose(); + expect(stream.isClosed, isTrue); + expect(controller.widget, isNull); + }); + }); + + group('init', () { + _MockCirclesController circles; + _MockMarkersController markers; + _MockPolygonsController polygons; + _MockPolylinesController polylines; + _MockGMap map; + + setUp(() { + circles = _MockCirclesController(); + markers = _MockMarkersController(); + polygons = _MockPolygonsController(); + polylines = _MockPolylinesController(); + map = _MockGMap(); + }); + + testWidgets('listens to map events', (WidgetTester tester) async { + controller = _createController(); + controller.debugSetOverrides( + createMap: (_, __) => map, + circles: circles, + markers: markers, + polygons: polygons, + polylines: polylines, + ); + + expect(map.onClickController.hasListener, isFalse); + expect(map.onRightclickController.hasListener, isFalse); + expect(map.onBoundsChangedController.hasListener, isFalse); + expect(map.onIdleController.hasListener, isFalse); + + controller.init(); + + expect(map.onClickController.hasListener, isTrue); + expect(map.onRightclickController.hasListener, isTrue); + expect(map.onBoundsChangedController.hasListener, isTrue); + expect(map.onIdleController.hasListener, isTrue); + }); + + testWidgets('binds geometry controllers to map\'s', + (WidgetTester tester) async { + controller = _createController(); + controller.debugSetOverrides( + createMap: (_, __) => map, + circles: circles, + markers: markers, + polygons: polygons, + polylines: polylines, + ); + + controller.init(); + + verify(circles.bindToMap(mapId, map)); + verify(markers.bindToMap(mapId, map)); + verify(polygons.bindToMap(mapId, map)); + verify(polylines.bindToMap(mapId, map)); + }); + + testWidgets('renders initial geometry', (WidgetTester tester) async { + controller = _createController(options: { + 'circlesToAdd': [ + {'circleId': 'circle-1'} + ], + 'markersToAdd': [ + {'markerId': 'marker-1'} + ], + 'polygonsToAdd': [ + {'polygonId': 'polygon-1'} + ], + 'polylinesToAdd': [ + {'polylineId': 'polyline-1'} + ], + }); + controller.debugSetOverrides( + circles: circles, + markers: markers, + polygons: polygons, + polylines: polylines, + ); + + controller.init(); + + final capturedCircles = + verify(circles.addCircles(captureAny)).captured[0] as Set; + final capturedMarkers = + verify(markers.addMarkers(captureAny)).captured[0] as Set; + final capturedPolygons = verify(polygons.addPolygons(captureAny)) + .captured[0] as Set; + final capturedPolylines = verify(polylines.addPolylines(captureAny)) + .captured[0] as Set; + + expect(capturedCircles.first.circleId.value, 'circle-1'); + expect(capturedMarkers.first.markerId.value, 'marker-1'); + expect(capturedPolygons.first.polygonId.value, 'polygon-1'); + expect(capturedPolylines.first.polylineId.value, 'polyline-1'); + }); + + group('Initialization options', () { + gmaps.MapOptions capturedOptions; + setUp(() { + capturedOptions = null; + }); + testWidgets('translates initial options', (WidgetTester tester) async { + controller = _createController(options: { + 'options': { + 'mapType': 2, + 'zoomControlsEnabled': true, + } + }); + controller.debugSetOverrides(createMap: (_, options) { + capturedOptions = options; + return map; + }); + + controller.init(); + + expect(capturedOptions, isNotNull); + expect(capturedOptions.mapTypeId, gmaps.MapTypeId.SATELLITE); + expect(capturedOptions.zoomControl, true); + expect(capturedOptions.gestureHandling, 'auto', + reason: + 'by default the map handles zoom/pan gestures internally'); + }); + + testWidgets('disables gestureHandling with scrollGesturesEnabled false', + (WidgetTester tester) async { + controller = _createController(options: { + 'options': { + 'scrollGesturesEnabled': false, + } + }); + controller.debugSetOverrides(createMap: (_, options) { + capturedOptions = options; + return map; + }); + + controller.init(); + + expect(capturedOptions, isNotNull); + expect(capturedOptions.gestureHandling, 'none', + reason: + 'disabling scroll gestures disables all gesture handling'); + }); + + testWidgets('disables gestureHandling with zoomGesturesEnabled false', + (WidgetTester tester) async { + controller = _createController(options: { + 'options': { + 'zoomGesturesEnabled': false, + } + }); + controller.debugSetOverrides(createMap: (_, options) { + capturedOptions = options; + return map; + }); + + controller.init(); + + expect(capturedOptions, isNotNull); + expect(capturedOptions.gestureHandling, 'none', + reason: + 'disabling scroll gestures disables all gesture handling'); + }); + + testWidgets('does not set initial position if absent', + (WidgetTester tester) async { + controller = _createController(); + controller.debugSetOverrides(createMap: (_, options) { + capturedOptions = options; + return map; + }); + + controller.init(); + + expect(capturedOptions, isNotNull); + expect(capturedOptions.zoom, isNull); + expect(capturedOptions.center, isNull); + }); + + testWidgets('sets initial position when passed', + (WidgetTester tester) async { + controller = _createController(options: { + 'initialCameraPosition': { + 'target': [43.308, -5.6910], + 'zoom': 12, + 'bearing': 0, + 'tilt': 0, + } + }); + controller.debugSetOverrides(createMap: (_, options) { + capturedOptions = options; + return map; + }); + + controller.init(); + + expect(capturedOptions, isNotNull); + expect(capturedOptions.zoom, 12); + expect(capturedOptions.center, isNotNull); + }); + }); + + group('Traffic Layer', () { + testWidgets('by default is disabled', (WidgetTester tester) async { + controller = _createController(); + controller.init(); + expect(controller.trafficLayer, isNull); + }); + + testWidgets('initializes with traffic layer', + (WidgetTester tester) async { + controller = _createController(options: { + 'options': { + 'trafficEnabled': true, + } + }); + controller.debugSetOverrides(createMap: (_, __) => map); + controller.init(); + expect(controller.trafficLayer, isNotNull); + }); + }); + }); + + // These are the methods that are delegated to the gmaps.GMap object, that we can mock... + group('Map control methods', () { + _MockGMap map; + + setUp(() { + map = _MockGMap(); + controller = _createController(); + controller.debugSetOverrides(createMap: (_, __) => map); + controller.init(); + }); + + group('updateRawOptions', () { + testWidgets('can update `options`', (WidgetTester tester) async { + controller.updateRawOptions({ + 'mapType': 2, + }); + final options = verify(map.options = captureAny).captured[0]; + + expect(options.mapTypeId, gmaps.MapTypeId.SATELLITE); + }); + + testWidgets('can turn on/off traffic', (WidgetTester tester) async { + expect(controller.trafficLayer, isNull); + + controller.updateRawOptions({ + 'trafficEnabled': true, + }); + + expect(controller.trafficLayer, isNotNull); + + controller.updateRawOptions({ + 'trafficEnabled': false, + }); + + expect(controller.trafficLayer, isNull); + }); + }); + + group('viewport getters', () { + testWidgets('getVisibleRegion', (WidgetTester tester) async { + await controller.getVisibleRegion(); + + verify(map.bounds); + }); + + testWidgets('getZoomLevel', (WidgetTester tester) async { + when(map.zoom).thenReturn(10); + + await controller.getZoomLevel(); + + verify(map.zoom); + }); + }); + + group('moveCamera', () { + testWidgets('newLatLngZoom', (WidgetTester tester) async { + await (controller + .moveCamera(CameraUpdate.newLatLngZoom(LatLng(19, 26), 12))); + + verify(map.zoom = 12); + final captured = verify(map.panTo(captureAny)).captured[0]; + expect(captured.lat, 19); + expect(captured.lng, 26); + }); + }); + + group('map.projection methods', () { + // These are too much for dart mockito, can't mock: + // map.projection.method() (in Javascript ;) ) + }); + }); + + // These are the methods that get forwarded to other controllers, so we just verify calls. + group('Pass-through methods', () { + setUp(() { + controller = _createController(); + }); + + testWidgets('updateCircles', (WidgetTester tester) async { + final mock = _MockCirclesController(); + controller.debugSetOverrides(circles: mock); + + final previous = { + Circle(circleId: CircleId('to-be-updated')), + Circle(circleId: CircleId('to-be-removed')), + }; + + final current = { + Circle(circleId: CircleId('to-be-updated'), visible: false), + Circle(circleId: CircleId('to-be-added')), + }; + + controller.updateCircles(CircleUpdates.from(previous, current)); + + verify(mock.removeCircles({ + CircleId('to-be-removed'), + })); + verify(mock.addCircles({ + Circle(circleId: CircleId('to-be-added')), + })); + verify(mock.changeCircles({ + Circle(circleId: CircleId('to-be-updated'), visible: false), + })); + }); + + testWidgets('updateMarkers', (WidgetTester tester) async { + final mock = _MockMarkersController(); + controller.debugSetOverrides(markers: mock); + + final previous = { + Marker(markerId: MarkerId('to-be-updated')), + Marker(markerId: MarkerId('to-be-removed')), + }; + + final current = { + Marker(markerId: MarkerId('to-be-updated'), visible: false), + Marker(markerId: MarkerId('to-be-added')), + }; + + controller.updateMarkers(MarkerUpdates.from(previous, current)); + + verify(mock.removeMarkers({ + MarkerId('to-be-removed'), + })); + verify(mock.addMarkers({ + Marker(markerId: MarkerId('to-be-added')), + })); + verify(mock.changeMarkers({ + Marker(markerId: MarkerId('to-be-updated'), visible: false), + })); + }); + + testWidgets('updatePolygons', (WidgetTester tester) async { + final mock = _MockPolygonsController(); + controller.debugSetOverrides(polygons: mock); + + final previous = { + Polygon(polygonId: PolygonId('to-be-updated')), + Polygon(polygonId: PolygonId('to-be-removed')), + }; + + final current = { + Polygon(polygonId: PolygonId('to-be-updated'), visible: false), + Polygon(polygonId: PolygonId('to-be-added')), + }; + + controller.updatePolygons(PolygonUpdates.from(previous, current)); + + verify(mock.removePolygons({ + PolygonId('to-be-removed'), + })); + verify(mock.addPolygons({ + Polygon(polygonId: PolygonId('to-be-added')), + })); + verify(mock.changePolygons({ + Polygon(polygonId: PolygonId('to-be-updated'), visible: false), + })); + }); + + testWidgets('updatePolylines', (WidgetTester tester) async { + final mock = _MockPolylinesController(); + controller.debugSetOverrides(polylines: mock); + + final previous = { + Polyline(polylineId: PolylineId('to-be-updated')), + Polyline(polylineId: PolylineId('to-be-removed')), + }; + + final current = { + Polyline(polylineId: PolylineId('to-be-updated'), visible: false), + Polyline(polylineId: PolylineId('to-be-added')), + }; + + controller.updatePolylines(PolylineUpdates.from(previous, current)); + + verify(mock.removePolylines({ + PolylineId('to-be-removed'), + })); + verify(mock.addPolylines({ + Polyline(polylineId: PolylineId('to-be-added')), + })); + verify(mock.changePolylines({ + Polyline(polylineId: PolylineId('to-be-updated'), visible: false), + })); + }); + + testWidgets('infoWindow visibility', (WidgetTester tester) async { + final mock = _MockMarkersController(); + controller.debugSetOverrides(markers: mock); + final markerId = MarkerId('marker-with-infowindow'); + + controller.showInfoWindow(markerId); + + verify(mock.showMarkerInfoWindow(markerId)); + + controller.hideInfoWindow(markerId); + + verify(mock.hideMarkerInfoWindow(markerId)); + + controller.isInfoWindowShown(markerId); + + verify(mock.isInfoWindowShown(markerId)); + }); + }); + }); +} diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_controller_e2e_test.dart b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_controller_e2e_test.dart new file mode 100644 index 000000000000..efa93a120e78 --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_controller_e2e_test.dart @@ -0,0 +1,7 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:e2e/e2e_driver.dart' as e2e; + +Future main() async => e2e.main(); diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_plugin_e2e.dart b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_plugin_e2e.dart new file mode 100644 index 000000000000..80ec5400bdd7 --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_plugin_e2e.dart @@ -0,0 +1,392 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:async'; + +import 'package:e2e/e2e.dart'; +import 'package:flutter/widgets.dart'; +import 'package:google_maps/google_maps.dart' as gmaps; +import 'package:google_maps_flutter_web/google_maps_flutter_web.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/mockito.dart'; + +import 'package:google_maps_flutter_platform_interface/google_maps_flutter_platform_interface.dart'; + +class _MockGoogleMapController extends Mock implements GoogleMapController {} + +/// Test GoogleMapsPlugin +void main() { + E2EWidgetsFlutterBinding.ensureInitialized() as E2EWidgetsFlutterBinding; + + group('GoogleMapsPlugin', () { + _MockGoogleMapController controller; + GoogleMapsPlugin plugin; + int reportedMapId; + + void onPlatformViewCreated(int id) { + reportedMapId = id; + } + + setUp(() { + controller = _MockGoogleMapController(); + plugin = GoogleMapsPlugin(); + reportedMapId = null; + }); + + group('init/dispose', () { + group('before buildWidget', () { + testWidgets('init throws assertion', (WidgetTester tester) async { + expect(() => plugin.init(0), throwsAssertionError); + }); + }); + + group('after buildWidget', () { + setUp(() { + plugin.debugSetMapById({0: controller}); + }); + + testWidgets('init initializes controller', (WidgetTester tester) async { + await plugin.init(0); + + verify(controller.init()); + }); + + testWidgets('cannot call methods after dispose', + (WidgetTester tester) async { + plugin.dispose(mapId: 0); + + verify(controller.dispose()); + expect( + () => plugin.init(0), + throwsAssertionError, + reason: 'Method calls should fail after dispose.', + ); + }); + }); + }); + + group('buildView', () { + final testMapId = 33930; + + testWidgets('throws without _webOnlyMapCreationId', + (WidgetTester tester) async { + expect( + () => plugin.buildView({}, null, onPlatformViewCreated), + throwsAssertionError, + reason: + '_webOnlyMapCreationId is mandatory to prevent unnecessary reloads in web.', + ); + }); + + testWidgets( + 'returns an HtmlElementView and caches the controller for later', + (WidgetTester tester) async { + final Map cache = {}; + plugin.debugSetMapById(cache); + + final HtmlElementView widget = plugin.buildView({ + '_webOnlyMapCreationId': testMapId, + }, null, onPlatformViewCreated); + + expect( + widget.viewType, + contains('$testMapId'), + reason: + 'view type should contain the mapId passed when creating the map.', + ); + expect( + reportedMapId, + testMapId, + reason: 'Should call onPlatformViewCreated with the mapId', + ); + expect(cache, contains(testMapId)); + expect( + cache[testMapId], + isNotNull, + reason: 'cached controller cannot be null.', + ); + }); + + testWidgets('returns cached instance if it already exists', + (WidgetTester tester) async { + final expected = HtmlElementView(viewType: 'only-for-testing'); + when(controller.widget).thenReturn(expected); + plugin.debugSetMapById({testMapId: controller}); + + final widget = plugin.buildView({ + '_webOnlyMapCreationId': testMapId, + }, null, onPlatformViewCreated); + + expect(widget, equals(expected)); + expect( + reportedMapId, + isNull, + reason: + 'onPlatformViewCreated should not be called when returning a cached controller', + ); + }); + }); + + group('setMapStyles', () { + String mapStyle = '''[{ + "featureType": "poi.park", + "elementType": "labels.text.fill", + "stylers": [{"color": "#6b9a76"}] + }]'''; + + testWidgets('translates styles for controller', + (WidgetTester tester) async { + plugin.debugSetMapById({0: controller}); + + await plugin.setMapStyle(mapStyle, mapId: 0); + + var captured = + verify(controller.updateRawOptions(captureThat(isMap))).captured[0]; + + expect(captured, contains('styles')); + var styles = captured['styles']; + expect(styles.length, 1); + // Let's peek inside the styles... + var style = styles[0] as gmaps.MapTypeStyle; + expect(style.featureType, gmaps.MapTypeStyleFeatureType.POI_PARK); + expect( + style.elementType, gmaps.MapTypeStyleElementType.LABELS_TEXT_FILL); + expect(style.stylers.length, 1); + expect(style.stylers[0].color, '#6b9a76'); + }); + }); + + // These methods only pass-through values from the plugin to the controller + // so we verify them all together here... + group('Pass-through methods:', () { + int mapId = 0; + setUp(() { + plugin.debugSetMapById({mapId: controller}); + }); + // Options + testWidgets('updateMapOptions', (WidgetTester tester) async { + final expectedMapOptions = {'someOption': 12345}; + + await plugin.updateMapOptions(expectedMapOptions, mapId: mapId); + + verify(controller.updateRawOptions(expectedMapOptions)); + }); + // Geometry + testWidgets('updateMarkers', (WidgetTester tester) async { + final expectedUpdates = MarkerUpdates.from(null, null); + + await plugin.updateMarkers(expectedUpdates, mapId: mapId); + + verify(controller.updateMarkers(expectedUpdates)); + }); + testWidgets('updatePolygons', (WidgetTester tester) async { + final expectedUpdates = PolygonUpdates.from(null, null); + + await plugin.updatePolygons(expectedUpdates, mapId: mapId); + + verify(controller.updatePolygons(expectedUpdates)); + }); + testWidgets('updatePolylines', (WidgetTester tester) async { + final expectedUpdates = PolylineUpdates.from(null, null); + + await plugin.updatePolylines(expectedUpdates, mapId: mapId); + + verify(controller.updatePolylines(expectedUpdates)); + }); + testWidgets('updateCircles', (WidgetTester tester) async { + final expectedUpdates = CircleUpdates.from(null, null); + + await plugin.updateCircles(expectedUpdates, mapId: mapId); + + verify(controller.updateCircles(expectedUpdates)); + }); + // Camera + testWidgets('animateCamera', (WidgetTester tester) async { + final expectedUpdates = + CameraUpdate.newLatLng(LatLng(43.3626, -5.8433)); + + await plugin.animateCamera(expectedUpdates, mapId: mapId); + + verify(controller.moveCamera(expectedUpdates)); + }); + testWidgets('moveCamera', (WidgetTester tester) async { + final expectedUpdates = + CameraUpdate.newLatLng(LatLng(43.3628, -5.8478)); + + await plugin.moveCamera(expectedUpdates, mapId: mapId); + + verify(controller.moveCamera(expectedUpdates)); + }); + // Viewport + testWidgets('getVisibleRegion', (WidgetTester tester) async { + await plugin.getVisibleRegion(mapId: mapId); + + verify(controller.getVisibleRegion()); + }); + testWidgets('getZoomLevel', (WidgetTester tester) async { + await plugin.getZoomLevel(mapId: mapId); + + verify(controller.getZoomLevel()); + }); + testWidgets('getScreenCoordinate', (WidgetTester tester) async { + final latLng = LatLng(43.3613, -5.8499); + + await plugin.getScreenCoordinate(latLng, mapId: mapId); + + verify(controller.getScreenCoordinate(latLng)); + }); + testWidgets('getLatLng', (WidgetTester tester) async { + final coordinates = ScreenCoordinate(x: 19, y: 26); + + await plugin.getLatLng(coordinates, mapId: mapId); + + verify(controller.getLatLng(coordinates)); + }); + // InfoWindows + testWidgets('showMarkerInfoWindow', (WidgetTester tester) async { + final markerId = MarkerId('testing-123'); + + await plugin.showMarkerInfoWindow(markerId, mapId: mapId); + + verify(controller.showInfoWindow(markerId)); + }); + testWidgets('hideMarkerInfoWindow', (WidgetTester tester) async { + final markerId = MarkerId('testing-123'); + + await plugin.hideMarkerInfoWindow(markerId, mapId: mapId); + + verify(controller.hideInfoWindow(markerId)); + }); + testWidgets('isMarkerInfoWindowShown', (WidgetTester tester) async { + final markerId = MarkerId('testing-123'); + + await plugin.isMarkerInfoWindowShown(markerId, mapId: mapId); + + verify(controller.isInfoWindowShown(markerId)); + }); + }); + + // Verify all event streams are filtered correctly from the main one... + group('Event Streams', () { + int mapId = 0; + StreamController streamController; + setUp(() { + streamController = StreamController.broadcast(); + when(controller.events) + .thenAnswer((realInvocation) => streamController.stream); + plugin.debugSetMapById({mapId: controller}); + }); + + // Dispatches a few events in the global streamController, and expects *only* the passed event to be there. + void _testStreamFiltering(Stream stream, MapEvent event) async { + Timer.run(() { + streamController.add(_OtherMapEvent(mapId)); + streamController.add(event); + streamController.add(_OtherMapEvent(mapId)); + streamController.close(); + }); + + final events = await stream.toList(); + + expect(events.length, 1); + expect(events[0], event); + } + + // Camera events + testWidgets('onCameraMoveStarted', (WidgetTester tester) async { + final event = CameraMoveStartedEvent(mapId); + + final stream = plugin.onCameraMoveStarted(mapId: mapId); + + await _testStreamFiltering(stream, event); + }); + testWidgets('onCameraMoveStarted', (WidgetTester tester) async { + final event = CameraMoveEvent( + mapId, + CameraPosition( + target: LatLng(43.3790, -5.8660), + ), + ); + + final stream = plugin.onCameraMove(mapId: mapId); + + await _testStreamFiltering(stream, event); + }); + testWidgets('onCameraIdle', (WidgetTester tester) async { + final event = CameraIdleEvent(mapId); + + final stream = plugin.onCameraIdle(mapId: mapId); + + await _testStreamFiltering(stream, event); + }); + // Marker events + testWidgets('onMarkerTap', (WidgetTester tester) async { + final event = MarkerTapEvent(mapId, MarkerId('test-123')); + + final stream = plugin.onMarkerTap(mapId: mapId); + + await _testStreamFiltering(stream, event); + }); + testWidgets('onInfoWindowTap', (WidgetTester tester) async { + final event = InfoWindowTapEvent(mapId, MarkerId('test-123')); + + final stream = plugin.onInfoWindowTap(mapId: mapId); + + await _testStreamFiltering(stream, event); + }); + testWidgets('onMarkerDragEnd', (WidgetTester tester) async { + final event = MarkerDragEndEvent( + mapId, + LatLng(43.3677, -5.8372), + MarkerId('test-123'), + ); + + final stream = plugin.onMarkerDragEnd(mapId: mapId); + + await _testStreamFiltering(stream, event); + }); + // Geometry + testWidgets('onPolygonTap', (WidgetTester tester) async { + final event = PolygonTapEvent(mapId, PolygonId('test-123')); + + final stream = plugin.onPolygonTap(mapId: mapId); + + await _testStreamFiltering(stream, event); + }); + testWidgets('onPolylineTap', (WidgetTester tester) async { + final event = PolylineTapEvent(mapId, PolylineId('test-123')); + + final stream = plugin.onPolylineTap(mapId: mapId); + + await _testStreamFiltering(stream, event); + }); + testWidgets('onCircleTap', (WidgetTester tester) async { + final event = CircleTapEvent(mapId, CircleId('test-123')); + + final stream = plugin.onCircleTap(mapId: mapId); + + await _testStreamFiltering(stream, event); + }); + // Map taps + testWidgets('onTap', (WidgetTester tester) async { + final event = MapTapEvent(mapId, LatLng(43.3597, -5.8458)); + + final stream = plugin.onTap(mapId: mapId); + + await _testStreamFiltering(stream, event); + }); + testWidgets('onLongPress', (WidgetTester tester) async { + final event = MapLongPressEvent(mapId, LatLng(43.3608, -5.8425)); + + final stream = plugin.onLongPress(mapId: mapId); + + await _testStreamFiltering(stream, event); + }); + }); + }); +} + +class _OtherMapEvent extends MapEvent { + _OtherMapEvent(int mapId) : super(mapId, null); +} diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_plugin_e2e_test.dart b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_plugin_e2e_test.dart new file mode 100644 index 000000000000..efa93a120e78 --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_plugin_e2e_test.dart @@ -0,0 +1,7 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:e2e/e2e_driver.dart' as e2e; + +Future main() async => e2e.main(); diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/marker_e2e.dart b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/marker_e2e.dart new file mode 100644 index 000000000000..7f9d9ba409e0 --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/marker_e2e.dart @@ -0,0 +1,99 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:async'; + +import 'package:e2e/e2e.dart'; +import 'package:google_maps/google_maps.dart' as gmaps; +import 'package:google_maps_flutter_web/google_maps_flutter_web.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/mockito.dart'; + +class _MockMarker extends Mock implements gmaps.Marker { + final onClickController = StreamController(); + final onDragEndController = StreamController(); + + @override + Stream get onClick => onClickController.stream; + + @override + Stream get onDragend => onDragEndController.stream; +} + +class _MockMouseEvent extends Mock implements gmaps.MouseEvent {} + +class _MockInfoWindow extends Mock implements gmaps.InfoWindow {} + +/// Test Markers +void main() { + E2EWidgetsFlutterBinding.ensureInitialized() as E2EWidgetsFlutterBinding; + + bool called = false; + void onTap() { + called = true; + } + + void onDragEnd(gmaps.LatLng _) { + called = true; + } + + setUp(() { + called = false; + }); + + group('MarkerController', () { + _MockMarker marker; + + setUp(() { + marker = _MockMarker(); + }); + + testWidgets('onTap gets called', (WidgetTester tester) async { + MarkerController(marker: marker, onTap: onTap); + // Simulate a click + await marker.onClickController.add(null); + expect(called, isTrue); + }); + + testWidgets('onDragEnd gets called', (WidgetTester tester) async { + when(marker.draggable).thenReturn(true); + MarkerController(marker: marker, onDragEnd: onDragEnd); + // Simulate a drag end + await marker.onDragEndController.add(_MockMouseEvent()); + expect(called, isTrue); + }); + + testWidgets('update', (WidgetTester tester) async { + final controller = MarkerController(marker: marker); + final options = gmaps.MarkerOptions()..draggable = false; + controller.update(options); + verify(marker.options = options); + }); + + testWidgets('infoWindow null, showInfoWindow.', + (WidgetTester tester) async { + final controller = MarkerController(marker: marker); + controller.showInfoWindow(); + expect(controller.infoWindowShown, isFalse); + }); + + testWidgets('showInfoWindow', (WidgetTester tester) async { + final infoWindow = _MockInfoWindow(); + final controller = + MarkerController(marker: marker, infoWindow: infoWindow); + controller.showInfoWindow(); + verify(infoWindow.open(any, any)).called(1); + expect(controller.infoWindowShown, isTrue); + }); + + testWidgets('hideInfoWindow', (WidgetTester tester) async { + final infoWindow = _MockInfoWindow(); + final controller = + MarkerController(marker: marker, infoWindow: infoWindow); + controller.hideInfoWindow(); + verify(infoWindow.close()).called(1); + expect(controller.infoWindowShown, isFalse); + }); + }); +} diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/marker_e2e_test.dart b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/marker_e2e_test.dart new file mode 100644 index 000000000000..efa93a120e78 --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/marker_e2e_test.dart @@ -0,0 +1,7 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:e2e/e2e_driver.dart' as e2e; + +Future main() async => e2e.main(); diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/markers_e2e.dart b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/markers_e2e.dart new file mode 100644 index 000000000000..53c34e9fa6eb --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/markers_e2e.dart @@ -0,0 +1,102 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:async'; + +import 'package:e2e/e2e.dart'; +import 'package:google_maps_flutter_platform_interface/google_maps_flutter_platform_interface.dart'; +import 'package:google_maps_flutter_web/google_maps_flutter_web.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + E2EWidgetsFlutterBinding.ensureInitialized() as E2EWidgetsFlutterBinding; + + group('MarkersController', () { + StreamController stream; + MarkersController controller; + + setUp(() { + stream = StreamController(); + controller = MarkersController(stream: stream); + }); + + testWidgets('addMarkers', (WidgetTester tester) async { + final markers = { + Marker(markerId: MarkerId('1')), + Marker(markerId: MarkerId('2')), + }; + + controller.addMarkers(markers); + + expect(controller.markers.length, 2); + expect(controller.markers, contains(MarkerId('1'))); + expect(controller.markers, contains(MarkerId('2'))); + expect(controller.markers, isNot(contains(MarkerId('66')))); + }); + + testWidgets('changeMarkers', (WidgetTester tester) async { + final markers = { + Marker(markerId: MarkerId('1')), + }; + controller.addMarkers(markers); + + expect(controller.markers[MarkerId('1')].marker.draggable, isFalse); + + // Update the marker with radius 10 + final updatedMarkers = { + Marker(markerId: MarkerId('1'), draggable: true), + }; + controller.changeMarkers(updatedMarkers); + + expect(controller.markers.length, 1); + expect(controller.markers[MarkerId('1')].marker.draggable, isTrue); + }); + + testWidgets('removeMarkers', (WidgetTester tester) async { + final markers = { + Marker(markerId: MarkerId('1')), + Marker(markerId: MarkerId('2')), + Marker(markerId: MarkerId('3')), + }; + + controller.addMarkers(markers); + + expect(controller.markers.length, 3); + + // Remove some markers... + final markerIdsToRemove = { + MarkerId('1'), + MarkerId('3'), + }; + + controller.removeMarkers(markerIdsToRemove); + + expect(controller.markers.length, 1); + expect(controller.markers, isNot(contains(MarkerId('1')))); + expect(controller.markers, contains(MarkerId('2'))); + expect(controller.markers, isNot(contains(MarkerId('3')))); + }); + + testWidgets('InfoWindow show/hide', (WidgetTester tester) async { + final markers = { + Marker( + markerId: MarkerId('1'), + infoWindow: InfoWindow(title: "Title", snippet: "Snippet"), + ), + }; + + controller.addMarkers(markers); + + expect(controller.markers[MarkerId('1')].infoWindowShown, isFalse); + + controller.showMarkerInfoWindow(MarkerId('1')); + + expect(controller.markers[MarkerId('1')].infoWindowShown, isTrue); + + controller.hideMarkerInfoWindow(MarkerId('1')); + + expect(controller.markers[MarkerId('1')].infoWindowShown, isFalse); + }); + }); +} diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/markers_e2e_test.dart b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/markers_e2e_test.dart new file mode 100644 index 000000000000..efa93a120e78 --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/markers_e2e_test.dart @@ -0,0 +1,7 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:e2e/e2e_driver.dart' as e2e; + +Future main() async => e2e.main(); diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shape_e2e.dart b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shape_e2e.dart new file mode 100644 index 000000000000..8a0e1d84facc --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shape_e2e.dart @@ -0,0 +1,113 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:async'; + +import 'package:e2e/e2e.dart'; +import 'package:google_maps/google_maps.dart' as gmaps; +import 'package:google_maps_flutter_web/google_maps_flutter_web.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/mockito.dart'; + +class _MockCircle extends Mock implements gmaps.Circle { + final onClickController = StreamController(); + @override + Stream get onClick => onClickController.stream; +} + +class _MockPolygon extends Mock implements gmaps.Polygon { + final onClickController = StreamController(); + @override + Stream get onClick => onClickController.stream; +} + +class _MockPolyline extends Mock implements gmaps.Polyline { + final onClickController = StreamController(); + @override + Stream get onClick => onClickController.stream; +} + +/// Test Shapes (Circle, Polygon, Polyline) +void main() { + E2EWidgetsFlutterBinding.ensureInitialized() as E2EWidgetsFlutterBinding; + + bool called = false; + void onTap() { + called = true; + } + + setUp(() { + called = false; + }); + + group('CircleController', () { + _MockCircle circle; + + setUp(() { + circle = _MockCircle(); + }); + + testWidgets('onTap gets called', (WidgetTester tester) async { + CircleController(circle: circle, consumeTapEvents: true, onTap: onTap); + expect(circle.onClickController.hasListener, isTrue); + // Simulate a click + await circle.onClickController.add(null); + expect(called, isTrue); + }); + + testWidgets('update', (WidgetTester tester) async { + final controller = CircleController(circle: circle); + final options = gmaps.CircleOptions()..draggable = false; + controller.update(options); + verify(circle.options = options); + }); + }); + + group('PolygonController', () { + _MockPolygon polygon; + + setUp(() { + polygon = _MockPolygon(); + }); + + testWidgets('onTap gets called', (WidgetTester tester) async { + PolygonController(polygon: polygon, consumeTapEvents: true, onTap: onTap); + expect(polygon.onClickController.hasListener, isTrue); + // Simulate a click + await polygon.onClickController.add(null); + expect(called, isTrue); + }); + + testWidgets('update', (WidgetTester tester) async { + final controller = PolygonController(polygon: polygon); + final options = gmaps.PolygonOptions()..draggable = false; + controller.update(options); + verify(polygon.options = options); + }); + }); + + group('PolylineController', () { + _MockPolyline polyline; + + setUp(() { + polyline = _MockPolyline(); + }); + + testWidgets('onTap gets called', (WidgetTester tester) async { + PolylineController( + polyline: polyline, consumeTapEvents: true, onTap: onTap); + expect(polyline.onClickController.hasListener, isTrue); + // Simulate a click + await polyline.onClickController.add(null); + expect(called, isTrue); + }); + + testWidgets('update', (WidgetTester tester) async { + final controller = PolylineController(polyline: polyline); + final options = gmaps.PolylineOptions()..draggable = false; + controller.update(options); + verify(polyline.options = options); + }); + }); +} diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shape_e2e_test.dart b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shape_e2e_test.dart new file mode 100644 index 000000000000..efa93a120e78 --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shape_e2e_test.dart @@ -0,0 +1,7 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:e2e/e2e_driver.dart' as e2e; + +Future main() async => e2e.main(); diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shapes_e2e.dart b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shapes_e2e.dart new file mode 100644 index 000000000000..9ff3ad9455bb --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shapes_e2e.dart @@ -0,0 +1,214 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:async'; + +import 'package:e2e/e2e.dart'; +import 'package:google_maps_flutter_platform_interface/google_maps_flutter_platform_interface.dart'; +import 'package:google_maps_flutter_web/google_maps_flutter_web.dart'; +import 'package:flutter_test/flutter_test.dart'; + +/// Test Shapes (Circle, Polygon, Polyline) +void main() { + E2EWidgetsFlutterBinding.ensureInitialized() as E2EWidgetsFlutterBinding; + + group('CirclesController', () { + StreamController stream; + CirclesController controller; + + setUp(() { + stream = StreamController(); + controller = CirclesController(stream: stream); + }); + + testWidgets('addCircles', (WidgetTester tester) async { + final circles = { + Circle(circleId: CircleId('1')), + Circle(circleId: CircleId('2')), + }; + + controller.addCircles(circles); + + expect(controller.circles.length, 2); + expect(controller.circles, contains(CircleId('1'))); + expect(controller.circles, contains(CircleId('2'))); + expect(controller.circles, isNot(contains(CircleId('66')))); + }); + + testWidgets('changeCircles', (WidgetTester tester) async { + final circles = { + Circle(circleId: CircleId('1')), + }; + controller.addCircles(circles); + + expect(controller.circles[CircleId('1')].circle.visible, isTrue); + + final updatedCircles = { + Circle(circleId: CircleId('1'), visible: false), + }; + controller.changeCircles(updatedCircles); + + expect(controller.circles.length, 1); + expect(controller.circles[CircleId('1')].circle.visible, isFalse); + }); + + testWidgets('removeCircles', (WidgetTester tester) async { + final circles = { + Circle(circleId: CircleId('1')), + Circle(circleId: CircleId('2')), + Circle(circleId: CircleId('3')), + }; + + controller.addCircles(circles); + + expect(controller.circles.length, 3); + + // Remove some circles... + final circleIdsToRemove = { + CircleId('1'), + CircleId('3'), + }; + + controller.removeCircles(circleIdsToRemove); + + expect(controller.circles.length, 1); + expect(controller.circles, isNot(contains(CircleId('1')))); + expect(controller.circles, contains(CircleId('2'))); + expect(controller.circles, isNot(contains(CircleId('3')))); + }); + }); + + group('PolygonsController', () { + StreamController stream; + PolygonsController controller; + + setUp(() { + stream = StreamController(); + controller = PolygonsController(stream: stream); + }); + + testWidgets('addPolygons', (WidgetTester tester) async { + final polygons = { + Polygon(polygonId: PolygonId('1')), + Polygon(polygonId: PolygonId('2')), + }; + + controller.addPolygons(polygons); + + expect(controller.polygons.length, 2); + expect(controller.polygons, contains(PolygonId('1'))); + expect(controller.polygons, contains(PolygonId('2'))); + expect(controller.polygons, isNot(contains(PolygonId('66')))); + }); + + testWidgets('changePolygons', (WidgetTester tester) async { + final polygons = { + Polygon(polygonId: PolygonId('1')), + }; + controller.addPolygons(polygons); + + expect(controller.polygons[PolygonId('1')].polygon.visible, isTrue); + + // Update the polygon + final updatedPolygons = { + Polygon(polygonId: PolygonId('1'), visible: false), + }; + controller.changePolygons(updatedPolygons); + + expect(controller.polygons.length, 1); + expect(controller.polygons[PolygonId('1')].polygon.visible, isFalse); + }); + + testWidgets('removePolygons', (WidgetTester tester) async { + final polygons = { + Polygon(polygonId: PolygonId('1')), + Polygon(polygonId: PolygonId('2')), + Polygon(polygonId: PolygonId('3')), + }; + + controller.addPolygons(polygons); + + expect(controller.polygons.length, 3); + + // Remove some polygons... + final polygonIdsToRemove = { + PolygonId('1'), + PolygonId('3'), + }; + + controller.removePolygons(polygonIdsToRemove); + + expect(controller.polygons.length, 1); + expect(controller.polygons, isNot(contains(PolygonId('1')))); + expect(controller.polygons, contains(PolygonId('2'))); + expect(controller.polygons, isNot(contains(PolygonId('3')))); + }); + }); + + group('PolylinesController', () { + StreamController stream; + PolylinesController controller; + + setUp(() { + stream = StreamController(); + controller = PolylinesController(stream: stream); + }); + + testWidgets('addPolylines', (WidgetTester tester) async { + final polylines = { + Polyline(polylineId: PolylineId('1')), + Polyline(polylineId: PolylineId('2')), + }; + + controller.addPolylines(polylines); + + expect(controller.lines.length, 2); + expect(controller.lines, contains(PolylineId('1'))); + expect(controller.lines, contains(PolylineId('2'))); + expect(controller.lines, isNot(contains(PolylineId('66')))); + }); + + testWidgets('changePolylines', (WidgetTester tester) async { + final polylines = { + Polyline(polylineId: PolylineId('1')), + }; + controller.addPolylines(polylines); + + expect(controller.lines[PolylineId('1')].line.visible, isTrue); + + final updatedPolylines = { + Polyline(polylineId: PolylineId('1'), visible: false), + }; + controller.changePolylines(updatedPolylines); + + expect(controller.lines.length, 1); + expect(controller.lines[PolylineId('1')].line.visible, isFalse); + }); + + testWidgets('removePolylines', (WidgetTester tester) async { + final polylines = { + Polyline(polylineId: PolylineId('1')), + Polyline(polylineId: PolylineId('2')), + Polyline(polylineId: PolylineId('3')), + }; + + controller.addPolylines(polylines); + + expect(controller.lines.length, 3); + + // Remove some polylines... + final polylineIdsToRemove = { + PolylineId('1'), + PolylineId('3'), + }; + + controller.removePolylines(polylineIdsToRemove); + + expect(controller.lines.length, 1); + expect(controller.lines, isNot(contains(PolylineId('1')))); + expect(controller.lines, contains(PolylineId('2'))); + expect(controller.lines, isNot(contains(PolylineId('3')))); + }); + }); +} diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shapes_e2e_test.dart b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shapes_e2e_test.dart new file mode 100644 index 000000000000..efa93a120e78 --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shapes_e2e_test.dart @@ -0,0 +1,7 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:e2e/e2e_driver.dart' as e2e; + +Future main() async => e2e.main(); diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/web/index.html b/packages/google_maps_flutter/google_maps_flutter_web/test/web/index.html new file mode 100644 index 000000000000..3b7e4edc3df1 --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/web/index.html @@ -0,0 +1,14 @@ + + + + + Browser Tests + + + + + + + diff --git a/script/incremental_build.sh b/script/incremental_build.sh index ba8bf938d593..5351926b0051 100755 --- a/script/incremental_build.sh +++ b/script/incremental_build.sh @@ -17,6 +17,7 @@ CUSTOM_ANALYSIS_PLUGINS=( "in_app_purchase" "camera" "video_player/video_player_web" + "google_maps_flutter/google_maps_flutter_web" ) # Comma-separated string of the list above readonly CUSTOM_FLAG=$(IFS=, ; echo "${CUSTOM_ANALYSIS_PLUGINS[*]}") From bb562dd45c74268790a7f907eb8bd9cf05051e6b Mon Sep 17 00:00:00 2001 From: Tong Wu <6259181+digiter@users.noreply.github.com> Date: Wed, 19 Aug 2020 09:57:51 -0700 Subject: [PATCH 043/233] [e2e] Update code onwer. (#2915) --- CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index 51a9407127c9..f69d354cbcda 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -10,7 +10,7 @@ packages/battery/* @amirh @matthew-carroll packages/camera/* @bparrishMines packages/connectivity/* @cyanglaz @matthew-carroll packages/device_info/* @matthew-carroll -packages/e2e/* @collinjackson @digiter +packages/e2e/* @collinjackson @dnfield packages/espresso/* @collinjackson @adazh packages/google_maps_flutter/* @cyanglaz packages/google_sign_in/* @cyanglaz @mehmetf From 89794a635a5efad6705e3d7ccc29e8139318d947 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Wed, 19 Aug 2020 11:47:10 -0700 Subject: [PATCH 044/233] Rename e2e -> integration_test (#2918) * e2e -> integration_test and associated version bumps --- .cirrus.yml | 14 +- CODEOWNERS | 2 +- README.md | 3 +- .../androidalarmmanager/MainActivityTest.java | 2 +- .../example/pubspec.yaml | 4 +- .../android_alarm_manager_e2e.dart | 4 +- .../EmbeddingV1ActivityTest.java | 2 +- .../MainActivityTest.java | 2 +- packages/android_intent/example/pubspec.yaml | 4 +- .../test_driver/android_intent_e2e.dart | 4 +- packages/battery/CHANGELOG.md | 5 + .../battery/EmbedderV1ActivityTest.java | 2 +- .../plugins/battery/FlutterActivityTest.java | 2 +- .../batteryexample/EmbedderV1Activity.java | 5 +- packages/battery/example/pubspec.yaml | 4 +- packages/battery/pubspec.yaml | 6 +- packages/battery/test/battery_e2e.dart | 4 +- .../EmbeddingV1ActivityTest.java | 2 +- .../cameraexample/FlutterActivityTest.java | 2 +- .../cameraexample/EmbeddingV1Activity.java | 5 +- packages/camera/example/pubspec.yaml | 4 +- .../example/test_driver/camera_e2e.dart | 4 +- .../connectivity/connectivity/CHANGELOG.md | 4 + .../EmbeddingV1ActivityTest.java | 2 +- .../FlutterActivityTest.java | 2 +- .../connectivity/example/pubspec.yaml | 4 +- .../test_driver/test/connectivity_e2e.dart | 4 +- .../connectivity/connectivity/pubspec.yaml | 6 +- .../connectivity/test/connectivity_e2e.dart | 4 +- .../connectivity_for_web/CHANGELOG.md | 4 + .../connectivity_for_web/pubspec.yaml | 6 +- .../connectivity_for_web/test/lib/main.dart | 4 +- .../connectivity_for_web/test/pubspec.yaml | 5 +- .../EmbeddingV1ActivityTest.java | 2 +- .../FlutterActivityTest.java | 2 +- .../connectivity_macos/example/pubspec.yaml | 4 +- .../test_driver/test/connectivity_e2e.dart | 4 +- .../EmbeddingV1ActivityTest.java | 2 +- .../device_info/example/pubspec.yaml | 4 +- .../example/test_driver/device_info_e2e.dart | 4 +- packages/e2e/README.md | 10 +- packages/e2e/android/settings.gradle | 1 - .../e2e/example/ios/RunnerTests/RunnerTests.m | 4 - .../Flutter/GeneratedPluginRegistrant.swift | 12 -- .../example/test_driver/example_e2e_test.dart | 5 - packages/e2e/ios/Classes/E2EIosTest.h | 22 -- .../EmbeddingV1ActivityTest.java | 2 +- .../MainActivityTest.java | 2 +- .../EmbeddingV1Activity.java | 5 +- .../MainActivity.java | 4 +- .../example/pubspec.yaml | 4 +- .../flutter_plugin_android_lifecycle_e2e.dart | 4 +- .../googlemaps/EmbeddingV1ActivityTest.java | 2 +- .../plugins/googlemaps/MainActivityTest.java | 2 +- .../EmbeddingV1Activity.java | 5 +- .../google_maps_flutter/example/pubspec.yaml | 4 +- .../example/test_driver/google_maps_e2e.dart | 4 +- .../EmbeddingV1ActivityTest.java | 2 +- .../FlutterActivityTest.java | 2 +- .../example/pubspec.yaml | 4 +- .../google_sign_in/CHANGELOG.md | 4 + .../EmbeddingV1ActivityTest.java | 2 +- .../FlutterActivityTest.java | 2 +- .../google_sign_in/example/pubspec.yaml | 4 +- .../google_sign_in/pubspec.yaml | 6 +- .../test/google_sign_in_e2e.dart | 4 +- .../image_picker/image_picker/CHANGELOG.md | 4 + .../EmbeddingV1ActivityTest.java | 2 +- .../FlutterActivityTest.java | 2 +- .../image_picker/example/pubspec.yaml | 4 +- .../image_picker/image_picker/pubspec.yaml | 6 +- .../test/old_image_picker_e2e.dart | 4 +- packages/in_app_purchase/CHANGELOG.md | 4 + .../EmbeddingV1Activity.java | 5 +- .../EmbeddingV1ActivityTest.java | 2 +- .../FlutterActivityTest.java | 2 +- packages/in_app_purchase/example/pubspec.yaml | 4 +- packages/in_app_purchase/pubspec.yaml | 6 +- .../test/in_app_purchase_e2e.dart | 4 +- packages/{e2e => integration_test}/.gitignore | 0 packages/{e2e => integration_test}/.metadata | 0 .../{e2e => integration_test}/CHANGELOG.md | 6 +- packages/{e2e => integration_test}/LICENSE | 0 packages/integration_test/README.md | 192 ++++++++++++++++++ .../android/.gitignore | 0 .../android/build.gradle | 2 +- .../android/gradle.properties | 0 .../integration_test/android/settings.gradle | 1 + .../android/src/main/AndroidManifest.xml | 2 +- .../integration_test}/FlutterTestRunner.java | 4 +- .../IntegrationTestPlugin.java} | 12 +- .../example/.gitignore | 0 .../example/.metadata | 0 .../example/README.md | 0 .../example/android/app/build.gradle | 2 +- .../e2e_example/EmbedderV1ActivityTest.java | 4 +- .../e2e_example/FlutterActivityTest.java | 4 +- .../FlutterActivityWithPermissionTest.java | 8 +- .../android/app/src/debug/AndroidManifest.xml | 2 +- .../android/app/src/main/AndroidManifest.xml | 4 +- .../e2e_example/EmbedderV1Activity.java | 7 +- .../main/res/drawable/launch_background.xml | 0 .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin .../app/src/main/res/values/styles.xml | 0 .../app/src/profile/AndroidManifest.xml | 2 +- .../example/android/build.gradle | 0 .../example/android/gradle.properties | 0 .../gradle/wrapper/gradle-wrapper.properties | 0 .../example/android/settings.gradle | 0 .../ios/Flutter/AppFrameworkInfo.plist | 0 .../example/ios/Flutter/Debug.xcconfig | 0 .../example/ios/Flutter/Release.xcconfig | 0 .../ios/Runner.xcodeproj/project.pbxproj | 0 .../xcshareddata/xcschemes/Runner.xcscheme | 0 .../example/ios/Runner/AppDelegate.h | 0 .../example/ios/Runner/AppDelegate.m | 0 .../AppIcon.appiconset/Contents.json | 0 .../Icon-App-1024x1024@1x.png | Bin .../AppIcon.appiconset/Icon-App-20x20@1x.png | Bin .../AppIcon.appiconset/Icon-App-20x20@2x.png | Bin .../AppIcon.appiconset/Icon-App-20x20@3x.png | Bin .../AppIcon.appiconset/Icon-App-29x29@1x.png | Bin .../AppIcon.appiconset/Icon-App-29x29@2x.png | Bin .../AppIcon.appiconset/Icon-App-29x29@3x.png | Bin .../AppIcon.appiconset/Icon-App-40x40@1x.png | Bin .../AppIcon.appiconset/Icon-App-40x40@2x.png | Bin .../AppIcon.appiconset/Icon-App-40x40@3x.png | Bin .../AppIcon.appiconset/Icon-App-60x60@2x.png | Bin .../AppIcon.appiconset/Icon-App-60x60@3x.png | Bin .../AppIcon.appiconset/Icon-App-76x76@1x.png | Bin .../AppIcon.appiconset/Icon-App-76x76@2x.png | Bin .../Icon-App-83.5x83.5@2x.png | Bin .../LaunchImage.imageset/Contents.json | 0 .../LaunchImage.imageset/LaunchImage.png | Bin .../LaunchImage.imageset/LaunchImage@2x.png | Bin .../LaunchImage.imageset/LaunchImage@3x.png | Bin .../LaunchImage.imageset/README.md | 0 .../Runner/Base.lproj/LaunchScreen.storyboard | 0 .../ios/Runner/Base.lproj/Main.storyboard | 0 .../example/ios/Runner/Info.plist | 2 +- .../example/ios/Runner/main.m | 0 .../example/ios/RunnerTests/Info.plist | 0 .../example/ios/RunnerTests/RunnerTests.m | 4 + .../example/lib/main.dart | 0 .../example/lib/my_app.dart | 0 .../example/lib/my_web_app.dart | 0 .../macos/Flutter/Flutter-Debug.xcconfig | 0 .../macos/Flutter/Flutter-Release.xcconfig | 0 .../macos/Runner.xcodeproj/project.pbxproj | 6 +- .../xcshareddata/xcschemes/Runner.xcscheme | 8 +- .../contents.xcworkspacedata | 0 .../xcshareddata/IDEWorkspaceChecks.plist | 0 .../example/macos/Runner/AppDelegate.swift | 0 .../AppIcon.appiconset/Contents.json | 0 .../AppIcon.appiconset/app_icon_1024.png | Bin .../AppIcon.appiconset/app_icon_128.png | Bin .../AppIcon.appiconset/app_icon_16.png | Bin .../AppIcon.appiconset/app_icon_256.png | Bin .../AppIcon.appiconset/app_icon_32.png | Bin .../AppIcon.appiconset/app_icon_512.png | Bin .../AppIcon.appiconset/app_icon_64.png | Bin .../macos/Runner/Base.lproj/MainMenu.xib | 0 .../macos/Runner/Configs/AppInfo.xcconfig | 4 +- .../macos/Runner/Configs/Debug.xcconfig | 0 .../macos/Runner/Configs/Release.xcconfig | 0 .../macos/Runner/Configs/Warnings.xcconfig | 0 .../macos/Runner/DebugProfile.entitlements | 0 .../example/macos/Runner/Info.plist | 0 .../macos/Runner/MainFlutterWindow.swift | 0 .../example/macos/Runner/Release.entitlements | 0 .../example/pubspec.yaml | 10 +- .../test_driver/example_integration.dart} | 8 +- .../test_driver/example_integration_io.dart} | 6 +- .../test_driver/example_integration_test.dart | 5 + .../test_driver/example_integration_web.dart} | 6 +- .../example/test_driver/failure.dart | 8 +- .../example/test_driver/failure_test.dart | 2 +- .../example/web/favicon.png | Bin .../example/web/icons/Icon-192.png | Bin .../example/web/icons/Icon-512.png | Bin .../example/web/index.html | 0 .../example/web/manifest.json | 0 .../integration_test_macos}/CHANGELOG.md | 4 + .../integration_test_macos}/LICENSE | 0 .../ios/integration_test_macos.podspec} | 8 +- .../macos/Assets/.gitkeep | 0 .../Classes/IntegrationTestPlugin.swift} | 6 +- .../macos/integration_test_macos.podspec} | 8 +- .../integration_test_macos}/pubspec.yaml | 8 +- .../{e2e => integration_test}/ios/.gitignore | 0 .../ios/Assets/.gitkeep | 0 .../ios/Classes/IntegrationTestIosTest.h | 22 ++ .../ios/Classes/IntegrationTestIosTest.m} | 18 +- .../ios/Classes/IntegrationTestPlugin.h} | 10 +- .../ios/Classes/IntegrationTestPlugin.m} | 21 +- .../ios/integration_test.podspec} | 8 +- .../lib/_extension_io.dart | 0 .../lib/_extension_web.dart | 0 .../{e2e => integration_test}/lib/common.dart | 2 +- .../lib/integration_test.dart} | 22 +- .../lib/integration_test_driver.dart} | 25 +-- .../{e2e => integration_test}/pubspec.yaml | 12 +- .../test/binding_fail_test.dart | 23 ++- .../test/binding_test.dart | 25 +-- .../test/data/README.md | 0 .../test/data/fail_test_script.dart | 8 +- .../test/data/pass_test_script.dart | 8 +- .../test/data/pass_then_fail_test_script.dart | 8 +- .../test/response_serialization_test.dart | 2 +- packages/local_auth/CHANGELOG.md | 4 + .../localauth/EmbeddingV1ActivityTest.java | 2 +- .../plugins/localauth/MainActivityTest.java | 2 +- .../localauthexample/EmbeddingV1Activity.java | 5 +- packages/local_auth/example/pubspec.yaml | 4 +- packages/local_auth/pubspec.yaml | 6 +- packages/local_auth/test/local_auth_e2e.dart | 4 +- packages/package_info/CHANGELOG.md | 4 + .../EmbedderV1ActivityTest.java | 2 +- .../packageinfoexample/MainActivityTest.java | 2 +- packages/package_info/example/pubspec.yaml | 4 +- .../example/test_driver/package_info_e2e.dart | 4 +- packages/package_info/pubspec.yaml | 6 +- .../path_provider/path_provider/CHANGELOG.md | 4 + .../java/EmbeddingV1ActivityTest.java | 2 +- .../androidTest/java/MainActivityTest.java | 2 +- .../EmbeddingV1Activity.java | 5 +- .../path_provider/example/pubspec.yaml | 4 +- .../test_driver/path_provider_e2e.dart | 4 +- .../path_provider/path_provider/pubspec.yaml | 6 +- .../path_provider/test/path_provider_e2e.dart | 4 +- .../path_provider_linux/example/pubspec.yaml | 4 +- .../test_driver/path_provider_e2e.dart | 4 +- .../java/EmbeddingV1ActivityTest.java | 2 +- .../androidTest/java/MainActivityTest.java | 2 +- .../pathproviderexample/MainActivity.java | 4 +- .../path_provider_macos/example/pubspec.yaml | 4 +- .../test_driver/path_provider_e2e.dart | 4 +- packages/quick_actions/CHANGELOG.md | 4 + .../EmbeddingV1ActivityTest.java | 2 +- .../FlutterActivityTest.java | 2 +- packages/quick_actions/example/pubspec.yaml | 4 +- .../test_driver/quick_actions_e2e.dart | 4 +- packages/quick_actions/pubspec.yaml | 6 +- packages/sensors/CHANGELOG.md | 4 + .../sensorsexample/EmbeddingV1Activity.java | 5 +- .../EmbeddingV1ActivityTest.java | 2 +- .../sensorsexample/FlutterActivityTest.java | 2 +- packages/sensors/example/pubspec.yaml | 4 +- packages/sensors/pubspec.yaml | 6 +- packages/sensors/test/sensors_e2e.dart | 4 +- packages/share/CHANGELOG.md | 4 + .../shareexample/EmbeddingV1Activity.java | 5 +- .../shareexample/EmbeddingV1ActivityTest.java | 2 +- .../shareexample/FlutterActivityTest.java | 2 +- packages/share/example/pubspec.yaml | 4 +- packages/share/pubspec.yaml | 6 +- packages/share/test/share_e2e.dart | 4 +- .../shared_preferences/CHANGELOG.md | 4 + .../EmbeddingV1Activity.java | 5 +- .../EmbeddingV1ActivityTest.java | 2 +- .../FlutterActivityTest.java | 2 +- .../shared_preferences/example/pubspec.yaml | 4 +- .../test_driver/shared_preferences_e2e.dart | 4 +- .../shared_preferences/pubspec.yaml | 6 +- .../example/pubspec.yaml | 4 +- .../test_driver/shared_preferences_e2e.dart | 4 +- .../example/pubspec.yaml | 4 +- .../test_driver/shared_preferences_e2e.dart | 4 +- .../EmbeddingV1ActivityTest.java | 2 +- .../urllauncherexample/MainActivityTest.java | 2 +- .../EmbeddingV1Activity.java | 5 +- .../url_launcher/example/pubspec.yaml | 4 +- .../example/test_driver/url_launcher_e2e.dart | 4 +- .../url_launcher_linux/example/pubspec.yaml | 4 +- .../example/test_driver/url_launcher_e2e.dart | 4 +- .../EmbeddingV1ActivityTest.java | 2 +- .../FlutterActivityTest.java | 2 +- .../EmbeddingV1Activity.java | 5 +- .../url_launcher_macos/example/pubspec.yaml | 4 +- .../example/test_driver/url_launcher_e2e.dart | 4 +- .../EmbeddingV1Activity.java | 5 +- .../video_player/example/pubspec.yaml | 4 +- .../example/test_driver/video_player_e2e.dart | 4 +- .../EmbeddingV1ActivityTest.java | 2 +- .../MainActivityTest.java | 2 +- .../EmbeddingV1Activity.java | 5 +- packages/webview_flutter/example/pubspec.yaml | 4 +- .../test_driver/webview_flutter_e2e.dart | 4 +- 292 files changed, 727 insertions(+), 461 deletions(-) delete mode 100644 packages/e2e/android/settings.gradle delete mode 100644 packages/e2e/example/ios/RunnerTests/RunnerTests.m delete mode 100644 packages/e2e/example/macos/Flutter/GeneratedPluginRegistrant.swift delete mode 100644 packages/e2e/example/test_driver/example_e2e_test.dart delete mode 100644 packages/e2e/ios/Classes/E2EIosTest.h rename packages/{e2e => integration_test}/.gitignore (100%) rename packages/{e2e => integration_test}/.metadata (100%) rename packages/{e2e => integration_test}/CHANGELOG.md (97%) rename packages/{e2e => integration_test}/LICENSE (100%) create mode 100644 packages/integration_test/README.md rename packages/{e2e => integration_test}/android/.gitignore (100%) rename packages/{e2e => integration_test}/android/build.gradle (95%) rename packages/{e2e => integration_test}/android/gradle.properties (100%) create mode 100644 packages/integration_test/android/settings.gradle rename packages/{e2e => integration_test}/android/src/main/AndroidManifest.xml (65%) rename packages/{e2e/android/src/main/java/dev/flutter/plugins/e2e => integration_test/android/src/main/java/dev/flutter/plugins/integration_test}/FlutterTestRunner.java (96%) rename packages/{e2e/android/src/main/java/dev/flutter/plugins/e2e/E2EPlugin.java => integration_test/android/src/main/java/dev/flutter/plugins/integration_test/IntegrationTestPlugin.java} (85%) rename packages/{e2e => integration_test}/example/.gitignore (100%) rename packages/{e2e => integration_test}/example/.metadata (100%) rename packages/{e2e => integration_test}/example/README.md (100%) rename packages/{e2e => integration_test}/example/android/app/build.gradle (96%) rename packages/{e2e => integration_test}/example/android/app/src/androidTest/java/com/example/e2e_example/EmbedderV1ActivityTest.java (73%) rename packages/{e2e => integration_test}/example/android/app/src/androidTest/java/com/example/e2e_example/FlutterActivityTest.java (76%) rename packages/{e2e => integration_test}/example/android/app/src/androidTest/java/com/example/e2e_example/FlutterActivityWithPermissionTest.java (66%) rename packages/{e2e => integration_test}/example/android/app/src/debug/AndroidManifest.xml (84%) rename packages/{e2e => integration_test}/example/android/app/src/main/AndroidManifest.xml (94%) rename packages/{e2e => integration_test}/example/android/app/src/main/java/com/example/e2e_example/EmbedderV1Activity.java (62%) rename packages/{e2e => integration_test}/example/android/app/src/main/res/drawable/launch_background.xml (100%) rename packages/{e2e => integration_test}/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png (100%) rename packages/{e2e => integration_test}/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png (100%) rename packages/{e2e => integration_test}/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png (100%) rename packages/{e2e => integration_test}/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png (100%) rename packages/{e2e => integration_test}/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png (100%) rename packages/{e2e => integration_test}/example/android/app/src/main/res/values/styles.xml (100%) rename packages/{e2e => integration_test}/example/android/app/src/profile/AndroidManifest.xml (84%) rename packages/{e2e => integration_test}/example/android/build.gradle (100%) rename packages/{e2e => integration_test}/example/android/gradle.properties (100%) rename packages/{e2e => integration_test}/example/android/gradle/wrapper/gradle-wrapper.properties (100%) rename packages/{e2e => integration_test}/example/android/settings.gradle (100%) rename packages/{e2e => integration_test}/example/ios/Flutter/AppFrameworkInfo.plist (100%) rename packages/{e2e => integration_test}/example/ios/Flutter/Debug.xcconfig (100%) rename packages/{e2e => integration_test}/example/ios/Flutter/Release.xcconfig (100%) rename packages/{e2e => integration_test}/example/ios/Runner.xcodeproj/project.pbxproj (100%) rename packages/{e2e => integration_test}/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme (100%) rename packages/{e2e => integration_test}/example/ios/Runner/AppDelegate.h (100%) rename packages/{e2e => integration_test}/example/ios/Runner/AppDelegate.m (100%) rename packages/{e2e => integration_test}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json (100%) rename packages/{e2e => integration_test}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png (100%) rename packages/{e2e => integration_test}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png (100%) rename packages/{e2e => integration_test}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png (100%) rename packages/{e2e => integration_test}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png (100%) rename packages/{e2e => integration_test}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png (100%) rename packages/{e2e => integration_test}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png (100%) rename packages/{e2e => integration_test}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png (100%) rename packages/{e2e => integration_test}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png (100%) rename packages/{e2e => integration_test}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png (100%) rename packages/{e2e => integration_test}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png (100%) rename packages/{e2e => integration_test}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png (100%) rename packages/{e2e => integration_test}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png (100%) rename packages/{e2e => integration_test}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png (100%) rename packages/{e2e => integration_test}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png (100%) rename packages/{e2e => integration_test}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png (100%) rename packages/{e2e => integration_test}/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json (100%) rename packages/{e2e => integration_test}/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png (100%) rename packages/{e2e => integration_test}/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png (100%) rename packages/{e2e => integration_test}/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png (100%) rename packages/{e2e => integration_test}/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md (100%) rename packages/{e2e => integration_test}/example/ios/Runner/Base.lproj/LaunchScreen.storyboard (100%) rename packages/{e2e => integration_test}/example/ios/Runner/Base.lproj/Main.storyboard (100%) rename packages/{e2e => integration_test}/example/ios/Runner/Info.plist (97%) rename packages/{e2e => integration_test}/example/ios/Runner/main.m (100%) rename packages/{e2e => integration_test}/example/ios/RunnerTests/Info.plist (100%) create mode 100644 packages/integration_test/example/ios/RunnerTests/RunnerTests.m rename packages/{e2e => integration_test}/example/lib/main.dart (100%) rename packages/{e2e => integration_test}/example/lib/my_app.dart (100%) rename packages/{e2e => integration_test}/example/lib/my_web_app.dart (100%) rename packages/{e2e => integration_test}/example/macos/Flutter/Flutter-Debug.xcconfig (100%) rename packages/{e2e => integration_test}/example/macos/Flutter/Flutter-Release.xcconfig (100%) rename packages/{e2e => integration_test}/example/macos/Runner.xcodeproj/project.pbxproj (98%) rename packages/{e2e => integration_test}/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme (93%) rename packages/{e2e => integration_test}/example/macos/Runner.xcworkspace/contents.xcworkspacedata (100%) rename packages/{e2e => integration_test}/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist (100%) rename packages/{e2e => integration_test}/example/macos/Runner/AppDelegate.swift (100%) rename packages/{e2e => integration_test}/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json (100%) rename packages/{e2e => integration_test}/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png (100%) rename packages/{e2e => integration_test}/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png (100%) rename packages/{e2e => integration_test}/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png (100%) rename packages/{e2e => integration_test}/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png (100%) rename packages/{e2e => integration_test}/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png (100%) rename packages/{e2e => integration_test}/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png (100%) rename packages/{e2e => integration_test}/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png (100%) rename packages/{e2e => integration_test}/example/macos/Runner/Base.lproj/MainMenu.xib (100%) rename packages/{e2e => integration_test}/example/macos/Runner/Configs/AppInfo.xcconfig (83%) rename packages/{e2e => integration_test}/example/macos/Runner/Configs/Debug.xcconfig (100%) rename packages/{e2e => integration_test}/example/macos/Runner/Configs/Release.xcconfig (100%) rename packages/{e2e => integration_test}/example/macos/Runner/Configs/Warnings.xcconfig (100%) rename packages/{e2e => integration_test}/example/macos/Runner/DebugProfile.entitlements (100%) rename packages/{e2e => integration_test}/example/macos/Runner/Info.plist (100%) rename packages/{e2e => integration_test}/example/macos/Runner/MainFlutterWindow.swift (100%) rename packages/{e2e => integration_test}/example/macos/Runner/Release.entitlements (100%) rename packages/{e2e => integration_test}/example/pubspec.yaml (71%) rename packages/{e2e/example/test_driver/example_e2e.dart => integration_test/example/test_driver/example_integration.dart} (63%) rename packages/{e2e/example/test_driver/example_e2e_io.dart => integration_test/example/test_driver/example_integration_io.dart} (84%) create mode 100644 packages/integration_test/example/test_driver/example_integration_test.dart rename packages/{e2e/example/test_driver/example_e2e_web.dart => integration_test/example/test_driver/example_integration_web.dart} (84%) rename packages/{e2e => integration_test}/example/test_driver/failure.dart (79%) rename packages/{e2e => integration_test}/example/test_driver/failure_test.dart (89%) rename packages/{e2e => integration_test}/example/web/favicon.png (100%) rename packages/{e2e => integration_test}/example/web/icons/Icon-192.png (100%) rename packages/{e2e => integration_test}/example/web/icons/Icon-512.png (100%) rename packages/{e2e => integration_test}/example/web/index.html (100%) rename packages/{e2e => integration_test}/example/web/manifest.json (100%) rename packages/{e2e/e2e_macos => integration_test/integration_test_macos}/CHANGELOG.md (59%) rename packages/{e2e/e2e_macos => integration_test/integration_test_macos}/LICENSE (100%) rename packages/{e2e/e2e_macos/ios/e2e_macos.podspec => integration_test/integration_test_macos/ios/integration_test_macos.podspec} (68%) rename packages/{e2e/e2e_macos => integration_test/integration_test_macos}/macos/Assets/.gitkeep (100%) rename packages/{e2e/e2e_macos/macos/Classes/E2EPlugin.swift => integration_test/integration_test_macos/macos/Classes/IntegrationTestPlugin.swift} (75%) rename packages/{e2e/e2e_macos/macos/e2e_macos.podspec => integration_test/integration_test_macos/macos/integration_test_macos.podspec} (77%) rename packages/{e2e/e2e_macos => integration_test/integration_test_macos}/pubspec.yaml (62%) rename packages/{e2e => integration_test}/ios/.gitignore (100%) rename packages/{e2e => integration_test}/ios/Assets/.gitkeep (100%) create mode 100644 packages/integration_test/ios/Classes/IntegrationTestIosTest.h rename packages/{e2e/ios/Classes/E2EIosTest.m => integration_test/ios/Classes/IntegrationTestIosTest.m} (69%) rename packages/{e2e/ios/Classes/E2EPlugin.h => integration_test/ios/Classes/IntegrationTestPlugin.h} (63%) rename packages/{e2e/ios/Classes/E2EPlugin.m => integration_test/ios/Classes/IntegrationTestPlugin.m} (65%) rename packages/{e2e/ios/e2e.podspec => integration_test/ios/integration_test.podspec} (81%) rename packages/{e2e => integration_test}/lib/_extension_io.dart (100%) rename packages/{e2e => integration_test}/lib/_extension_web.dart (100%) rename packages/{e2e => integration_test}/lib/common.dart (97%) rename packages/{e2e/lib/e2e.dart => integration_test/lib/integration_test.dart} (88%) rename packages/{e2e/lib/e2e_driver.dart => integration_test/lib/integration_test_driver.dart} (77%) rename packages/{e2e => integration_test}/pubspec.yaml (69%) rename packages/{e2e => integration_test}/test/binding_fail_test.dart (73%) rename packages/{e2e => integration_test}/test/binding_test.dart (70%) rename packages/{e2e => integration_test}/test/data/README.md (100%) rename packages/{e2e => integration_test}/test/data/fail_test_script.dart (54%) rename packages/{e2e => integration_test}/test/data/pass_test_script.dart (54%) rename packages/{e2e => integration_test}/test/data/pass_then_fail_test_script.dart (53%) rename packages/{e2e => integration_test}/test/response_serialization_test.dart (97%) diff --git a/.cirrus.yml b/.cirrus.yml index 915f9f80a6a6..8c8cc624d1ee 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -7,7 +7,7 @@ task: cpu: 8 memory: 16G env: - E2E_PATH: "./packages/e2e" + INTEGRATION_TEST_PATH: "./packages/integration_test" upgrade_script: - flutter channel stable - flutter upgrade @@ -47,9 +47,9 @@ task: - if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi - flutter channel $CHANNEL - ./script/build_all_plugins_app.sh apk - - name: e2e_web_smoke_test - # Tests e2e example test in web. - only_if: "changesInclude('.cirrus.yml', 'packages/e2e/**') || $CIRRUS_PR == ''" + - name: integration_web_smoke_test + # Tests integration example test in web. + only_if: "changesInclude('.cirrus.yml', 'packages/integration_test/**') || $CIRRUS_PR == ''" install_script: - flutter config --enable-web - git clone https://github.com/flutter/web_installers.git @@ -58,8 +58,8 @@ task: - dart lib/web_driver_installer.dart chromedriver --install-only - ./chromedriver/chromedriver --port=4444 & test_script: - - cd $E2E_PATH/example/ - - flutter drive -v --target=test_driver/example_e2e.dart -d web-server --release --browser-name=chrome + - cd $INTEGRATION_TEST_PATH/example/ + - flutter drive -v --target=test_driver/example_integration.dart -d web-server --release --browser-name=chrome - name: build-apks+java-test+firebase-test-lab env: matrix: @@ -107,7 +107,7 @@ task: cpu: 8 memory: 16G env: - E2E_PATH: "./packages/e2e" + INTEGRATION_TEST_PATH: "./packages/integration_test" upgrade_script: - flutter channel stable - flutter upgrade diff --git a/CODEOWNERS b/CODEOWNERS index f69d354cbcda..97f8bf388697 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -10,11 +10,11 @@ packages/battery/* @amirh @matthew-carroll packages/camera/* @bparrishMines packages/connectivity/* @cyanglaz @matthew-carroll packages/device_info/* @matthew-carroll -packages/e2e/* @collinjackson @dnfield packages/espresso/* @collinjackson @adazh packages/google_maps_flutter/* @cyanglaz packages/google_sign_in/* @cyanglaz @mehmetf packages/image_picker/* @cyanglaz +packages/integration_test/* @dnfield packages/in_app_purchase/* @mklim @cyanglaz @LHLL packages/ios_platform_images/* @gaaclarke packages/package_info/* @cyanglaz @matthew-carroll diff --git a/README.md b/README.md index 026dd9d7739b..b2015a705e79 100644 --- a/README.md +++ b/README.md @@ -44,12 +44,13 @@ These are the available plugins in this repository. | [camera](./packages/camera/) | [![pub package](https://img.shields.io/pub/v/camera.svg)](https://pub.dev/packages/camera) | | [connectivity](./packages/connectivity/) | [![pub package](https://img.shields.io/pub/v/connectivity.svg)](https://pub.dev/packages/connectivity) | | [device_info](./packages/device_info/) | [![pub package](https://img.shields.io/pub/v/device_info.svg)](https://pub.dev/packages/device_info) | -| [e2e](./packages/e2e/) | [![pub package](https://img.shields.io/pub/v/e2e.svg)](https://pub.dev/packages/e2e) | +| [e2e (Discontinued, use integration_test)](./packages/e2e/) | [![pub package](https://img.shields.io/pub/v/e2e.svg)](https://pub.dev/packages/e2e) | | [espresso](./packages/espresso/) | [![pub package](https://img.shields.io/pub/v/espresso.svg)](https://pub.dev/packages/espresso) | | [flutter_plugin_android_lifecycle](./packages/flutter_plugin_android_lifecycle/) | [![pub package](https://img.shields.io/pub/v/flutter_plugin_android_lifecycle.svg)](https://pub.dev/packages/flutter_plugin_android_lifecycle) | | [google_maps_flutter](./packages/google_maps_flutter) | [![pub package](https://img.shields.io/pub/v/google_maps_flutter.svg)](https://pub.dev/packages/google_maps_flutter) | | [google_sign_in](./packages/google_sign_in/) | [![pub package](https://img.shields.io/pub/v/google_sign_in.svg)](https://pub.dev/packages/google_sign_in) | | [image_picker](./packages/image_picker/) | [![pub package](https://img.shields.io/pub/v/image_picker.svg)](https://pub.dev/packages/image_picker) | +| [integration_test](./packages/integration_test/) | [![pub package](https://img.shields.io/pub/v/integration_test.svg)](https://pub.dev/packages/integration_test) | | [in_app_purchase](./packages/in_app_purchase/) | [![pub package](https://img.shields.io/pub/v/in_app_purchase.svg)](https://pub.dev/packages/in_app_purchase) | | [ios_platform_images](./packages/ios_platform_images/) | [![pub package](https://img.shields.io/pub/v/ios_platform_images.svg)](https://pub.dev/packages/ios_platform_images) | | [local_auth](./packages/local_auth/) | [![pub package](https://img.shields.io/pub/v/local_auth.svg)](https://pub.dev/packages/local_auth) | diff --git a/packages/android_alarm_manager/example/android/app/src/androidTest/java/io/plugins/androidalarmmanager/MainActivityTest.java b/packages/android_alarm_manager/example/android/app/src/androidTest/java/io/plugins/androidalarmmanager/MainActivityTest.java index 04aef18888a9..373e770697d5 100644 --- a/packages/android_alarm_manager/example/android/app/src/androidTest/java/io/plugins/androidalarmmanager/MainActivityTest.java +++ b/packages/android_alarm_manager/example/android/app/src/androidTest/java/io/plugins/androidalarmmanager/MainActivityTest.java @@ -5,7 +5,7 @@ package io.flutter.plugins.androidalarmmanagerexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/android_alarm_manager/example/pubspec.yaml b/packages/android_alarm_manager/example/pubspec.yaml index c4d698bdde14..93cbc57d8de5 100644 --- a/packages/android_alarm_manager/example/pubspec.yaml +++ b/packages/android_alarm_manager/example/pubspec.yaml @@ -7,8 +7,8 @@ dependencies: android_alarm_manager: path: ../ shared_preferences: ^0.5.6 - e2e: - path: ../../e2e + integration_test: + path: ../../integration_test path_provider: ^1.3.1 dev_dependencies: diff --git a/packages/android_alarm_manager/example/test_driver/android_alarm_manager_e2e.dart b/packages/android_alarm_manager/example/test_driver/android_alarm_manager_e2e.dart index a5bc1ac0ba48..4d2e3201eecf 100644 --- a/packages/android_alarm_manager/example/test_driver/android_alarm_manager_e2e.dart +++ b/packages/android_alarm_manager/example/test_driver/android_alarm_manager_e2e.dart @@ -6,7 +6,7 @@ import 'dart:async'; import 'dart:io'; import 'package:android_alarm_manager_example/main.dart' as app; import 'package:android_alarm_manager/android_alarm_manager.dart'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_driver/driver_extension.dart'; import 'package:path_provider/path_provider.dart'; @@ -55,7 +55,7 @@ void appMain() { } void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); setUp(() async { await AndroidAlarmManager.initialize(); diff --git a/packages/android_intent/example/android/app/src/androidTestDebug/java/io/flutter/plugins/androidintentexample/EmbeddingV1ActivityTest.java b/packages/android_intent/example/android/app/src/androidTestDebug/java/io/flutter/plugins/androidintentexample/EmbeddingV1ActivityTest.java index f239ae88e5d1..7ab0e87e7c5a 100644 --- a/packages/android_intent/example/android/app/src/androidTestDebug/java/io/flutter/plugins/androidintentexample/EmbeddingV1ActivityTest.java +++ b/packages/android_intent/example/android/app/src/androidTestDebug/java/io/flutter/plugins/androidintentexample/EmbeddingV1ActivityTest.java @@ -1,7 +1,7 @@ package io.flutter.plugins.androidintentexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/android_intent/example/android/app/src/androidTestDebug/java/io/flutter/plugins/androidintentexample/MainActivityTest.java b/packages/android_intent/example/android/app/src/androidTestDebug/java/io/flutter/plugins/androidintentexample/MainActivityTest.java index 5352e447ee3e..619dbcd853e7 100644 --- a/packages/android_intent/example/android/app/src/androidTestDebug/java/io/flutter/plugins/androidintentexample/MainActivityTest.java +++ b/packages/android_intent/example/android/app/src/androidTestDebug/java/io/flutter/plugins/androidintentexample/MainActivityTest.java @@ -1,7 +1,7 @@ package io.flutter.plugins.androidintentexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/android_intent/example/pubspec.yaml b/packages/android_intent/example/pubspec.yaml index 325a4c54ee5f..31d434e8c038 100644 --- a/packages/android_intent/example/pubspec.yaml +++ b/packages/android_intent/example/pubspec.yaml @@ -8,8 +8,8 @@ dependencies: path: ../ dev_dependencies: - e2e: - path: ../../e2e + integration_test: + path: ../../integration_test flutter_driver: sdk: flutter pedantic: ^1.8.0 diff --git a/packages/android_intent/example/test_driver/android_intent_e2e.dart b/packages/android_intent/example/test_driver/android_intent_e2e.dart index 880e7efee76c..78a667b27a09 100644 --- a/packages/android_intent/example/test_driver/android_intent_e2e.dart +++ b/packages/android_intent/example/test_driver/android_intent_e2e.dart @@ -2,7 +2,7 @@ import 'dart:io'; import 'package:android_intent/android_intent.dart'; import 'package:android_intent_example/main.dart'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -12,7 +12,7 @@ import 'package:flutter_test/flutter_test.dart'; /// possible to meaningfully test it through its Dart interface currently. There /// are more useful unit tests for the platform logic under android/src/test/. void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('Embedding example app loads', (WidgetTester tester) async { // Build our app and trigger a frame. await tester.pumpWidget(MyApp()); diff --git a/packages/battery/CHANGELOG.md b/packages/battery/CHANGELOG.md index 7b948981d3f0..c47879ce0419 100644 --- a/packages/battery/CHANGELOG.md +++ b/packages/battery/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.0.3 + +* Update package:e2e to use package:integration_test + + ## 1.0.2 * Update package:e2e reference to use the local version in the flutter/plugins diff --git a/packages/battery/example/android/app/src/androidTest/java/io/flutter/plugins/battery/EmbedderV1ActivityTest.java b/packages/battery/example/android/app/src/androidTest/java/io/flutter/plugins/battery/EmbedderV1ActivityTest.java index 40fedbb889ba..1bd860eb147c 100644 --- a/packages/battery/example/android/app/src/androidTest/java/io/flutter/plugins/battery/EmbedderV1ActivityTest.java +++ b/packages/battery/example/android/app/src/androidTest/java/io/flutter/plugins/battery/EmbedderV1ActivityTest.java @@ -5,7 +5,7 @@ package io.flutter.plugins.batteryexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/battery/example/android/app/src/androidTest/java/io/flutter/plugins/battery/FlutterActivityTest.java b/packages/battery/example/android/app/src/androidTest/java/io/flutter/plugins/battery/FlutterActivityTest.java index 88aade36d064..636c716d7a91 100644 --- a/packages/battery/example/android/app/src/androidTest/java/io/flutter/plugins/battery/FlutterActivityTest.java +++ b/packages/battery/example/android/app/src/androidTest/java/io/flutter/plugins/battery/FlutterActivityTest.java @@ -5,7 +5,7 @@ package io.flutter.plugins.batteryexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/battery/example/android/app/src/main/java/io/flutter/plugins/batteryexample/EmbedderV1Activity.java b/packages/battery/example/android/app/src/main/java/io/flutter/plugins/batteryexample/EmbedderV1Activity.java index 7ccc9c1e2fd3..5fa885cdd9d8 100644 --- a/packages/battery/example/android/app/src/main/java/io/flutter/plugins/batteryexample/EmbedderV1Activity.java +++ b/packages/battery/example/android/app/src/main/java/io/flutter/plugins/batteryexample/EmbedderV1Activity.java @@ -5,7 +5,7 @@ package io.flutter.plugins.batteryexample; import android.os.Bundle; -import dev.flutter.plugins.e2e.E2EPlugin; +import dev.flutter.plugins.integration_test.IntegrationTestPlugin; import io.flutter.app.FlutterActivity; import io.flutter.plugins.battery.BatteryPlugin; @@ -14,6 +14,7 @@ public class EmbedderV1Activity extends FlutterActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); BatteryPlugin.registerWith(registrarFor("io.flutter.plugins.battery.BatteryPlugin")); - E2EPlugin.registerWith(registrarFor("dev.flutter.plugins.e2e.E2EPlugin")); + IntegrationTestPlugin.registerWith( + registrarFor("dev.flutter.plugins.integration_test.IntegrationTestPlugin")); } } diff --git a/packages/battery/example/pubspec.yaml b/packages/battery/example/pubspec.yaml index d0ef82ea071a..5ec38f6ce5c2 100644 --- a/packages/battery/example/pubspec.yaml +++ b/packages/battery/example/pubspec.yaml @@ -10,8 +10,8 @@ dependencies: dev_dependencies: flutter_driver: sdk: flutter - e2e: - path: ../../e2e + integration_test: + path: ../../integration_test pedantic: ^1.8.0 flutter: diff --git a/packages/battery/pubspec.yaml b/packages/battery/pubspec.yaml index 487ee5b800ac..7a02f37bab85 100644 --- a/packages/battery/pubspec.yaml +++ b/packages/battery/pubspec.yaml @@ -2,7 +2,7 @@ name: battery description: Flutter plugin for accessing information about the battery state (full, charging, discharging) on Android and iOS. homepage: https://github.com/flutter/plugins/tree/master/packages/battery -version: 1.0.2 +version: 1.0.3 flutter: plugin: @@ -24,8 +24,8 @@ dev_dependencies: mockito: 3.0.0 flutter_test: sdk: flutter - e2e: - path: ../e2e + integration_test: + path: ../integration_test pedantic: ^1.8.0 environment: diff --git a/packages/battery/test/battery_e2e.dart b/packages/battery/test/battery_e2e.dart index 6ffc7e6541fb..ed7b6fe5a0e4 100644 --- a/packages/battery/test/battery_e2e.dart +++ b/packages/battery/test/battery_e2e.dart @@ -4,10 +4,10 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:battery/battery.dart'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('Can get battery level', (WidgetTester tester) async { final Battery battery = Battery(); diff --git a/packages/camera/example/android/app/src/androidTestDebug/java/io/flutter/plugins/cameraexample/EmbeddingV1ActivityTest.java b/packages/camera/example/android/app/src/androidTestDebug/java/io/flutter/plugins/cameraexample/EmbeddingV1ActivityTest.java index fd947a03f1b0..3149191b478d 100644 --- a/packages/camera/example/android/app/src/androidTestDebug/java/io/flutter/plugins/cameraexample/EmbeddingV1ActivityTest.java +++ b/packages/camera/example/android/app/src/androidTestDebug/java/io/flutter/plugins/cameraexample/EmbeddingV1ActivityTest.java @@ -1,7 +1,7 @@ package io.flutter.plugins.cameraexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/camera/example/android/app/src/androidTestDebug/java/io/flutter/plugins/cameraexample/FlutterActivityTest.java b/packages/camera/example/android/app/src/androidTestDebug/java/io/flutter/plugins/cameraexample/FlutterActivityTest.java index e5eff70941fd..c90c66defc32 100644 --- a/packages/camera/example/android/app/src/androidTestDebug/java/io/flutter/plugins/cameraexample/FlutterActivityTest.java +++ b/packages/camera/example/android/app/src/androidTestDebug/java/io/flutter/plugins/cameraexample/FlutterActivityTest.java @@ -1,7 +1,7 @@ package io.flutter.plugins.cameraexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/camera/example/android/app/src/main/java/io/flutter/plugins/cameraexample/EmbeddingV1Activity.java b/packages/camera/example/android/app/src/main/java/io/flutter/plugins/cameraexample/EmbeddingV1Activity.java index 76f47c500bcf..c0ef7d891bfc 100644 --- a/packages/camera/example/android/app/src/main/java/io/flutter/plugins/cameraexample/EmbeddingV1Activity.java +++ b/packages/camera/example/android/app/src/main/java/io/flutter/plugins/cameraexample/EmbeddingV1Activity.java @@ -1,7 +1,7 @@ package io.flutter.plugins.cameraexample; import android.os.Bundle; -import dev.flutter.plugins.e2e.E2EPlugin; +import dev.flutter.plugins.integration_test.IntegrationTestPlugin; import io.flutter.app.FlutterActivity; import io.flutter.plugins.camera.CameraPlugin; import io.flutter.plugins.pathprovider.PathProviderPlugin; @@ -12,7 +12,8 @@ public class EmbeddingV1Activity extends FlutterActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); CameraPlugin.registerWith(registrarFor("io.flutter.plugins.camera.CameraPlugin")); - E2EPlugin.registerWith(registrarFor("dev.flutter.plugins.e2e.E2EPlugin")); + IntegrationTestPlugin.registerWith( + registrarFor("dev.flutter.plugins.integration_test.IntegrationTestPlugin")); PathProviderPlugin.registerWith( registrarFor("io.flutter.plugins.pathprovider.PathProviderPlugin")); VideoPlayerPlugin.registerWith( diff --git a/packages/camera/example/pubspec.yaml b/packages/camera/example/pubspec.yaml index cbd0adc8a61c..bc33087a5877 100644 --- a/packages/camera/example/pubspec.yaml +++ b/packages/camera/example/pubspec.yaml @@ -8,8 +8,8 @@ dependencies: flutter: sdk: flutter video_player: ^0.10.0 - e2e: - path: ../../e2e + integration_test: + path: ../../integration_test dev_dependencies: flutter_test: diff --git a/packages/camera/example/test_driver/camera_e2e.dart b/packages/camera/example/test_driver/camera_e2e.dart index a1cc8ad9ca02..ef4646f5ced9 100644 --- a/packages/camera/example/test_driver/camera_e2e.dart +++ b/packages/camera/example/test_driver/camera_e2e.dart @@ -7,12 +7,12 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:camera/camera.dart'; import 'package:path_provider/path_provider.dart'; import 'package:video_player/video_player.dart'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; void main() { Directory testDir; - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); setUpAll(() async { final Directory extDir = await getTemporaryDirectory(); diff --git a/packages/connectivity/connectivity/CHANGELOG.md b/packages/connectivity/connectivity/CHANGELOG.md index 9cecf8cd1489..27a1bb100e74 100644 --- a/packages/connectivity/connectivity/CHANGELOG.md +++ b/packages/connectivity/connectivity/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.4.9+2 + +* Update package:e2e to use package:integration_test + ## 0.4.9+1 * Update package:e2e reference to use the local version in the flutter/plugins diff --git a/packages/connectivity/connectivity/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/EmbeddingV1ActivityTest.java b/packages/connectivity/connectivity/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/EmbeddingV1ActivityTest.java index edd544d5f6ea..048da070991e 100644 --- a/packages/connectivity/connectivity/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/EmbeddingV1ActivityTest.java +++ b/packages/connectivity/connectivity/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/EmbeddingV1ActivityTest.java @@ -5,7 +5,7 @@ package io.flutter.plugins.connectivityexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/connectivity/connectivity/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/FlutterActivityTest.java b/packages/connectivity/connectivity/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/FlutterActivityTest.java index 0b0ee94c77b9..0f0dcf2555f3 100644 --- a/packages/connectivity/connectivity/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/FlutterActivityTest.java +++ b/packages/connectivity/connectivity/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/FlutterActivityTest.java @@ -5,7 +5,7 @@ package io.flutter.plugins.connectivityexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/connectivity/connectivity/example/pubspec.yaml b/packages/connectivity/connectivity/example/pubspec.yaml index fb8ba621af2a..1d07f7d19e60 100644 --- a/packages/connectivity/connectivity/example/pubspec.yaml +++ b/packages/connectivity/connectivity/example/pubspec.yaml @@ -11,8 +11,8 @@ dev_dependencies: flutter_driver: sdk: flutter test: any - e2e: - path: ../../../e2e + integration_test: + path: ../../../integration_test pedantic: ^1.8.0 flutter: diff --git a/packages/connectivity/connectivity/example/test_driver/test/connectivity_e2e.dart b/packages/connectivity/connectivity/example/test_driver/test/connectivity_e2e.dart index 10c4bda34e0d..54a67337285a 100644 --- a/packages/connectivity/connectivity/example/test_driver/test/connectivity_e2e.dart +++ b/packages/connectivity/connectivity/example/test_driver/test/connectivity_e2e.dart @@ -3,12 +3,12 @@ // found in the LICENSE file. import 'dart:io'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:connectivity/connectivity.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); group('Connectivity test driver', () { Connectivity _connectivity; diff --git a/packages/connectivity/connectivity/pubspec.yaml b/packages/connectivity/connectivity/pubspec.yaml index cfe47792ff18..dc9d90827169 100644 --- a/packages/connectivity/connectivity/pubspec.yaml +++ b/packages/connectivity/connectivity/pubspec.yaml @@ -5,7 +5,7 @@ homepage: https://github.com/flutter/plugins/tree/master/packages/connectivity/c # 0.4.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.4.9+1 +version: 0.4.9+2 flutter: plugin: @@ -34,8 +34,8 @@ dev_dependencies: flutter_driver: sdk: flutter test: any - e2e: - path: ../../e2e + integration_test: + path: ../../integration_test mockito: ^4.1.1 plugin_platform_interface: ^1.0.0 pedantic: ^1.8.0 diff --git a/packages/connectivity/connectivity/test/connectivity_e2e.dart b/packages/connectivity/connectivity/test/connectivity_e2e.dart index 10c4bda34e0d..54a67337285a 100644 --- a/packages/connectivity/connectivity/test/connectivity_e2e.dart +++ b/packages/connectivity/connectivity/test/connectivity_e2e.dart @@ -3,12 +3,12 @@ // found in the LICENSE file. import 'dart:io'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:connectivity/connectivity.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); group('Connectivity test driver', () { Connectivity _connectivity; diff --git a/packages/connectivity/connectivity_for_web/CHANGELOG.md b/packages/connectivity/connectivity_for_web/CHANGELOG.md index 906b0fce2d9d..4c10ee64e855 100644 --- a/packages/connectivity/connectivity_for_web/CHANGELOG.md +++ b/packages/connectivity/connectivity_for_web/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.3.1+2 + +* Update package:e2e to use package:integration_test + ## 0.3.1+1 * Update package:e2e reference to use the local version in the flutter/plugins diff --git a/packages/connectivity/connectivity_for_web/pubspec.yaml b/packages/connectivity/connectivity_for_web/pubspec.yaml index acb31c3e385b..adba1f4f9a47 100644 --- a/packages/connectivity/connectivity_for_web/pubspec.yaml +++ b/packages/connectivity/connectivity_for_web/pubspec.yaml @@ -1,6 +1,6 @@ name: connectivity_for_web description: An implementation for the web platform of the Flutter `connectivity` plugin. This uses the NetworkInformation Web API, with a fallback to Navigator.onLine. -version: 0.3.1+1 +version: 0.3.1+2 homepage: https://github.com/ditman/plugins/tree/connectivity-web/packages/connectivity/experimental_connectivity_web flutter: @@ -23,8 +23,8 @@ dev_dependencies: sdk: flutter flutter_test: sdk: flutter - e2e: - path: ../../e2e + integration_test: + path: ../../integration_test mockito: ^4.1.1 environment: diff --git a/packages/connectivity/connectivity_for_web/test/lib/main.dart b/packages/connectivity/connectivity_for_web/test/lib/main.dart index 93b9a73cf31b..e3473532553e 100644 --- a/packages/connectivity/connectivity_for_web/test/lib/main.dart +++ b/packages/connectivity/connectivity_for_web/test/lib/main.dart @@ -1,4 +1,4 @@ -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:connectivity_platform_interface/connectivity_platform_interface.dart'; import 'package:connectivity_for_web/src/network_information_api_connectivity_plugin.dart'; @@ -8,7 +8,7 @@ import 'package:mockito/mockito.dart'; import 'src/connectivity_mocks.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); group('checkConnectivity', () { void testCheckConnectivity({ diff --git a/packages/connectivity/connectivity_for_web/test/pubspec.yaml b/packages/connectivity/connectivity_for_web/test/pubspec.yaml index 7c423f39a9b9..512b7df8c26e 100644 --- a/packages/connectivity/connectivity_for_web/test/pubspec.yaml +++ b/packages/connectivity/connectivity_for_web/test/pubspec.yaml @@ -1,6 +1,5 @@ name: connectivity_web_example description: Example web app for the connectivity plugin -version: 0.1.1+1 homepage: https://github.com/flutter/plugins/tree/master/packages/connectivity/connectivity_web dependencies: @@ -17,8 +16,8 @@ dev_dependencies: sdk: flutter flutter_driver: sdk: flutter - e2e: - path: ../../../e2e + integration_test: + path: ../../../integration_test mockito: ^4.1.1 environment: diff --git a/packages/connectivity/connectivity_macos/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/EmbeddingV1ActivityTest.java b/packages/connectivity/connectivity_macos/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/EmbeddingV1ActivityTest.java index edd544d5f6ea..048da070991e 100644 --- a/packages/connectivity/connectivity_macos/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/EmbeddingV1ActivityTest.java +++ b/packages/connectivity/connectivity_macos/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/EmbeddingV1ActivityTest.java @@ -5,7 +5,7 @@ package io.flutter.plugins.connectivityexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/connectivity/connectivity_macos/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/FlutterActivityTest.java b/packages/connectivity/connectivity_macos/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/FlutterActivityTest.java index 0b0ee94c77b9..0f0dcf2555f3 100644 --- a/packages/connectivity/connectivity_macos/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/FlutterActivityTest.java +++ b/packages/connectivity/connectivity_macos/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/FlutterActivityTest.java @@ -5,7 +5,7 @@ package io.flutter.plugins.connectivityexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/connectivity/connectivity_macos/example/pubspec.yaml b/packages/connectivity/connectivity_macos/example/pubspec.yaml index fd18be002bef..7faf3e2f67e7 100644 --- a/packages/connectivity/connectivity_macos/example/pubspec.yaml +++ b/packages/connectivity/connectivity_macos/example/pubspec.yaml @@ -12,8 +12,8 @@ dev_dependencies: flutter_driver: sdk: flutter test: any - e2e: - path: ../../../e2e + integration_test: + path: ../../../integration_test pedantic: ^1.8.0 flutter: diff --git a/packages/connectivity/connectivity_macos/example/test_driver/test/connectivity_e2e.dart b/packages/connectivity/connectivity_macos/example/test_driver/test/connectivity_e2e.dart index 10c4bda34e0d..54a67337285a 100644 --- a/packages/connectivity/connectivity_macos/example/test_driver/test/connectivity_e2e.dart +++ b/packages/connectivity/connectivity_macos/example/test_driver/test/connectivity_e2e.dart @@ -3,12 +3,12 @@ // found in the LICENSE file. import 'dart:io'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:connectivity/connectivity.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); group('Connectivity test driver', () { Connectivity _connectivity; diff --git a/packages/device_info/device_info/example/android/app/src/main/java/io/flutter/plugins/deviceinfoexample/EmbeddingV1ActivityTest.java b/packages/device_info/device_info/example/android/app/src/main/java/io/flutter/plugins/deviceinfoexample/EmbeddingV1ActivityTest.java index c8fb26e7f70f..797c06aa50b2 100644 --- a/packages/device_info/device_info/example/android/app/src/main/java/io/flutter/plugins/deviceinfoexample/EmbeddingV1ActivityTest.java +++ b/packages/device_info/device_info/example/android/app/src/main/java/io/flutter/plugins/deviceinfoexample/EmbeddingV1ActivityTest.java @@ -1,7 +1,7 @@ package io.flutter.plugins.deviceinfoexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/device_info/device_info/example/pubspec.yaml b/packages/device_info/device_info/example/pubspec.yaml index f26ee033d4be..e22f6026ba69 100644 --- a/packages/device_info/device_info/example/pubspec.yaml +++ b/packages/device_info/device_info/example/pubspec.yaml @@ -10,8 +10,8 @@ dependencies: dev_dependencies: flutter_driver: sdk: flutter - e2e: - path: ../../../e2e + integration_test: + path: ../../../integration_test pedantic: ^1.8.0 flutter: diff --git a/packages/device_info/device_info/example/test_driver/device_info_e2e.dart b/packages/device_info/device_info/example/test_driver/device_info_e2e.dart index db8a73f579c1..2fd1d9a9a491 100644 --- a/packages/device_info/device_info/example/test_driver/device_info_e2e.dart +++ b/packages/device_info/device_info/example/test_driver/device_info_e2e.dart @@ -5,10 +5,10 @@ import 'dart:io'; import 'package:flutter_test/flutter_test.dart'; import 'package:device_info/device_info.dart'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); IosDeviceInfo iosInfo; AndroidDeviceInfo androidInfo; diff --git a/packages/e2e/README.md b/packages/e2e/README.md index a9ebed1130a4..7f211900db70 100644 --- a/packages/e2e/README.md +++ b/packages/e2e/README.md @@ -1,11 +1,15 @@ -# e2e +# e2e (deprecated) + +## DEPRECATED + +This package has been moved to [integration_test](https://github.com/flutter/plugins/tree/master/packages/integration_test). + +## Old instructions This package enables self-driving testing of Flutter code on devices and emulators. It adapts flutter_test results into a format that is compatible with `flutter drive` and native Android instrumentation testing. -iOS support is not available yet, but is planned in the future. - ## Usage Add a dependency on the `e2e` package in the diff --git a/packages/e2e/android/settings.gradle b/packages/e2e/android/settings.gradle deleted file mode 100644 index e5d17d080b60..000000000000 --- a/packages/e2e/android/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'e2e' diff --git a/packages/e2e/example/ios/RunnerTests/RunnerTests.m b/packages/e2e/example/ios/RunnerTests/RunnerTests.m deleted file mode 100644 index 9614c6598b15..000000000000 --- a/packages/e2e/example/ios/RunnerTests/RunnerTests.m +++ /dev/null @@ -1,4 +0,0 @@ -#import -#import - -E2E_IOS_RUNNER(RunnerTests) diff --git a/packages/e2e/example/macos/Flutter/GeneratedPluginRegistrant.swift b/packages/e2e/example/macos/Flutter/GeneratedPluginRegistrant.swift deleted file mode 100644 index 2b7c33cf9b20..000000000000 --- a/packages/e2e/example/macos/Flutter/GeneratedPluginRegistrant.swift +++ /dev/null @@ -1,12 +0,0 @@ -// -// Generated file. Do not edit. -// - -import FlutterMacOS -import Foundation - -import e2e_macos - -func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { - E2EPlugin.register(with: registry.registrar(forPlugin: "E2EPlugin")) -} diff --git a/packages/e2e/example/test_driver/example_e2e_test.dart b/packages/e2e/example/test_driver/example_e2e_test.dart deleted file mode 100644 index cc3ea1572a52..000000000000 --- a/packages/e2e/example/test_driver/example_e2e_test.dart +++ /dev/null @@ -1,5 +0,0 @@ -import 'dart:async'; - -import 'package:e2e/e2e_driver.dart' as e2e; - -Future main() async => e2e.e2eDriver(); diff --git a/packages/e2e/ios/Classes/E2EIosTest.h b/packages/e2e/ios/Classes/E2EIosTest.h deleted file mode 100644 index 1d7651459419..000000000000 --- a/packages/e2e/ios/Classes/E2EIosTest.h +++ /dev/null @@ -1,22 +0,0 @@ -#import - -@interface E2EIosTest : NSObject - -- (BOOL)testE2E:(NSString **)testResult; - -@end - -#define E2E_IOS_RUNNER(__test_class) \ - @interface __test_class : XCTestCase \ - @end \ - \ - @implementation __test_class \ - \ - -(void)testE2E { \ - NSString *testResult; \ - E2EIosTest *e2eIosTest = [[E2EIosTest alloc] init]; \ - BOOL testPass = [e2eIosTest testE2E:&testResult]; \ - XCTAssertTrue(testPass, @"%@", testResult); \ - } \ - \ - @end diff --git a/packages/flutter_plugin_android_lifecycle/example/android/app/src/androidTest/java/io/flutter/plugins/flutter_plugin_android_lifecycle/EmbeddingV1ActivityTest.java b/packages/flutter_plugin_android_lifecycle/example/android/app/src/androidTest/java/io/flutter/plugins/flutter_plugin_android_lifecycle/EmbeddingV1ActivityTest.java index cb699d587a99..4f1435fb1b33 100644 --- a/packages/flutter_plugin_android_lifecycle/example/android/app/src/androidTest/java/io/flutter/plugins/flutter_plugin_android_lifecycle/EmbeddingV1ActivityTest.java +++ b/packages/flutter_plugin_android_lifecycle/example/android/app/src/androidTest/java/io/flutter/plugins/flutter_plugin_android_lifecycle/EmbeddingV1ActivityTest.java @@ -5,7 +5,7 @@ package io.flutter.plugins.flutter_plugin_android_lifecycle_example; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/flutter_plugin_android_lifecycle/example/android/app/src/androidTest/java/io/flutter/plugins/flutter_plugin_android_lifecycle/MainActivityTest.java b/packages/flutter_plugin_android_lifecycle/example/android/app/src/androidTest/java/io/flutter/plugins/flutter_plugin_android_lifecycle/MainActivityTest.java index 7228115bf534..4c3c9a247883 100644 --- a/packages/flutter_plugin_android_lifecycle/example/android/app/src/androidTest/java/io/flutter/plugins/flutter_plugin_android_lifecycle/MainActivityTest.java +++ b/packages/flutter_plugin_android_lifecycle/example/android/app/src/androidTest/java/io/flutter/plugins/flutter_plugin_android_lifecycle/MainActivityTest.java @@ -5,7 +5,7 @@ package io.flutter.plugins.flutter_plugin_android_lifecycle_example; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/flutter_plugin_android_lifecycle/example/android/app/src/main/java/io/flutter/plugins/flutter_plugin_android_lifecycle_example/EmbeddingV1Activity.java b/packages/flutter_plugin_android_lifecycle/example/android/app/src/main/java/io/flutter/plugins/flutter_plugin_android_lifecycle_example/EmbeddingV1Activity.java index 0eb8bb9ad407..63602ddb05e6 100644 --- a/packages/flutter_plugin_android_lifecycle/example/android/app/src/main/java/io/flutter/plugins/flutter_plugin_android_lifecycle_example/EmbeddingV1Activity.java +++ b/packages/flutter_plugin_android_lifecycle/example/android/app/src/main/java/io/flutter/plugins/flutter_plugin_android_lifecycle_example/EmbeddingV1Activity.java @@ -1,7 +1,7 @@ package io.flutter.plugins.flutter_plugin_android_lifecycle_example; import android.os.Bundle; -import dev.flutter.plugins.e2e.E2EPlugin; +import dev.flutter.plugins.integration_test.IntegrationTestPlugin; import io.flutter.app.FlutterActivity; import io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin; @@ -9,7 +9,8 @@ public class EmbeddingV1Activity extends FlutterActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - E2EPlugin.registerWith(registrarFor("dev.flutter.plugins.e2e.E2EPlugin")); + IntegrationTestPlugin.registerWith( + registrarFor("dev.flutter.plugins.integration_test.IntegrationTestPlugin")); FlutterAndroidLifecyclePlugin.registerWith( registrarFor( "io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin")); diff --git a/packages/flutter_plugin_android_lifecycle/example/android/app/src/main/java/io/flutter/plugins/flutter_plugin_android_lifecycle_example/MainActivity.java b/packages/flutter_plugin_android_lifecycle/example/android/app/src/main/java/io/flutter/plugins/flutter_plugin_android_lifecycle_example/MainActivity.java index 2ea33493eb3c..e2d2560e9105 100644 --- a/packages/flutter_plugin_android_lifecycle/example/android/app/src/main/java/io/flutter/plugins/flutter_plugin_android_lifecycle_example/MainActivity.java +++ b/packages/flutter_plugin_android_lifecycle/example/android/app/src/main/java/io/flutter/plugins/flutter_plugin_android_lifecycle_example/MainActivity.java @@ -6,7 +6,7 @@ import android.util.Log; import androidx.lifecycle.Lifecycle; -import dev.flutter.plugins.e2e.E2EPlugin; +import dev.flutter.plugins.integration_test.IntegrationTestPlugin; import io.flutter.embedding.android.FlutterActivity; import io.flutter.embedding.engine.FlutterEngine; import io.flutter.embedding.engine.plugins.FlutterPlugin; @@ -20,7 +20,7 @@ public class MainActivity extends FlutterActivity { @Override public void configureFlutterEngine(FlutterEngine flutterEngine) { flutterEngine.getPlugins().add(new TestPlugin()); - flutterEngine.getPlugins().add(new E2EPlugin()); + flutterEngine.getPlugins().add(new IntegrationTestPlugin()); } private static class TestPlugin implements FlutterPlugin, ActivityAware { diff --git a/packages/flutter_plugin_android_lifecycle/example/pubspec.yaml b/packages/flutter_plugin_android_lifecycle/example/pubspec.yaml index cb5691b6ceb2..a040dbe95d92 100644 --- a/packages/flutter_plugin_android_lifecycle/example/pubspec.yaml +++ b/packages/flutter_plugin_android_lifecycle/example/pubspec.yaml @@ -8,8 +8,8 @@ environment: dependencies: flutter: sdk: flutter - e2e: - path: ../../e2e + integration_test: + path: ../../integration_test dev_dependencies: flutter_test: diff --git a/packages/flutter_plugin_android_lifecycle/example/test_driver/flutter_plugin_android_lifecycle_e2e.dart b/packages/flutter_plugin_android_lifecycle/example/test_driver/flutter_plugin_android_lifecycle_e2e.dart index 5abead07d132..1405ab69153c 100644 --- a/packages/flutter_plugin_android_lifecycle/example/test_driver/flutter_plugin_android_lifecycle_e2e.dart +++ b/packages/flutter_plugin_android_lifecycle/example/test_driver/flutter_plugin_android_lifecycle_e2e.dart @@ -3,11 +3,11 @@ // BSD-style license that can be found in the LICENSE file. import 'package:flutter_test/flutter_test.dart'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; import 'package:flutter_plugin_android_lifecycle_example/main.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('loads', (WidgetTester tester) async { await tester.pumpWidget(MyApp()); diff --git a/packages/google_maps_flutter/google_maps_flutter/example/android/app/src/androidTest/java/io/flutter/plugins/googlemaps/EmbeddingV1ActivityTest.java b/packages/google_maps_flutter/google_maps_flutter/example/android/app/src/androidTest/java/io/flutter/plugins/googlemaps/EmbeddingV1ActivityTest.java index 6ce846749799..d8064e441fbd 100644 --- a/packages/google_maps_flutter/google_maps_flutter/example/android/app/src/androidTest/java/io/flutter/plugins/googlemaps/EmbeddingV1ActivityTest.java +++ b/packages/google_maps_flutter/google_maps_flutter/example/android/app/src/androidTest/java/io/flutter/plugins/googlemaps/EmbeddingV1ActivityTest.java @@ -1,7 +1,7 @@ package io.flutter.plugins.googlemaps; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import io.flutter.plugins.googlemapsexample.*; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/google_maps_flutter/google_maps_flutter/example/android/app/src/androidTest/java/io/flutter/plugins/googlemaps/MainActivityTest.java b/packages/google_maps_flutter/google_maps_flutter/example/android/app/src/androidTest/java/io/flutter/plugins/googlemaps/MainActivityTest.java index 6b52f1c87585..c70f16a17454 100644 --- a/packages/google_maps_flutter/google_maps_flutter/example/android/app/src/androidTest/java/io/flutter/plugins/googlemaps/MainActivityTest.java +++ b/packages/google_maps_flutter/google_maps_flutter/example/android/app/src/androidTest/java/io/flutter/plugins/googlemaps/MainActivityTest.java @@ -1,7 +1,7 @@ package io.flutter.plugins.googlemaps; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/google_maps_flutter/google_maps_flutter/example/android/app/src/main/java/io/flutter/plugins/googlemapsexample/EmbeddingV1Activity.java b/packages/google_maps_flutter/google_maps_flutter/example/android/app/src/main/java/io/flutter/plugins/googlemapsexample/EmbeddingV1Activity.java index 8d7b3054bf5f..18b107d47620 100644 --- a/packages/google_maps_flutter/google_maps_flutter/example/android/app/src/main/java/io/flutter/plugins/googlemapsexample/EmbeddingV1Activity.java +++ b/packages/google_maps_flutter/google_maps_flutter/example/android/app/src/main/java/io/flutter/plugins/googlemapsexample/EmbeddingV1Activity.java @@ -1,7 +1,7 @@ package io.flutter.plugins.googlemapsexample; import android.os.Bundle; -import dev.flutter.plugins.e2e.E2EPlugin; +import dev.flutter.plugins.integration_test.IntegrationTestPlugin; import io.flutter.app.FlutterActivity; import io.flutter.plugins.googlemaps.GoogleMapsPlugin; @@ -10,6 +10,7 @@ public class EmbeddingV1Activity extends FlutterActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); GoogleMapsPlugin.registerWith(registrarFor("io.flutter.plugins.googlemaps.GoogleMapsPlugin")); - E2EPlugin.registerWith(registrarFor("dev.flutter.plugins.e2e.E2EPlugin")); + IntegrationTestPlugin.registerWith( + registrarFor("dev.flutter.plugins.integration_test.IntegrationTestPlugin")); } } diff --git a/packages/google_maps_flutter/google_maps_flutter/example/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter/example/pubspec.yaml index a011cb126d5e..7bfc7a6feb9c 100644 --- a/packages/google_maps_flutter/google_maps_flutter/example/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter/example/pubspec.yaml @@ -16,8 +16,8 @@ dev_dependencies: flutter_driver: sdk: flutter test: ^1.6.0 - e2e: - path: ../../../e2e + integration_test: + path: ../../../integration_test pedantic: ^1.8.0 # For information on the generic Dart part of this file, see the diff --git a/packages/google_maps_flutter/google_maps_flutter/example/test_driver/google_maps_e2e.dart b/packages/google_maps_flutter/google_maps_flutter/example/test_driver/google_maps_e2e.dart index 69304d18778d..2a5bf80a4578 100644 --- a/packages/google_maps_flutter/google_maps_flutter/example/test_driver/google_maps_e2e.dart +++ b/packages/google_maps_flutter/google_maps_flutter/example/test_driver/google_maps_e2e.dart @@ -6,7 +6,7 @@ import 'dart:async'; import 'dart:io'; import 'dart:typed_data'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -20,7 +20,7 @@ const CameraPosition _kInitialCameraPosition = CameraPosition(target: _kInitialMapCenter, zoom: _kInitialZoomLevel); void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('testCompassToggle', (WidgetTester tester) async { final Key key = GlobalKey(); diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/EmbeddingV1ActivityTest.java b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/EmbeddingV1ActivityTest.java index 92c29c5d2393..4d872e7eb5a1 100644 --- a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/EmbeddingV1ActivityTest.java +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/EmbeddingV1ActivityTest.java @@ -5,7 +5,7 @@ package io.flutter.plugins.googlesigninexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/FlutterActivityTest.java b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/FlutterActivityTest.java index 21fe2cb9467a..f9aa77b30e5d 100644 --- a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/FlutterActivityTest.java +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/FlutterActivityTest.java @@ -5,7 +5,7 @@ package io.flutter.plugins.googlesigninexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/pubspec.yaml b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/pubspec.yaml index fff936d9b5e0..3e64fa2da3f2 100755 --- a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/pubspec.yaml +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/example/pubspec.yaml @@ -11,8 +11,8 @@ dependencies: dev_dependencies: pedantic: ^1.8.0 - e2e: - path: ../../../e2e + integration_test: + path: ../../../integration_test flutter_driver: sdk: flutter diff --git a/packages/google_sign_in/google_sign_in/CHANGELOG.md b/packages/google_sign_in/google_sign_in/CHANGELOG.md index 761ba0476eff..e0212458a549 100644 --- a/packages/google_sign_in/google_sign_in/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.5.3 + +* Update package:e2e -> package:integration_test + ## 4.5.2 * Update package:e2e reference to use the local version in the flutter/plugins diff --git a/packages/google_sign_in/google_sign_in/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/EmbeddingV1ActivityTest.java b/packages/google_sign_in/google_sign_in/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/EmbeddingV1ActivityTest.java index 92c29c5d2393..4d872e7eb5a1 100644 --- a/packages/google_sign_in/google_sign_in/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/EmbeddingV1ActivityTest.java +++ b/packages/google_sign_in/google_sign_in/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/EmbeddingV1ActivityTest.java @@ -5,7 +5,7 @@ package io.flutter.plugins.googlesigninexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/google_sign_in/google_sign_in/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/FlutterActivityTest.java b/packages/google_sign_in/google_sign_in/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/FlutterActivityTest.java index 21fe2cb9467a..f9aa77b30e5d 100644 --- a/packages/google_sign_in/google_sign_in/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/FlutterActivityTest.java +++ b/packages/google_sign_in/google_sign_in/example/android/app/src/main/java/io/flutter/plugins/googlesigninexample/FlutterActivityTest.java @@ -5,7 +5,7 @@ package io.flutter.plugins.googlesigninexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/google_sign_in/google_sign_in/example/pubspec.yaml b/packages/google_sign_in/google_sign_in/example/pubspec.yaml index 37d109649c8a..ebf8e82719f2 100755 --- a/packages/google_sign_in/google_sign_in/example/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in/example/pubspec.yaml @@ -10,8 +10,8 @@ dependencies: dev_dependencies: pedantic: ^1.8.0 - e2e: - path: ../../../e2e + integration_test: + path: ../../../integration_test flutter_driver: sdk: flutter diff --git a/packages/google_sign_in/google_sign_in/pubspec.yaml b/packages/google_sign_in/google_sign_in/pubspec.yaml index e76dbedfa116..c5bc15f037c5 100644 --- a/packages/google_sign_in/google_sign_in/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in/pubspec.yaml @@ -2,7 +2,7 @@ name: google_sign_in description: Flutter plugin for Google Sign-In, a secure authentication system for signing in with a Google account on Android and iOS. homepage: https://github.com/flutter/plugins/tree/master/packages/google_sign_in/google_sign_in -version: 4.5.2 +version: 4.5.3 flutter: plugin: @@ -34,8 +34,8 @@ dev_dependencies: flutter_test: sdk: flutter pedantic: ^1.8.0 - e2e: - path: ../../e2e + integration_test: + path: ../../integration_test environment: sdk: ">=2.1.0 <3.0.0" diff --git a/packages/google_sign_in/google_sign_in/test/google_sign_in_e2e.dart b/packages/google_sign_in/google_sign_in/test/google_sign_in_e2e.dart index 0c6431f37bf4..7b2b8d800778 100644 --- a/packages/google_sign_in/google_sign_in/test/google_sign_in_e2e.dart +++ b/packages/google_sign_in/google_sign_in/test/google_sign_in_e2e.dart @@ -1,9 +1,9 @@ -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:google_sign_in/google_sign_in.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('Can initialize the plugin', (WidgetTester tester) async { GoogleSignIn signIn = GoogleSignIn(); diff --git a/packages/image_picker/image_picker/CHANGELOG.md b/packages/image_picker/image_picker/CHANGELOG.md index 82bb5f37cf97..197314292f8f 100644 --- a/packages/image_picker/image_picker/CHANGELOG.md +++ b/packages/image_picker/image_picker/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.6.7+6 + +* Update package:e2e -> package:integration_test + ## 0.6.7+5 * Update package:e2e reference to use the local version in the flutter/plugins diff --git a/packages/image_picker/image_picker/example/android/app/src/main/java/io/flutter/plugins/imagepickerexample/EmbeddingV1ActivityTest.java b/packages/image_picker/image_picker/example/android/app/src/main/java/io/flutter/plugins/imagepickerexample/EmbeddingV1ActivityTest.java index a9146dfa5716..0a8330d734bd 100644 --- a/packages/image_picker/image_picker/example/android/app/src/main/java/io/flutter/plugins/imagepickerexample/EmbeddingV1ActivityTest.java +++ b/packages/image_picker/image_picker/example/android/app/src/main/java/io/flutter/plugins/imagepickerexample/EmbeddingV1ActivityTest.java @@ -5,7 +5,7 @@ package io.flutter.plugins.imagepickerexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/image_picker/image_picker/example/android/app/src/main/java/io/flutter/plugins/imagepickerexample/FlutterActivityTest.java b/packages/image_picker/image_picker/example/android/app/src/main/java/io/flutter/plugins/imagepickerexample/FlutterActivityTest.java index 6afe01481ea4..58f8df35dc4f 100644 --- a/packages/image_picker/image_picker/example/android/app/src/main/java/io/flutter/plugins/imagepickerexample/FlutterActivityTest.java +++ b/packages/image_picker/image_picker/example/android/app/src/main/java/io/flutter/plugins/imagepickerexample/FlutterActivityTest.java @@ -1,7 +1,7 @@ package io.flutter.plugins.imagepickerexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/image_picker/image_picker/example/pubspec.yaml b/packages/image_picker/image_picker/example/pubspec.yaml index 63e42a121d80..0ff2f280e2ab 100755 --- a/packages/image_picker/image_picker/example/pubspec.yaml +++ b/packages/image_picker/image_picker/example/pubspec.yaml @@ -14,8 +14,8 @@ dependencies: dev_dependencies: flutter_driver: sdk: flutter - e2e: - path: ../../../e2e + integration_test: + path: ../../../integration_test pedantic: ^1.8.0 flutter: diff --git a/packages/image_picker/image_picker/pubspec.yaml b/packages/image_picker/image_picker/pubspec.yaml index 94fa53be135e..118faf3712bc 100755 --- a/packages/image_picker/image_picker/pubspec.yaml +++ b/packages/image_picker/image_picker/pubspec.yaml @@ -2,7 +2,7 @@ name: image_picker description: Flutter plugin for selecting images from the Android and iOS image library, and taking new pictures with the camera. homepage: https://github.com/flutter/plugins/tree/master/packages/image_picker/image_picker -version: 0.6.7+5 +version: 0.6.7+6 flutter: plugin: @@ -23,8 +23,8 @@ dev_dependencies: video_player: ^0.10.3 flutter_test: sdk: flutter - e2e: - path: ../../e2e + integration_test: + path: ../../integration_test pedantic: ^1.8.0 environment: diff --git a/packages/image_picker/image_picker/test/old_image_picker_e2e.dart b/packages/image_picker/image_picker/test/old_image_picker_e2e.dart index b19e37dd6541..d21a4e0cdfa3 100644 --- a/packages/image_picker/image_picker/test/old_image_picker_e2e.dart +++ b/packages/image_picker/image_picker/test/old_image_picker_e2e.dart @@ -1,5 +1,5 @@ -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); } diff --git a/packages/in_app_purchase/CHANGELOG.md b/packages/in_app_purchase/CHANGELOG.md index 7e2eb3079396..ad53c7ccf1f5 100644 --- a/packages/in_app_purchase/CHANGELOG.md +++ b/packages/in_app_purchase/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.3.4+4 + +* Update package:e2e -> package:integration_test + ## 0.3.4+3 * Fixed typo 'manuelly' for 'manually'. diff --git a/packages/in_app_purchase/example/android/app/src/main/java/io/flutter/plugins/inapppurchaseexample/EmbeddingV1Activity.java b/packages/in_app_purchase/example/android/app/src/main/java/io/flutter/plugins/inapppurchaseexample/EmbeddingV1Activity.java index 425c1661066b..e157950e5bec 100644 --- a/packages/in_app_purchase/example/android/app/src/main/java/io/flutter/plugins/inapppurchaseexample/EmbeddingV1Activity.java +++ b/packages/in_app_purchase/example/android/app/src/main/java/io/flutter/plugins/inapppurchaseexample/EmbeddingV1Activity.java @@ -5,7 +5,7 @@ package io.flutter.plugins.inapppurchaseexample; import android.os.Bundle; -import dev.flutter.plugins.e2e.E2EPlugin; +import dev.flutter.plugins.integration_test.IntegrationTestPlugin; import io.flutter.app.FlutterActivity; import io.flutter.plugins.inapppurchase.InAppPurchasePlugin; import io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin; @@ -14,7 +14,8 @@ public class EmbeddingV1Activity extends FlutterActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - E2EPlugin.registerWith(registrarFor("dev.flutter.plugins.e2e.E2EPlugin")); + IntegrationTestPlugin.registerWith( + registrarFor("dev.flutter.plugins.integration_test.IntegrationTestPlugin")); SharedPreferencesPlugin.registerWith( registrarFor("io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin")); InAppPurchasePlugin.registerWith( diff --git a/packages/in_app_purchase/example/android/app/src/main/java/io/flutter/plugins/inapppurchaseexample/EmbeddingV1ActivityTest.java b/packages/in_app_purchase/example/android/app/src/main/java/io/flutter/plugins/inapppurchaseexample/EmbeddingV1ActivityTest.java index aaed781653da..b8ca3ae96e2c 100644 --- a/packages/in_app_purchase/example/android/app/src/main/java/io/flutter/plugins/inapppurchaseexample/EmbeddingV1ActivityTest.java +++ b/packages/in_app_purchase/example/android/app/src/main/java/io/flutter/plugins/inapppurchaseexample/EmbeddingV1ActivityTest.java @@ -5,7 +5,7 @@ package io.flutter.plugins.inapppurchaseexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/in_app_purchase/example/android/app/src/main/java/io/flutter/plugins/inapppurchaseexample/FlutterActivityTest.java b/packages/in_app_purchase/example/android/app/src/main/java/io/flutter/plugins/inapppurchaseexample/FlutterActivityTest.java index 1a6203bcd7a8..15ec0da9958e 100644 --- a/packages/in_app_purchase/example/android/app/src/main/java/io/flutter/plugins/inapppurchaseexample/FlutterActivityTest.java +++ b/packages/in_app_purchase/example/android/app/src/main/java/io/flutter/plugins/inapppurchaseexample/FlutterActivityTest.java @@ -5,7 +5,7 @@ package io.flutter.plugins.inapppurchaseexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/in_app_purchase/example/pubspec.yaml b/packages/in_app_purchase/example/pubspec.yaml index 6d8fd0e90739..48359dbc6a06 100644 --- a/packages/in_app_purchase/example/pubspec.yaml +++ b/packages/in_app_purchase/example/pubspec.yaml @@ -14,8 +14,8 @@ dev_dependencies: sdk: flutter in_app_purchase: path: ../ - e2e: - path: ../../e2e + integration_test: + path: ../../integration_test pedantic: ^1.8.0 flutter: diff --git a/packages/in_app_purchase/pubspec.yaml b/packages/in_app_purchase/pubspec.yaml index 4b50721bf22b..0633d154cb8b 100644 --- a/packages/in_app_purchase/pubspec.yaml +++ b/packages/in_app_purchase/pubspec.yaml @@ -1,7 +1,7 @@ name: in_app_purchase description: A Flutter plugin for in-app purchases. Exposes APIs for making in-app purchases through the App Store and Google Play. homepage: https://github.com/flutter/plugins/tree/master/packages/in_app_purchase -version: 0.3.4+3 +version: 0.3.4+4 dependencies: async: ^2.0.8 @@ -22,8 +22,8 @@ dev_dependencies: path: example/ test: ^1.5.2 shared_preferences: ^0.5.2 - e2e: - path: ../e2e + integration_test: + path: ../integration_test pedantic: ^1.8.0 flutter: diff --git a/packages/in_app_purchase/test/in_app_purchase_e2e.dart b/packages/in_app_purchase/test/in_app_purchase_e2e.dart index e167227b4c8f..a5bfdb0eb409 100644 --- a/packages/in_app_purchase/test/in_app_purchase_e2e.dart +++ b/packages/in_app_purchase/test/in_app_purchase_e2e.dart @@ -4,10 +4,10 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:in_app_purchase/in_app_purchase.dart'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('Can create InAppPurchaseConnection instance', (WidgetTester tester) async { diff --git a/packages/e2e/.gitignore b/packages/integration_test/.gitignore similarity index 100% rename from packages/e2e/.gitignore rename to packages/integration_test/.gitignore diff --git a/packages/e2e/.metadata b/packages/integration_test/.metadata similarity index 100% rename from packages/e2e/.metadata rename to packages/integration_test/.metadata diff --git a/packages/e2e/CHANGELOG.md b/packages/integration_test/CHANGELOG.md similarity index 97% rename from packages/e2e/CHANGELOG.md rename to packages/integration_test/CHANGELOG.md index 2ccf9573a17d..cbd5282028f4 100644 --- a/packages/e2e/CHANGELOG.md +++ b/packages/integration_test/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.8.0 + +* Rename plugin to integration_test. + ## 0.7.0 * Move utilities for tracking frame performance in an e2e test to `flutter_test`. @@ -152,7 +156,7 @@ * Renamed package from instrumentation_adapter to e2e. * Refactored example app test. * **Breaking change**. Renamed `InstrumentationAdapterFlutterBinding` to - `E2EWidgetsFlutterBinding`. + `IntegrationTestWidgetsFlutterBinding`. * Updated README. ## 0.1.4 diff --git a/packages/e2e/LICENSE b/packages/integration_test/LICENSE similarity index 100% rename from packages/e2e/LICENSE rename to packages/integration_test/LICENSE diff --git a/packages/integration_test/README.md b/packages/integration_test/README.md new file mode 100644 index 000000000000..bb0bfa2eb1ae --- /dev/null +++ b/packages/integration_test/README.md @@ -0,0 +1,192 @@ +# integration_test + +This package enables self-driving testing of Flutter code on devices and emulators. +It adapts flutter_test results into a format that is compatible with `flutter drive` +and native Android instrumentation testing. + +## Usage + +Add a dependency on the `integration_test` package in the +`dev_dependencies` section of pubspec.yaml. For plugins, do this in the +pubspec.yaml of the example app. + +Invoke `IntegrationTestWidgetsFlutterBinding.ensureInitialized()` at the start +of a test file, e.g. + +```dart +import 'package:integration_test/integration_test.dart'; + +void main() { + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + testWidgets("failing test example", (WidgetTester tester) async { + expect(2 + 2, equals(5)); + }); +} +``` + +## Test locations + +It is recommended to put integration_test tests in the `test/` folder of the app +or package. For example apps, if the integration_test test references example +app code, it should go in `example/test/`. It is also acceptable to put +integration_test tests in `test_driver/` folder so that they're alongside the +runner app (see below). + +## Using Flutter driver to run tests + +`IntegrationTestWidgetsTestBinding` supports launching the on-device tests with +`flutter drive`. Note that the tests don't use the `FlutterDriver` API, they +use `testWidgets` instead. + +Put the a file named `_integration_test.dart` in the app' +`test_driver` directory: + +```dart +import 'dart:async'; + +import 'package:integration_test/integration_test_driver.dart'; + +Future main() async => integrationDriver(); + +``` + +To run a example app test with Flutter driver: + +``` +cd example +flutter drive test/_integration.dart +``` + +To test plugin APIs using Flutter driver: + +``` +cd example +flutter drive --driver=test_driver/_test.dart test/_e2e.dart +``` + +You can run tests on web in release or profile mode. + +First you need to make sure you have downloaded the driver for the browser. + +``` +cd example +flutter drive -v --target=test_driver/dart -d web-server --release --browser-name=chrome +``` + +## Android device testing + +Create an instrumentation test file in your application's +**android/app/src/androidTest/java/com/example/myapp/** directory (replacing +com, example, and myapp with values from your app's package name). You can name +this test file MainActivityTest.java or another name of your choice. + +```java +package com.example.myapp; + +import androidx.test.rule.ActivityTestRule; +import dev.flutter.plugins.e2e.FlutterTestRunner; +import org.junit.Rule; +import org.junit.runner.RunWith; + +@RunWith(FlutterTestRunner.class) +public class MainActivityTest { + @Rule + public ActivityTestRule rule = new ActivityTestRule<>(MainActivity.class, true, false); +} +``` + +Update your application's **myapp/android/app/build.gradle** to make sure it +uses androidx's version of AndroidJUnitRunner and has androidx libraries as a +dependency. + +``` +android { + ... + defaultConfig { + ... + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } +} + +dependencies { + testImplementation 'junit:junit:4.12' + + // https://developer.android.com/jetpack/androidx/releases/test/#1.2.0 + androidTestImplementation 'androidx.test:runner:1.2.0' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' +} +``` + +To e2e test on a local Android device (emulated or physical): + +``` +./gradlew app:connectedAndroidTest -Ptarget=`pwd`/../test_driver/_e2e.dart +``` + +## Firebase Test Lab + +If this is your first time testing with Firebase Test Lab, you'll need to follow +the guides in the [Firebase test lab +documentation](https://firebase.google.com/docs/test-lab/?gclid=EAIaIQobChMIs5qVwqW25QIV8iCtBh3DrwyUEAAYASAAEgLFU_D_BwE) +to set up a project. + +To run an e2e test on Android devices using Firebase Test Lab, use gradle commands to build an +instrumentation test for Android, after creating `androidTest` as suggested in the last section. + +```bash +pushd android +# flutter build generates files in android/ for building the app +flutter build apk +./gradlew app:assembleAndroidTest +./gradlew app:assembleDebug -Ptarget=.dart +popd +``` + +Upload the build apks Firebase Test Lab, making sure to replace , +, , and with your values. + +```bash +gcloud auth activate-service-account --key-file= +gcloud --quiet config set project +gcloud firebase test android run --type instrumentation \ + --app build/app/outputs/apk/debug/app-debug.apk \ + --test build/app/outputs/apk/androidTest/debug/app-debug-androidTest.apk\ + --timeout 2m \ + --results-bucket= \ + --results-dir= +``` + +You can pass additional parameters on the command line, such as the +devices you want to test on. See +[gcloud firebase test android run](https://cloud.google.com/sdk/gcloud/reference/firebase/test/android/run). + +## iOS device testing + +You need to change `iOS/Podfile` to avoid test target statically linking to the plugins. One way is to +link all of the plugins dynamically: + +``` +target 'Runner' do + use_frameworks! + ... +end +``` + +To e2e test on your iOS device (simulator or real), rebuild your iOS targets with Flutter tool. + +``` +flutter build ios -t test_driver/_e2e.dart (--simulator) +``` + +Open Xcode project (by default, it's `ios/Runner.xcodeproj`). Create a test target +(navigating `File > New > Target...` and set up the values) and a test file `RunnerTests.m` and +change the code. You can change `RunnerTests.m` to the name of your choice. + +```objective-c +#import +#import + +E2E_IOS_RUNNER(RunnerTests) +``` + +Now you can start RunnerTests to kick out e2e tests! diff --git a/packages/e2e/android/.gitignore b/packages/integration_test/android/.gitignore similarity index 100% rename from packages/e2e/android/.gitignore rename to packages/integration_test/android/.gitignore diff --git a/packages/e2e/android/build.gradle b/packages/integration_test/android/build.gradle similarity index 95% rename from packages/e2e/android/build.gradle rename to packages/integration_test/android/build.gradle index d0bb6c5a5967..9f5a3896be0d 100644 --- a/packages/e2e/android/build.gradle +++ b/packages/integration_test/android/build.gradle @@ -1,4 +1,4 @@ -group 'com.example.e2e' +group 'com.example.integration_test' version '1.0-SNAPSHOT' buildscript { diff --git a/packages/e2e/android/gradle.properties b/packages/integration_test/android/gradle.properties similarity index 100% rename from packages/e2e/android/gradle.properties rename to packages/integration_test/android/gradle.properties diff --git a/packages/integration_test/android/settings.gradle b/packages/integration_test/android/settings.gradle new file mode 100644 index 000000000000..1d010945f01e --- /dev/null +++ b/packages/integration_test/android/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'integrationTest' diff --git a/packages/e2e/android/src/main/AndroidManifest.xml b/packages/integration_test/android/src/main/AndroidManifest.xml similarity index 65% rename from packages/e2e/android/src/main/AndroidManifest.xml rename to packages/integration_test/android/src/main/AndroidManifest.xml index 33fdf86052ab..183e7fcd827c 100644 --- a/packages/e2e/android/src/main/AndroidManifest.xml +++ b/packages/integration_test/android/src/main/AndroidManifest.xml @@ -1,3 +1,3 @@ + package="dev.flutter.integration_test"> diff --git a/packages/e2e/android/src/main/java/dev/flutter/plugins/e2e/FlutterTestRunner.java b/packages/integration_test/android/src/main/java/dev/flutter/plugins/integration_test/FlutterTestRunner.java similarity index 96% rename from packages/e2e/android/src/main/java/dev/flutter/plugins/e2e/FlutterTestRunner.java rename to packages/integration_test/android/src/main/java/dev/flutter/plugins/integration_test/FlutterTestRunner.java index 78f0c3c5bac2..511fc141a917 100644 --- a/packages/e2e/android/src/main/java/dev/flutter/plugins/e2e/FlutterTestRunner.java +++ b/packages/integration_test/android/src/main/java/dev/flutter/plugins/integration_test/FlutterTestRunner.java @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -package dev.flutter.plugins.e2e; +package dev.flutter.plugins.integration_test; import android.util.Log; import androidx.test.rule.ActivityTestRule; @@ -68,7 +68,7 @@ public void run(RunNotifier notifier) { } Map results = null; try { - results = E2EPlugin.testResults.get(); + results = IntegrationTestPlugin.testResults.get(); } catch (ExecutionException | InterruptedException e) { throw new IllegalThreadStateException("Unable to get test results"); } diff --git a/packages/e2e/android/src/main/java/dev/flutter/plugins/e2e/E2EPlugin.java b/packages/integration_test/android/src/main/java/dev/flutter/plugins/integration_test/IntegrationTestPlugin.java similarity index 85% rename from packages/e2e/android/src/main/java/dev/flutter/plugins/e2e/E2EPlugin.java rename to packages/integration_test/android/src/main/java/dev/flutter/plugins/integration_test/IntegrationTestPlugin.java index 31100d442731..2245b33ba4c3 100644 --- a/packages/e2e/android/src/main/java/dev/flutter/plugins/e2e/E2EPlugin.java +++ b/packages/integration_test/android/src/main/java/dev/flutter/plugins/integration_test/IntegrationTestPlugin.java @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -package dev.flutter.plugins.e2e; +package dev.flutter.plugins.integration_test; import android.content.Context; import com.google.common.util.concurrent.SettableFuture; @@ -16,19 +16,19 @@ import java.util.Map; import java.util.concurrent.Future; -/** E2EPlugin */ -public class E2EPlugin implements MethodCallHandler, FlutterPlugin { +/** IntegrationTestPlugin */ +public class IntegrationTestPlugin implements MethodCallHandler, FlutterPlugin { private MethodChannel methodChannel; private static final SettableFuture> testResultsSettable = SettableFuture.create(); public static final Future> testResults = testResultsSettable; - private static final String CHANNEL = "plugins.flutter.io/e2e"; + private static final String CHANNEL = "plugins.flutter.io/integration_test"; /** Plugin registration. */ public static void registerWith(Registrar registrar) { - final E2EPlugin instance = new E2EPlugin(); + final IntegrationTestPlugin instance = new IntegrationTestPlugin(); instance.onAttachedToEngine(registrar.context(), registrar.messenger()); } @@ -38,7 +38,7 @@ public void onAttachedToEngine(FlutterPluginBinding binding) { } private void onAttachedToEngine(Context applicationContext, BinaryMessenger messenger) { - methodChannel = new MethodChannel(messenger, "plugins.flutter.io/e2e"); + methodChannel = new MethodChannel(messenger, "plugins.flutter.io/integration_test"); methodChannel.setMethodCallHandler(this); } diff --git a/packages/e2e/example/.gitignore b/packages/integration_test/example/.gitignore similarity index 100% rename from packages/e2e/example/.gitignore rename to packages/integration_test/example/.gitignore diff --git a/packages/e2e/example/.metadata b/packages/integration_test/example/.metadata similarity index 100% rename from packages/e2e/example/.metadata rename to packages/integration_test/example/.metadata diff --git a/packages/e2e/example/README.md b/packages/integration_test/example/README.md similarity index 100% rename from packages/e2e/example/README.md rename to packages/integration_test/example/README.md diff --git a/packages/e2e/example/android/app/build.gradle b/packages/integration_test/example/android/app/build.gradle similarity index 96% rename from packages/e2e/example/android/app/build.gradle rename to packages/integration_test/example/android/app/build.gradle index 527ed2dd38e0..73bd5f4bc41e 100644 --- a/packages/e2e/example/android/app/build.gradle +++ b/packages/integration_test/example/android/app/build.gradle @@ -33,7 +33,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.example.e2e_example" + applicationId "com.example.integration_test_example" minSdkVersion 16 targetSdkVersion 28 versionCode flutterVersionCode.toInteger() diff --git a/packages/e2e/example/android/app/src/androidTest/java/com/example/e2e_example/EmbedderV1ActivityTest.java b/packages/integration_test/example/android/app/src/androidTest/java/com/example/e2e_example/EmbedderV1ActivityTest.java similarity index 73% rename from packages/e2e/example/android/app/src/androidTest/java/com/example/e2e_example/EmbedderV1ActivityTest.java rename to packages/integration_test/example/android/app/src/androidTest/java/com/example/e2e_example/EmbedderV1ActivityTest.java index eedde293eb6c..0ce7dc14d4a5 100644 --- a/packages/e2e/example/android/app/src/androidTest/java/com/example/e2e_example/EmbedderV1ActivityTest.java +++ b/packages/integration_test/example/android/app/src/androidTest/java/com/example/e2e_example/EmbedderV1ActivityTest.java @@ -1,7 +1,7 @@ -package com.example.e2e_example; +package com.example.integration_test_example; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/e2e/example/android/app/src/androidTest/java/com/example/e2e_example/FlutterActivityTest.java b/packages/integration_test/example/android/app/src/androidTest/java/com/example/e2e_example/FlutterActivityTest.java similarity index 76% rename from packages/e2e/example/android/app/src/androidTest/java/com/example/e2e_example/FlutterActivityTest.java rename to packages/integration_test/example/android/app/src/androidTest/java/com/example/e2e_example/FlutterActivityTest.java index 86d552733332..36ae1ddfc7e8 100644 --- a/packages/e2e/example/android/app/src/androidTest/java/com/example/e2e_example/FlutterActivityTest.java +++ b/packages/integration_test/example/android/app/src/androidTest/java/com/example/e2e_example/FlutterActivityTest.java @@ -1,7 +1,7 @@ -package com.example.e2e_example; +package com.example.integration_test_example; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/e2e/example/android/app/src/androidTest/java/com/example/e2e_example/FlutterActivityWithPermissionTest.java b/packages/integration_test/example/android/app/src/androidTest/java/com/example/e2e_example/FlutterActivityWithPermissionTest.java similarity index 66% rename from packages/e2e/example/android/app/src/androidTest/java/com/example/e2e_example/FlutterActivityWithPermissionTest.java rename to packages/integration_test/example/android/app/src/androidTest/java/com/example/e2e_example/FlutterActivityWithPermissionTest.java index 73c3780f4e55..c01d23466fed 100644 --- a/packages/e2e/example/android/app/src/androidTest/java/com/example/e2e_example/FlutterActivityWithPermissionTest.java +++ b/packages/integration_test/example/android/app/src/androidTest/java/com/example/e2e_example/FlutterActivityWithPermissionTest.java @@ -1,16 +1,16 @@ -package com.example.e2e_example; +package com.example.integration_test_example; import android.Manifest.permission; import androidx.test.rule.ActivityTestRule; import androidx.test.rule.GrantPermissionRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; /** - * Demonstrates how a E2E test on Android can be run with permissions already granted. This is - * helpful if developers want to test native App behavior that depends on certain system service + * Demonstrates how an integration test on Android can be run with permissions already granted. This + * is helpful if developers want to test native App behavior that depends on certain system service * results which are guarded with permissions. */ @RunWith(FlutterTestRunner.class) diff --git a/packages/e2e/example/android/app/src/debug/AndroidManifest.xml b/packages/integration_test/example/android/app/src/debug/AndroidManifest.xml similarity index 84% rename from packages/e2e/example/android/app/src/debug/AndroidManifest.xml rename to packages/integration_test/example/android/app/src/debug/AndroidManifest.xml index 5d4aea26b1dd..04d0fdb2c153 100644 --- a/packages/e2e/example/android/app/src/debug/AndroidManifest.xml +++ b/packages/integration_test/example/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="com.example.integration_test_example"> diff --git a/packages/e2e/example/android/app/src/main/AndroidManifest.xml b/packages/integration_test/example/android/app/src/main/AndroidManifest.xml similarity index 94% rename from packages/e2e/example/android/app/src/main/AndroidManifest.xml rename to packages/integration_test/example/android/app/src/main/AndroidManifest.xml index 4710b796c0f5..d789e0e15faf 100644 --- a/packages/e2e/example/android/app/src/main/AndroidManifest.xml +++ b/packages/integration_test/example/android/app/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="com.example.integration_test_example"> + package="com.example.integration_test_example"> diff --git a/packages/e2e/example/android/build.gradle b/packages/integration_test/example/android/build.gradle similarity index 100% rename from packages/e2e/example/android/build.gradle rename to packages/integration_test/example/android/build.gradle diff --git a/packages/e2e/example/android/gradle.properties b/packages/integration_test/example/android/gradle.properties similarity index 100% rename from packages/e2e/example/android/gradle.properties rename to packages/integration_test/example/android/gradle.properties diff --git a/packages/e2e/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/integration_test/example/android/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from packages/e2e/example/android/gradle/wrapper/gradle-wrapper.properties rename to packages/integration_test/example/android/gradle/wrapper/gradle-wrapper.properties diff --git a/packages/e2e/example/android/settings.gradle b/packages/integration_test/example/android/settings.gradle similarity index 100% rename from packages/e2e/example/android/settings.gradle rename to packages/integration_test/example/android/settings.gradle diff --git a/packages/e2e/example/ios/Flutter/AppFrameworkInfo.plist b/packages/integration_test/example/ios/Flutter/AppFrameworkInfo.plist similarity index 100% rename from packages/e2e/example/ios/Flutter/AppFrameworkInfo.plist rename to packages/integration_test/example/ios/Flutter/AppFrameworkInfo.plist diff --git a/packages/e2e/example/ios/Flutter/Debug.xcconfig b/packages/integration_test/example/ios/Flutter/Debug.xcconfig similarity index 100% rename from packages/e2e/example/ios/Flutter/Debug.xcconfig rename to packages/integration_test/example/ios/Flutter/Debug.xcconfig diff --git a/packages/e2e/example/ios/Flutter/Release.xcconfig b/packages/integration_test/example/ios/Flutter/Release.xcconfig similarity index 100% rename from packages/e2e/example/ios/Flutter/Release.xcconfig rename to packages/integration_test/example/ios/Flutter/Release.xcconfig diff --git a/packages/e2e/example/ios/Runner.xcodeproj/project.pbxproj b/packages/integration_test/example/ios/Runner.xcodeproj/project.pbxproj similarity index 100% rename from packages/e2e/example/ios/Runner.xcodeproj/project.pbxproj rename to packages/integration_test/example/ios/Runner.xcodeproj/project.pbxproj diff --git a/packages/e2e/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/integration_test/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme similarity index 100% rename from packages/e2e/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme rename to packages/integration_test/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme diff --git a/packages/e2e/example/ios/Runner/AppDelegate.h b/packages/integration_test/example/ios/Runner/AppDelegate.h similarity index 100% rename from packages/e2e/example/ios/Runner/AppDelegate.h rename to packages/integration_test/example/ios/Runner/AppDelegate.h diff --git a/packages/e2e/example/ios/Runner/AppDelegate.m b/packages/integration_test/example/ios/Runner/AppDelegate.m similarity index 100% rename from packages/e2e/example/ios/Runner/AppDelegate.m rename to packages/integration_test/example/ios/Runner/AppDelegate.m diff --git a/packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json rename to packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png similarity index 100% rename from packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png rename to packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png diff --git a/packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png similarity index 100% rename from packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png rename to packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png diff --git a/packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png similarity index 100% rename from packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png rename to packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png diff --git a/packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png similarity index 100% rename from packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png rename to packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png diff --git a/packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png similarity index 100% rename from packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png rename to packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png diff --git a/packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png similarity index 100% rename from packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png rename to packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png diff --git a/packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png similarity index 100% rename from packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png rename to packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png diff --git a/packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png similarity index 100% rename from packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png rename to packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png diff --git a/packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png similarity index 100% rename from packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png rename to packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png diff --git a/packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png similarity index 100% rename from packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png rename to packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png diff --git a/packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png similarity index 100% rename from packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png rename to packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png diff --git a/packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png similarity index 100% rename from packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png rename to packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png diff --git a/packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png similarity index 100% rename from packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png rename to packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png diff --git a/packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png similarity index 100% rename from packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png rename to packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png diff --git a/packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png similarity index 100% rename from packages/e2e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png rename to packages/integration_test/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png diff --git a/packages/e2e/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/integration_test/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json similarity index 100% rename from packages/e2e/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json rename to packages/integration_test/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json diff --git a/packages/e2e/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/integration_test/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png similarity index 100% rename from packages/e2e/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png rename to packages/integration_test/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png diff --git a/packages/e2e/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/integration_test/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png similarity index 100% rename from packages/e2e/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png rename to packages/integration_test/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png diff --git a/packages/e2e/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/integration_test/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png similarity index 100% rename from packages/e2e/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png rename to packages/integration_test/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png diff --git a/packages/e2e/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/packages/integration_test/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md similarity index 100% rename from packages/e2e/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md rename to packages/integration_test/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md diff --git a/packages/e2e/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/integration_test/example/ios/Runner/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from packages/e2e/example/ios/Runner/Base.lproj/LaunchScreen.storyboard rename to packages/integration_test/example/ios/Runner/Base.lproj/LaunchScreen.storyboard diff --git a/packages/e2e/example/ios/Runner/Base.lproj/Main.storyboard b/packages/integration_test/example/ios/Runner/Base.lproj/Main.storyboard similarity index 100% rename from packages/e2e/example/ios/Runner/Base.lproj/Main.storyboard rename to packages/integration_test/example/ios/Runner/Base.lproj/Main.storyboard diff --git a/packages/e2e/example/ios/Runner/Info.plist b/packages/integration_test/example/ios/Runner/Info.plist similarity index 97% rename from packages/e2e/example/ios/Runner/Info.plist rename to packages/integration_test/example/ios/Runner/Info.plist index 62f6fbb5c02c..d0e099be56e7 100644 --- a/packages/e2e/example/ios/Runner/Info.plist +++ b/packages/integration_test/example/ios/Runner/Info.plist @@ -11,7 +11,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - e2e_example + integration_test_example CFBundlePackageType APPL CFBundleShortVersionString diff --git a/packages/e2e/example/ios/Runner/main.m b/packages/integration_test/example/ios/Runner/main.m similarity index 100% rename from packages/e2e/example/ios/Runner/main.m rename to packages/integration_test/example/ios/Runner/main.m diff --git a/packages/e2e/example/ios/RunnerTests/Info.plist b/packages/integration_test/example/ios/RunnerTests/Info.plist similarity index 100% rename from packages/e2e/example/ios/RunnerTests/Info.plist rename to packages/integration_test/example/ios/RunnerTests/Info.plist diff --git a/packages/integration_test/example/ios/RunnerTests/RunnerTests.m b/packages/integration_test/example/ios/RunnerTests/RunnerTests.m new file mode 100644 index 000000000000..ac89c60e5f06 --- /dev/null +++ b/packages/integration_test/example/ios/RunnerTests/RunnerTests.m @@ -0,0 +1,4 @@ +#import +#import + +INTEGRATION_TEST_IOS_RUNNER(RunnerTests) diff --git a/packages/e2e/example/lib/main.dart b/packages/integration_test/example/lib/main.dart similarity index 100% rename from packages/e2e/example/lib/main.dart rename to packages/integration_test/example/lib/main.dart diff --git a/packages/e2e/example/lib/my_app.dart b/packages/integration_test/example/lib/my_app.dart similarity index 100% rename from packages/e2e/example/lib/my_app.dart rename to packages/integration_test/example/lib/my_app.dart diff --git a/packages/e2e/example/lib/my_web_app.dart b/packages/integration_test/example/lib/my_web_app.dart similarity index 100% rename from packages/e2e/example/lib/my_web_app.dart rename to packages/integration_test/example/lib/my_web_app.dart diff --git a/packages/e2e/example/macos/Flutter/Flutter-Debug.xcconfig b/packages/integration_test/example/macos/Flutter/Flutter-Debug.xcconfig similarity index 100% rename from packages/e2e/example/macos/Flutter/Flutter-Debug.xcconfig rename to packages/integration_test/example/macos/Flutter/Flutter-Debug.xcconfig diff --git a/packages/e2e/example/macos/Flutter/Flutter-Release.xcconfig b/packages/integration_test/example/macos/Flutter/Flutter-Release.xcconfig similarity index 100% rename from packages/e2e/example/macos/Flutter/Flutter-Release.xcconfig rename to packages/integration_test/example/macos/Flutter/Flutter-Release.xcconfig diff --git a/packages/e2e/example/macos/Runner.xcodeproj/project.pbxproj b/packages/integration_test/example/macos/Runner.xcodeproj/project.pbxproj similarity index 98% rename from packages/e2e/example/macos/Runner.xcodeproj/project.pbxproj rename to packages/integration_test/example/macos/Runner.xcodeproj/project.pbxproj index 73b46daf7715..718462e3b4c5 100644 --- a/packages/e2e/example/macos/Runner.xcodeproj/project.pbxproj +++ b/packages/integration_test/example/macos/Runner.xcodeproj/project.pbxproj @@ -62,7 +62,7 @@ 2A162B3576CC7562C04C8319 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; - 33CC10ED2044A3C60003C045 /* e2e_example_example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = e2e_example_example.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10ED2044A3C60003C045 /* integration_test_example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = integration_test_example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; @@ -132,7 +132,7 @@ 33CC10EE2044A3C60003C045 /* Products */ = { isa = PBXGroup; children = ( - 33CC10ED2044A3C60003C045 /* e2e_example_example.app */, + 33CC10ED2044A3C60003C045 /* integration_test_example.app */, ); name = Products; sourceTree = ""; @@ -204,7 +204,7 @@ ); name = Runner; productName = Runner; - productReference = 33CC10ED2044A3C60003C045 /* e2e_example_example.app */; + productReference = 33CC10ED2044A3C60003C045 /* integration_test_example.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ diff --git a/packages/e2e/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/integration_test/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme similarity index 93% rename from packages/e2e/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme rename to packages/integration_test/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index b0cc6c6e2166..464e05225e4c 100644 --- a/packages/e2e/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/packages/integration_test/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -15,7 +15,7 @@ @@ -43,7 +43,7 @@ @@ -66,7 +66,7 @@ @@ -85,7 +85,7 @@ diff --git a/packages/e2e/example/macos/Runner.xcworkspace/contents.xcworkspacedata b/packages/integration_test/example/macos/Runner.xcworkspace/contents.xcworkspacedata similarity index 100% rename from packages/e2e/example/macos/Runner.xcworkspace/contents.xcworkspacedata rename to packages/integration_test/example/macos/Runner.xcworkspace/contents.xcworkspacedata diff --git a/packages/e2e/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/integration_test/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from packages/e2e/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to packages/integration_test/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/packages/e2e/example/macos/Runner/AppDelegate.swift b/packages/integration_test/example/macos/Runner/AppDelegate.swift similarity index 100% rename from packages/e2e/example/macos/Runner/AppDelegate.swift rename to packages/integration_test/example/macos/Runner/AppDelegate.swift diff --git a/packages/e2e/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/integration_test/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from packages/e2e/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json rename to packages/integration_test/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/packages/e2e/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/packages/integration_test/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png similarity index 100% rename from packages/e2e/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png rename to packages/integration_test/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png diff --git a/packages/e2e/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/packages/integration_test/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png similarity index 100% rename from packages/e2e/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png rename to packages/integration_test/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png diff --git a/packages/e2e/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/packages/integration_test/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png similarity index 100% rename from packages/e2e/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png rename to packages/integration_test/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png diff --git a/packages/e2e/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/packages/integration_test/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png similarity index 100% rename from packages/e2e/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png rename to packages/integration_test/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png diff --git a/packages/e2e/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/packages/integration_test/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png similarity index 100% rename from packages/e2e/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png rename to packages/integration_test/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png diff --git a/packages/e2e/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/packages/integration_test/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png similarity index 100% rename from packages/e2e/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png rename to packages/integration_test/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png diff --git a/packages/e2e/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/packages/integration_test/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png similarity index 100% rename from packages/e2e/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png rename to packages/integration_test/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png diff --git a/packages/e2e/example/macos/Runner/Base.lproj/MainMenu.xib b/packages/integration_test/example/macos/Runner/Base.lproj/MainMenu.xib similarity index 100% rename from packages/e2e/example/macos/Runner/Base.lproj/MainMenu.xib rename to packages/integration_test/example/macos/Runner/Base.lproj/MainMenu.xib diff --git a/packages/e2e/example/macos/Runner/Configs/AppInfo.xcconfig b/packages/integration_test/example/macos/Runner/Configs/AppInfo.xcconfig similarity index 83% rename from packages/e2e/example/macos/Runner/Configs/AppInfo.xcconfig rename to packages/integration_test/example/macos/Runner/Configs/AppInfo.xcconfig index 8a3359f80a49..1d9e2f0e043c 100644 --- a/packages/e2e/example/macos/Runner/Configs/AppInfo.xcconfig +++ b/packages/integration_test/example/macos/Runner/Configs/AppInfo.xcconfig @@ -5,10 +5,10 @@ // 'flutter create' template. // The application's name. By default this is also the title of the Flutter window. -PRODUCT_NAME = e2e_example_example +PRODUCT_NAME = integration_test_example // The application's bundle identifier -PRODUCT_BUNDLE_IDENTIFIER = com.example.e2eExample +PRODUCT_BUNDLE_IDENTIFIER = com.example.integrationTestExample // The copyright displayed in application information PRODUCT_COPYRIGHT = Copyright © 2019 com.example. All rights reserved. diff --git a/packages/e2e/example/macos/Runner/Configs/Debug.xcconfig b/packages/integration_test/example/macos/Runner/Configs/Debug.xcconfig similarity index 100% rename from packages/e2e/example/macos/Runner/Configs/Debug.xcconfig rename to packages/integration_test/example/macos/Runner/Configs/Debug.xcconfig diff --git a/packages/e2e/example/macos/Runner/Configs/Release.xcconfig b/packages/integration_test/example/macos/Runner/Configs/Release.xcconfig similarity index 100% rename from packages/e2e/example/macos/Runner/Configs/Release.xcconfig rename to packages/integration_test/example/macos/Runner/Configs/Release.xcconfig diff --git a/packages/e2e/example/macos/Runner/Configs/Warnings.xcconfig b/packages/integration_test/example/macos/Runner/Configs/Warnings.xcconfig similarity index 100% rename from packages/e2e/example/macos/Runner/Configs/Warnings.xcconfig rename to packages/integration_test/example/macos/Runner/Configs/Warnings.xcconfig diff --git a/packages/e2e/example/macos/Runner/DebugProfile.entitlements b/packages/integration_test/example/macos/Runner/DebugProfile.entitlements similarity index 100% rename from packages/e2e/example/macos/Runner/DebugProfile.entitlements rename to packages/integration_test/example/macos/Runner/DebugProfile.entitlements diff --git a/packages/e2e/example/macos/Runner/Info.plist b/packages/integration_test/example/macos/Runner/Info.plist similarity index 100% rename from packages/e2e/example/macos/Runner/Info.plist rename to packages/integration_test/example/macos/Runner/Info.plist diff --git a/packages/e2e/example/macos/Runner/MainFlutterWindow.swift b/packages/integration_test/example/macos/Runner/MainFlutterWindow.swift similarity index 100% rename from packages/e2e/example/macos/Runner/MainFlutterWindow.swift rename to packages/integration_test/example/macos/Runner/MainFlutterWindow.swift diff --git a/packages/e2e/example/macos/Runner/Release.entitlements b/packages/integration_test/example/macos/Runner/Release.entitlements similarity index 100% rename from packages/e2e/example/macos/Runner/Release.entitlements rename to packages/integration_test/example/macos/Runner/Release.entitlements diff --git a/packages/e2e/example/pubspec.yaml b/packages/integration_test/example/pubspec.yaml similarity index 71% rename from packages/e2e/example/pubspec.yaml rename to packages/integration_test/example/pubspec.yaml index 9ef6098477e3..9384e9763935 100644 --- a/packages/e2e/example/pubspec.yaml +++ b/packages/integration_test/example/pubspec.yaml @@ -1,5 +1,5 @@ -name: e2e_example -description: Demonstrates how to use the e2e plugin. +name: integration_test_example +description: Demonstrates how to use the integration_test plugin. publish_to: 'none' environment: @@ -17,10 +17,10 @@ dev_dependencies: sdk: flutter flutter_driver: sdk: flutter - e2e: + integration_test: path: ../ - e2e_macos: - path: ../e2e_macos + integration_test_macos: + path: ../integration_test_macos test: any pedantic: ^1.8.0 diff --git a/packages/e2e/example/test_driver/example_e2e.dart b/packages/integration_test/example/test_driver/example_integration.dart similarity index 63% rename from packages/e2e/example/test_driver/example_e2e.dart rename to packages/integration_test/example/test_driver/example_integration.dart index d97702d5d7cf..3ee993b911b9 100644 --- a/packages/e2e/example/test_driver/example_e2e.dart +++ b/packages/integration_test/example/test_driver/example_integration.dart @@ -5,12 +5,12 @@ // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the values of widget properties are correct. -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; -import 'example_e2e_io.dart' if (dart.library.html) 'example_e2e_web.dart' - as tests; +import 'example_integration_io.dart' + if (dart.library.html) 'example_integration_web.dart' as tests; void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); tests.main(); } diff --git a/packages/e2e/example/test_driver/example_e2e_io.dart b/packages/integration_test/example/test_driver/example_integration_io.dart similarity index 84% rename from packages/e2e/example/test_driver/example_e2e_io.dart rename to packages/integration_test/example/test_driver/example_integration_io.dart index 9766f568b654..35fc7271d841 100644 --- a/packages/e2e/example/test_driver/example_e2e_io.dart +++ b/packages/integration_test/example/test_driver/example_integration_io.dart @@ -8,12 +8,12 @@ import 'dart:io' show Platform; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; -import 'package:e2e_example/main.dart' as app; +import 'package:integration_test_example/main.dart' as app; void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('verify text', (WidgetTester tester) async { // Build our app and trigger a frame. app.main(); diff --git a/packages/integration_test/example/test_driver/example_integration_test.dart b/packages/integration_test/example/test_driver/example_integration_test.dart new file mode 100644 index 000000000000..10acaa69a42e --- /dev/null +++ b/packages/integration_test/example/test_driver/example_integration_test.dart @@ -0,0 +1,5 @@ +import 'dart:async'; + +import 'package:integration_test/integration_test_driver.dart'; + +Future main() async => integrationDriver(); diff --git a/packages/e2e/example/test_driver/example_e2e_web.dart b/packages/integration_test/example/test_driver/example_integration_web.dart similarity index 84% rename from packages/e2e/example/test_driver/example_e2e_web.dart rename to packages/integration_test/example/test_driver/example_integration_web.dart index 24c3f2cbb2a4..e1141cc010c8 100644 --- a/packages/e2e/example/test_driver/example_e2e_web.dart +++ b/packages/integration_test/example/test_driver/example_integration_web.dart @@ -8,12 +8,12 @@ import 'dart:html' as html; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; -import 'package:e2e_example/main.dart' as app; +import 'package:integration_test_example/main.dart' as app; void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('verify text', (WidgetTester tester) async { // Build our app and trigger a frame. app.main(); diff --git a/packages/e2e/example/test_driver/failure.dart b/packages/integration_test/example/test_driver/failure.dart similarity index 79% rename from packages/e2e/example/test_driver/failure.dart rename to packages/integration_test/example/test_driver/failure.dart index ddeeb800bb06..ffb569f75fbb 100644 --- a/packages/e2e/example/test_driver/failure.dart +++ b/packages/integration_test/example/test_driver/failure.dart @@ -4,16 +4,16 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; -import 'package:e2e_example/main.dart' as app; +import 'package:integration_test_example/main.dart' as app; -// Tests the failure behavior of the E2EWidgetsFlutterBinding +// Tests the failure behavior of the IntegrationTestWidgetsFlutterBinding // // This test fails intentionally! It should be run using a test runner that // expects failure. void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('success', (WidgetTester tester) async { expect(1 + 1, 2); // This should pass diff --git a/packages/e2e/example/test_driver/failure_test.dart b/packages/integration_test/example/test_driver/failure_test.dart similarity index 89% rename from packages/e2e/example/test_driver/failure_test.dart rename to packages/integration_test/example/test_driver/failure_test.dart index a828df6242d7..bd9302f39409 100644 --- a/packages/e2e/example/test_driver/failure_test.dart +++ b/packages/integration_test/example/test_driver/failure_test.dart @@ -1,6 +1,6 @@ import 'dart:async'; -import 'package:e2e/common.dart' as common; +import 'package:integration_test/common.dart' as common; import 'package:flutter_driver/flutter_driver.dart'; import 'package:test/test.dart'; diff --git a/packages/e2e/example/web/favicon.png b/packages/integration_test/example/web/favicon.png similarity index 100% rename from packages/e2e/example/web/favicon.png rename to packages/integration_test/example/web/favicon.png diff --git a/packages/e2e/example/web/icons/Icon-192.png b/packages/integration_test/example/web/icons/Icon-192.png similarity index 100% rename from packages/e2e/example/web/icons/Icon-192.png rename to packages/integration_test/example/web/icons/Icon-192.png diff --git a/packages/e2e/example/web/icons/Icon-512.png b/packages/integration_test/example/web/icons/Icon-512.png similarity index 100% rename from packages/e2e/example/web/icons/Icon-512.png rename to packages/integration_test/example/web/icons/Icon-512.png diff --git a/packages/e2e/example/web/index.html b/packages/integration_test/example/web/index.html similarity index 100% rename from packages/e2e/example/web/index.html rename to packages/integration_test/example/web/index.html diff --git a/packages/e2e/example/web/manifest.json b/packages/integration_test/example/web/manifest.json similarity index 100% rename from packages/e2e/example/web/manifest.json rename to packages/integration_test/example/web/manifest.json diff --git a/packages/e2e/e2e_macos/CHANGELOG.md b/packages/integration_test/integration_test_macos/CHANGELOG.md similarity index 59% rename from packages/e2e/e2e_macos/CHANGELOG.md rename to packages/integration_test/integration_test_macos/CHANGELOG.md index a49173cad15e..ab4bac1a3f3f 100644 --- a/packages/e2e/e2e_macos/CHANGELOG.md +++ b/packages/integration_test/integration_test_macos/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2 + +* Renames package to integration_test_macos. + ## 0.0.1+1 * Remove Android folder from `e2e_macos`. diff --git a/packages/e2e/e2e_macos/LICENSE b/packages/integration_test/integration_test_macos/LICENSE similarity index 100% rename from packages/e2e/e2e_macos/LICENSE rename to packages/integration_test/integration_test_macos/LICENSE diff --git a/packages/e2e/e2e_macos/ios/e2e_macos.podspec b/packages/integration_test/integration_test_macos/ios/integration_test_macos.podspec similarity index 68% rename from packages/e2e/e2e_macos/ios/e2e_macos.podspec rename to packages/integration_test/integration_test_macos/ios/integration_test_macos.podspec index 561933b15d08..7294590a6479 100644 --- a/packages/e2e/e2e_macos/ios/e2e_macos.podspec +++ b/packages/integration_test/integration_test_macos/ios/integration_test_macos.podspec @@ -2,14 +2,14 @@ # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| - s.name = 'e2e_macos' + s.name = 'IntegrationTestMacOS' s.version = '0.0.1' - s.summary = 'No-op implementation of the e2e desktop plugin to avoid build issues on iOS' + s.summary = 'No-op implementation of the integration_test desktop plugin to avoid build issues on iOS' s.description = <<-DESC - No-op implementation of e2e to avoid build issues on iOS. + No-op implementation of integration to avoid build issues on iOS. See https://github.com/flutter/flutter/issues/39659 DESC - s.homepage = 'https://github.com/flutter/plugins/tree/master/packages/e2e/e2e_macos' + s.homepage = 'https://github.com/flutter/plugins/tree/master/packages/integration_test/integration_test_macos' s.license = { :file => '../LICENSE' } s.author = { 'Flutter Team' => 'flutter-dev@googlegroups.com' } s.source = { :path => '.' } diff --git a/packages/e2e/e2e_macos/macos/Assets/.gitkeep b/packages/integration_test/integration_test_macos/macos/Assets/.gitkeep similarity index 100% rename from packages/e2e/e2e_macos/macos/Assets/.gitkeep rename to packages/integration_test/integration_test_macos/macos/Assets/.gitkeep diff --git a/packages/e2e/e2e_macos/macos/Classes/E2EPlugin.swift b/packages/integration_test/integration_test_macos/macos/Classes/IntegrationTestPlugin.swift similarity index 75% rename from packages/e2e/e2e_macos/macos/Classes/E2EPlugin.swift rename to packages/integration_test/integration_test_macos/macos/Classes/IntegrationTestPlugin.swift index c3a80a9bcdbd..b4eb5fc410d5 100644 --- a/packages/e2e/e2e_macos/macos/Classes/E2EPlugin.swift +++ b/packages/integration_test/integration_test_macos/macos/Classes/IntegrationTestPlugin.swift @@ -1,13 +1,13 @@ import FlutterMacOS -public class E2EPlugin: NSObject, FlutterPlugin { +public class IntegrationTestPlugin: NSObject, FlutterPlugin { public static func register(with registrar: FlutterPluginRegistrar) { let channel = FlutterMethodChannel( - name: "plugins.flutter.io/e2e", + name: "plugins.flutter.io/integration_test", binaryMessenger: registrar.messenger) - let instance = E2EPlugin() + let instance = IntegrationTestPlugin() registrar.addMethodCallDelegate(instance, channel: channel) } diff --git a/packages/e2e/e2e_macos/macos/e2e_macos.podspec b/packages/integration_test/integration_test_macos/macos/integration_test_macos.podspec similarity index 77% rename from packages/e2e/e2e_macos/macos/e2e_macos.podspec rename to packages/integration_test/integration_test_macos/macos/integration_test_macos.podspec index c92addd8ba07..74bf66321319 100644 --- a/packages/e2e/e2e_macos/macos/e2e_macos.podspec +++ b/packages/integration_test/integration_test_macos/macos/integration_test_macos.podspec @@ -2,16 +2,16 @@ # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| - s.name = 'e2e_macos' + s.name = 'IntegrationTestMacOS' s.version = '0.0.1' - s.summary = 'Adapter for e2e tests.' + s.summary = 'Adapter for integration tests.' s.description = <<-DESC Runs tests that use the flutter_test API as integration tests on macOS. DESC - s.homepage = 'https://github.com/flutter/plugins/tree/master/packages/e2e/e2e_macos' + s.homepage = 'https://github.com/flutter/plugins/tree/master/packages/integration_test/integration_test_macos' s.license = { :type => 'BSD', :file => '../LICENSE' } s.author = { 'Flutter Team' => 'flutter-dev@googlegroups.com' } - s.source = { :http => 'https://github.com/flutter/plugins/tree/master/packages/e2e' } + s.source = { :http => 'https://github.com/flutter/plugins/tree/master/packages/integration_test' } s.source_files = 'Classes/**/*' s.dependency 'FlutterMacOS' diff --git a/packages/e2e/e2e_macos/pubspec.yaml b/packages/integration_test/integration_test_macos/pubspec.yaml similarity index 62% rename from packages/e2e/e2e_macos/pubspec.yaml rename to packages/integration_test/integration_test_macos/pubspec.yaml index e026f32d3b0c..46510e32b94a 100644 --- a/packages/e2e/e2e_macos/pubspec.yaml +++ b/packages/integration_test/integration_test_macos/pubspec.yaml @@ -1,14 +1,14 @@ -name: e2e_macos -description: Desktop implementation of e2e plugin +name: integration_test_macos +description: Desktop implementation of integration_test plugin version: 0.0.1+1 author: Flutter Team -homepage: https://github.com/flutter/plugins/tree/master/packages/e2e/e2e_macos +homepage: https://github.com/flutter/plugins/tree/master/packages/integration_test/integration_test_macos flutter: plugin: platforms: macos: - pluginClass: E2EPlugin + pluginClass: IntegrationTestPlugin environment: sdk: ">=2.1.0 <3.0.0" diff --git a/packages/e2e/ios/.gitignore b/packages/integration_test/ios/.gitignore similarity index 100% rename from packages/e2e/ios/.gitignore rename to packages/integration_test/ios/.gitignore diff --git a/packages/e2e/ios/Assets/.gitkeep b/packages/integration_test/ios/Assets/.gitkeep similarity index 100% rename from packages/e2e/ios/Assets/.gitkeep rename to packages/integration_test/ios/Assets/.gitkeep diff --git a/packages/integration_test/ios/Classes/IntegrationTestIosTest.h b/packages/integration_test/ios/Classes/IntegrationTestIosTest.h new file mode 100644 index 000000000000..9c53edb160e9 --- /dev/null +++ b/packages/integration_test/ios/Classes/IntegrationTestIosTest.h @@ -0,0 +1,22 @@ +#import + +@interface IntegrationTestIosTest : NSObject + +- (BOOL)testIntegrationTest:(NSString **)testResult; + +@end + +#define INTEGRATION_TEST_IOS_RUNNER(__test_class) \ + @interface __test_class : XCTestCase \ + @end \ + \ + @implementation __test_class \ + \ + -(void)testIntegrationTest { \ + NSString *testResult; \ + IntegrationTestIosTest *integrationTestIosTest = [[IntegrationTestIosTest alloc] init]; \ + BOOL testPass = [integrationTestIosTest testIntegrationTest:&testResult]; \ + XCTAssertTrue(testPass, @"%@", testResult); \ + } \ + \ + @end diff --git a/packages/e2e/ios/Classes/E2EIosTest.m b/packages/integration_test/ios/Classes/IntegrationTestIosTest.m similarity index 69% rename from packages/e2e/ios/Classes/E2EIosTest.m rename to packages/integration_test/ios/Classes/IntegrationTestIosTest.m index b788780d87e7..4243cdd86bc0 100644 --- a/packages/e2e/ios/Classes/E2EIosTest.m +++ b/packages/integration_test/ios/Classes/IntegrationTestIosTest.m @@ -1,10 +1,10 @@ -#import "E2EIosTest.h" -#import "E2EPlugin.h" +#import "IntegrationTestIosTest.h" +#import "IntegrationTestPlugin.h" -@implementation E2EIosTest +@implementation IntegrationTestIosTest -- (BOOL)testE2E:(NSString **)testResult { - E2EPlugin *e2ePlugin = [E2EPlugin instance]; +- (BOOL)testIntegrationTest:(NSString **)testResult { + IntegrationTestPlugin *integrationTestPlugin = [IntegrationTestPlugin instance]; UIViewController *rootViewController = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; if (![rootViewController isKindOfClass:[FlutterViewController class]]) { @@ -12,11 +12,11 @@ - (BOOL)testE2E:(NSString **)testResult { return NO; } FlutterViewController *flutterViewController = (FlutterViewController *)rootViewController; - [e2ePlugin setupChannels:flutterViewController.engine.binaryMessenger]; - while (!e2ePlugin.testResults) { + [integrationTestPlugin setupChannels:flutterViewController.engine.binaryMessenger]; + while (!integrationTestPlugin.testResults) { CFRunLoopRunInMode(kCFRunLoopDefaultMode, 1.f, NO); } - NSDictionary *testResults = e2ePlugin.testResults; + NSDictionary *testResults = integrationTestPlugin.testResults; NSMutableArray *passedTests = [NSMutableArray array]; NSMutableArray *failedTests = [NSMutableArray array]; NSLog(@"==================== Test Results ====================="); @@ -34,7 +34,7 @@ - (BOOL)testE2E:(NSString **)testResult { BOOL testPass = failedTests.count == 0; if (!testPass && testResult) { *testResult = - [NSString stringWithFormat:@"Detected failed E2E test(s) %@ among %@", + [NSString stringWithFormat:@"Detected failed integration test(s) %@ among %@", failedTests.description, testResults.allKeys.description]; } return testPass; diff --git a/packages/e2e/ios/Classes/E2EPlugin.h b/packages/integration_test/ios/Classes/IntegrationTestPlugin.h similarity index 63% rename from packages/e2e/ios/Classes/E2EPlugin.h rename to packages/integration_test/ios/Classes/IntegrationTestPlugin.h index e1a99f1b5a8e..8dd3109ffe09 100644 --- a/packages/e2e/ios/Classes/E2EPlugin.h +++ b/packages/integration_test/ios/Classes/IntegrationTestPlugin.h @@ -2,17 +2,19 @@ NS_ASSUME_NONNULL_BEGIN -/** A Flutter plugin that's responsible for communicating the test results back to iOS XCTest. */ -@interface E2EPlugin : NSObject +/** A Flutter plugin that's responsible for communicating the test results back + * to iOS XCTest. */ +@interface IntegrationTestPlugin : NSObject /** - * Test results that are sent from Dart when E2E test completes. Before the completion, it is + * Test results that are sent from Dart when integration test completes. Before the + * completion, it is * @c nil. */ @property(nonatomic, readonly, nullable) NSDictionary *testResults; /** Fetches the singleton instance of the plugin. */ -+ (E2EPlugin *)instance; ++ (IntegrationTestPlugin *)instance; - (void)setupChannels:(id)binaryMessenger; diff --git a/packages/e2e/ios/Classes/E2EPlugin.m b/packages/integration_test/ios/Classes/IntegrationTestPlugin.m similarity index 65% rename from packages/e2e/ios/Classes/E2EPlugin.m rename to packages/integration_test/ios/Classes/IntegrationTestPlugin.m index e025c2917201..99d0c7fdf888 100644 --- a/packages/e2e/ios/Classes/E2EPlugin.m +++ b/packages/integration_test/ios/Classes/IntegrationTestPlugin.m @@ -1,23 +1,23 @@ -#import "E2EPlugin.h" +#import "IntegrationTestPlugin.h" -static NSString *const kE2EPluginChannel = @"plugins.flutter.io/e2e"; +static NSString *const kIntegrationTestPluginChannel = @"plugins.flutter.io/integratoin_test"; static NSString *const kMethodTestFinished = @"allTestsFinished"; -@interface E2EPlugin () +@interface IntegrationTestPlugin () @property(nonatomic, readwrite) NSDictionary *testResults; @end -@implementation E2EPlugin { +@implementation IntegrationTestPlugin { NSDictionary *_testResults; } -+ (E2EPlugin *)instance { ++ (IntegrationTestPlugin *)instance { static dispatch_once_t onceToken; - static E2EPlugin *sInstance; + static IntegrationTestPlugin *sInstance; dispatch_once(&onceToken, ^{ - sInstance = [[E2EPlugin alloc] initForRegistration]; + sInstance = [[IntegrationTestPlugin alloc] initForRegistration]; }); return sInstance; } @@ -29,13 +29,14 @@ - (instancetype)initForRegistration { + (void)registerWithRegistrar:(NSObject *)registrar { // No initialization happens here because of the way XCTest loads the testing // bundles. Setup on static variables can be disregarded when a new static - // instance of E2EPlugin is allocated when the bundle is reloaded. + // instance of IntegrationTestPlugin is allocated when the bundle is reloaded. // See also: https://github.com/flutter/plugins/pull/2465 } - (void)setupChannels:(id)binaryMessenger { - FlutterMethodChannel *channel = [FlutterMethodChannel methodChannelWithName:kE2EPluginChannel - binaryMessenger:binaryMessenger]; + FlutterMethodChannel *channel = + [FlutterMethodChannel methodChannelWithName:kIntegrationTestPluginChannel + binaryMessenger:binaryMessenger]; [channel setMethodCallHandler:^(FlutterMethodCall *call, FlutterResult result) { [self handleMethodCall:call result:result]; }]; diff --git a/packages/e2e/ios/e2e.podspec b/packages/integration_test/ios/integration_test.podspec similarity index 81% rename from packages/e2e/ios/e2e.podspec rename to packages/integration_test/ios/integration_test.podspec index 0a6a6915607d..9fb0dfc9d790 100644 --- a/packages/e2e/ios/e2e.podspec +++ b/packages/integration_test/ios/integration_test.podspec @@ -2,16 +2,16 @@ # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| - s.name = 'e2e' + s.name = 'integration_test' s.version = '0.0.1' - s.summary = 'Adapter for e2e tests.' + s.summary = 'Adapter for integration tests.' s.description = <<-DESC Runs tests that use the flutter_test API as integration tests. DESC - s.homepage = 'https://github.com/flutter/plugins/tree/master/packages/e2e' + s.homepage = 'https://github.com/flutter/plugins/tree/master/packages/integration_test' s.license = { :type => 'BSD', :file => '../LICENSE' } s.author = { 'Flutter Team' => 'flutter-dev@googlegroups.com' } - s.source = { :http => 'https://github.com/flutter/plugins/tree/master/packages/e2e' } + s.source = { :http => 'https://github.com/flutter/plugins/tree/master/packages/integration_test' } s.source_files = 'Classes/**/*' s.public_header_files = 'Classes/**/*.h' s.dependency 'Flutter' diff --git a/packages/e2e/lib/_extension_io.dart b/packages/integration_test/lib/_extension_io.dart similarity index 100% rename from packages/e2e/lib/_extension_io.dart rename to packages/integration_test/lib/_extension_io.dart diff --git a/packages/e2e/lib/_extension_web.dart b/packages/integration_test/lib/_extension_web.dart similarity index 100% rename from packages/e2e/lib/_extension_web.dart rename to packages/integration_test/lib/_extension_web.dart diff --git a/packages/e2e/lib/common.dart b/packages/integration_test/lib/common.dart similarity index 97% rename from packages/e2e/lib/common.dart rename to packages/integration_test/lib/common.dart index 4325b6555ba8..3363e3c91989 100644 --- a/packages/e2e/lib/common.dart +++ b/packages/integration_test/lib/common.dart @@ -4,7 +4,7 @@ import 'dart:convert'; -/// An object sent from e2e back to the Flutter Driver in response to +/// An object sent from integration_test back to the Flutter Driver in response to /// `request_data` command. class Response { final List _failureDetails; diff --git a/packages/e2e/lib/e2e.dart b/packages/integration_test/lib/integration_test.dart similarity index 88% rename from packages/e2e/lib/e2e.dart rename to packages/integration_test/lib/integration_test.dart index 93ce1f2c6cac..6354ef768939 100644 --- a/packages/e2e/lib/e2e.dart +++ b/packages/integration_test/lib/integration_test.dart @@ -15,16 +15,18 @@ import '_extension_io.dart' if (dart.library.html) '_extension_web.dart'; /// A subclass of [LiveTestWidgetsFlutterBinding] that reports tests results /// on a channel to adapt them to native instrumentation test format. -class E2EWidgetsFlutterBinding extends LiveTestWidgetsFlutterBinding { +class IntegrationTestWidgetsFlutterBinding + extends LiveTestWidgetsFlutterBinding { /// Sets up a listener to report that the tests are finished when everything is /// torn down. - E2EWidgetsFlutterBinding() { + IntegrationTestWidgetsFlutterBinding() { // TODO(jackson): Report test results as they arrive tearDownAll(() async { + print('TESTING123: TEARING HER DOWN'); try { // For web integration tests we are not using the - // `plugins.flutter.io/e2e`. Mark the tests as complete before invoking - // the channel. + // `plugins.flutter.io/integration_test`. Mark the tests as complete + // before invoking the channel. if (kIsWeb) { if (!_allTestsPassed.isCompleted) { _allTestsPassed.complete(true); @@ -35,7 +37,7 @@ class E2EWidgetsFlutterBinding extends LiveTestWidgetsFlutterBinding { {'results': results}, ); } on MissingPluginException { - print('Warning: E2E test plugin was not detected.'); + print('Warning: integration_test test plugin was not detected.'); } if (!_allTestsPassed.isCompleted) _allTestsPassed.complete(true); }); @@ -101,17 +103,19 @@ class E2EWidgetsFlutterBinding extends LiveTestWidgetsFlutterBinding { /// Similar to [WidgetsFlutterBinding.ensureInitialized]. /// - /// Returns an instance of the [E2EWidgetsFlutterBinding], creating and + /// Returns an instance of the [IntegrationTestWidgetsFlutterBinding], creating and /// initializing it if necessary. static WidgetsBinding ensureInitialized() { + print('TESTING123 ensuring init'); if (WidgetsBinding.instance == null) { - E2EWidgetsFlutterBinding(); + IntegrationTestWidgetsFlutterBinding(); } - assert(WidgetsBinding.instance is E2EWidgetsFlutterBinding); + assert(WidgetsBinding.instance is IntegrationTestWidgetsFlutterBinding); return WidgetsBinding.instance; } - static const MethodChannel _channel = MethodChannel('plugins.flutter.io/e2e'); + static const MethodChannel _channel = + MethodChannel('plugins.flutter.io/integration_test'); /// Test results that will be populated after the tests have completed. /// diff --git a/packages/e2e/lib/e2e_driver.dart b/packages/integration_test/lib/integration_test_driver.dart similarity index 77% rename from packages/e2e/lib/e2e_driver.dart rename to packages/integration_test/lib/integration_test_driver.dart index c33083e07574..e5160b4e8d68 100644 --- a/packages/e2e/lib/e2e_driver.dart +++ b/packages/integration_test/lib/integration_test_driver.dart @@ -8,12 +8,9 @@ import 'dart:io'; import 'package:flutter_driver/flutter_driver.dart'; -import 'package:e2e/common.dart' as e2e; +import 'package:integration_test/common.dart'; import 'package:path/path.dart' as path; -/// This method remains for backword compatibility. -Future main() => e2eDriver(); - /// Flutter Driver test output directory. /// /// Tests should write any output files to this directory. Defaults to the path @@ -22,16 +19,16 @@ Future main() => e2eDriver(); String testOutputsDirectory = Platform.environment['FLUTTER_TEST_OUTPUTS_DIR'] ?? 'build'; -/// The callback type to handle [e2e.Response.data] after the test succcess. +/// The callback type to handle [integration_test.Response.data] after the test succcess. typedef ResponseDataCallback = FutureOr Function(Map); /// Writes a json-serializable json data to to /// [testOutputsDirectory]/`testOutputFilename.json`. /// -/// This is the default `responseDataCallback` in [e2eDriver]. +/// This is the default `responseDataCallback` in [integrationDriver]. Future writeResponseData( Map data, { - String testOutputFilename = 'e2e_response_data', + String testOutputFilename = 'integration_response_data', String destinationDirectory, }) async { assert(testOutputFilename != null); @@ -45,33 +42,33 @@ Future writeResponseData( await file.writeAsString(resultString); } -/// Adaptor to run E2E test using `flutter drive`. +/// Adaptor to run an integration test using `flutter drive`. /// /// `timeout` controls the longest time waited before the test ends. /// It is not necessarily the execution time for the test app: the test may /// finish sooner than the `timeout`. /// -/// `responseDataCallback` is the handler for processing [e2e.Response.data]. +/// `responseDataCallback` is the handler for processing [integration_test.Response.data]. /// The default value is `writeResponseData`. /// -/// To an E2E test `.dart` using `flutter drive`, put a file named +/// To an integration test `.dart` using `flutter drive`, put a file named /// `_test.dart` in the app's `test_driver` directory: /// /// ```dart /// import 'dart:async'; /// -/// import 'package:e2e/e2e_driver.dart' as e2e; +/// import 'package:integration_test/integration_test_driver.dart'; /// -/// Future main() async => e2e.e2eDriver(); +/// Future main() async => integrationDriver(); /// /// ``` -Future e2eDriver({ +Future integrationDriver({ Duration timeout = const Duration(minutes: 1), ResponseDataCallback responseDataCallback = writeResponseData, }) async { final FlutterDriver driver = await FlutterDriver.connect(); final String jsonResult = await driver.requestData(null, timeout: timeout); - final e2e.Response response = e2e.Response.fromJson(jsonResult); + final Response response = Response.fromJson(jsonResult); await driver.close(); if (response.allTestsPassed) { diff --git a/packages/e2e/pubspec.yaml b/packages/integration_test/pubspec.yaml similarity index 69% rename from packages/e2e/pubspec.yaml rename to packages/integration_test/pubspec.yaml index 221dd3a8b047..b222531044e9 100644 --- a/packages/e2e/pubspec.yaml +++ b/packages/integration_test/pubspec.yaml @@ -1,7 +1,7 @@ -name: e2e +name: integration_test description: Runs tests that use the flutter_test API as integration tests. -version: 0.7.0 -homepage: https://github.com/flutter/plugins/tree/master/packages/e2e +version: 0.8.0 +homepage: https://github.com/flutter/plugins/tree/master/packages/integration_test environment: sdk: ">=2.2.2 <3.0.0" @@ -23,7 +23,7 @@ flutter: plugin: platforms: android: - package: dev.flutter.plugins.e2e - pluginClass: E2EPlugin + package: dev.flutter.plugins.integration_test + pluginClass: IntegrationTestPlugin ios: - pluginClass: E2EPlugin + pluginClass: IntegrationTestPlugin diff --git a/packages/e2e/test/binding_fail_test.dart b/packages/integration_test/test/binding_fail_test.dart similarity index 73% rename from packages/e2e/test/binding_fail_test.dart rename to packages/integration_test/test/binding_fail_test.dart index 0b00e1177e55..020fb9607608 100644 --- a/packages/e2e/test/binding_fail_test.dart +++ b/packages/integration_test/test/binding_fail_test.dart @@ -6,10 +6,11 @@ import 'package:flutter_test/flutter_test.dart'; // Assumes that the flutter command is in `$PATH`. const String _flutterBin = 'flutter'; -const String _e2eResultsPrefix = 'E2EWidgetsFlutterBinding test results:'; +const String _integrationResultsPrefix = + 'IntegrationTestWidgetsFlutterBinding test results:'; void main() async { - group('E2E binding result', () { + group('Integration binding result', () { test('when multiple tests pass', () async { final Map results = await _runTest('test/data/pass_test_script.dart'); @@ -48,18 +49,18 @@ void main() async { }); } -/// Runs a test script and returns the [E2EWidgetsFlutterBinding.result]. +/// Runs a test script and returns the [IntegrationTestWidgetsFlutterBinding.result]. /// /// [scriptPath] is relative to the package root. Future> _runTest(String scriptPath) async { final Process process = await Process.start(_flutterBin, ['test', '--machine', scriptPath]); - // In the test [tearDownAll] block, the test results are encoded into JSON and - // are printed with the [_e2eResultsPrefix] prefix. - // - // See the following for the test event spec which we parse the printed lines - // out of: https://github.com/dart-lang/test/blob/master/pkgs/test/doc/json_reporter.md + /// In the test [tearDownAll] block, the test results are encoded into JSON and + /// are printed with the [_integrationResultsPrefix] prefix. + /// + /// See the following for the test event spec which we parse the printed lines + /// out of: https://github.com/dart-lang/test/blob/master/pkgs/test/doc/json_reporter.md final String testResults = (await process.stdout .transform(utf8.decoder) .expand((String text) => text.split('\n')) @@ -73,9 +74,9 @@ Future> _runTest(String scriptPath) async { .where((dynamic testEvent) => testEvent != null && testEvent['type'] == 'print') .map((dynamic printEvent) => printEvent['message'] as String) - .firstWhere( - (String message) => message.startsWith(_e2eResultsPrefix))) - .replaceAll(_e2eResultsPrefix, ''); + .firstWhere((String message) => + message.startsWith(_integrationResultsPrefix))) + .replaceAll(_integrationResultsPrefix, ''); return jsonDecode(testResults); } diff --git a/packages/e2e/test/binding_test.dart b/packages/integration_test/test/binding_test.dart similarity index 70% rename from packages/e2e/test/binding_test.dart rename to packages/integration_test/test/binding_test.dart index 50ff42dba39c..bad365ac59b6 100644 --- a/packages/e2e/test/binding_test.dart +++ b/packages/integration_test/test/binding_test.dart @@ -1,30 +1,31 @@ import 'package:flutter/material.dart'; -import 'package:e2e/e2e.dart'; -import 'package:e2e/common.dart'; +import 'package:integration_test/integration_test.dart'; +import 'package:integration_test/common.dart'; import 'package:flutter_test/flutter_test.dart'; void main() async { Future> request; - group('Test E2E binding', () { - final WidgetsBinding binding = E2EWidgetsFlutterBinding.ensureInitialized(); - assert(binding is E2EWidgetsFlutterBinding); - final E2EWidgetsFlutterBinding e2eBinding = - binding as E2EWidgetsFlutterBinding; + group('Test Integration binding', () { + final WidgetsBinding binding = + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + assert(binding is IntegrationTestWidgetsFlutterBinding); + final IntegrationTestWidgetsFlutterBinding integrationBinding = + binding as IntegrationTestWidgetsFlutterBinding; setUp(() { - request = e2eBinding.callback({ + request = integrationBinding.callback({ 'command': 'request_data', }); }); - testWidgets('Run E2E app', (WidgetTester tester) async { + testWidgets('Run Integration app', (WidgetTester tester) async { runApp(MaterialApp( home: Text('Test'), )); - expect(tester.binding, e2eBinding); - e2eBinding.reportData = {'answer': 42}; + expect(tester.binding, integrationBinding); + integrationBinding.reportData = {'answer': 42}; }); testWidgets('setSurfaceSize works', (WidgetTester tester) async { @@ -57,7 +58,7 @@ void main() async { tearDownAll(() async { // This part is outside the group so that `request` has been compeleted as // part of the `tearDownAll` registerred in the group during - // `E2EWidgetsFlutterBinding` initialization. + // `IntegrationTestWidgetsFlutterBinding` initialization. final Map response = (await request)['response'] as Map; final String message = response['message'] as String; diff --git a/packages/e2e/test/data/README.md b/packages/integration_test/test/data/README.md similarity index 100% rename from packages/e2e/test/data/README.md rename to packages/integration_test/test/data/README.md diff --git a/packages/e2e/test/data/fail_test_script.dart b/packages/integration_test/test/data/fail_test_script.dart similarity index 54% rename from packages/e2e/test/data/fail_test_script.dart rename to packages/integration_test/test/data/fail_test_script.dart index cbca5900fe29..05a75d7d031e 100644 --- a/packages/e2e/test/data/fail_test_script.dart +++ b/packages/integration_test/test/data/fail_test_script.dart @@ -1,11 +1,11 @@ import 'dart:convert'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; import 'package:flutter_test/flutter_test.dart'; void main() async { - final E2EWidgetsFlutterBinding binding = - E2EWidgetsFlutterBinding.ensureInitialized(); + final IntegrationTestWidgetsFlutterBinding binding = + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('failing test 1', (WidgetTester tester) async { expect(true, false); @@ -17,6 +17,6 @@ void main() async { tearDownAll(() { print( - 'E2EWidgetsFlutterBinding test results: ${jsonEncode(binding.results)}'); + 'IntegrationTestWidgetsFlutterBinding test results: ${jsonEncode(binding.results)}'); }); } diff --git a/packages/e2e/test/data/pass_test_script.dart b/packages/integration_test/test/data/pass_test_script.dart similarity index 54% rename from packages/e2e/test/data/pass_test_script.dart rename to packages/integration_test/test/data/pass_test_script.dart index 194f71cdfe9b..7e222c8e8961 100644 --- a/packages/e2e/test/data/pass_test_script.dart +++ b/packages/integration_test/test/data/pass_test_script.dart @@ -1,11 +1,11 @@ import 'dart:convert'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; import 'package:flutter_test/flutter_test.dart'; void main() async { - final E2EWidgetsFlutterBinding binding = - E2EWidgetsFlutterBinding.ensureInitialized(); + final IntegrationTestWidgetsFlutterBinding binding = + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('passing test 1', (WidgetTester tester) async { expect(true, true); @@ -17,6 +17,6 @@ void main() async { tearDownAll(() { print( - 'E2EWidgetsFlutterBinding test results: ${jsonEncode(binding.results)}'); + 'IntegrationTestWidgetsFlutterBinding test results: ${jsonEncode(binding.results)}'); }); } diff --git a/packages/e2e/test/data/pass_then_fail_test_script.dart b/packages/integration_test/test/data/pass_then_fail_test_script.dart similarity index 53% rename from packages/e2e/test/data/pass_then_fail_test_script.dart rename to packages/integration_test/test/data/pass_then_fail_test_script.dart index ffb7cac5cd5d..324c1c21cfa6 100644 --- a/packages/e2e/test/data/pass_then_fail_test_script.dart +++ b/packages/integration_test/test/data/pass_then_fail_test_script.dart @@ -1,11 +1,11 @@ import 'dart:convert'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; import 'package:flutter_test/flutter_test.dart'; void main() async { - final E2EWidgetsFlutterBinding binding = - E2EWidgetsFlutterBinding.ensureInitialized(); + final IntegrationTestWidgetsFlutterBinding binding = + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('passing test', (WidgetTester tester) async { expect(true, true); @@ -17,6 +17,6 @@ void main() async { tearDownAll(() { print( - 'E2EWidgetsFlutterBinding test results: ${jsonEncode(binding.results)}'); + 'IntegrationTestWidgetsFlutterBinding test results: ${jsonEncode(binding.results)}'); }); } diff --git a/packages/e2e/test/response_serialization_test.dart b/packages/integration_test/test/response_serialization_test.dart similarity index 97% rename from packages/e2e/test/response_serialization_test.dart rename to packages/integration_test/test/response_serialization_test.dart index 4d823e2ebf10..8b969402035d 100644 --- a/packages/e2e/test/response_serialization_test.dart +++ b/packages/integration_test/test/response_serialization_test.dart @@ -1,6 +1,6 @@ import 'package:flutter_test/flutter_test.dart'; -import 'package:e2e/common.dart'; +import 'package:integration_test/common.dart'; void main() { test('Serialize and deserialize Failure', () { diff --git a/packages/local_auth/CHANGELOG.md b/packages/local_auth/CHANGELOG.md index 280de9ffbce6..222014af2153 100644 --- a/packages/local_auth/CHANGELOG.md +++ b/packages/local_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.6.3+1 + +* Update package:e2e -> package:integration_test + ## 0.6.3 * Increase upper range of `package:platform` constraint to allow 3.X versions. diff --git a/packages/local_auth/example/android/app/src/androidTest/java/io/flutter/plugins/localauth/EmbeddingV1ActivityTest.java b/packages/local_auth/example/android/app/src/androidTest/java/io/flutter/plugins/localauth/EmbeddingV1ActivityTest.java index 354f86b10ac6..6b125e4cf8e2 100644 --- a/packages/local_auth/example/android/app/src/androidTest/java/io/flutter/plugins/localauth/EmbeddingV1ActivityTest.java +++ b/packages/local_auth/example/android/app/src/androidTest/java/io/flutter/plugins/localauth/EmbeddingV1ActivityTest.java @@ -1,7 +1,7 @@ package io.flutter.plugins.localauth; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import io.flutter.plugins.localauthexample.EmbeddingV1Activity; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/local_auth/example/android/app/src/androidTest/java/io/flutter/plugins/localauth/MainActivityTest.java b/packages/local_auth/example/android/app/src/androidTest/java/io/flutter/plugins/localauth/MainActivityTest.java index 222316395505..3d2d55bce0fa 100644 --- a/packages/local_auth/example/android/app/src/androidTest/java/io/flutter/plugins/localauth/MainActivityTest.java +++ b/packages/local_auth/example/android/app/src/androidTest/java/io/flutter/plugins/localauth/MainActivityTest.java @@ -1,7 +1,7 @@ package io.flutter.plugins.localauth; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import io.flutter.embedding.android.FlutterFragmentActivity; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/local_auth/example/android/app/src/main/java/io/flutter/plugins/localauthexample/EmbeddingV1Activity.java b/packages/local_auth/example/android/app/src/main/java/io/flutter/plugins/localauthexample/EmbeddingV1Activity.java index 166a043e9b66..456d5407c4be 100644 --- a/packages/local_auth/example/android/app/src/main/java/io/flutter/plugins/localauthexample/EmbeddingV1Activity.java +++ b/packages/local_auth/example/android/app/src/main/java/io/flutter/plugins/localauthexample/EmbeddingV1Activity.java @@ -1,7 +1,7 @@ package io.flutter.plugins.localauthexample; import android.os.Bundle; -import dev.flutter.plugins.e2e.E2EPlugin; +import dev.flutter.plugins.integration_test.IntegrationTestPlugin; import io.flutter.app.FlutterFragmentActivity; import io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin; import io.flutter.plugins.localauth.LocalAuthPlugin; @@ -10,7 +10,8 @@ public class EmbeddingV1Activity extends FlutterFragmentActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - E2EPlugin.registerWith(registrarFor("dev.flutter.plugins.e2e.E2EPlugin")); + IntegrationTestPlugin.registerWith( + registrarFor("dev.flutter.plugins.integration_test.IntegrationTestPlugin")); FlutterAndroidLifecyclePlugin.registerWith( registrarFor( "io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin")); diff --git a/packages/local_auth/example/pubspec.yaml b/packages/local_auth/example/pubspec.yaml index 478b37409f3e..8d17a43efb26 100644 --- a/packages/local_auth/example/pubspec.yaml +++ b/packages/local_auth/example/pubspec.yaml @@ -8,8 +8,8 @@ dependencies: path: ../ dev_dependencies: - e2e: - path: ../../e2e + integration_test: + path: ../../integration_test flutter_driver: sdk: flutter pedantic: ^1.8.0 diff --git a/packages/local_auth/pubspec.yaml b/packages/local_auth/pubspec.yaml index 2b11d7187f98..57bf9fa37b6c 100644 --- a/packages/local_auth/pubspec.yaml +++ b/packages/local_auth/pubspec.yaml @@ -2,7 +2,7 @@ name: local_auth description: Flutter plugin for Android and iOS device authentication sensors such as Fingerprint Reader and Touch ID. homepage: https://github.com/flutter/plugins/tree/master/packages/local_auth -version: 0.6.3 +version: 0.6.3+1 flutter: plugin: @@ -22,8 +22,8 @@ dependencies: flutter_plugin_android_lifecycle: ^1.0.2 dev_dependencies: - e2e: - path: ../e2e + integration_test: + path: ../integration_test flutter_driver: sdk: flutter flutter_test: diff --git a/packages/local_auth/test/local_auth_e2e.dart b/packages/local_auth/test/local_auth_e2e.dart index 5e9dc57b73f6..47e5dfa67912 100644 --- a/packages/local_auth/test/local_auth_e2e.dart +++ b/packages/local_auth/test/local_auth_e2e.dart @@ -1,10 +1,10 @@ import 'package:flutter_test/flutter_test.dart'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; import 'package:local_auth/local_auth.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('canCheckBiometrics', (WidgetTester tester) async { expect(LocalAuthentication().getAvailableBiometrics(), completion(isList)); diff --git a/packages/package_info/CHANGELOG.md b/packages/package_info/CHANGELOG.md index 5b5c78144efc..f88c270d92a3 100644 --- a/packages/package_info/CHANGELOG.md +++ b/packages/package_info/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.4.3 + +* Update package:e2e -> package:integration_test + ## 0.4.2 * Update package:e2e reference to use the local version in the flutter/plugins diff --git a/packages/package_info/example/android/app/src/androidTest/java/io/flutter/plugins/packageinfoexample/EmbedderV1ActivityTest.java b/packages/package_info/example/android/app/src/androidTest/java/io/flutter/plugins/packageinfoexample/EmbedderV1ActivityTest.java index 2da6799c19c4..ab1d2d29635e 100644 --- a/packages/package_info/example/android/app/src/androidTest/java/io/flutter/plugins/packageinfoexample/EmbedderV1ActivityTest.java +++ b/packages/package_info/example/android/app/src/androidTest/java/io/flutter/plugins/packageinfoexample/EmbedderV1ActivityTest.java @@ -5,7 +5,7 @@ package io.flutter.plugins.packageinfoexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/package_info/example/android/app/src/androidTest/java/io/flutter/plugins/packageinfoexample/MainActivityTest.java b/packages/package_info/example/android/app/src/androidTest/java/io/flutter/plugins/packageinfoexample/MainActivityTest.java index 363ccecd5ebd..91aad52d4241 100644 --- a/packages/package_info/example/android/app/src/androidTest/java/io/flutter/plugins/packageinfoexample/MainActivityTest.java +++ b/packages/package_info/example/android/app/src/androidTest/java/io/flutter/plugins/packageinfoexample/MainActivityTest.java @@ -5,7 +5,7 @@ package io.flutter.plugins.packageinfoexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/package_info/example/pubspec.yaml b/packages/package_info/example/pubspec.yaml index 8b4bd88c9acf..a6dbbce44811 100644 --- a/packages/package_info/example/pubspec.yaml +++ b/packages/package_info/example/pubspec.yaml @@ -6,8 +6,8 @@ dependencies: sdk: flutter package_info: path: ../ - e2e: - path: ../../e2e + integration_test: + path: ../../integration_test dev_dependencies: flutter_driver: diff --git a/packages/package_info/example/test_driver/package_info_e2e.dart b/packages/package_info/example/test_driver/package_info_e2e.dart index d701c8030bd9..5038509ec84f 100644 --- a/packages/package_info/example/test_driver/package_info_e2e.dart +++ b/packages/package_info/example/test_driver/package_info_e2e.dart @@ -4,12 +4,12 @@ import 'dart:io'; import 'package:flutter_test/flutter_test.dart'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; import 'package:package_info/package_info.dart'; import 'package:package_info_example/main.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('fromPlatform', (WidgetTester tester) async { final PackageInfo info = await PackageInfo.fromPlatform(); diff --git a/packages/package_info/pubspec.yaml b/packages/package_info/pubspec.yaml index 0634da129370..0705dd11d139 100644 --- a/packages/package_info/pubspec.yaml +++ b/packages/package_info/pubspec.yaml @@ -5,7 +5,7 @@ homepage: https://github.com/flutter/plugins/tree/master/packages/package_info # 0.4.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.4.2 +version: 0.4.3 flutter: plugin: @@ -28,8 +28,8 @@ dev_dependencies: flutter_driver: sdk: flutter test: any - e2e: - path: ../e2e + integration_test: + path: ../integration_test pedantic: ^1.8.0 environment: diff --git a/packages/path_provider/path_provider/CHANGELOG.md b/packages/path_provider/path_provider/CHANGELOG.md index eab5b5f62a2d..07778d5ccef3 100644 --- a/packages/path_provider/path_provider/CHANGELOG.md +++ b/packages/path_provider/path_provider/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.6.14 + +* Update package:e2e -> package:integration_test + ## 1.6.13 * Update package:e2e reference to use the local version in the flutter/plugins diff --git a/packages/path_provider/path_provider/example/android/app/src/androidTest/java/EmbeddingV1ActivityTest.java b/packages/path_provider/path_provider/example/android/app/src/androidTest/java/EmbeddingV1ActivityTest.java index 00ebeffe038a..50cb342715cb 100644 --- a/packages/path_provider/path_provider/example/android/app/src/androidTest/java/EmbeddingV1ActivityTest.java +++ b/packages/path_provider/path_provider/example/android/app/src/androidTest/java/EmbeddingV1ActivityTest.java @@ -2,7 +2,7 @@ package io.flutter.plugins.pathprovider; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import io.flutter.plugins.pathproviderexample.EmbeddingV1Activity; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/path_provider/path_provider/example/android/app/src/androidTest/java/MainActivityTest.java b/packages/path_provider/path_provider/example/android/app/src/androidTest/java/MainActivityTest.java index 59725c7123a5..a99767c4ccf9 100644 --- a/packages/path_provider/path_provider/example/android/app/src/androidTest/java/MainActivityTest.java +++ b/packages/path_provider/path_provider/example/android/app/src/androidTest/java/MainActivityTest.java @@ -2,7 +2,7 @@ package io.flutter.plugins.pathprovider; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/path_provider/path_provider/example/android/app/src/main/java/io/flutter/plugins/pathproviderexample/EmbeddingV1Activity.java b/packages/path_provider/path_provider/example/android/app/src/main/java/io/flutter/plugins/pathproviderexample/EmbeddingV1Activity.java index 2a59361e7f67..6c4a6185359c 100644 --- a/packages/path_provider/path_provider/example/android/app/src/main/java/io/flutter/plugins/pathproviderexample/EmbeddingV1Activity.java +++ b/packages/path_provider/path_provider/example/android/app/src/main/java/io/flutter/plugins/pathproviderexample/EmbeddingV1Activity.java @@ -2,7 +2,7 @@ package io.flutter.plugins.pathproviderexample; import android.os.Bundle; -import dev.flutter.plugins.e2e.E2EPlugin; +import dev.flutter.plugins.integration_test.IntegrationTestPlugin; import io.flutter.app.FlutterActivity; import io.flutter.plugins.pathprovider.PathProviderPlugin; @@ -10,7 +10,8 @@ public class EmbeddingV1Activity extends FlutterActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - E2EPlugin.registerWith(registrarFor("dev.flutter.plugins.e2e.E2EPlugin")); + IntegrationTestPlugin.registerWith( + registrarFor("dev.flutter.plugins.integration_test.IntegrationTestPlugin")); PathProviderPlugin.registerWith( registrarFor("io.flutter.plugins.pathprovider.PathProviderPlugin")); } diff --git a/packages/path_provider/path_provider/example/pubspec.yaml b/packages/path_provider/path_provider/example/pubspec.yaml index 367c6c68df45..983b3b82eb53 100644 --- a/packages/path_provider/path_provider/example/pubspec.yaml +++ b/packages/path_provider/path_provider/example/pubspec.yaml @@ -8,8 +8,8 @@ dependencies: path: ../ dev_dependencies: - e2e: - path: ../../../e2e + integration_test: + path: ../../../integration_test flutter_driver: sdk: flutter test: any diff --git a/packages/path_provider/path_provider/example/test_driver/path_provider_e2e.dart b/packages/path_provider/path_provider/example/test_driver/path_provider_e2e.dart index d3a1019a7c23..8eb8520b5b4b 100644 --- a/packages/path_provider/path_provider/example/test_driver/path_provider_e2e.dart +++ b/packages/path_provider/path_provider/example/test_driver/path_provider_e2e.dart @@ -7,10 +7,10 @@ import 'dart:async'; import 'dart:io'; import 'package:flutter_test/flutter_test.dart'; import 'package:path_provider/path_provider.dart'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('getTemporaryDirectory', (WidgetTester tester) async { final Directory result = await getTemporaryDirectory(); diff --git a/packages/path_provider/path_provider/pubspec.yaml b/packages/path_provider/path_provider/pubspec.yaml index cac4ff2656f4..7781c76331d4 100644 --- a/packages/path_provider/path_provider/pubspec.yaml +++ b/packages/path_provider/path_provider/pubspec.yaml @@ -2,7 +2,7 @@ name: path_provider description: Flutter plugin for getting commonly used locations on the Android & iOS file systems, such as the temp and app data directories. homepage: https://github.com/flutter/plugins/tree/master/packages/path_provider/path_provider -version: 1.6.13 +version: 1.6.14 flutter: plugin: @@ -25,8 +25,8 @@ dependencies: path_provider_linux: ^0.0.1 dev_dependencies: - e2e: - path: ../../e2e + integration_test: + path: ../../integration_test flutter_test: sdk: flutter flutter_driver: diff --git a/packages/path_provider/path_provider/test/path_provider_e2e.dart b/packages/path_provider/path_provider/test/path_provider_e2e.dart index 545671e32b01..18570aeca57e 100644 --- a/packages/path_provider/path_provider/test/path_provider_e2e.dart +++ b/packages/path_provider/path_provider/test/path_provider_e2e.dart @@ -1,9 +1,9 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:path_provider/path_provider.dart'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('Can get temporary directory', (WidgetTester tester) async { final String tempPath = (await getTemporaryDirectory()).path; diff --git a/packages/path_provider/path_provider_linux/example/pubspec.yaml b/packages/path_provider/path_provider_linux/example/pubspec.yaml index 186142d1d3a7..85dbb24bbb29 100644 --- a/packages/path_provider/path_provider_linux/example/pubspec.yaml +++ b/packages/path_provider/path_provider_linux/example/pubspec.yaml @@ -24,8 +24,8 @@ dev_dependencies: sdk: flutter flutter_driver: sdk: flutter - e2e: - path: ../../../e2e + integration_test: + path: ../../../integration_test # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/packages/path_provider/path_provider_linux/example/test_driver/path_provider_e2e.dart b/packages/path_provider/path_provider_linux/example/test_driver/path_provider_e2e.dart index c90c4d96dde5..18ac49debbd4 100644 --- a/packages/path_provider/path_provider_linux/example/test_driver/path_provider_e2e.dart +++ b/packages/path_provider/path_provider_linux/example/test_driver/path_provider_e2e.dart @@ -5,10 +5,10 @@ import 'dart:io'; import 'package:flutter_test/flutter_test.dart'; import 'package:path_provider/path_provider.dart'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('getTemporaryDirectory', (WidgetTester tester) async { final Directory result = await getTemporaryDirectory(); diff --git a/packages/path_provider/path_provider_macos/example/android/app/src/androidTest/java/EmbeddingV1ActivityTest.java b/packages/path_provider/path_provider_macos/example/android/app/src/androidTest/java/EmbeddingV1ActivityTest.java index 00ebeffe038a..50cb342715cb 100644 --- a/packages/path_provider/path_provider_macos/example/android/app/src/androidTest/java/EmbeddingV1ActivityTest.java +++ b/packages/path_provider/path_provider_macos/example/android/app/src/androidTest/java/EmbeddingV1ActivityTest.java @@ -2,7 +2,7 @@ package io.flutter.plugins.pathprovider; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import io.flutter.plugins.pathproviderexample.EmbeddingV1Activity; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/path_provider/path_provider_macos/example/android/app/src/androidTest/java/MainActivityTest.java b/packages/path_provider/path_provider_macos/example/android/app/src/androidTest/java/MainActivityTest.java index 9f8e2c272a9a..09e000524a69 100644 --- a/packages/path_provider/path_provider_macos/example/android/app/src/androidTest/java/MainActivityTest.java +++ b/packages/path_provider/path_provider_macos/example/android/app/src/androidTest/java/MainActivityTest.java @@ -2,7 +2,7 @@ package io.flutter.plugins.pathprovider; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import io.flutter.plugins.pathproviderexample.MainActivity; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/path_provider/path_provider_macos/example/android/app/src/main/java/io/flutter/plugins/pathproviderexample/MainActivity.java b/packages/path_provider/path_provider_macos/example/android/app/src/main/java/io/flutter/plugins/pathproviderexample/MainActivity.java index 36372960fe9c..bdecc162446a 100644 --- a/packages/path_provider/path_provider_macos/example/android/app/src/main/java/io/flutter/plugins/pathproviderexample/MainActivity.java +++ b/packages/path_provider/path_provider_macos/example/android/app/src/main/java/io/flutter/plugins/pathproviderexample/MainActivity.java @@ -4,7 +4,7 @@ package io.flutter.plugins.pathproviderexample; -import dev.flutter.plugins.e2e.E2EPlugin; +import dev.flutter.plugins.integration_test.IntegrationTestPlugin; import io.flutter.embedding.android.FlutterActivity; import io.flutter.embedding.engine.FlutterEngine; import io.flutter.plugins.pathprovider.PathProviderPlugin; @@ -14,6 +14,6 @@ public class MainActivity extends FlutterActivity { @Override public void configureFlutterEngine(FlutterEngine flutterEngine) { flutterEngine.getPlugins().add(new PathProviderPlugin()); - flutterEngine.getPlugins().add(new E2EPlugin()); + flutterEngine.getPlugins().add(new IntegrationTestPlugin()); } } diff --git a/packages/path_provider/path_provider_macos/example/pubspec.yaml b/packages/path_provider/path_provider_macos/example/pubspec.yaml index e80768763e8b..1ba991dc8160 100644 --- a/packages/path_provider/path_provider_macos/example/pubspec.yaml +++ b/packages/path_provider/path_provider_macos/example/pubspec.yaml @@ -9,8 +9,8 @@ dependencies: path: ../ dev_dependencies: - e2e: - path: ../../../e2e + integration_test: + path: ../../../integration_test flutter_driver: sdk: flutter test: any diff --git a/packages/path_provider/path_provider_macos/example/test_driver/path_provider_e2e.dart b/packages/path_provider/path_provider_macos/example/test_driver/path_provider_e2e.dart index 6cb8362b76d5..58a4d1805cb0 100644 --- a/packages/path_provider/path_provider_macos/example/test_driver/path_provider_e2e.dart +++ b/packages/path_provider/path_provider_macos/example/test_driver/path_provider_e2e.dart @@ -5,10 +5,10 @@ import 'dart:io'; import 'package:flutter_test/flutter_test.dart'; import 'package:path_provider/path_provider.dart'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('getTemporaryDirectory', (WidgetTester tester) async { final Directory result = await getTemporaryDirectory(); diff --git a/packages/quick_actions/CHANGELOG.md b/packages/quick_actions/CHANGELOG.md index f1f7f85de08b..b850014e2bf0 100644 --- a/packages/quick_actions/CHANGELOG.md +++ b/packages/quick_actions/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.4.0+8 + +* Update package:e2e -> package:integration_test + ## 0.4.0+7 * Update package:e2e reference to use the local version in the flutter/plugins diff --git a/packages/quick_actions/example/android/app/src/main/java/io/flutter/plugins/quickactionsexample/EmbeddingV1ActivityTest.java b/packages/quick_actions/example/android/app/src/main/java/io/flutter/plugins/quickactionsexample/EmbeddingV1ActivityTest.java index 8a3d6bee2354..6fc6778159e5 100644 --- a/packages/quick_actions/example/android/app/src/main/java/io/flutter/plugins/quickactionsexample/EmbeddingV1ActivityTest.java +++ b/packages/quick_actions/example/android/app/src/main/java/io/flutter/plugins/quickactionsexample/EmbeddingV1ActivityTest.java @@ -5,7 +5,7 @@ package io.flutter.plugins.quickactionsexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/quick_actions/example/android/app/src/main/java/io/flutter/plugins/quickactionsexample/FlutterActivityTest.java b/packages/quick_actions/example/android/app/src/main/java/io/flutter/plugins/quickactionsexample/FlutterActivityTest.java index 84b0c3e6ea42..9ce1e8dfe4ea 100644 --- a/packages/quick_actions/example/android/app/src/main/java/io/flutter/plugins/quickactionsexample/FlutterActivityTest.java +++ b/packages/quick_actions/example/android/app/src/main/java/io/flutter/plugins/quickactionsexample/FlutterActivityTest.java @@ -5,7 +5,7 @@ package io.flutter.plugins.quickactionsexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/quick_actions/example/pubspec.yaml b/packages/quick_actions/example/pubspec.yaml index 38427fcdadf0..6f9c0efd01af 100644 --- a/packages/quick_actions/example/pubspec.yaml +++ b/packages/quick_actions/example/pubspec.yaml @@ -10,8 +10,8 @@ dependencies: dev_dependencies: flutter_driver: sdk: flutter - e2e: - path: ../../e2e + integration_test: + path: ../../integration_test pedantic: ^1.8.0 flutter: diff --git a/packages/quick_actions/example/test_driver/quick_actions_e2e.dart b/packages/quick_actions/example/test_driver/quick_actions_e2e.dart index 41d35b874640..03ecfe491d93 100644 --- a/packages/quick_actions/example/test_driver/quick_actions_e2e.dart +++ b/packages/quick_actions/example/test_driver/quick_actions_e2e.dart @@ -3,11 +3,11 @@ // BSD-style license that can be found in the LICENSE file. import 'package:flutter_test/flutter_test.dart'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; import 'package:quick_actions/quick_actions.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('Can set shortcuts', (WidgetTester tester) async { final QuickActions quickActions = QuickActions(); diff --git a/packages/quick_actions/pubspec.yaml b/packages/quick_actions/pubspec.yaml index be720f65be6c..0468bbfd2e00 100644 --- a/packages/quick_actions/pubspec.yaml +++ b/packages/quick_actions/pubspec.yaml @@ -2,7 +2,7 @@ name: quick_actions description: Flutter plugin for creating shortcuts on home screen, also known as Quick Actions on iOS and App Shortcuts on Android. homepage: https://github.com/flutter/plugins/tree/master/packages/quick_actions -version: 0.4.0+7 +version: 0.4.0+8 flutter: plugin: @@ -23,8 +23,8 @@ dev_dependencies: mockito: ^3.0.0 flutter_test: sdk: flutter - e2e: - path: ../e2e + integration_test: + path: ../integration_test pedantic: ^1.8.0 environment: diff --git a/packages/sensors/CHANGELOG.md b/packages/sensors/CHANGELOG.md index 236618d3d34a..cd70351e1c2b 100644 --- a/packages/sensors/CHANGELOG.md +++ b/packages/sensors/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.4.2+4 + +* Update package:e2e -> package:integration_test + ## 0.4.2+3 * Update package:e2e reference to use the local version in the flutter/plugins diff --git a/packages/sensors/example/android/app/src/main/java/io/flutter/plugins/sensorsexample/EmbeddingV1Activity.java b/packages/sensors/example/android/app/src/main/java/io/flutter/plugins/sensorsexample/EmbeddingV1Activity.java index 80f6c8223377..390819ba0e49 100644 --- a/packages/sensors/example/android/app/src/main/java/io/flutter/plugins/sensorsexample/EmbeddingV1Activity.java +++ b/packages/sensors/example/android/app/src/main/java/io/flutter/plugins/sensorsexample/EmbeddingV1Activity.java @@ -5,7 +5,7 @@ package io.flutter.plugins.sensorsexample; import android.os.Bundle; -import dev.flutter.plugins.e2e.E2EPlugin; +import dev.flutter.plugins.integration_test.IntegrationTestPlugin; import io.flutter.app.FlutterActivity; import io.flutter.plugins.sensors.SensorsPlugin; @@ -13,7 +13,8 @@ public class EmbeddingV1Activity extends FlutterActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - E2EPlugin.registerWith(registrarFor("dev.flutter.plugins.e2e.E2EPlugin")); + IntegrationTestPlugin.registerWith( + registrarFor("dev.flutter.plugins.integration_test.IntegrationTestPlugin")); SensorsPlugin.registerWith(registrarFor("io.flutter.plugins.sensors.SensorsPlugin")); } } diff --git a/packages/sensors/example/android/app/src/main/java/io/flutter/plugins/sensorsexample/EmbeddingV1ActivityTest.java b/packages/sensors/example/android/app/src/main/java/io/flutter/plugins/sensorsexample/EmbeddingV1ActivityTest.java index 92f0564ecc9e..ace170bb78ac 100644 --- a/packages/sensors/example/android/app/src/main/java/io/flutter/plugins/sensorsexample/EmbeddingV1ActivityTest.java +++ b/packages/sensors/example/android/app/src/main/java/io/flutter/plugins/sensorsexample/EmbeddingV1ActivityTest.java @@ -1,7 +1,7 @@ package io.flutter.plugins.sensorsexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/sensors/example/android/app/src/main/java/io/flutter/plugins/sensorsexample/FlutterActivityTest.java b/packages/sensors/example/android/app/src/main/java/io/flutter/plugins/sensorsexample/FlutterActivityTest.java index c5d0c9392934..0835b0f5945a 100644 --- a/packages/sensors/example/android/app/src/main/java/io/flutter/plugins/sensorsexample/FlutterActivityTest.java +++ b/packages/sensors/example/android/app/src/main/java/io/flutter/plugins/sensorsexample/FlutterActivityTest.java @@ -5,7 +5,7 @@ package io.flutter.plugins.sensorsexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/sensors/example/pubspec.yaml b/packages/sensors/example/pubspec.yaml index 02bca30f8f0b..eb46c611a43a 100644 --- a/packages/sensors/example/pubspec.yaml +++ b/packages/sensors/example/pubspec.yaml @@ -10,8 +10,8 @@ dependencies: dev_dependencies: flutter_driver: sdk: flutter - e2e: - path: ../../e2e + integration_test: + path: ../../integration_test pedantic: ^1.8.0 flutter: diff --git a/packages/sensors/pubspec.yaml b/packages/sensors/pubspec.yaml index 9abbe6ba5d18..0daaf08521bc 100644 --- a/packages/sensors/pubspec.yaml +++ b/packages/sensors/pubspec.yaml @@ -5,7 +5,7 @@ homepage: https://github.com/flutter/plugins/tree/master/packages/sensors # 0.4.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.4.2+3 +version: 0.4.2+4 flutter: plugin: @@ -24,8 +24,8 @@ dev_dependencies: test: ^1.3.0 flutter_test: sdk: flutter - e2e: - path: ../e2e + integration_test: + path: ../integration_test mockito: ^4.1.1 pedantic: ^1.8.0 diff --git a/packages/sensors/test/sensors_e2e.dart b/packages/sensors/test/sensors_e2e.dart index acc356dfc235..ea1db0375f38 100644 --- a/packages/sensors/test/sensors_e2e.dart +++ b/packages/sensors/test/sensors_e2e.dart @@ -5,10 +5,10 @@ import 'dart:async'; import 'package:flutter_test/flutter_test.dart'; import 'package:sensors/sensors.dart'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('Can subscript to accelerometerEvents and get non-null events', (WidgetTester tester) async { diff --git a/packages/share/CHANGELOG.md b/packages/share/CHANGELOG.md index e18933d1be0f..8c3814d2f559 100644 --- a/packages/share/CHANGELOG.md +++ b/packages/share/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.6.4+5 + +* Update package:e2e -> package:integration_test + ## 0.6.4+4 * Update package:e2e reference to use the local version in the flutter/plugins diff --git a/packages/share/example/android/app/src/main/java/io/flutter/plugins/shareexample/EmbeddingV1Activity.java b/packages/share/example/android/app/src/main/java/io/flutter/plugins/shareexample/EmbeddingV1Activity.java index e12d223b0f7b..70b1a8d8f09e 100644 --- a/packages/share/example/android/app/src/main/java/io/flutter/plugins/shareexample/EmbeddingV1Activity.java +++ b/packages/share/example/android/app/src/main/java/io/flutter/plugins/shareexample/EmbeddingV1Activity.java @@ -5,7 +5,7 @@ package io.flutter.plugins.shareexample; import android.os.Bundle; -import dev.flutter.plugins.e2e.E2EPlugin; +import dev.flutter.plugins.integration_test.IntegrationTestPlugin; import io.flutter.app.FlutterActivity; import io.flutter.plugins.share.SharePlugin; @@ -14,7 +14,8 @@ public class EmbeddingV1Activity extends FlutterActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - E2EPlugin.registerWith(registrarFor("dev.flutter.plugins.e2e.E2EPlugin")); + IntegrationTestPlugin.registerWith( + registrarFor("dev.flutter.plugins.integration_test.IntegrationTestPlugin")); SharePlugin.registerWith(registrarFor("io.flutter.plugins.share.SharePlugin")); } } diff --git a/packages/share/example/android/app/src/main/java/io/flutter/plugins/shareexample/EmbeddingV1ActivityTest.java b/packages/share/example/android/app/src/main/java/io/flutter/plugins/shareexample/EmbeddingV1ActivityTest.java index 83e7cf020174..b5ae4ef061b6 100644 --- a/packages/share/example/android/app/src/main/java/io/flutter/plugins/shareexample/EmbeddingV1ActivityTest.java +++ b/packages/share/example/android/app/src/main/java/io/flutter/plugins/shareexample/EmbeddingV1ActivityTest.java @@ -1,7 +1,7 @@ package io.flutter.plugins.shareexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/share/example/android/app/src/main/java/io/flutter/plugins/shareexample/FlutterActivityTest.java b/packages/share/example/android/app/src/main/java/io/flutter/plugins/shareexample/FlutterActivityTest.java index 0ad24ddc4824..3b73737f15b2 100644 --- a/packages/share/example/android/app/src/main/java/io/flutter/plugins/shareexample/FlutterActivityTest.java +++ b/packages/share/example/android/app/src/main/java/io/flutter/plugins/shareexample/FlutterActivityTest.java @@ -5,7 +5,7 @@ package io.flutter.plugins.shareexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/share/example/pubspec.yaml b/packages/share/example/pubspec.yaml index 4c0bb731c8a9..4830b7186019 100644 --- a/packages/share/example/pubspec.yaml +++ b/packages/share/example/pubspec.yaml @@ -10,8 +10,8 @@ dependencies: dev_dependencies: flutter_driver: sdk: flutter - e2e: - path: ../../e2e + integration_test: + path: ../../integration_test pedantic: ^1.8.0 flutter: diff --git a/packages/share/pubspec.yaml b/packages/share/pubspec.yaml index 8da4d85bf842..f5e545ca112e 100644 --- a/packages/share/pubspec.yaml +++ b/packages/share/pubspec.yaml @@ -5,7 +5,7 @@ homepage: https://github.com/flutter/plugins/tree/master/packages/share # 0.6.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.6.4+4 +version: 0.6.4+5 flutter: plugin: @@ -26,8 +26,8 @@ dev_dependencies: mockito: ^3.0.0 flutter_test: sdk: flutter - e2e: - path: ../e2e + integration_test: + path: ../integration_test pedantic: ^1.8.0 environment: diff --git a/packages/share/test/share_e2e.dart b/packages/share/test/share_e2e.dart index eb990222b009..08a19ce2c27b 100644 --- a/packages/share/test/share_e2e.dart +++ b/packages/share/test/share_e2e.dart @@ -4,10 +4,10 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:share/share.dart'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('Can launch share', (WidgetTester tester) async { expect(Share.share('message', subject: 'title'), completes); diff --git a/packages/shared_preferences/shared_preferences/CHANGELOG.md b/packages/shared_preferences/shared_preferences/CHANGELOG.md index 52f1c1e28ac6..3f4edca10dc2 100644 --- a/packages/shared_preferences/shared_preferences/CHANGELOG.md +++ b/packages/shared_preferences/shared_preferences/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.5.10 + +* Update package:e2e -> package:integration_test + ## 0.5.9 * Update package:e2e reference to use the local version in the flutter/plugins diff --git a/packages/shared_preferences/shared_preferences/example/android/app/src/main/java/io/flutter/plugins/sharedpreferencesexample/EmbeddingV1Activity.java b/packages/shared_preferences/shared_preferences/example/android/app/src/main/java/io/flutter/plugins/sharedpreferencesexample/EmbeddingV1Activity.java index 33f294231602..7a748792f566 100644 --- a/packages/shared_preferences/shared_preferences/example/android/app/src/main/java/io/flutter/plugins/sharedpreferencesexample/EmbeddingV1Activity.java +++ b/packages/shared_preferences/shared_preferences/example/android/app/src/main/java/io/flutter/plugins/sharedpreferencesexample/EmbeddingV1Activity.java @@ -5,7 +5,7 @@ package io.flutter.plugins.sharedpreferencesexample; import android.os.Bundle; -import dev.flutter.plugins.e2e.E2EPlugin; +import dev.flutter.plugins.integration_test.IntegrationTestPlugin; import io.flutter.app.FlutterActivity; import io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin; @@ -14,7 +14,8 @@ public class EmbeddingV1Activity extends FlutterActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - E2EPlugin.registerWith(registrarFor("dev.flutter.plugins.e2e.E2EPlugin")); + IntegrationTestPlugin.registerWith( + registrarFor("dev.flutter.plugins.integration_test.IntegrationTestPlugin")); SharedPreferencesPlugin.registerWith( registrarFor("io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin")); } diff --git a/packages/shared_preferences/shared_preferences/example/android/app/src/main/java/io/flutter/plugins/sharedpreferencesexample/EmbeddingV1ActivityTest.java b/packages/shared_preferences/shared_preferences/example/android/app/src/main/java/io/flutter/plugins/sharedpreferencesexample/EmbeddingV1ActivityTest.java index 6917efbc69a6..d37f5549e3ec 100644 --- a/packages/shared_preferences/shared_preferences/example/android/app/src/main/java/io/flutter/plugins/sharedpreferencesexample/EmbeddingV1ActivityTest.java +++ b/packages/shared_preferences/shared_preferences/example/android/app/src/main/java/io/flutter/plugins/sharedpreferencesexample/EmbeddingV1ActivityTest.java @@ -2,7 +2,7 @@ package io.flutter.plugins.sharedpreferencesexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/shared_preferences/shared_preferences/example/android/app/src/main/java/io/flutter/plugins/sharedpreferencesexample/FlutterActivityTest.java b/packages/shared_preferences/shared_preferences/example/android/app/src/main/java/io/flutter/plugins/sharedpreferencesexample/FlutterActivityTest.java index 62a00b901081..7a63d6d90c91 100644 --- a/packages/shared_preferences/shared_preferences/example/android/app/src/main/java/io/flutter/plugins/sharedpreferencesexample/FlutterActivityTest.java +++ b/packages/shared_preferences/shared_preferences/example/android/app/src/main/java/io/flutter/plugins/sharedpreferencesexample/FlutterActivityTest.java @@ -5,7 +5,7 @@ package io.flutter.plugins.sharedpreferencesexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/shared_preferences/shared_preferences/example/pubspec.yaml b/packages/shared_preferences/shared_preferences/example/pubspec.yaml index 7a24c3f6f495..2b970949bee6 100644 --- a/packages/shared_preferences/shared_preferences/example/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences/example/pubspec.yaml @@ -11,8 +11,8 @@ dev_dependencies: flutter_driver: sdk: flutter test: any - e2e: - path: ../../../e2e + integration_test: + path: ../../../integration_test pedantic: ^1.8.0 flutter: diff --git a/packages/shared_preferences/shared_preferences/example/test_driver/shared_preferences_e2e.dart b/packages/shared_preferences/shared_preferences/example/test_driver/shared_preferences_e2e.dart index b693df2131ed..0d49ed95dd2d 100644 --- a/packages/shared_preferences/shared_preferences/example/test_driver/shared_preferences_e2e.dart +++ b/packages/shared_preferences/shared_preferences/example/test_driver/shared_preferences_e2e.dart @@ -1,10 +1,10 @@ import 'dart:async'; import 'package:flutter_test/flutter_test.dart'; import 'package:shared_preferences/shared_preferences.dart'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); group('$SharedPreferences', () { const Map kTestValues = { diff --git a/packages/shared_preferences/shared_preferences/pubspec.yaml b/packages/shared_preferences/shared_preferences/pubspec.yaml index 6477b33361ab..04b7813a2a99 100644 --- a/packages/shared_preferences/shared_preferences/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences/pubspec.yaml @@ -5,7 +5,7 @@ homepage: https://github.com/flutter/plugins/tree/master/packages/shared_prefere # 0.5.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.5.9 +version: 0.5.10 flutter: plugin: @@ -42,8 +42,8 @@ dev_dependencies: flutter_driver: sdk: flutter test: any - e2e: - path: ../../e2e + integration_test: + path: ../../integration_test pedantic: ^1.8.0 environment: diff --git a/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml b/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml index 6f0683776e05..5936e3ace02f 100644 --- a/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml @@ -18,8 +18,8 @@ dev_dependencies: flutter_driver: sdk: flutter test: any - e2e: - path: ../../../e2e + integration_test: + path: ../../../integration_test pedantic: ^1.8.0 flutter: diff --git a/packages/shared_preferences/shared_preferences_linux/example/test_driver/shared_preferences_e2e.dart b/packages/shared_preferences/shared_preferences_linux/example/test_driver/shared_preferences_e2e.dart index b693df2131ed..0d49ed95dd2d 100644 --- a/packages/shared_preferences/shared_preferences_linux/example/test_driver/shared_preferences_e2e.dart +++ b/packages/shared_preferences/shared_preferences_linux/example/test_driver/shared_preferences_e2e.dart @@ -1,10 +1,10 @@ import 'dart:async'; import 'package:flutter_test/flutter_test.dart'; import 'package:shared_preferences/shared_preferences.dart'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); group('$SharedPreferences', () { const Map kTestValues = { diff --git a/packages/shared_preferences/shared_preferences_macos/example/pubspec.yaml b/packages/shared_preferences/shared_preferences_macos/example/pubspec.yaml index c6f2026b59bb..de4b6ed9d379 100644 --- a/packages/shared_preferences/shared_preferences_macos/example/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_macos/example/pubspec.yaml @@ -12,8 +12,8 @@ dev_dependencies: flutter_driver: sdk: flutter test: any - e2e: - path: ../../../e2e + integration_test: + path: ../../../integration_test pedantic: ^1.8.0 flutter: diff --git a/packages/shared_preferences/shared_preferences_macos/example/test_driver/shared_preferences_e2e.dart b/packages/shared_preferences/shared_preferences_macos/example/test_driver/shared_preferences_e2e.dart index b693df2131ed..0d49ed95dd2d 100644 --- a/packages/shared_preferences/shared_preferences_macos/example/test_driver/shared_preferences_e2e.dart +++ b/packages/shared_preferences/shared_preferences_macos/example/test_driver/shared_preferences_e2e.dart @@ -1,10 +1,10 @@ import 'dart:async'; import 'package:flutter_test/flutter_test.dart'; import 'package:shared_preferences/shared_preferences.dart'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); group('$SharedPreferences', () { const Map kTestValues = { diff --git a/packages/url_launcher/url_launcher/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/EmbeddingV1ActivityTest.java b/packages/url_launcher/url_launcher/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/EmbeddingV1ActivityTest.java index 9ce8eb281f69..fb66478feed8 100644 --- a/packages/url_launcher/url_launcher/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/EmbeddingV1ActivityTest.java +++ b/packages/url_launcher/url_launcher/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/EmbeddingV1ActivityTest.java @@ -1,7 +1,7 @@ package io.flutter.plugins.urllauncherexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/url_launcher/url_launcher/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/MainActivityTest.java b/packages/url_launcher/url_launcher/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/MainActivityTest.java index 927ff1dbac74..5b50523f7f40 100644 --- a/packages/url_launcher/url_launcher/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/MainActivityTest.java +++ b/packages/url_launcher/url_launcher/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/MainActivityTest.java @@ -1,7 +1,7 @@ package io.flutter.plugins.urllauncherexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/url_launcher/url_launcher/example/android/app/src/main/java/io/flutter/plugins/urllauncherexample/EmbeddingV1Activity.java b/packages/url_launcher/url_launcher/example/android/app/src/main/java/io/flutter/plugins/urllauncherexample/EmbeddingV1Activity.java index fc6aa5622573..39afc642ddb9 100644 --- a/packages/url_launcher/url_launcher/example/android/app/src/main/java/io/flutter/plugins/urllauncherexample/EmbeddingV1Activity.java +++ b/packages/url_launcher/url_launcher/example/android/app/src/main/java/io/flutter/plugins/urllauncherexample/EmbeddingV1Activity.java @@ -5,7 +5,7 @@ package io.flutter.plugins.urllauncherexample; import android.os.Bundle; -import dev.flutter.plugins.e2e.E2EPlugin; +import dev.flutter.plugins.integration_test.IntegrationTestPlugin; import io.flutter.app.FlutterActivity; import io.flutter.plugins.urllauncher.UrlLauncherPlugin; @@ -14,7 +14,8 @@ public class EmbeddingV1Activity extends FlutterActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - E2EPlugin.registerWith(registrarFor("dev.flutter.plugins.e2e.E2EPlugin")); + IntegrationTestPlugin.registerWith( + registrarFor("dev.flutter.plugins.integration_test.IntegrationTestPlugin")); UrlLauncherPlugin.registerWith( registrarFor("io.flutter.plugins.urllauncher.UrlLauncherPlugin")); } diff --git a/packages/url_launcher/url_launcher/example/pubspec.yaml b/packages/url_launcher/url_launcher/example/pubspec.yaml index 576b1041129b..b48445c3a7e9 100644 --- a/packages/url_launcher/url_launcher/example/pubspec.yaml +++ b/packages/url_launcher/url_launcher/example/pubspec.yaml @@ -8,8 +8,8 @@ dependencies: path: ../ dev_dependencies: - e2e: - path: ../../../e2e + integration_test: + path: ../../../integration_test flutter_driver: sdk: flutter pedantic: ^1.8.0 diff --git a/packages/url_launcher/url_launcher/example/test_driver/url_launcher_e2e.dart b/packages/url_launcher/url_launcher/example/test_driver/url_launcher_e2e.dart index 6cf1168c81bd..fe51d94aa3a9 100644 --- a/packages/url_launcher/url_launcher/example/test_driver/url_launcher_e2e.dart +++ b/packages/url_launcher/url_launcher/example/test_driver/url_launcher_e2e.dart @@ -6,11 +6,11 @@ import 'dart:io' show Platform; import 'package:flutter/foundation.dart' show kIsWeb; import 'package:flutter_test/flutter_test.dart'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; import 'package:url_launcher/url_launcher.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); test('canLaunch', () async { expect(await canLaunch('randomstring'), false); diff --git a/packages/url_launcher/url_launcher_linux/example/pubspec.yaml b/packages/url_launcher/url_launcher_linux/example/pubspec.yaml index 2d99a8c2df9c..c9d0c32f5cb6 100644 --- a/packages/url_launcher/url_launcher_linux/example/pubspec.yaml +++ b/packages/url_launcher/url_launcher_linux/example/pubspec.yaml @@ -9,8 +9,8 @@ dependencies: path: ../ dev_dependencies: - e2e: - path: ../../../e2e + integration_test: + path: ../../../integration_test flutter_driver: sdk: flutter pedantic: ^1.8.0 diff --git a/packages/url_launcher/url_launcher_linux/example/test_driver/url_launcher_e2e.dart b/packages/url_launcher/url_launcher_linux/example/test_driver/url_launcher_e2e.dart index 516835cec33b..0b25516c2a29 100644 --- a/packages/url_launcher/url_launcher_linux/example/test_driver/url_launcher_e2e.dart +++ b/packages/url_launcher/url_launcher_linux/example/test_driver/url_launcher_e2e.dart @@ -3,11 +3,11 @@ // BSD-style license that can be found in the LICENSE file. import 'package:flutter_test/flutter_test.dart'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; import 'package:url_launcher/url_launcher.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); test('canLaunch', () async { expect(await canLaunch('randomstring'), false); diff --git a/packages/url_launcher/url_launcher_macos/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/EmbeddingV1ActivityTest.java b/packages/url_launcher/url_launcher_macos/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/EmbeddingV1ActivityTest.java index 9ce8eb281f69..fb66478feed8 100644 --- a/packages/url_launcher/url_launcher_macos/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/EmbeddingV1ActivityTest.java +++ b/packages/url_launcher/url_launcher_macos/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/EmbeddingV1ActivityTest.java @@ -1,7 +1,7 @@ package io.flutter.plugins.urllauncherexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/url_launcher/url_launcher_macos/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/FlutterActivityTest.java b/packages/url_launcher/url_launcher_macos/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/FlutterActivityTest.java index 927ff1dbac74..5b50523f7f40 100644 --- a/packages/url_launcher/url_launcher_macos/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/FlutterActivityTest.java +++ b/packages/url_launcher/url_launcher_macos/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/FlutterActivityTest.java @@ -1,7 +1,7 @@ package io.flutter.plugins.urllauncherexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/url_launcher/url_launcher_macos/example/android/app/src/main/java/io/flutter/plugins/urllauncherexample/EmbeddingV1Activity.java b/packages/url_launcher/url_launcher_macos/example/android/app/src/main/java/io/flutter/plugins/urllauncherexample/EmbeddingV1Activity.java index fc6aa5622573..39afc642ddb9 100644 --- a/packages/url_launcher/url_launcher_macos/example/android/app/src/main/java/io/flutter/plugins/urllauncherexample/EmbeddingV1Activity.java +++ b/packages/url_launcher/url_launcher_macos/example/android/app/src/main/java/io/flutter/plugins/urllauncherexample/EmbeddingV1Activity.java @@ -5,7 +5,7 @@ package io.flutter.plugins.urllauncherexample; import android.os.Bundle; -import dev.flutter.plugins.e2e.E2EPlugin; +import dev.flutter.plugins.integration_test.IntegrationTestPlugin; import io.flutter.app.FlutterActivity; import io.flutter.plugins.urllauncher.UrlLauncherPlugin; @@ -14,7 +14,8 @@ public class EmbeddingV1Activity extends FlutterActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - E2EPlugin.registerWith(registrarFor("dev.flutter.plugins.e2e.E2EPlugin")); + IntegrationTestPlugin.registerWith( + registrarFor("dev.flutter.plugins.integration_test.IntegrationTestPlugin")); UrlLauncherPlugin.registerWith( registrarFor("io.flutter.plugins.urllauncher.UrlLauncherPlugin")); } diff --git a/packages/url_launcher/url_launcher_macos/example/pubspec.yaml b/packages/url_launcher/url_launcher_macos/example/pubspec.yaml index a03bce7ad9f5..0fab67e8af1b 100644 --- a/packages/url_launcher/url_launcher_macos/example/pubspec.yaml +++ b/packages/url_launcher/url_launcher_macos/example/pubspec.yaml @@ -9,8 +9,8 @@ dependencies: path: ../ dev_dependencies: - e2e: - path: ../../../e2e + integration_test: + path: ../../../integration_test flutter_driver: sdk: flutter pedantic: ^1.8.0 diff --git a/packages/url_launcher/url_launcher_macos/example/test_driver/url_launcher_e2e.dart b/packages/url_launcher/url_launcher_macos/example/test_driver/url_launcher_e2e.dart index e1d75f93b326..676b78c3bbfb 100644 --- a/packages/url_launcher/url_launcher_macos/example/test_driver/url_launcher_e2e.dart +++ b/packages/url_launcher/url_launcher_macos/example/test_driver/url_launcher_e2e.dart @@ -3,11 +3,11 @@ // BSD-style license that can be found in the LICENSE file. import 'package:flutter_test/flutter_test.dart'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; import 'package:url_launcher/url_launcher.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); test('canLaunch', () async { expect(await canLaunch('randomstring'), false); diff --git a/packages/video_player/video_player/example/android/app/src/main/java/io/flutter/plugins/videoplayerexample/EmbeddingV1Activity.java b/packages/video_player/video_player/example/android/app/src/main/java/io/flutter/plugins/videoplayerexample/EmbeddingV1Activity.java index de29b463fca9..b21435f82fde 100644 --- a/packages/video_player/video_player/example/android/app/src/main/java/io/flutter/plugins/videoplayerexample/EmbeddingV1Activity.java +++ b/packages/video_player/video_player/example/android/app/src/main/java/io/flutter/plugins/videoplayerexample/EmbeddingV1Activity.java @@ -5,7 +5,7 @@ package io.flutter.plugins.videoplayerexample; import android.os.Bundle; -import dev.flutter.plugins.e2e.E2EPlugin; +import dev.flutter.plugins.integration_test.IntegrationTestPlugin; import io.flutter.app.FlutterActivity; import io.flutter.plugins.videoplayer.VideoPlayerPlugin; @@ -13,7 +13,8 @@ public class EmbeddingV1Activity extends FlutterActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - E2EPlugin.registerWith(registrarFor("dev.flutter.plugins.e2e.E2EPlugin")); + IntegrationTestPlugin.registerWith( + registrarFor("dev.flutter.plugins.integration_test.IntegrationTestPlugin")); VideoPlayerPlugin.registerWith( registrarFor("io.flutter.plugins.videoplayer.VideoPlayerPlugin")); } diff --git a/packages/video_player/video_player/example/pubspec.yaml b/packages/video_player/video_player/example/pubspec.yaml index 1fb4f5b8e089..e0afa4193dc2 100644 --- a/packages/video_player/video_player/example/pubspec.yaml +++ b/packages/video_player/video_player/example/pubspec.yaml @@ -12,8 +12,8 @@ dev_dependencies: sdk: flutter flutter_driver: sdk: flutter - e2e: - path: ../../../e2e + integration_test: + path: ../../../integration_test test: any pedantic: ^1.8.0 diff --git a/packages/video_player/video_player/example/test_driver/video_player_e2e.dart b/packages/video_player/video_player/example/test_driver/video_player_e2e.dart index bf35cf50b728..0953c8feb6c0 100644 --- a/packages/video_player/video_player/example/test_driver/video_player_e2e.dart +++ b/packages/video_player/video_player/example/test_driver/video_player_e2e.dart @@ -3,14 +3,14 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:io'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:video_player/video_player.dart'; const Duration _playDuration = Duration(seconds: 1); void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); VideoPlayerController _controller; tearDown(() async => _controller.dispose()); diff --git a/packages/webview_flutter/example/android/app/src/androidTestDebug/java/io/flutter/plugins/webviewflutterexample/EmbeddingV1ActivityTest.java b/packages/webview_flutter/example/android/app/src/androidTestDebug/java/io/flutter/plugins/webviewflutterexample/EmbeddingV1ActivityTest.java index 80c7318e397e..8f253d8dc74f 100644 --- a/packages/webview_flutter/example/android/app/src/androidTestDebug/java/io/flutter/plugins/webviewflutterexample/EmbeddingV1ActivityTest.java +++ b/packages/webview_flutter/example/android/app/src/androidTestDebug/java/io/flutter/plugins/webviewflutterexample/EmbeddingV1ActivityTest.java @@ -1,7 +1,7 @@ package io.flutter.plugins.webviewflutterexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/webview_flutter/example/android/app/src/androidTestDebug/java/io/flutter/plugins/webviewflutterexample/MainActivityTest.java b/packages/webview_flutter/example/android/app/src/androidTestDebug/java/io/flutter/plugins/webviewflutterexample/MainActivityTest.java index de7998186981..a9b1a9412cbd 100644 --- a/packages/webview_flutter/example/android/app/src/androidTestDebug/java/io/flutter/plugins/webviewflutterexample/MainActivityTest.java +++ b/packages/webview_flutter/example/android/app/src/androidTestDebug/java/io/flutter/plugins/webviewflutterexample/MainActivityTest.java @@ -1,7 +1,7 @@ package io.flutter.plugins.webviewflutterexample; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; diff --git a/packages/webview_flutter/example/android/app/src/main/java/io/flutter/plugins/webviewflutterexample/EmbeddingV1Activity.java b/packages/webview_flutter/example/android/app/src/main/java/io/flutter/plugins/webviewflutterexample/EmbeddingV1Activity.java index d0f538e89ce3..3a88496594a3 100644 --- a/packages/webview_flutter/example/android/app/src/main/java/io/flutter/plugins/webviewflutterexample/EmbeddingV1Activity.java +++ b/packages/webview_flutter/example/android/app/src/main/java/io/flutter/plugins/webviewflutterexample/EmbeddingV1Activity.java @@ -5,7 +5,7 @@ package io.flutter.plugins.webviewflutterexample; import android.os.Bundle; -import dev.flutter.plugins.e2e.E2EPlugin; +import dev.flutter.plugins.integration_test.IntegrationTestPlugin; import io.flutter.app.FlutterActivity; import io.flutter.plugins.webviewflutter.WebViewFlutterPlugin; @@ -13,7 +13,8 @@ public class EmbeddingV1Activity extends FlutterActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - E2EPlugin.registerWith(registrarFor("dev.flutter.plugins.e2e.E2EPlugin")); + IntegrationTestPlugin.registerWith( + registrarFor("dev.flutter.plugins.integration_test.IntegrationTestPlugin")); WebViewFlutterPlugin.registerWith( registrarFor("io.flutter.plugins.webviewflutter.WebViewFlutterPlugin")); } diff --git a/packages/webview_flutter/example/pubspec.yaml b/packages/webview_flutter/example/pubspec.yaml index f33076406f5f..44c740ae9739 100644 --- a/packages/webview_flutter/example/pubspec.yaml +++ b/packages/webview_flutter/example/pubspec.yaml @@ -15,8 +15,8 @@ dev_dependencies: sdk: flutter flutter_driver: sdk: flutter - e2e: - path: ../../e2e + integration_test: + path: ../../integration_test pedantic: ^1.8.0 flutter: diff --git a/packages/webview_flutter/example/test_driver/webview_flutter_e2e.dart b/packages/webview_flutter/example/test_driver/webview_flutter_e2e.dart index 3468067de603..162ca2cdcd9a 100644 --- a/packages/webview_flutter/example/test_driver/webview_flutter_e2e.dart +++ b/packages/webview_flutter/example/test_driver/webview_flutter_e2e.dart @@ -13,10 +13,10 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:webview_flutter/platform_interface.dart'; import 'package:webview_flutter/webview_flutter.dart'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized(); + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('initalUrl', (WidgetTester tester) async { final Completer controllerCompleter = From 0b156b23233df0584c0c78834cfac72fd5d56cd8 Mon Sep 17 00:00:00 2001 From: Yash Johri Date: Thu, 20 Aug 2020 01:28:16 +0530 Subject: [PATCH 045/233] [device_info] Port device_info to use platform interface (#2942) --- packages/device_info/device_info/CHANGELOG.md | 4 + .../device_info/lib/device_info.dart | 301 +----------------- packages/device_info/device_info/pubspec.yaml | 3 +- 3 files changed, 12 insertions(+), 296 deletions(-) diff --git a/packages/device_info/device_info/CHANGELOG.md b/packages/device_info/device_info/CHANGELOG.md index 9af729780914..4f5e1d927c10 100644 --- a/packages/device_info/device_info/CHANGELOG.md +++ b/packages/device_info/device_info/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.4.2+7 + +* Port device_info plugin to use platform interface. + ## 0.4.2+6 * Moved everything from device_info to device_info/device_info diff --git a/packages/device_info/device_info/lib/device_info.dart b/packages/device_info/device_info/lib/device_info.dart index 25b7d46cdb11..f63730c4323f 100644 --- a/packages/device_info/device_info/lib/device_info.dart +++ b/packages/device_info/device_info/lib/device_info.dart @@ -3,8 +3,10 @@ // found in the LICENSE file. import 'dart:async'; +import 'package:device_info_platform_interface/device_info_platform_interface.dart'; -import 'package:flutter/services.dart'; +export 'package:device_info_platform_interface/device_info_platform_interface.dart' + show AndroidBuildVersion, AndroidDeviceInfo, IosDeviceInfo, IosUtsname; /// Provides device and operating system information. class DeviceInfoPlugin { @@ -12,10 +14,6 @@ class DeviceInfoPlugin { /// repeatedly or in performance-sensitive blocks. DeviceInfoPlugin(); - /// Channel used to communicate to native code. - static const MethodChannel channel = - MethodChannel('plugins.flutter.io/device_info'); - /// This information does not change from call to call. Cache it. AndroidDeviceInfo _cachedAndroidDeviceInfo; @@ -23,8 +21,8 @@ class DeviceInfoPlugin { /// /// See: https://developer.android.com/reference/android/os/Build.html Future get androidInfo async => - _cachedAndroidDeviceInfo ??= AndroidDeviceInfo._fromMap(await channel - .invokeMapMethod('getAndroidDeviceInfo')); + _cachedAndroidDeviceInfo ??= + await DeviceInfoPlatform.instance.androidInfo(); /// This information does not change from call to call. Cache it. IosDeviceInfo _cachedIosDeviceInfo; @@ -33,292 +31,5 @@ class DeviceInfoPlugin { /// /// See: https://developer.apple.com/documentation/uikit/uidevice Future get iosInfo async => - _cachedIosDeviceInfo ??= IosDeviceInfo._fromMap( - await channel.invokeMapMethod('getIosDeviceInfo')); -} - -/// Information derived from `android.os.Build`. -/// -/// See: https://developer.android.com/reference/android/os/Build.html -class AndroidDeviceInfo { - AndroidDeviceInfo._({ - this.version, - this.board, - this.bootloader, - this.brand, - this.device, - this.display, - this.fingerprint, - this.hardware, - this.host, - this.id, - this.manufacturer, - this.model, - this.product, - List supported32BitAbis, - List supported64BitAbis, - List supportedAbis, - this.tags, - this.type, - this.isPhysicalDevice, - this.androidId, - List systemFeatures, - }) : supported32BitAbis = List.unmodifiable(supported32BitAbis), - supported64BitAbis = List.unmodifiable(supported64BitAbis), - supportedAbis = List.unmodifiable(supportedAbis), - systemFeatures = List.unmodifiable(systemFeatures); - - /// Android operating system version values derived from `android.os.Build.VERSION`. - final AndroidBuildVersion version; - - /// The name of the underlying board, like "goldfish". - final String board; - - /// The system bootloader version number. - final String bootloader; - - /// The consumer-visible brand with which the product/hardware will be associated, if any. - final String brand; - - /// The name of the industrial design. - final String device; - - /// A build ID string meant for displaying to the user. - final String display; - - /// A string that uniquely identifies this build. - final String fingerprint; - - /// The name of the hardware (from the kernel command line or /proc). - final String hardware; - - /// Hostname. - final String host; - - /// Either a changelist number, or a label like "M4-rc20". - final String id; - - /// The manufacturer of the product/hardware. - final String manufacturer; - - /// The end-user-visible name for the end product. - final String model; - - /// The name of the overall product. - final String product; - - /// An ordered list of 32 bit ABIs supported by this device. - final List supported32BitAbis; - - /// An ordered list of 64 bit ABIs supported by this device. - final List supported64BitAbis; - - /// An ordered list of ABIs supported by this device. - final List supportedAbis; - - /// Comma-separated tags describing the build, like "unsigned,debug". - final String tags; - - /// The type of build, like "user" or "eng". - final String type; - - /// `false` if the application is running in an emulator, `true` otherwise. - final bool isPhysicalDevice; - - /// The Android hardware device ID that is unique between the device + user and app signing. - final String androidId; - - /// Describes what features are available on the current device. - /// - /// This can be used to check if the device has, for example, a front-facing - /// camera, or a touchscreen. However, in many cases this is not the best - /// API to use. For example, if you are interested in bluetooth, this API - /// can tell you if the device has a bluetooth radio, but it cannot tell you - /// if bluetooth is currently enabled, or if you have been granted the - /// necessary permissions to use it. Please *only* use this if there is no - /// other way to determine if a feature is supported. - /// - /// This data comes from Android's PackageManager.getSystemAvailableFeatures, - /// and many of the common feature strings to look for are available in - /// PackageManager's public documentation: - /// https://developer.android.com/reference/android/content/pm/PackageManager - final List systemFeatures; - - /// Deserializes from the message received from [_kChannel]. - static AndroidDeviceInfo _fromMap(Map map) { - return AndroidDeviceInfo._( - version: - AndroidBuildVersion._fromMap(map['version']?.cast()), - board: map['board'], - bootloader: map['bootloader'], - brand: map['brand'], - device: map['device'], - display: map['display'], - fingerprint: map['fingerprint'], - hardware: map['hardware'], - host: map['host'], - id: map['id'], - manufacturer: map['manufacturer'], - model: map['model'], - product: map['product'], - supported32BitAbis: _fromList(map['supported32BitAbis']), - supported64BitAbis: _fromList(map['supported64BitAbis']), - supportedAbis: _fromList(map['supportedAbis']), - tags: map['tags'], - type: map['type'], - isPhysicalDevice: map['isPhysicalDevice'], - androidId: map['androidId'], - systemFeatures: _fromList(map['systemFeatures']), - ); - } - - /// Deserializes message as List - static List _fromList(dynamic message) { - final List list = message; - return List.from(list); - } -} - -/// Version values of the current Android operating system build derived from -/// `android.os.Build.VERSION`. -/// -/// See: https://developer.android.com/reference/android/os/Build.VERSION.html -class AndroidBuildVersion { - AndroidBuildVersion._({ - this.baseOS, - this.codename, - this.incremental, - this.previewSdkInt, - this.release, - this.sdkInt, - this.securityPatch, - }); - - /// The base OS build the product is based on. - final String baseOS; - - /// The current development codename, or the string "REL" if this is a release build. - final String codename; - - /// The internal value used by the underlying source control to represent this build. - final String incremental; - - /// The developer preview revision of a prerelease SDK. - final int previewSdkInt; - - /// The user-visible version string. - final String release; - - /// The user-visible SDK version of the framework. - /// - /// Possible values are defined in: https://developer.android.com/reference/android/os/Build.VERSION_CODES.html - final int sdkInt; - - /// The user-visible security patch level. - final String securityPatch; - - /// Deserializes from the map message received from [_kChannel]. - static AndroidBuildVersion _fromMap(Map map) { - return AndroidBuildVersion._( - baseOS: map['baseOS'], - codename: map['codename'], - incremental: map['incremental'], - previewSdkInt: map['previewSdkInt'], - release: map['release'], - sdkInt: map['sdkInt'], - securityPatch: map['securityPatch'], - ); - } -} - -/// Information derived from `UIDevice`. -/// -/// See: https://developer.apple.com/documentation/uikit/uidevice -class IosDeviceInfo { - IosDeviceInfo._({ - this.name, - this.systemName, - this.systemVersion, - this.model, - this.localizedModel, - this.identifierForVendor, - this.isPhysicalDevice, - this.utsname, - }); - - /// Device name. - final String name; - - /// The name of the current operating system. - final String systemName; - - /// The current operating system version. - final String systemVersion; - - /// Device model. - final String model; - - /// Localized name of the device model. - final String localizedModel; - - /// Unique UUID value identifying the current device. - final String identifierForVendor; - - /// `false` if the application is running in a simulator, `true` otherwise. - final bool isPhysicalDevice; - - /// Operating system information derived from `sys/utsname.h`. - final IosUtsname utsname; - - /// Deserializes from the map message received from [_kChannel]. - static IosDeviceInfo _fromMap(Map map) { - return IosDeviceInfo._( - name: map['name'], - systemName: map['systemName'], - systemVersion: map['systemVersion'], - model: map['model'], - localizedModel: map['localizedModel'], - identifierForVendor: map['identifierForVendor'], - isPhysicalDevice: map['isPhysicalDevice'] == 'true', - utsname: IosUtsname._fromMap(map['utsname']?.cast()), - ); - } -} - -/// Information derived from `utsname`. -/// See http://pubs.opengroup.org/onlinepubs/7908799/xsh/sysutsname.h.html for details. -class IosUtsname { - IosUtsname._({ - this.sysname, - this.nodename, - this.release, - this.version, - this.machine, - }); - - /// Operating system name. - final String sysname; - - /// Network node name. - final String nodename; - - /// Release level. - final String release; - - /// Version level. - final String version; - - /// Hardware type (e.g. 'iPhone7,1' for iPhone 6 Plus). - final String machine; - - /// Deserializes from the map message received from [_kChannel]. - static IosUtsname _fromMap(Map map) { - return IosUtsname._( - sysname: map['sysname'], - nodename: map['nodename'], - release: map['release'], - version: map['version'], - machine: map['machine'], - ); - } + _cachedIosDeviceInfo ??= await DeviceInfoPlatform.instance.iosInfo(); } diff --git a/packages/device_info/device_info/pubspec.yaml b/packages/device_info/device_info/pubspec.yaml index 8792bdaf5c40..8cb058751fd1 100644 --- a/packages/device_info/device_info/pubspec.yaml +++ b/packages/device_info/device_info/pubspec.yaml @@ -5,7 +5,7 @@ homepage: https://github.com/flutter/plugins/tree/master/packages/device_info # 0.4.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.4.2+6 +version: 0.4.2+7 flutter: plugin: @@ -19,6 +19,7 @@ flutter: dependencies: flutter: sdk: flutter + device_info_platform_interface: ^1.0.0 dev_dependencies: test: ^1.3.0 From a9ac52f3fe10034ef7f48a98f9112bca0666d3e9 Mon Sep 17 00:00:00 2001 From: David Iglesias Date: Wed, 19 Aug 2020 14:13:30 -0700 Subject: [PATCH 046/233] [google_maps_flutter_web] Move e2e tests to integration_test. (#2945) --- .../google_maps_flutter_web/CHANGELOG.md | 4 ++++ .../google_maps_flutter_web/pubspec.yaml | 5 +++-- .../google_maps_flutter_web/test/README.md | 4 ++-- .../google_maps_flutter_web/test/pubspec.yaml | 7 ++++--- .../google_maps_flutter_web/test/run_test | 2 +- ...er_e2e.dart => google_maps_controller_integration.dart} | 4 ++-- ...t.dart => google_maps_controller_integration_test.dart} | 4 ++-- ...plugin_e2e.dart => google_maps_plugin_integration.dart} | 4 ++-- ..._test.dart => google_maps_plugin_integration_test.dart} | 4 ++-- .../{marker_e2e.dart => marker_integration.dart} | 4 ++-- ...{markers_e2e_test.dart => marker_integration_test.dart} | 4 ++-- .../{markers_e2e.dart => markers_integration.dart} | 4 ++-- ..._plugin_e2e_test.dart => markers_integration_test.dart} | 4 ++-- .../test/test_driver/shape_e2e_test.dart | 7 ------- .../test_driver/{shape_e2e.dart => shape_integration.dart} | 4 ++-- .../test/test_driver/shape_integration_test.dart | 7 +++++++ .../test/test_driver/shapes_e2e_test.dart | 7 ------- .../{shapes_e2e.dart => shapes_integration.dart} | 4 ++-- .../test/test_driver/shapes_integration_test.dart | 7 +++++++ 19 files changed, 48 insertions(+), 42 deletions(-) rename packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/{google_maps_controller_e2e.dart => google_maps_controller_integration.dart} (99%) rename packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/{marker_e2e_test.dart => google_maps_controller_integration_test.dart} (59%) rename packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/{google_maps_plugin_e2e.dart => google_maps_plugin_integration.dart} (99%) rename packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/{google_maps_controller_e2e_test.dart => google_maps_plugin_integration_test.dart} (59%) rename packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/{marker_e2e.dart => marker_integration.dart} (96%) rename packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/{markers_e2e_test.dart => marker_integration_test.dart} (59%) rename packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/{markers_e2e.dart => markers_integration.dart} (96%) rename packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/{google_maps_plugin_e2e_test.dart => markers_integration_test.dart} (59%) delete mode 100644 packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shape_e2e_test.dart rename packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/{shape_e2e.dart => shape_integration.dart} (96%) create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shape_integration_test.dart delete mode 100644 packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shapes_e2e_test.dart rename packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/{shapes_e2e.dart => shapes_integration.dart} (98%) create mode 100644 packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shapes_integration_test.dart diff --git a/packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md index d989279aac42..1c4272849c05 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.0+1 + +* Port e2e tests to use the new integration_test package. + ## 0.1.0 * First open-source version diff --git a/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml index a4a734ac773e..e916f7aa6590 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml @@ -1,7 +1,7 @@ name: google_maps_flutter_web description: Web platform implementation of google_maps_flutter homepage: https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter -version: 0.1.0 +version: 0.1.0+1 flutter: plugin: @@ -27,7 +27,8 @@ dev_dependencies: url_launcher: ^5.2.5 pedantic: ^1.8.0 mockito: ^4.1.1 - e2e: ^0.6.1 + integration_test: + path: ../../integration_test environment: sdk: ">=2.3.0 <3.0.0" diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/README.md b/packages/google_maps_flutter/google_maps_flutter_web/test/README.md index 6eae799ce11c..7c48d024ba57 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/test/README.md +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/README.md @@ -11,7 +11,7 @@ Make sure you have updated to the latest Flutter master. 4. Change into the `test` directory of your clone. -5. Run tests: `flutter drive -d web-server --browser-name=chrome --target=test_driver/TEST_NAME_e2e.dart`, or (in Linux): +5. Run tests: `flutter drive -d web-server --browser-name=chrome --target=test_driver/TEST_NAME_integration.dart`, or (in Linux): - * Single: `./run_test test_driver/TEST_NAME_e2e.dart` + * Single: `./run_test test_driver/TEST_NAME_integration.dart` * All: `./run_test` diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_web/test/pubspec.yaml index ec091f00a56f..008cc0350430 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/test/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/pubspec.yaml @@ -9,14 +9,15 @@ dependencies: sdk: flutter dev_dependencies: - google_maps_flutter_web: - path: ../ google_maps: ^3.4.4 flutter_driver: sdk: flutter flutter_test: sdk: flutter - e2e: ^0.6.1 http: ^0.12.2 mockito: ^4.1.1 + google_maps_flutter_web: + path: ../ + integration_test: + path: ../../../integration_test diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/run_test b/packages/google_maps_flutter/google_maps_flutter_web/test/run_test index 4b43cf0947dc..74a8526a0fa3 100755 --- a/packages/google_maps_flutter/google_maps_flutter_web/test/run_test +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/run_test @@ -4,7 +4,7 @@ if pgrep -lf chromedriver > /dev/null; then if [ $# -eq 0 ]; then echo "No target specified, running all tests..." - find test_driver/ -iname *_e2e.dart | xargs -n1 -i -t flutter drive -d web-server --web-port=7357 --browser-name=chrome --target='{}' + find test_driver/ -iname *_integration.dart | xargs -n1 -i -t flutter drive -d web-server --web-port=7357 --browser-name=chrome --target='{}' else echo "Running test target: $1..." set -x diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_controller_e2e.dart b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_controller_integration.dart similarity index 99% rename from packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_controller_e2e.dart rename to packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_controller_integration.dart index fac1956bb9f8..fc21476e9703 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_controller_e2e.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_controller_integration.dart @@ -4,7 +4,7 @@ import 'dart:async'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; import 'package:google_maps/google_maps.dart' as gmaps; import 'package:google_maps_flutter_web/google_maps_flutter_web.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -40,7 +40,7 @@ class _MockGMap extends Mock implements gmaps.GMap { /// Test Google Map Controller void main() { - E2EWidgetsFlutterBinding.ensureInitialized() as E2EWidgetsFlutterBinding; + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); group('GoogleMapController', () { final int mapId = 33930; diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/marker_e2e_test.dart b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_controller_integration_test.dart similarity index 59% rename from packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/marker_e2e_test.dart rename to packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_controller_integration_test.dart index efa93a120e78..39444c0daa24 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/marker_e2e_test.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_controller_integration_test.dart @@ -2,6 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:e2e/e2e_driver.dart' as e2e; +import 'package:integration_test/integration_test_driver.dart'; -Future main() async => e2e.main(); +Future main() async => integrationDriver(); diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_plugin_e2e.dart b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_plugin_integration.dart similarity index 99% rename from packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_plugin_e2e.dart rename to packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_plugin_integration.dart index 80ec5400bdd7..59b5de42400f 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_plugin_e2e.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_plugin_integration.dart @@ -4,7 +4,7 @@ import 'dart:async'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; import 'package:flutter/widgets.dart'; import 'package:google_maps/google_maps.dart' as gmaps; import 'package:google_maps_flutter_web/google_maps_flutter_web.dart'; @@ -17,7 +17,7 @@ class _MockGoogleMapController extends Mock implements GoogleMapController {} /// Test GoogleMapsPlugin void main() { - E2EWidgetsFlutterBinding.ensureInitialized() as E2EWidgetsFlutterBinding; + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); group('GoogleMapsPlugin', () { _MockGoogleMapController controller; diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_controller_e2e_test.dart b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_plugin_integration_test.dart similarity index 59% rename from packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_controller_e2e_test.dart rename to packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_plugin_integration_test.dart index efa93a120e78..39444c0daa24 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_controller_e2e_test.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_plugin_integration_test.dart @@ -2,6 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:e2e/e2e_driver.dart' as e2e; +import 'package:integration_test/integration_test_driver.dart'; -Future main() async => e2e.main(); +Future main() async => integrationDriver(); diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/marker_e2e.dart b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/marker_integration.dart similarity index 96% rename from packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/marker_e2e.dart rename to packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/marker_integration.dart index 7f9d9ba409e0..1cada32104af 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/marker_e2e.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/marker_integration.dart @@ -4,7 +4,7 @@ import 'dart:async'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; import 'package:google_maps/google_maps.dart' as gmaps; import 'package:google_maps_flutter_web/google_maps_flutter_web.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -27,7 +27,7 @@ class _MockInfoWindow extends Mock implements gmaps.InfoWindow {} /// Test Markers void main() { - E2EWidgetsFlutterBinding.ensureInitialized() as E2EWidgetsFlutterBinding; + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); bool called = false; void onTap() { diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/markers_e2e_test.dart b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/marker_integration_test.dart similarity index 59% rename from packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/markers_e2e_test.dart rename to packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/marker_integration_test.dart index efa93a120e78..39444c0daa24 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/markers_e2e_test.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/marker_integration_test.dart @@ -2,6 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:e2e/e2e_driver.dart' as e2e; +import 'package:integration_test/integration_test_driver.dart'; -Future main() async => e2e.main(); +Future main() async => integrationDriver(); diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/markers_e2e.dart b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/markers_integration.dart similarity index 96% rename from packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/markers_e2e.dart rename to packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/markers_integration.dart index 53c34e9fa6eb..f447535668b9 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/markers_e2e.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/markers_integration.dart @@ -4,13 +4,13 @@ import 'dart:async'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; import 'package:google_maps_flutter_platform_interface/google_maps_flutter_platform_interface.dart'; import 'package:google_maps_flutter_web/google_maps_flutter_web.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { - E2EWidgetsFlutterBinding.ensureInitialized() as E2EWidgetsFlutterBinding; + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); group('MarkersController', () { StreamController stream; diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_plugin_e2e_test.dart b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/markers_integration_test.dart similarity index 59% rename from packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_plugin_e2e_test.dart rename to packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/markers_integration_test.dart index efa93a120e78..39444c0daa24 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/google_maps_plugin_e2e_test.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/markers_integration_test.dart @@ -2,6 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:e2e/e2e_driver.dart' as e2e; +import 'package:integration_test/integration_test_driver.dart'; -Future main() async => e2e.main(); +Future main() async => integrationDriver(); diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shape_e2e_test.dart b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shape_e2e_test.dart deleted file mode 100644 index efa93a120e78..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shape_e2e_test.dart +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:e2e/e2e_driver.dart' as e2e; - -Future main() async => e2e.main(); diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shape_e2e.dart b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shape_integration.dart similarity index 96% rename from packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shape_e2e.dart rename to packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shape_integration.dart index 8a0e1d84facc..a05d704850e6 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shape_e2e.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shape_integration.dart @@ -4,7 +4,7 @@ import 'dart:async'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; import 'package:google_maps/google_maps.dart' as gmaps; import 'package:google_maps_flutter_web/google_maps_flutter_web.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -30,7 +30,7 @@ class _MockPolyline extends Mock implements gmaps.Polyline { /// Test Shapes (Circle, Polygon, Polyline) void main() { - E2EWidgetsFlutterBinding.ensureInitialized() as E2EWidgetsFlutterBinding; + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); bool called = false; void onTap() { diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shape_integration_test.dart b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shape_integration_test.dart new file mode 100644 index 000000000000..39444c0daa24 --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shape_integration_test.dart @@ -0,0 +1,7 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:integration_test/integration_test_driver.dart'; + +Future main() async => integrationDriver(); diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shapes_e2e_test.dart b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shapes_e2e_test.dart deleted file mode 100644 index efa93a120e78..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shapes_e2e_test.dart +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:e2e/e2e_driver.dart' as e2e; - -Future main() async => e2e.main(); diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shapes_e2e.dart b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shapes_integration.dart similarity index 98% rename from packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shapes_e2e.dart rename to packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shapes_integration.dart index 9ff3ad9455bb..b1bff7edd429 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shapes_e2e.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shapes_integration.dart @@ -4,14 +4,14 @@ import 'dart:async'; -import 'package:e2e/e2e.dart'; +import 'package:integration_test/integration_test.dart'; import 'package:google_maps_flutter_platform_interface/google_maps_flutter_platform_interface.dart'; import 'package:google_maps_flutter_web/google_maps_flutter_web.dart'; import 'package:flutter_test/flutter_test.dart'; /// Test Shapes (Circle, Polygon, Polyline) void main() { - E2EWidgetsFlutterBinding.ensureInitialized() as E2EWidgetsFlutterBinding; + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); group('CirclesController', () { StreamController stream; diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shapes_integration_test.dart b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shapes_integration_test.dart new file mode 100644 index 000000000000..39444c0daa24 --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/shapes_integration_test.dart @@ -0,0 +1,7 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:integration_test/integration_test_driver.dart'; + +Future main() async => integrationDriver(); From 4360a232e4a9357787c3c3519d559d0aad50cf98 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Fri, 21 Aug 2020 19:39:36 -0700 Subject: [PATCH 047/233] [shared_preferences_linux] update `file` package dep version to be compatible with framework (#2950) --- .../shared_preferences/shared_preferences_linux/CHANGELOG.md | 4 ++++ .../shared_preferences/shared_preferences_linux/pubspec.yaml | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/shared_preferences/shared_preferences_linux/CHANGELOG.md b/packages/shared_preferences/shared_preferences_linux/CHANGELOG.md index 353a921ff281..5bfd6651edfa 100644 --- a/packages/shared_preferences/shared_preferences_linux/CHANGELOG.md +++ b/packages/shared_preferences/shared_preferences_linux/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2+2 + +* Bump the `file` package dependency to resolve dep conflicts with `flutter_driver`. + ## 0.0.2+1 * Replace path_provider dependency with path_provider_linux. diff --git a/packages/shared_preferences/shared_preferences_linux/pubspec.yaml b/packages/shared_preferences/shared_preferences_linux/pubspec.yaml index 3d40d39241ac..8a19c46fd531 100644 --- a/packages/shared_preferences/shared_preferences_linux/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_linux/pubspec.yaml @@ -1,6 +1,6 @@ name: shared_preferences_linux description: Linux implementation of the shared_preferences plugin -version: 0.0.2+1 +version: 0.0.2+2 homepage: https://github.com/flutter/plugins/tree/master/packages/shared_preferences/shared_preferences_linux flutter: @@ -15,7 +15,7 @@ environment: flutter: ">=1.12.8 <2.0.0" dependencies: - file: ^5.1.0 + file: ">=5.1.0 <7.0.0" flutter: sdk: flutter meta: ^1.0.4 From 481e8c251667bcb28d177bfc7d295d584e703bae Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Fri, 21 Aug 2020 20:26:45 -0700 Subject: [PATCH 048/233] [android_intent] fix platform package dep (#2948) --- packages/android_intent/CHANGELOG.md | 4 ++++ packages/android_intent/pubspec.yaml | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/android_intent/CHANGELOG.md b/packages/android_intent/CHANGELOG.md index 4d63b0cbceab..f06652e71931 100644 --- a/packages/android_intent/CHANGELOG.md +++ b/packages/android_intent/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.3.7+3 + +* Update the `platform` package dependency to resolve the conflict with the latest flutter. + ## 0.3.7+2 * Declare API stability and compatibility with `1.0.0` (more details at: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0). diff --git a/packages/android_intent/pubspec.yaml b/packages/android_intent/pubspec.yaml index 2e786277d869..166a73dfcb4d 100644 --- a/packages/android_intent/pubspec.yaml +++ b/packages/android_intent/pubspec.yaml @@ -4,7 +4,7 @@ homepage: https://github.com/flutter/plugins/tree/master/packages/android_intent # 0.3.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.3.7+2 +version: 0.3.7+3 flutter: plugin: @@ -16,7 +16,7 @@ flutter: dependencies: flutter: sdk: flutter - platform: ^2.0.0 + platform: ">=2.0.0 <4.0.0" meta: ^1.0.5 dev_dependencies: test: ^1.3.0 From e0a49a7fbdbc4e06d04e4cfbbe2c6056f09bf3d4 Mon Sep 17 00:00:00 2001 From: David Iglesias Date: Mon, 24 Aug 2020 16:20:15 -0700 Subject: [PATCH 049/233] [path_provider, video_player] Tweak pubspecs to pass bulk analysis. (#2959) --- .../path_provider/path_provider_macos/example/pubspec.yaml | 6 +++++- packages/video_player/video_player/CHANGELOG.md | 4 ++++ packages/video_player/video_player/pubspec.yaml | 6 +++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/path_provider/path_provider_macos/example/pubspec.yaml b/packages/path_provider/path_provider_macos/example/pubspec.yaml index 1ba991dc8160..aaa6842651b5 100644 --- a/packages/path_provider/path_provider_macos/example/pubspec.yaml +++ b/packages/path_provider/path_provider_macos/example/pubspec.yaml @@ -4,7 +4,11 @@ description: Demonstrates how to use the path_provider plugin. dependencies: flutter: sdk: flutter - path_provider: any + path_provider: ^1.6.14 + +# path_provider_macos is endorsed, so we need to add it to dependency_overrides +# to depend on it from path: +dependency_overrides: path_provider_macos: path: ../ diff --git a/packages/video_player/video_player/CHANGELOG.md b/packages/video_player/video_player/CHANGELOG.md index 1fdfad6256f4..ccc5a6393db0 100644 --- a/packages/video_player/video_player/CHANGELOG.md +++ b/packages/video_player/video_player/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.10.12+1 + +* Depend on the version of `video_player_platform_interface` that contains the new `VideoPlayerOptions` class. + ## 0.10.12 * Introduce VideoPlayerOptions to set the audio mix mode. diff --git a/packages/video_player/video_player/pubspec.yaml b/packages/video_player/video_player/pubspec.yaml index a62f6f09a202..d1072641223c 100644 --- a/packages/video_player/video_player/pubspec.yaml +++ b/packages/video_player/video_player/pubspec.yaml @@ -4,7 +4,7 @@ description: Flutter plugin for displaying inline video with other Flutter # 0.10.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.10.12 +version: 0.10.12+1 homepage: https://github.com/flutter/plugins/tree/master/packages/video_player/video_player flutter: @@ -19,8 +19,8 @@ flutter: default_package: video_player_web dependencies: - meta: "^1.0.5" - video_player_platform_interface: ^2.0.0 + meta: ^1.0.5 + video_player_platform_interface: ^2.1.0 # The design on https://flutter.dev/go/federated-plugins was to leave # this constraint as "any". We cannot do it right now as it fails pub publish # validation, so we set a ^ constraint. From 68ce35eb3b933e35b29f7fa8916c3570691aa78d Mon Sep 17 00:00:00 2001 From: Jia Hao Date: Tue, 25 Aug 2020 13:29:08 +0800 Subject: [PATCH 050/233] [integration_test] Minor cleanup (#2956) - Doc typos - Unused Java variables --- .../plugins/integration_test/IntegrationTestPlugin.java | 4 ++-- packages/integration_test/lib/common.dart | 2 +- packages/integration_test/lib/integration_test_driver.dart | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/integration_test/android/src/main/java/dev/flutter/plugins/integration_test/IntegrationTestPlugin.java b/packages/integration_test/android/src/main/java/dev/flutter/plugins/integration_test/IntegrationTestPlugin.java index 2245b33ba4c3..efe1028b6836 100644 --- a/packages/integration_test/android/src/main/java/dev/flutter/plugins/integration_test/IntegrationTestPlugin.java +++ b/packages/integration_test/android/src/main/java/dev/flutter/plugins/integration_test/IntegrationTestPlugin.java @@ -37,8 +37,8 @@ public void onAttachedToEngine(FlutterPluginBinding binding) { onAttachedToEngine(binding.getApplicationContext(), binding.getBinaryMessenger()); } - private void onAttachedToEngine(Context applicationContext, BinaryMessenger messenger) { - methodChannel = new MethodChannel(messenger, "plugins.flutter.io/integration_test"); + private void onAttachedToEngine(Context unusedApplicationContext, BinaryMessenger messenger) { + methodChannel = new MethodChannel(messenger, CHANNEL); methodChannel.setMethodCallHandler(this); } diff --git a/packages/integration_test/lib/common.dart b/packages/integration_test/lib/common.dart index 3363e3c91989..cea67d189307 100644 --- a/packages/integration_test/lib/common.dart +++ b/packages/integration_test/lib/common.dart @@ -53,7 +53,7 @@ class Response { } } - /// Method for formating the test failures' details. + /// Method for formatting the test failures' details. String formatFailures(List failureDetails) { if (failureDetails.isEmpty) { return ''; diff --git a/packages/integration_test/lib/integration_test_driver.dart b/packages/integration_test/lib/integration_test_driver.dart index e5160b4e8d68..3b0e756000d0 100644 --- a/packages/integration_test/lib/integration_test_driver.dart +++ b/packages/integration_test/lib/integration_test_driver.dart @@ -19,7 +19,8 @@ import 'package:path/path.dart' as path; String testOutputsDirectory = Platform.environment['FLUTTER_TEST_OUTPUTS_DIR'] ?? 'build'; -/// The callback type to handle [integration_test.Response.data] after the test succcess. +/// The callback type to handle [integration_test.Response.data] after the test +/// succeeds. typedef ResponseDataCallback = FutureOr Function(Map); /// Writes a json-serializable json data to to From 3a992ac6919129b248774369d0ffd5bed456a486 Mon Sep 17 00:00:00 2001 From: Panmari Date: Tue, 25 Aug 2020 18:00:14 +0200 Subject: [PATCH 051/233] Updating documentation to use isEmpty check. (#2955) The value returned is never null. This is already done correclty in the example app. Co-authored-by: Dan Field --- packages/image_picker/image_picker/CHANGELOG.md | 4 ++++ packages/image_picker/image_picker/README.md | 2 +- packages/image_picker/image_picker/pubspec.yaml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/image_picker/image_picker/CHANGELOG.md b/packages/image_picker/image_picker/CHANGELOG.md index 197314292f8f..07447db130ca 100644 --- a/packages/image_picker/image_picker/CHANGELOG.md +++ b/packages/image_picker/image_picker/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.6.7+7 + +* Updating documentation to use isEmpty check. + ## 0.6.7+6 * Update package:e2e -> package:integration_test diff --git a/packages/image_picker/image_picker/README.md b/packages/image_picker/image_picker/README.md index 1c9503cbe5cb..71d20ea4af2c 100755 --- a/packages/image_picker/image_picker/README.md +++ b/packages/image_picker/image_picker/README.md @@ -77,7 +77,7 @@ Android system -- although very rarely -- sometimes kills the MainActivity after Future retrieveLostData() async { final LostData response = await picker.getLostData(); - if (response == null) { + if (response.isEmpty) { return; } if (response.file != null) { diff --git a/packages/image_picker/image_picker/pubspec.yaml b/packages/image_picker/image_picker/pubspec.yaml index 118faf3712bc..91338f1e22ee 100755 --- a/packages/image_picker/image_picker/pubspec.yaml +++ b/packages/image_picker/image_picker/pubspec.yaml @@ -2,7 +2,7 @@ name: image_picker description: Flutter plugin for selecting images from the Android and iOS image library, and taking new pictures with the camera. homepage: https://github.com/flutter/plugins/tree/master/packages/image_picker/image_picker -version: 0.6.7+6 +version: 0.6.7+7 flutter: plugin: From 6eda8db6516ac89551450db9483ff88471f95779 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Tue, 25 Aug 2020 20:54:59 -0700 Subject: [PATCH 052/233] Avoid walleye 26 --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 8c8cc624d1ee..d5a1ac82f6d5 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -93,7 +93,7 @@ task: - echo "This user does not have permission to run Firebase Test Lab tests." - else - echo $GCLOUD_FIREBASE_TESTLAB_KEY > ${HOME}/gcloud-service-key.json - - ./script/incremental_build.sh firebase-test-lab + - ./script/incremental_build.sh firebase-test-lab --device model=flame,version=29 --device model=starqlteue,version=26 - fi - export CIRRUS_CHANGE_MESSAGE=`cat /tmp/cirrus_change_message.txt` - export CIRRUS_COMMIT_MESSAGE=`cat /tmp/cirrus_commit_message.txt` From f8f666f2281a7d98b6cac8a7ea4d11b5480135e0 Mon Sep 17 00:00:00 2001 From: Jia Hao Date: Wed, 26 Aug 2020 21:28:08 +0800 Subject: [PATCH 053/233] Rebase previous commits (#2966) * [battery] Fixed typo in README.md (#2944) * [integration_test] Remove debugging statement (#2963) Co-authored-by: Yash Johri --- packages/battery/CHANGELOG.md | 4 ++++ packages/battery/README.md | 4 ++-- packages/battery/pubspec.yaml | 2 +- packages/integration_test/lib/integration_test.dart | 1 - 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/battery/CHANGELOG.md b/packages/battery/CHANGELOG.md index c47879ce0419..b45d82ebeaa5 100644 --- a/packages/battery/CHANGELOG.md +++ b/packages/battery/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.4 + +* Updated README.md. + ## 1.0.3 * Update package:e2e to use package:integration_test diff --git a/packages/battery/README.md b/packages/battery/README.md index 93f8330db0db..22ce5007acd7 100644 --- a/packages/battery/README.md +++ b/packages/battery/README.md @@ -14,10 +14,10 @@ To use this plugin, add `battery` as a [dependency in your pubspec.yaml file](ht import 'package:battery/battery.dart'; // Instantiate it -var battery = Battery(); +var _battery = Battery(); // Access current battery level -print(await battery.batteryLevel); +print(await _battery.batteryLevel); // Be informed when the state (full, charging, discharging) changes _battery.onBatteryStateChanged.listen((BatteryState state) { diff --git a/packages/battery/pubspec.yaml b/packages/battery/pubspec.yaml index 7a02f37bab85..8363d7a09ee2 100644 --- a/packages/battery/pubspec.yaml +++ b/packages/battery/pubspec.yaml @@ -2,7 +2,7 @@ name: battery description: Flutter plugin for accessing information about the battery state (full, charging, discharging) on Android and iOS. homepage: https://github.com/flutter/plugins/tree/master/packages/battery -version: 1.0.3 +version: 1.0.4 flutter: plugin: diff --git a/packages/integration_test/lib/integration_test.dart b/packages/integration_test/lib/integration_test.dart index 6354ef768939..28d0da320486 100644 --- a/packages/integration_test/lib/integration_test.dart +++ b/packages/integration_test/lib/integration_test.dart @@ -22,7 +22,6 @@ class IntegrationTestWidgetsFlutterBinding IntegrationTestWidgetsFlutterBinding() { // TODO(jackson): Report test results as they arrive tearDownAll(() async { - print('TESTING123: TEARING HER DOWN'); try { // For web integration tests we are not using the // `plugins.flutter.io/integration_test`. Mark the tests as complete From 722726348c108a908ecab199422bae6166cc69e8 Mon Sep 17 00:00:00 2001 From: Matt Carroll Date: Wed, 26 Aug 2020 08:56:08 -0700 Subject: [PATCH 054/233] Add README instructions for enablePendingPurchases (#2921) Add README instructions for enablePendingPurchases. If a developer attempts to access this plugin on Android without invoking enablePendingPurchases, an exception is thrown. Related StackOverflow post: https://stackoverflow.com/questions/60046903/flutter-in-app-purchase-enablependingpurchases-enablependingpurchases-must --- packages/in_app_purchase/CHANGELOG.md | 4 ++++ packages/in_app_purchase/README.md | 15 ++++++++++++++- packages/in_app_purchase/pubspec.yaml | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/in_app_purchase/CHANGELOG.md b/packages/in_app_purchase/CHANGELOG.md index ad53c7ccf1f5..65f7f86a16e6 100644 --- a/packages/in_app_purchase/CHANGELOG.md +++ b/packages/in_app_purchase/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.3.4+5 + +* Added necessary README docs for getting started with Android. + ## 0.3.4+4 * Update package:e2e -> package:integration_test diff --git a/packages/in_app_purchase/README.md b/packages/in_app_purchase/README.md index f3a34a667c70..021811842b2f 100644 --- a/packages/in_app_purchase/README.md +++ b/packages/in_app_purchase/README.md @@ -51,6 +51,19 @@ use. ### Initializing the plugin +```dart +void main() { + // Inform the plugin that this app supports pending purchases on Android. + // An error will occur on Android if you access the plugin `instance` + // without this call. + // + // On iOS this is a no-op. + InAppPurchaseConnection.enablePendingPurchases(); + + runApp(MyApp()); +} +``` + ```dart // Subscribe to any incoming purchases at app initialization. These can // propagate from either storefront so it's important to listen as soon as @@ -90,7 +103,7 @@ if (!available) { // Set literals require Dart 2.2. Alternatively, use `Set _kIds = ['product1', 'product2'].toSet()`. const Set _kIds = {'product1', 'product2'}; final ProductDetailsResponse response = await InAppPurchaseConnection.instance.queryProductDetails(_kIds); -if (!response.notFoundIDs.isEmpty) { +if (response.notFoundIDs.isNotEmpty) { // Handle the error. } List products = response.productDetails; diff --git a/packages/in_app_purchase/pubspec.yaml b/packages/in_app_purchase/pubspec.yaml index 0633d154cb8b..42bb0d8f4619 100644 --- a/packages/in_app_purchase/pubspec.yaml +++ b/packages/in_app_purchase/pubspec.yaml @@ -1,7 +1,7 @@ name: in_app_purchase description: A Flutter plugin for in-app purchases. Exposes APIs for making in-app purchases through the App Store and Google Play. homepage: https://github.com/flutter/plugins/tree/master/packages/in_app_purchase -version: 0.3.4+4 +version: 0.3.4+5 dependencies: async: ^2.0.8 From 3b6ddc80075f86f8b233940cb32d8fa1995fd2d9 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 26 Aug 2020 09:46:27 -0700 Subject: [PATCH 055/233] [video_player_platform_interface] fix `setMixIWithOthers` test channel (#2968) --- .../CHANGELOG.md | 4 ++++ .../lib/messages.dart | 13 +++++++++++++ .../pubspec.yaml | 2 +- .../test/method_channel_video_player_test.dart | 17 +++++++++++++++++ 4 files changed, 35 insertions(+), 1 deletion(-) diff --git a/packages/video_player/video_player_platform_interface/CHANGELOG.md b/packages/video_player/video_player_platform_interface/CHANGELOG.md index 0920582abad0..2af6f01ffe88 100644 --- a/packages/video_player/video_player_platform_interface/CHANGELOG.md +++ b/packages/video_player/video_player_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.1.1 + +* Fix mixWithOthers test channel. + ## 2.1.0 * Add VideoPlayerOptions with audo mix mode diff --git a/packages/video_player/video_player_platform_interface/lib/messages.dart b/packages/video_player/video_player_platform_interface/lib/messages.dart index a75ece0db850..c5e8cd413b70 100644 --- a/packages/video_player/video_player_platform_interface/lib/messages.dart +++ b/packages/video_player/video_player_platform_interface/lib/messages.dart @@ -134,6 +134,7 @@ abstract class VideoPlayerApiTest { PositionMessage position(TextureMessage arg); void seekTo(PositionMessage arg); void pause(TextureMessage arg); + void setMixWithOthers(MixWithOthersMessage arg); } void VideoPlayerApiTestSetup(VideoPlayerApiTest api) { @@ -225,6 +226,18 @@ void VideoPlayerApiTestSetup(VideoPlayerApiTest api) { return {}; }); } + { + const BasicMessageChannel channel = BasicMessageChannel( + 'dev.flutter.pigeon.VideoPlayerApi.setMixWithOthers', + StandardMessageCodec()); + channel.setMockMessageHandler((dynamic message) async { + final Map mapMessage = message as Map; + final MixWithOthersMessage input = + MixWithOthersMessage._fromMap(mapMessage); + api.setMixWithOthers(input); + return {}; + }); + } } class VideoPlayerApi { diff --git a/packages/video_player/video_player_platform_interface/pubspec.yaml b/packages/video_player/video_player_platform_interface/pubspec.yaml index 4740605d7669..38bc6851f376 100644 --- a/packages/video_player/video_player_platform_interface/pubspec.yaml +++ b/packages/video_player/video_player_platform_interface/pubspec.yaml @@ -3,7 +3,7 @@ description: A common platform interface for the video_player plugin. homepage: https://github.com/flutter/plugins/tree/master/packages/video_player/video_player_platform_interface # NOTE: We strongly prefer non-breaking changes, even at the expense of a # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes -version: 2.1.0 +version: 2.1.1 dependencies: flutter: diff --git a/packages/video_player/video_player_platform_interface/test/method_channel_video_player_test.dart b/packages/video_player/video_player_platform_interface/test/method_channel_video_player_test.dart index e7bcf26e9d26..185953163350 100644 --- a/packages/video_player/video_player_platform_interface/test/method_channel_video_player_test.dart +++ b/packages/video_player/video_player_platform_interface/test/method_channel_video_player_test.dart @@ -19,6 +19,7 @@ class _ApiLogger implements VideoPlayerApiTest { PositionMessage positionMessage; LoopingMessage loopingMessage; VolumeMessage volumeMessage; + MixWithOthersMessage mixWithOthersMessage; @override TextureMessage create(CreateMessage arg) { @@ -50,6 +51,12 @@ class _ApiLogger implements VideoPlayerApiTest { textureMessage = arg; } + @override + void setMixWithOthers(MixWithOthersMessage arg) { + log.add('setMixWithOthers'); + mixWithOthersMessage = arg; + } + @override PositionMessage position(TextureMessage arg) { log.add('position'); @@ -179,6 +186,16 @@ void main() { expect(log.textureMessage.textureId, 1); }); + test('setMixWithOthers', () async { + await player.setMixWithOthers(true); + expect(log.log.last, 'setMixWithOthers'); + expect(log.mixWithOthersMessage.mixWithOthers, true); + + await player.setMixWithOthers(false); + expect(log.log.last, 'setMixWithOthers'); + expect(log.mixWithOthersMessage.mixWithOthers, false); + }); + test('setVolume', () async { await player.setVolume(1, 0.7); expect(log.log.last, 'setVolume'); From 4a727faba7e84b096112eb1aa46844717b3c285c Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 26 Aug 2020 13:55:31 -0700 Subject: [PATCH 056/233] [video_player] Fix `setWithOthers` test (#2970) --- packages/video_player/video_player/CHANGELOG.md | 4 ++++ packages/video_player/video_player/pubspec.yaml | 2 +- .../video_player/test/video_player_test.dart | 9 +++++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/video_player/video_player/CHANGELOG.md b/packages/video_player/video_player/CHANGELOG.md index ccc5a6393db0..35f50419f823 100644 --- a/packages/video_player/video_player/CHANGELOG.md +++ b/packages/video_player/video_player/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.10.12+2 + +* Fix `setMixWithOthers` test. + ## 0.10.12+1 * Depend on the version of `video_player_platform_interface` that contains the new `VideoPlayerOptions` class. diff --git a/packages/video_player/video_player/pubspec.yaml b/packages/video_player/video_player/pubspec.yaml index d1072641223c..04c7c6ba3ddb 100644 --- a/packages/video_player/video_player/pubspec.yaml +++ b/packages/video_player/video_player/pubspec.yaml @@ -4,7 +4,7 @@ description: Flutter plugin for displaying inline video with other Flutter # 0.10.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.10.12+1 +version: 0.10.12+2 homepage: https://github.com/flutter/plugins/tree/master/packages/video_player/video_player flutter: diff --git a/packages/video_player/video_player/test/video_player_test.dart b/packages/video_player/video_player/test/video_player_test.dart index 67722594989c..f2d4c35a1ce8 100644 --- a/packages/video_player/video_player/test/video_player_test.dart +++ b/packages/video_player/video_player/test/video_player_test.dart @@ -579,11 +579,11 @@ void main() { expect(colors.backgroundColor, backgroundColor); }); - test('setMixWithOthers', () { + test('setMixWithOthers', () async { final VideoPlayerController controller = VideoPlayerController.file( File(''), videoPlayerOptions: VideoPlayerOptions(mixWithOthers: true)); - controller.initialize(); + await controller.initialize(); expect(controller.videoPlayerOptions.mixWithOthers, true); }); } @@ -656,6 +656,11 @@ class FakeVideoPlayerPlatform extends VideoPlayerApiTest { void setVolume(VolumeMessage arg) { calls.add('setVolume'); } + + @override + void setMixWithOthers(MixWithOthersMessage arg) { + calls.add('setMixWithOthers'); + } } class FakeVideoEventStream { From f8341ef980de149530dba8efddcf6663e55ac504 Mon Sep 17 00:00:00 2001 From: Jia Hao Date: Thu, 27 Aug 2020 08:01:56 +0800 Subject: [PATCH 057/233] [integration_test] Show stack trace of widget test errors on the platform side (#2967) * [integration_test] Show stack trace of widget test errors on the platform side We keep things simple for now, because this might change once we have a proper test reporter. --- packages/integration_test/CHANGELOG.md | 4 +++ .../integration_test/FlutterTestRunner.java | 2 +- .../ios/Classes/IntegrationTestIosTest.m | 2 +- packages/integration_test/lib/common.dart | 8 +++-- .../lib/integration_test.dart | 32 +++++++++++-------- packages/integration_test/pubspec.yaml | 2 +- .../test/binding_fail_test.dart | 19 +++++------ 7 files changed, 38 insertions(+), 31 deletions(-) diff --git a/packages/integration_test/CHANGELOG.md b/packages/integration_test/CHANGELOG.md index cbd5282028f4..6e5e4bb3d51b 100644 --- a/packages/integration_test/CHANGELOG.md +++ b/packages/integration_test/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.8.1 + +* Show stack trace of widget test errors on the platform side + ## 0.8.0 * Rename plugin to integration_test. diff --git a/packages/integration_test/android/src/main/java/dev/flutter/plugins/integration_test/FlutterTestRunner.java b/packages/integration_test/android/src/main/java/dev/flutter/plugins/integration_test/FlutterTestRunner.java index 511fc141a917..fc6b99b30f64 100644 --- a/packages/integration_test/android/src/main/java/dev/flutter/plugins/integration_test/FlutterTestRunner.java +++ b/packages/integration_test/android/src/main/java/dev/flutter/plugins/integration_test/FlutterTestRunner.java @@ -77,7 +77,7 @@ public void run(RunNotifier notifier) { Description d = Description.createTestDescription(testClass, name); notifier.fireTestStarted(d); String outcome = results.get(name); - if (outcome.equals("failed")) { + if (!outcome.equals("success")) { Exception dummyException = new Exception(outcome); notifier.fireTestFailure(new Failure(d, dummyException)); } diff --git a/packages/integration_test/ios/Classes/IntegrationTestIosTest.m b/packages/integration_test/ios/Classes/IntegrationTestIosTest.m index 4243cdd86bc0..1397f547e6f6 100644 --- a/packages/integration_test/ios/Classes/IntegrationTestIosTest.m +++ b/packages/integration_test/ios/Classes/IntegrationTestIosTest.m @@ -26,7 +26,7 @@ - (BOOL)testIntegrationTest:(NSString **)testResult { NSLog(@"%@ passed.", test); [passedTests addObject:test]; } else { - NSLog(@"%@ failed.", test); + NSLog(@"%@ failed: %@", test, result); [failedTests addObject:test]; } } diff --git a/packages/integration_test/lib/common.dart b/packages/integration_test/lib/common.dart index cea67d189307..789b1fa54948 100644 --- a/packages/integration_test/lib/common.dart +++ b/packages/integration_test/lib/common.dart @@ -78,7 +78,7 @@ class Response { } _failureDetails.forEach((Failure f) { - list.add(f.toString()); + list.add(f.toJson()); }); return list; @@ -107,14 +107,16 @@ class Failure { Failure(this.methodName, this.details); /// Serializes the object to JSON. - @override - String toString() { + String toJson() { return json.encode({ 'methodName': methodName, 'details': details, }); } + @override + String toString() => toJson(); + /// Decode a JSON string to create a Failure object. static Failure fromJsonString(String jsonString) { Map failure = json.decode(jsonString); diff --git a/packages/integration_test/lib/integration_test.dart b/packages/integration_test/lib/integration_test.dart index 28d0da320486..430b7ee38510 100644 --- a/packages/integration_test/lib/integration_test.dart +++ b/packages/integration_test/lib/integration_test.dart @@ -13,6 +13,8 @@ import 'package:flutter/widgets.dart'; import 'common.dart'; import '_extension_io.dart' if (dart.library.html) '_extension_web.dart'; +const String _success = 'success'; + /// A subclass of [LiveTestWidgetsFlutterBinding] that reports tests results /// on a channel to adapt them to native instrumentation test format. class IntegrationTestWidgetsFlutterBinding @@ -33,7 +35,14 @@ class IntegrationTestWidgetsFlutterBinding } await _channel.invokeMethod( 'allTestsFinished', - {'results': results}, + { + 'results': results.map((name, result) { + if (result is Failure) { + return MapEntry(name, result.details); + } + return MapEntry(name, result); + }) + }, ); } on MissingPluginException { print('Warning: integration_test test plugin was not detected.'); @@ -46,8 +55,7 @@ class IntegrationTestWidgetsFlutterBinding final TestExceptionReporter oldTestExceptionReporter = reportTestException; reportTestException = (FlutterErrorDetails details, String testDescription) { - results[testDescription] = 'failed'; - _failureMethodsDetails.add(Failure(testDescription, details.toString())); + results[testDescription] = Failure(testDescription, details.toString()); if (!_allTestsPassed.isCompleted) { _allTestsPassed.complete(false); } @@ -95,17 +103,11 @@ class IntegrationTestWidgetsFlutterBinding final Completer _allTestsPassed = Completer(); - /// Stores failure details. - /// - /// Failed test method's names used as key. - final List _failureMethodsDetails = List(); - /// Similar to [WidgetsFlutterBinding.ensureInitialized]. /// /// Returns an instance of the [IntegrationTestWidgetsFlutterBinding], creating and /// initializing it if necessary. static WidgetsBinding ensureInitialized() { - print('TESTING123 ensuring init'); if (WidgetsBinding.instance == null) { IntegrationTestWidgetsFlutterBinding(); } @@ -118,10 +120,12 @@ class IntegrationTestWidgetsFlutterBinding /// Test results that will be populated after the tests have completed. /// - /// Keys are the test descriptions, and values are either `success` or - /// `failed`. + /// Keys are the test descriptions, and values are either [_success] or + /// a [Failure]. @visibleForTesting - Map results = {}; + Map results = {}; + + List get _failures => results.values.whereType().toList(); /// The extra data for the reported result. /// @@ -143,7 +147,7 @@ class IntegrationTestWidgetsFlutterBinding 'message': allTestsPassed ? Response.allTestsPassed(data: reportData).toJson() : Response.someTestsFailed( - _failureMethodsDetails, + _failures, data: reportData, ).toJson(), }; @@ -185,6 +189,6 @@ class IntegrationTestWidgetsFlutterBinding description: description, timeout: timeout, ); - results[description] ??= 'success'; + results[description] ??= _success; } } diff --git a/packages/integration_test/pubspec.yaml b/packages/integration_test/pubspec.yaml index b222531044e9..c1514146c869 100644 --- a/packages/integration_test/pubspec.yaml +++ b/packages/integration_test/pubspec.yaml @@ -1,6 +1,6 @@ name: integration_test description: Runs tests that use the flutter_test API as integration tests. -version: 0.8.0 +version: 0.8.1 homepage: https://github.com/flutter/plugins/tree/master/packages/integration_test environment: diff --git a/packages/integration_test/test/binding_fail_test.dart b/packages/integration_test/test/binding_fail_test.dart index 020fb9607608..bb5961b18fc7 100644 --- a/packages/integration_test/test/binding_fail_test.dart +++ b/packages/integration_test/test/binding_fail_test.dart @@ -8,6 +8,7 @@ import 'package:flutter_test/flutter_test.dart'; const String _flutterBin = 'flutter'; const String _integrationResultsPrefix = 'IntegrationTestWidgetsFlutterBinding test results:'; +const String _failureExcerpt = 'Expected: \\n Actual: '; void main() async { group('Integration binding result', () { @@ -27,24 +28,20 @@ void main() async { final Map results = await _runTest('test/data/fail_test_script.dart'); + expect(results, hasLength(2)); expect( - results, - equals({ - 'failing test 1': 'failed', - 'failing test 2': 'failed', - })); + results, containsPair('failing test 1', contains(_failureExcerpt))); + expect( + results, containsPair('failing test 2', contains(_failureExcerpt))); }); test('when one test passes, then another fails', () async { final Map results = await _runTest('test/data/pass_then_fail_test_script.dart'); - expect( - results, - equals({ - 'passing test': 'success', - 'failing test': 'failed', - })); + expect(results, hasLength(2)); + expect(results, containsPair('passing test', equals('success'))); + expect(results, containsPair('failing test', contains(_failureExcerpt))); }); }); } From e4b55a496389030d70b756a47a0fc7af98c71710 Mon Sep 17 00:00:00 2001 From: Jia Hao Date: Thu, 27 Aug 2020 14:00:21 +0800 Subject: [PATCH 058/233] [integration_test] Fix channel name for iOS, docs (#2972) --- packages/integration_test/CHANGELOG.md | 1 + packages/integration_test/README.md | 38 +++++++++---------- packages/integration_test/example/README.md | 4 +- .../ios/Classes/IntegrationTestPlugin.m | 2 +- 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/packages/integration_test/CHANGELOG.md b/packages/integration_test/CHANGELOG.md index 6e5e4bb3d51b..ee72930a75a9 100644 --- a/packages/integration_test/CHANGELOG.md +++ b/packages/integration_test/CHANGELOG.md @@ -1,6 +1,7 @@ ## 0.8.1 * Show stack trace of widget test errors on the platform side +* Fix method channel name for iOS ## 0.8.0 diff --git a/packages/integration_test/README.md b/packages/integration_test/README.md index bb0bfa2eb1ae..a48210beacf8 100644 --- a/packages/integration_test/README.md +++ b/packages/integration_test/README.md @@ -6,7 +6,7 @@ and native Android instrumentation testing. ## Usage -Add a dependency on the `integration_test` package in the +Add a dependency on the `integration_test` and `flutter_test` package in the `dev_dependencies` section of pubspec.yaml. For plugins, do this in the pubspec.yaml of the example app. @@ -14,6 +14,7 @@ Invoke `IntegrationTestWidgetsFlutterBinding.ensureInitialized()` at the start of a test file, e.g. ```dart +import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; void main() { @@ -32,7 +33,7 @@ app code, it should go in `example/test/`. It is also acceptable to put integration_test tests in `test_driver/` folder so that they're alongside the runner app (see below). -## Using Flutter driver to run tests +## Using Flutter Driver to Run Tests `IntegrationTestWidgetsTestBinding` supports launching the on-device tests with `flutter drive`. Note that the tests don't use the `FlutterDriver` API, they @@ -47,28 +48,27 @@ import 'dart:async'; import 'package:integration_test/integration_test_driver.dart'; Future main() async => integrationDriver(); - ``` To run a example app test with Flutter driver: -``` +```sh cd example flutter drive test/_integration.dart ``` To test plugin APIs using Flutter driver: -``` +```sh cd example -flutter drive --driver=test_driver/_test.dart test/_e2e.dart +flutter drive --driver=test_driver/_test.dart test/_integration_test.dart ``` You can run tests on web in release or profile mode. First you need to make sure you have downloaded the driver for the browser. -``` +```sh cd example flutter drive -v --target=test_driver/dart -d web-server --release --browser-name=chrome ``` @@ -84,7 +84,7 @@ this test file MainActivityTest.java or another name of your choice. package com.example.myapp; import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.e2e.FlutterTestRunner; +import dev.flutter.plugins.integration_test.FlutterTestRunner; import org.junit.Rule; import org.junit.runner.RunWith; @@ -99,7 +99,7 @@ Update your application's **myapp/android/app/build.gradle** to make sure it uses androidx's version of AndroidJUnitRunner and has androidx libraries as a dependency. -``` +```gradle android { ... defaultConfig { @@ -117,10 +117,10 @@ dependencies { } ``` -To e2e test on a local Android device (emulated or physical): +To run a test on a local Android device (emulated or physical): -``` -./gradlew app:connectedAndroidTest -Ptarget=`pwd`/../test_driver/_e2e.dart +```sh +./gradlew app:connectedAndroidTest -Ptarget=`pwd`/../test_driver/_integration_test.dart ``` ## Firebase Test Lab @@ -130,7 +130,7 @@ the guides in the [Firebase test lab documentation](https://firebase.google.com/docs/test-lab/?gclid=EAIaIQobChMIs5qVwqW25QIV8iCtBh3DrwyUEAAYASAAEgLFU_D_BwE) to set up a project. -To run an e2e test on Android devices using Firebase Test Lab, use gradle commands to build an +To run a test on Android devices using Firebase Test Lab, use gradle commands to build an instrumentation test for Android, after creating `androidTest` as suggested in the last section. ```bash @@ -172,10 +172,10 @@ target 'Runner' do end ``` -To e2e test on your iOS device (simulator or real), rebuild your iOS targets with Flutter tool. +To run a test on your iOS device (simulator or real), rebuild your iOS targets with Flutter tool. -``` -flutter build ios -t test_driver/_e2e.dart (--simulator) +```sh +flutter build ios -t test_driver/_integration_test.dart (--simulator) ``` Open Xcode project (by default, it's `ios/Runner.xcodeproj`). Create a test target @@ -184,9 +184,9 @@ change the code. You can change `RunnerTests.m` to the name of your choice. ```objective-c #import -#import +#import -E2E_IOS_RUNNER(RunnerTests) +INTEGRATION_TEST_IOS_RUNNER(RunnerTests) ``` -Now you can start RunnerTests to kick out e2e tests! +Now you can start RunnerTests to kick out integration tests! diff --git a/packages/integration_test/example/README.md b/packages/integration_test/example/README.md index 64a5e8780bc2..7c61fbf5c8de 100644 --- a/packages/integration_test/example/README.md +++ b/packages/integration_test/example/README.md @@ -1,6 +1,6 @@ -# e2e_example +# integration_test_example -Demonstrates how to use the e2e plugin. +Demonstrates how to use the `package:integration_test`. ## Getting Started diff --git a/packages/integration_test/ios/Classes/IntegrationTestPlugin.m b/packages/integration_test/ios/Classes/IntegrationTestPlugin.m index 99d0c7fdf888..e7e5a74c01ee 100644 --- a/packages/integration_test/ios/Classes/IntegrationTestPlugin.m +++ b/packages/integration_test/ios/Classes/IntegrationTestPlugin.m @@ -1,6 +1,6 @@ #import "IntegrationTestPlugin.h" -static NSString *const kIntegrationTestPluginChannel = @"plugins.flutter.io/integratoin_test"; +static NSString *const kIntegrationTestPluginChannel = @"plugins.flutter.io/integration_test"; static NSString *const kMethodTestFinished = @"allTestsFinished"; @interface IntegrationTestPlugin () From 9d1f1311057cca5d161fad5e29e144cb1187f970 Mon Sep 17 00:00:00 2001 From: Yash Johri Date: Thu, 27 Aug 2020 23:57:35 +0530 Subject: [PATCH 059/233] [battery] Moved battery to its own subdir (#2969) This is the first step in the federation of the plugin. --- packages/battery/{ => battery}/CHANGELOG.md | 4 ++++ packages/battery/{ => battery}/LICENSE | 0 packages/battery/{ => battery}/README.md | 0 .../battery/{ => battery}/android/build.gradle | 0 .../{ => battery}/android/gradle.properties | 0 .../gradle/wrapper/gradle-wrapper.properties | 0 .../{ => battery}/android/settings.gradle | 0 .../android/src/main/AndroidManifest.xml | 0 .../flutter/plugins/battery/BatteryPlugin.java | 0 packages/battery/{ => battery}/example/README.md | 0 .../example/android/app/build.gradle | 0 .../app/gradle/wrapper/gradle-wrapper.properties | 0 .../plugins/battery/EmbedderV1ActivityTest.java | 0 .../plugins/battery/FlutterActivityTest.java | 0 .../android/app/src/main/AndroidManifest.xml | 0 .../batteryexample/EmbedderV1Activity.java | 0 .../app/src/main/res/mipmap-hdpi/ic_launcher.png | Bin .../app/src/main/res/mipmap-mdpi/ic_launcher.png | Bin .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin .../src/main/res/mipmap-xxhdpi/ic_launcher.png | Bin .../src/main/res/mipmap-xxxhdpi/ic_launcher.png | Bin .../{ => battery}/example/android/build.gradle | 0 .../example/android/gradle.properties | 0 .../gradle/wrapper/gradle-wrapper.properties | 0 .../example/android/settings.gradle | 0 .../example/ios/Flutter/AppFrameworkInfo.plist | 0 .../example/ios/Flutter/Debug.xcconfig | 0 .../example/ios/Flutter/Release.xcconfig | 0 .../example/ios/Runner.xcodeproj/project.pbxproj | 0 .../project.xcworkspace/contents.xcworkspacedata | 0 .../xcshareddata/xcschemes/Runner.xcscheme | 0 .../Runner.xcworkspace/contents.xcworkspacedata | 0 .../example/ios/Runner/AppDelegate.h | 0 .../example/ios/Runner/AppDelegate.m | 0 .../AppIcon.appiconset/Contents.json | 0 .../AppIcon.appiconset/Icon-App-20x20@1x.png | Bin .../AppIcon.appiconset/Icon-App-20x20@2x.png | Bin .../AppIcon.appiconset/Icon-App-20x20@3x.png | Bin .../AppIcon.appiconset/Icon-App-29x29@1x.png | Bin .../AppIcon.appiconset/Icon-App-29x29@2x.png | Bin .../AppIcon.appiconset/Icon-App-29x29@3x.png | Bin .../AppIcon.appiconset/Icon-App-40x40@1x.png | Bin .../AppIcon.appiconset/Icon-App-40x40@2x.png | Bin .../AppIcon.appiconset/Icon-App-40x40@3x.png | Bin .../AppIcon.appiconset/Icon-App-60x60@2x.png | Bin .../AppIcon.appiconset/Icon-App-60x60@3x.png | Bin .../AppIcon.appiconset/Icon-App-76x76@1x.png | Bin .../AppIcon.appiconset/Icon-App-76x76@2x.png | Bin .../AppIcon.appiconset/Icon-App-83.5x83.5@2x.png | Bin .../Runner/Base.lproj/LaunchScreen.storyboard | 0 .../ios/Runner/Base.lproj/Main.storyboard | 0 .../{ => battery}/example/ios/Runner/Info.plist | 0 .../{ => battery}/example/ios/Runner/main.m | 0 .../battery/{ => battery}/example/lib/main.dart | 0 .../battery/{ => battery}/example/pubspec.yaml | 2 +- .../battery/{ => battery}/ios/Assets/.gitkeep | 0 .../{ => battery}/ios/Classes/FLTBatteryPlugin.h | 0 .../{ => battery}/ios/Classes/FLTBatteryPlugin.m | 0 .../battery/{ => battery}/ios/battery.podspec | 0 packages/battery/{ => battery}/lib/battery.dart | 0 packages/battery/{ => battery}/pubspec.yaml | 6 +++--- .../battery/{ => battery}/test/battery_e2e.dart | 0 .../battery/{ => battery}/test/battery_test.dart | 0 packages/battery/example/android.iml | 12 ------------ packages/battery/example/battery_example.iml | 15 --------------- 65 files changed, 8 insertions(+), 31 deletions(-) rename packages/battery/{ => battery}/CHANGELOG.md (98%) rename packages/battery/{ => battery}/LICENSE (100%) rename packages/battery/{ => battery}/README.md (100%) rename packages/battery/{ => battery}/android/build.gradle (100%) rename packages/battery/{ => battery}/android/gradle.properties (100%) rename packages/battery/{ => battery}/android/gradle/wrapper/gradle-wrapper.properties (100%) rename packages/battery/{ => battery}/android/settings.gradle (100%) rename packages/battery/{ => battery}/android/src/main/AndroidManifest.xml (100%) rename packages/battery/{ => battery}/android/src/main/java/io/flutter/plugins/battery/BatteryPlugin.java (100%) rename packages/battery/{ => battery}/example/README.md (100%) rename packages/battery/{ => battery}/example/android/app/build.gradle (100%) rename packages/battery/{ => battery}/example/android/app/gradle/wrapper/gradle-wrapper.properties (100%) rename packages/battery/{ => battery}/example/android/app/src/androidTest/java/io/flutter/plugins/battery/EmbedderV1ActivityTest.java (100%) rename packages/battery/{ => battery}/example/android/app/src/androidTest/java/io/flutter/plugins/battery/FlutterActivityTest.java (100%) rename packages/battery/{ => battery}/example/android/app/src/main/AndroidManifest.xml (100%) rename packages/battery/{ => battery}/example/android/app/src/main/java/io/flutter/plugins/batteryexample/EmbedderV1Activity.java (100%) rename packages/battery/{ => battery}/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png (100%) rename packages/battery/{ => battery}/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png (100%) rename packages/battery/{ => battery}/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png (100%) rename packages/battery/{ => battery}/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png (100%) rename packages/battery/{ => battery}/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png (100%) rename packages/battery/{ => battery}/example/android/build.gradle (100%) rename packages/battery/{ => battery}/example/android/gradle.properties (100%) rename packages/battery/{ => battery}/example/android/gradle/wrapper/gradle-wrapper.properties (100%) rename packages/battery/{ => battery}/example/android/settings.gradle (100%) rename packages/battery/{ => battery}/example/ios/Flutter/AppFrameworkInfo.plist (100%) rename packages/battery/{ => battery}/example/ios/Flutter/Debug.xcconfig (100%) rename packages/battery/{ => battery}/example/ios/Flutter/Release.xcconfig (100%) rename packages/battery/{ => battery}/example/ios/Runner.xcodeproj/project.pbxproj (100%) rename packages/battery/{ => battery}/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata (100%) rename packages/battery/{ => battery}/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme (100%) rename packages/battery/{ => battery}/example/ios/Runner.xcworkspace/contents.xcworkspacedata (100%) rename packages/battery/{ => battery}/example/ios/Runner/AppDelegate.h (100%) rename packages/battery/{ => battery}/example/ios/Runner/AppDelegate.m (100%) rename packages/battery/{ => battery}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json (100%) rename packages/battery/{ => battery}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png (100%) rename packages/battery/{ => battery}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png (100%) rename packages/battery/{ => battery}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png (100%) rename packages/battery/{ => battery}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png (100%) rename packages/battery/{ => battery}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png (100%) rename packages/battery/{ => battery}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png (100%) rename packages/battery/{ => battery}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png (100%) rename packages/battery/{ => battery}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png (100%) rename packages/battery/{ => battery}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png (100%) rename packages/battery/{ => battery}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png (100%) rename packages/battery/{ => battery}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png (100%) rename packages/battery/{ => battery}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png (100%) rename packages/battery/{ => battery}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png (100%) rename packages/battery/{ => battery}/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png (100%) rename packages/battery/{ => battery}/example/ios/Runner/Base.lproj/LaunchScreen.storyboard (100%) rename packages/battery/{ => battery}/example/ios/Runner/Base.lproj/Main.storyboard (100%) rename packages/battery/{ => battery}/example/ios/Runner/Info.plist (100%) rename packages/battery/{ => battery}/example/ios/Runner/main.m (100%) rename packages/battery/{ => battery}/example/lib/main.dart (100%) rename packages/battery/{ => battery}/example/pubspec.yaml (88%) rename packages/battery/{ => battery}/ios/Assets/.gitkeep (100%) rename packages/battery/{ => battery}/ios/Classes/FLTBatteryPlugin.h (100%) rename packages/battery/{ => battery}/ios/Classes/FLTBatteryPlugin.m (100%) rename packages/battery/{ => battery}/ios/battery.podspec (100%) rename packages/battery/{ => battery}/lib/battery.dart (100%) rename packages/battery/{ => battery}/pubspec.yaml (90%) rename packages/battery/{ => battery}/test/battery_e2e.dart (100%) rename packages/battery/{ => battery}/test/battery_test.dart (100%) delete mode 100644 packages/battery/example/android.iml delete mode 100644 packages/battery/example/battery_example.iml diff --git a/packages/battery/CHANGELOG.md b/packages/battery/battery/CHANGELOG.md similarity index 98% rename from packages/battery/CHANGELOG.md rename to packages/battery/battery/CHANGELOG.md index b45d82ebeaa5..2cf470d17e00 100644 --- a/packages/battery/CHANGELOG.md +++ b/packages/battery/battery/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.4+1 + +* Moved everything from battery to battery/battery + ## 1.0.4 * Updated README.md. diff --git a/packages/battery/LICENSE b/packages/battery/battery/LICENSE similarity index 100% rename from packages/battery/LICENSE rename to packages/battery/battery/LICENSE diff --git a/packages/battery/README.md b/packages/battery/battery/README.md similarity index 100% rename from packages/battery/README.md rename to packages/battery/battery/README.md diff --git a/packages/battery/android/build.gradle b/packages/battery/battery/android/build.gradle similarity index 100% rename from packages/battery/android/build.gradle rename to packages/battery/battery/android/build.gradle diff --git a/packages/battery/android/gradle.properties b/packages/battery/battery/android/gradle.properties similarity index 100% rename from packages/battery/android/gradle.properties rename to packages/battery/battery/android/gradle.properties diff --git a/packages/battery/android/gradle/wrapper/gradle-wrapper.properties b/packages/battery/battery/android/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from packages/battery/android/gradle/wrapper/gradle-wrapper.properties rename to packages/battery/battery/android/gradle/wrapper/gradle-wrapper.properties diff --git a/packages/battery/android/settings.gradle b/packages/battery/battery/android/settings.gradle similarity index 100% rename from packages/battery/android/settings.gradle rename to packages/battery/battery/android/settings.gradle diff --git a/packages/battery/android/src/main/AndroidManifest.xml b/packages/battery/battery/android/src/main/AndroidManifest.xml similarity index 100% rename from packages/battery/android/src/main/AndroidManifest.xml rename to packages/battery/battery/android/src/main/AndroidManifest.xml diff --git a/packages/battery/android/src/main/java/io/flutter/plugins/battery/BatteryPlugin.java b/packages/battery/battery/android/src/main/java/io/flutter/plugins/battery/BatteryPlugin.java similarity index 100% rename from packages/battery/android/src/main/java/io/flutter/plugins/battery/BatteryPlugin.java rename to packages/battery/battery/android/src/main/java/io/flutter/plugins/battery/BatteryPlugin.java diff --git a/packages/battery/example/README.md b/packages/battery/battery/example/README.md similarity index 100% rename from packages/battery/example/README.md rename to packages/battery/battery/example/README.md diff --git a/packages/battery/example/android/app/build.gradle b/packages/battery/battery/example/android/app/build.gradle similarity index 100% rename from packages/battery/example/android/app/build.gradle rename to packages/battery/battery/example/android/app/build.gradle diff --git a/packages/battery/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/battery/battery/example/android/app/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from packages/battery/example/android/app/gradle/wrapper/gradle-wrapper.properties rename to packages/battery/battery/example/android/app/gradle/wrapper/gradle-wrapper.properties diff --git a/packages/battery/example/android/app/src/androidTest/java/io/flutter/plugins/battery/EmbedderV1ActivityTest.java b/packages/battery/battery/example/android/app/src/androidTest/java/io/flutter/plugins/battery/EmbedderV1ActivityTest.java similarity index 100% rename from packages/battery/example/android/app/src/androidTest/java/io/flutter/plugins/battery/EmbedderV1ActivityTest.java rename to packages/battery/battery/example/android/app/src/androidTest/java/io/flutter/plugins/battery/EmbedderV1ActivityTest.java diff --git a/packages/battery/example/android/app/src/androidTest/java/io/flutter/plugins/battery/FlutterActivityTest.java b/packages/battery/battery/example/android/app/src/androidTest/java/io/flutter/plugins/battery/FlutterActivityTest.java similarity index 100% rename from packages/battery/example/android/app/src/androidTest/java/io/flutter/plugins/battery/FlutterActivityTest.java rename to packages/battery/battery/example/android/app/src/androidTest/java/io/flutter/plugins/battery/FlutterActivityTest.java diff --git a/packages/battery/example/android/app/src/main/AndroidManifest.xml b/packages/battery/battery/example/android/app/src/main/AndroidManifest.xml similarity index 100% rename from packages/battery/example/android/app/src/main/AndroidManifest.xml rename to packages/battery/battery/example/android/app/src/main/AndroidManifest.xml diff --git a/packages/battery/example/android/app/src/main/java/io/flutter/plugins/batteryexample/EmbedderV1Activity.java b/packages/battery/battery/example/android/app/src/main/java/io/flutter/plugins/batteryexample/EmbedderV1Activity.java similarity index 100% rename from packages/battery/example/android/app/src/main/java/io/flutter/plugins/batteryexample/EmbedderV1Activity.java rename to packages/battery/battery/example/android/app/src/main/java/io/flutter/plugins/batteryexample/EmbedderV1Activity.java diff --git a/packages/battery/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/battery/battery/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from packages/battery/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png rename to packages/battery/battery/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/packages/battery/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/battery/battery/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from packages/battery/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png rename to packages/battery/battery/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/packages/battery/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/battery/battery/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from packages/battery/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png rename to packages/battery/battery/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/packages/battery/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/battery/battery/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from packages/battery/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to packages/battery/battery/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/packages/battery/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/battery/battery/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from packages/battery/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to packages/battery/battery/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/packages/battery/example/android/build.gradle b/packages/battery/battery/example/android/build.gradle similarity index 100% rename from packages/battery/example/android/build.gradle rename to packages/battery/battery/example/android/build.gradle diff --git a/packages/battery/example/android/gradle.properties b/packages/battery/battery/example/android/gradle.properties similarity index 100% rename from packages/battery/example/android/gradle.properties rename to packages/battery/battery/example/android/gradle.properties diff --git a/packages/battery/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/battery/battery/example/android/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from packages/battery/example/android/gradle/wrapper/gradle-wrapper.properties rename to packages/battery/battery/example/android/gradle/wrapper/gradle-wrapper.properties diff --git a/packages/battery/example/android/settings.gradle b/packages/battery/battery/example/android/settings.gradle similarity index 100% rename from packages/battery/example/android/settings.gradle rename to packages/battery/battery/example/android/settings.gradle diff --git a/packages/battery/example/ios/Flutter/AppFrameworkInfo.plist b/packages/battery/battery/example/ios/Flutter/AppFrameworkInfo.plist similarity index 100% rename from packages/battery/example/ios/Flutter/AppFrameworkInfo.plist rename to packages/battery/battery/example/ios/Flutter/AppFrameworkInfo.plist diff --git a/packages/battery/example/ios/Flutter/Debug.xcconfig b/packages/battery/battery/example/ios/Flutter/Debug.xcconfig similarity index 100% rename from packages/battery/example/ios/Flutter/Debug.xcconfig rename to packages/battery/battery/example/ios/Flutter/Debug.xcconfig diff --git a/packages/battery/example/ios/Flutter/Release.xcconfig b/packages/battery/battery/example/ios/Flutter/Release.xcconfig similarity index 100% rename from packages/battery/example/ios/Flutter/Release.xcconfig rename to packages/battery/battery/example/ios/Flutter/Release.xcconfig diff --git a/packages/battery/example/ios/Runner.xcodeproj/project.pbxproj b/packages/battery/battery/example/ios/Runner.xcodeproj/project.pbxproj similarity index 100% rename from packages/battery/example/ios/Runner.xcodeproj/project.pbxproj rename to packages/battery/battery/example/ios/Runner.xcodeproj/project.pbxproj diff --git a/packages/battery/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/battery/battery/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from packages/battery/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to packages/battery/battery/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/packages/battery/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/battery/battery/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme similarity index 100% rename from packages/battery/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme rename to packages/battery/battery/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme diff --git a/packages/battery/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/battery/battery/example/ios/Runner.xcworkspace/contents.xcworkspacedata similarity index 100% rename from packages/battery/example/ios/Runner.xcworkspace/contents.xcworkspacedata rename to packages/battery/battery/example/ios/Runner.xcworkspace/contents.xcworkspacedata diff --git a/packages/battery/example/ios/Runner/AppDelegate.h b/packages/battery/battery/example/ios/Runner/AppDelegate.h similarity index 100% rename from packages/battery/example/ios/Runner/AppDelegate.h rename to packages/battery/battery/example/ios/Runner/AppDelegate.h diff --git a/packages/battery/example/ios/Runner/AppDelegate.m b/packages/battery/battery/example/ios/Runner/AppDelegate.m similarity index 100% rename from packages/battery/example/ios/Runner/AppDelegate.m rename to packages/battery/battery/example/ios/Runner/AppDelegate.m diff --git a/packages/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/battery/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from packages/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json rename to packages/battery/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/packages/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/battery/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png similarity index 100% rename from packages/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png rename to packages/battery/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png diff --git a/packages/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/battery/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png similarity index 100% rename from packages/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png rename to packages/battery/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png diff --git a/packages/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/battery/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png similarity index 100% rename from packages/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png rename to packages/battery/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png diff --git a/packages/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/battery/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png similarity index 100% rename from packages/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png rename to packages/battery/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png diff --git a/packages/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/battery/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png similarity index 100% rename from packages/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png rename to packages/battery/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png diff --git a/packages/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/battery/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png similarity index 100% rename from packages/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png rename to packages/battery/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png diff --git a/packages/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/battery/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png similarity index 100% rename from packages/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png rename to packages/battery/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png diff --git a/packages/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/battery/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png similarity index 100% rename from packages/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png rename to packages/battery/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png diff --git a/packages/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/battery/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png similarity index 100% rename from packages/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png rename to packages/battery/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png diff --git a/packages/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/battery/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png similarity index 100% rename from packages/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png rename to packages/battery/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png diff --git a/packages/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/battery/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png similarity index 100% rename from packages/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png rename to packages/battery/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png diff --git a/packages/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/battery/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png similarity index 100% rename from packages/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png rename to packages/battery/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png diff --git a/packages/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/battery/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png similarity index 100% rename from packages/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png rename to packages/battery/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png diff --git a/packages/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/battery/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png similarity index 100% rename from packages/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png rename to packages/battery/battery/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png diff --git a/packages/battery/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/battery/battery/example/ios/Runner/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from packages/battery/example/ios/Runner/Base.lproj/LaunchScreen.storyboard rename to packages/battery/battery/example/ios/Runner/Base.lproj/LaunchScreen.storyboard diff --git a/packages/battery/example/ios/Runner/Base.lproj/Main.storyboard b/packages/battery/battery/example/ios/Runner/Base.lproj/Main.storyboard similarity index 100% rename from packages/battery/example/ios/Runner/Base.lproj/Main.storyboard rename to packages/battery/battery/example/ios/Runner/Base.lproj/Main.storyboard diff --git a/packages/battery/example/ios/Runner/Info.plist b/packages/battery/battery/example/ios/Runner/Info.plist similarity index 100% rename from packages/battery/example/ios/Runner/Info.plist rename to packages/battery/battery/example/ios/Runner/Info.plist diff --git a/packages/battery/example/ios/Runner/main.m b/packages/battery/battery/example/ios/Runner/main.m similarity index 100% rename from packages/battery/example/ios/Runner/main.m rename to packages/battery/battery/example/ios/Runner/main.m diff --git a/packages/battery/example/lib/main.dart b/packages/battery/battery/example/lib/main.dart similarity index 100% rename from packages/battery/example/lib/main.dart rename to packages/battery/battery/example/lib/main.dart diff --git a/packages/battery/example/pubspec.yaml b/packages/battery/battery/example/pubspec.yaml similarity index 88% rename from packages/battery/example/pubspec.yaml rename to packages/battery/battery/example/pubspec.yaml index 5ec38f6ce5c2..e7a9b1c8b74d 100644 --- a/packages/battery/example/pubspec.yaml +++ b/packages/battery/battery/example/pubspec.yaml @@ -11,7 +11,7 @@ dev_dependencies: flutter_driver: sdk: flutter integration_test: - path: ../../integration_test + path: ../../../integration_test pedantic: ^1.8.0 flutter: diff --git a/packages/battery/ios/Assets/.gitkeep b/packages/battery/battery/ios/Assets/.gitkeep similarity index 100% rename from packages/battery/ios/Assets/.gitkeep rename to packages/battery/battery/ios/Assets/.gitkeep diff --git a/packages/battery/ios/Classes/FLTBatteryPlugin.h b/packages/battery/battery/ios/Classes/FLTBatteryPlugin.h similarity index 100% rename from packages/battery/ios/Classes/FLTBatteryPlugin.h rename to packages/battery/battery/ios/Classes/FLTBatteryPlugin.h diff --git a/packages/battery/ios/Classes/FLTBatteryPlugin.m b/packages/battery/battery/ios/Classes/FLTBatteryPlugin.m similarity index 100% rename from packages/battery/ios/Classes/FLTBatteryPlugin.m rename to packages/battery/battery/ios/Classes/FLTBatteryPlugin.m diff --git a/packages/battery/ios/battery.podspec b/packages/battery/battery/ios/battery.podspec similarity index 100% rename from packages/battery/ios/battery.podspec rename to packages/battery/battery/ios/battery.podspec diff --git a/packages/battery/lib/battery.dart b/packages/battery/battery/lib/battery.dart similarity index 100% rename from packages/battery/lib/battery.dart rename to packages/battery/battery/lib/battery.dart diff --git a/packages/battery/pubspec.yaml b/packages/battery/battery/pubspec.yaml similarity index 90% rename from packages/battery/pubspec.yaml rename to packages/battery/battery/pubspec.yaml index 8363d7a09ee2..5e0549a07f97 100644 --- a/packages/battery/pubspec.yaml +++ b/packages/battery/battery/pubspec.yaml @@ -1,8 +1,8 @@ name: battery description: Flutter plugin for accessing information about the battery state (full, charging, discharging) on Android and iOS. -homepage: https://github.com/flutter/plugins/tree/master/packages/battery -version: 1.0.4 +homepage: https://github.com/flutter/plugins/tree/master/packages/battery/battery +version: 1.0.4+1 flutter: plugin: @@ -25,7 +25,7 @@ dev_dependencies: flutter_test: sdk: flutter integration_test: - path: ../integration_test + path: ../../integration_test pedantic: ^1.8.0 environment: diff --git a/packages/battery/test/battery_e2e.dart b/packages/battery/battery/test/battery_e2e.dart similarity index 100% rename from packages/battery/test/battery_e2e.dart rename to packages/battery/battery/test/battery_e2e.dart diff --git a/packages/battery/test/battery_test.dart b/packages/battery/battery/test/battery_test.dart similarity index 100% rename from packages/battery/test/battery_test.dart rename to packages/battery/battery/test/battery_test.dart diff --git a/packages/battery/example/android.iml b/packages/battery/example/android.iml deleted file mode 100644 index 462b903e05b6..000000000000 --- a/packages/battery/example/android.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/packages/battery/example/battery_example.iml b/packages/battery/example/battery_example.iml deleted file mode 100644 index 9d5dae19540c..000000000000 --- a/packages/battery/example/battery_example.iml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file From e8306b501a48fa41e3a4bdc4daea187f06a9d40d Mon Sep 17 00:00:00 2001 From: "Ming Lyu (CareF)" Date: Thu, 27 Aug 2020 21:09:03 -0400 Subject: [PATCH 060/233] [integration_test] add support to get timeline (#2947) --- packages/integration_test/CHANGELOG.md | 4 + .../test_driver/example_integration_io.dart | 31 ++++--- .../lib/integration_test.dart | 91 +++++++++++++++++++ packages/integration_test/pubspec.yaml | 4 +- .../integration_test/test/binding_test.dart | 34 +++++++ 5 files changed, 151 insertions(+), 13 deletions(-) diff --git a/packages/integration_test/CHANGELOG.md b/packages/integration_test/CHANGELOG.md index ee72930a75a9..d57819e331ea 100644 --- a/packages/integration_test/CHANGELOG.md +++ b/packages/integration_test/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.8.2 + +* Add support to get timeline. + ## 0.8.1 * Show stack trace of widget test errors on the platform side diff --git a/packages/integration_test/example/test_driver/example_integration_io.dart b/packages/integration_test/example/test_driver/example_integration_io.dart index 35fc7271d841..7ed28963c32b 100644 --- a/packages/integration_test/example/test_driver/example_integration_io.dart +++ b/packages/integration_test/example/test_driver/example_integration_io.dart @@ -13,22 +13,29 @@ import 'package:integration_test/integration_test.dart'; import 'package:integration_test_example/main.dart' as app; void main() { - IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + final IntegrationTestWidgetsFlutterBinding binding = + IntegrationTestWidgetsFlutterBinding.ensureInitialized() + as IntegrationTestWidgetsFlutterBinding; testWidgets('verify text', (WidgetTester tester) async { // Build our app and trigger a frame. app.main(); - // Trigger a frame. - await tester.pumpAndSettle(); + // Trace the timeline of the following operation. The timeline result will + // be written to `build/integration_response_data.json` with the key + // `timeline`. + await binding.traceAction(() async { + // Trigger a frame. + await tester.pumpAndSettle(); - // Verify that platform version is retrieved. - expect( - find.byWidgetPredicate( - (Widget widget) => - widget is Text && - widget.data.startsWith('Platform: ${Platform.operatingSystem}'), - ), - findsOneWidget, - ); + // Verify that platform version is retrieved. + expect( + find.byWidgetPredicate( + (Widget widget) => + widget is Text && + widget.data.startsWith('Platform: ${Platform.operatingSystem}'), + ), + findsOneWidget, + ); + }); }); } diff --git a/packages/integration_test/lib/integration_test.dart b/packages/integration_test/lib/integration_test.dart index 430b7ee38510..f6980bc9d6d1 100644 --- a/packages/integration_test/lib/integration_test.dart +++ b/packages/integration_test/lib/integration_test.dart @@ -3,12 +3,15 @@ // found in the LICENSE file. import 'dart:async'; +import 'dart:developer' as developer; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; +import 'package:vm_service/vm_service.dart' as vm; +import 'package:vm_service/vm_service_io.dart' as vm_io; import 'common.dart'; import '_extension_io.dart' if (dart.library.html) '_extension_web.dart'; @@ -191,4 +194,92 @@ class IntegrationTestWidgetsFlutterBinding ); results[description] ??= _success; } + + vm.VmService _vmService; + + /// Initialize the [vm.VmService] settings for the timeline. + @visibleForTesting + Future enableTimeline({ + List streams = const ['all'], + @visibleForTesting vm.VmService vmService, + }) async { + assert(streams != null); + assert(streams.isNotEmpty); + if (vmService != null) { + _vmService = vmService; + } + if (_vmService == null) { + final developer.ServiceProtocolInfo info = + await developer.Service.getInfo(); + assert(info.serverUri != null); + _vmService = await vm_io.vmServiceConnectUri( + 'ws://localhost:${info.serverUri.port}${info.serverUri.path}ws', + ); + } + await _vmService.setVMTimelineFlags(streams); + } + + /// Runs [action] and returns a [vm.Timeline] trace for it. + /// + /// Waits for the `Future` returned by [action] to complete prior to stopping + /// the trace. + /// + /// The `streams` parameter limits the recorded timeline event streams to only + /// the ones listed. By default, all streams are recorded. + /// See `timeline_streams` in + /// [Dart-SDK/runtime/vm/timeline.cc](https://github.com/dart-lang/sdk/blob/master/runtime/vm/timeline.cc) + /// + /// If [retainPriorEvents] is true, retains events recorded prior to calling + /// [action]. Otherwise, prior events are cleared before calling [action]. By + /// default, prior events are cleared. + Future traceTimeline( + Future action(), { + List streams = const ['all'], + bool retainPriorEvents = false, + }) async { + await enableTimeline(streams: streams); + if (retainPriorEvents) { + await action(); + return await _vmService.getVMTimeline(); + } + + await _vmService.clearVMTimeline(); + final vm.Timestamp startTime = await _vmService.getVMTimelineMicros(); + await action(); + final vm.Timestamp endTime = await _vmService.getVMTimelineMicros(); + return await _vmService.getVMTimeline( + timeOriginMicros: startTime.timestamp, + timeExtentMicros: endTime.timestamp, + ); + } + + /// This is a convenience wrap of [traceTimeline] and send the result back to + /// the host for the [flutter_driver] style tests. + /// + /// This records the timeline during `action` and adds the result to + /// [reportData] with `reportKey`. [reportData] contains the extra information + /// of the test other than test success/fail. It will be passed back to the + /// host and be processed by the [ResponseDataCallback] defined in + /// [integrationDriver]. By default it will be written to + /// `build/integration_response_data.json` with the key `timeline`. + /// + /// For tests with multiple calls of this method, `reportKey` needs to be a + /// unique key, otherwise the later result will override earlier one. + /// + /// The `streams` and `retainPriorEvents` parameters are passed as-is to + /// [traceTimeline]. + Future traceAction( + Future action(), { + List streams = const ['all'], + bool retainPriorEvents = false, + String reportKey = 'timeline', + }) async { + vm.Timeline timeline = await traceTimeline( + action, + streams: streams, + retainPriorEvents: retainPriorEvents, + ); + reportData ??= {}; + reportData[reportKey] = timeline.toJson(); + } } diff --git a/packages/integration_test/pubspec.yaml b/packages/integration_test/pubspec.yaml index c1514146c869..9dd4ade6ce49 100644 --- a/packages/integration_test/pubspec.yaml +++ b/packages/integration_test/pubspec.yaml @@ -1,6 +1,6 @@ name: integration_test description: Runs tests that use the flutter_test API as integration tests. -version: 0.8.1 +version: 0.8.2 homepage: https://github.com/flutter/plugins/tree/master/packages/integration_test environment: @@ -15,9 +15,11 @@ dependencies: flutter_test: sdk: flutter path: ^1.6.4 + vm_service: ^4.2.0 dev_dependencies: pedantic: ^1.8.0 + mockito: ^4.1.1 flutter: plugin: diff --git a/packages/integration_test/test/binding_test.dart b/packages/integration_test/test/binding_test.dart index bad365ac59b6..ef4efc59aac0 100644 --- a/packages/integration_test/test/binding_test.dart +++ b/packages/integration_test/test/binding_test.dart @@ -1,8 +1,18 @@ +import 'dart:convert'; + import 'package:flutter/material.dart'; import 'package:integration_test/integration_test.dart'; import 'package:integration_test/common.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/mockito.dart'; +import 'package:vm_service/vm_service.dart' as vm; + +vm.Timeline _ktimelines = vm.Timeline( + traceEvents: [], + timeOriginMicros: 100, + timeExtentMicros: 200, +); void main() async { Future> request; @@ -14,10 +24,21 @@ void main() async { final IntegrationTestWidgetsFlutterBinding integrationBinding = binding as IntegrationTestWidgetsFlutterBinding; + MockVM mockVM; + List clockTimes = [100, 200]; + setUp(() { request = integrationBinding.callback({ 'command': 'request_data', }); + mockVM = MockVM(); + when(mockVM.getVMTimeline( + timeOriginMicros: anyNamed('timeOriginMicros'), + timeExtentMicros: anyNamed('timeExtentMicros'), + )).thenAnswer((_) => Future.value(_ktimelines)); + when(mockVM.getVMTimelineMicros()).thenAnswer( + (_) => Future.value(vm.Timestamp(timestamp: clockTimes.removeAt(0))), + ); }); testWidgets('Run Integration app', (WidgetTester tester) async { @@ -53,6 +74,17 @@ void main() async { expect(widgetCenter.dx, windowCenterX); expect(widgetCenter.dy, windowCenterY); }); + + testWidgets('Test traceAction', (WidgetTester tester) async { + await integrationBinding.enableTimeline(vmService: mockVM); + await integrationBinding.traceAction(() async {}); + expect(integrationBinding.reportData, isNotNull); + expect(integrationBinding.reportData.containsKey('timeline'), true); + expect( + json.encode(integrationBinding.reportData['timeline']), + json.encode(_ktimelines), + ); + }); }); tearDownAll(() async { @@ -66,3 +98,5 @@ void main() async { assert(result.data['answer'] == 42); }); } + +class MockVM extends Mock implements vm.VmService {} From c62afeecedd5b55074b78bce94eab9c5329aa04b Mon Sep 17 00:00:00 2001 From: Patrick Boos Date: Fri, 28 Aug 2020 19:59:57 +0200 Subject: [PATCH 061/233] [share] Add sharing file support (android & ios) (#970) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Kifah Meeran <23234883+MaskyS@users.noreply.github.com> Co-authored-by: Aloïs Deniel Co-authored-by: Colin Stewart --- packages/share/CHANGELOG.md | 4 + packages/share/README.md | 6 + packages/share/android/build.gradle | 5 + .../android/src/main/AndroidManifest.xml | 11 + .../plugins/share/MethodCallHandler.java | 42 +++- .../java/io/flutter/plugins/share/Share.java | 197 +++++++++++++++++- .../plugins/share/ShareFileProvider.java | 14 ++ .../io/flutter/plugins/share/SharePlugin.java | 9 +- .../main/res/xml/flutter_share_file_paths.xml | 6 + packages/share/example/ios/Runner/Info.plist | 6 + .../share/example/lib/image_previews.dart | 75 +++++++ packages/share/example/lib/main.dart | 135 +++++++----- packages/share/example/pubspec.yaml | 2 +- packages/share/ios/Classes/FLTSharePlugin.m | 145 +++++++++++-- packages/share/lib/share.dart | 47 +++++ packages/share/pubspec.yaml | 3 +- packages/share/test/share_test.dart | 47 +++++ 17 files changed, 665 insertions(+), 89 deletions(-) create mode 100644 packages/share/android/src/main/java/io/flutter/plugins/share/ShareFileProvider.java create mode 100644 packages/share/android/src/main/res/xml/flutter_share_file_paths.xml create mode 100644 packages/share/example/lib/image_previews.dart diff --git a/packages/share/CHANGELOG.md b/packages/share/CHANGELOG.md index 8c3814d2f559..c4ee830ed34f 100644 --- a/packages/share/CHANGELOG.md +++ b/packages/share/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.6.5 + +* Added support for sharing files + ## 0.6.4+5 * Update package:e2e -> package:integration_test diff --git a/packages/share/README.md b/packages/share/README.md index 14be8da7d10e..750fca6a5b18 100644 --- a/packages/share/README.md +++ b/packages/share/README.md @@ -39,3 +39,9 @@ sharing to email. ``` dart Share.share('check out my website https://example.com', subject: 'Look what I made!'); ``` + +To share one or multiple files invoke the static `shareFiles` method anywhere in your Dart code. Optionally you can also pass in `text` and `subject`. +``` dart +Share.shareFiles(['${directory.path}/image.jpg'], text: 'Great picture'); +Share.shareFiles(['${directory.path}/image1.jpg', '${directory.path}/image2.jpg']); +``` \ No newline at end of file diff --git a/packages/share/android/build.gradle b/packages/share/android/build.gradle index e154b068c5dd..7506f4db8261 100644 --- a/packages/share/android/build.gradle +++ b/packages/share/android/build.gradle @@ -31,4 +31,9 @@ android { lintOptions { disable 'InvalidPackage' } + + dependencies { + implementation 'androidx.core:core:1.3.1' + implementation 'androidx.annotation:annotation:1.1.0' + } } diff --git a/packages/share/android/src/main/AndroidManifest.xml b/packages/share/android/src/main/AndroidManifest.xml index 407eae4d8128..c141a5c67928 100644 --- a/packages/share/android/src/main/AndroidManifest.xml +++ b/packages/share/android/src/main/AndroidManifest.xml @@ -1,3 +1,14 @@ + + + + + diff --git a/packages/share/android/src/main/java/io/flutter/plugins/share/MethodCallHandler.java b/packages/share/android/src/main/java/io/flutter/plugins/share/MethodCallHandler.java index f7e4d579e7a2..02841d3a4ae2 100644 --- a/packages/share/android/src/main/java/io/flutter/plugins/share/MethodCallHandler.java +++ b/packages/share/android/src/main/java/io/flutter/plugins/share/MethodCallHandler.java @@ -6,6 +6,8 @@ import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodChannel; +import java.io.*; +import java.util.List; import java.util.Map; /** Handles the method calls for the plugin. */ @@ -19,15 +21,37 @@ class MethodCallHandler implements MethodChannel.MethodCallHandler { @Override public void onMethodCall(MethodCall call, MethodChannel.Result result) { - if (call.method.equals("share")) { - if (!(call.arguments instanceof Map)) { - throw new IllegalArgumentException("Map argument expected"); - } - // Android does not support showing the share sheet at a particular point on screen. - share.share((String) call.argument("text"), (String) call.argument("subject")); - result.success(null); - } else { - result.notImplemented(); + switch (call.method) { + case "share": + expectMapArguments(call); + // Android does not support showing the share sheet at a particular point on screen. + share.share((String) call.argument("text"), (String) call.argument("subject")); + result.success(null); + break; + case "shareFiles": + expectMapArguments(call); + + // Android does not support showing the share sheet at a particular point on screen. + try { + share.shareFiles( + (List) call.argument("paths"), + (List) call.argument("mimeTypes"), + (String) call.argument("text"), + (String) call.argument("subject")); + result.success(null); + } catch (IOException e) { + result.error(e.getMessage(), null, null); + } + break; + default: + result.notImplemented(); + break; + } + } + + private void expectMapArguments(MethodCall call) throws IllegalArgumentException { + if (!(call.arguments instanceof Map)) { + throw new IllegalArgumentException("Map argument expected"); } } } diff --git a/packages/share/android/src/main/java/io/flutter/plugins/share/Share.java b/packages/share/android/src/main/java/io/flutter/plugins/share/Share.java index 8c9e833ee9d3..eb856bf572ee 100644 --- a/packages/share/android/src/main/java/io/flutter/plugins/share/Share.java +++ b/packages/share/android/src/main/java/io/flutter/plugins/share/Share.java @@ -5,19 +5,36 @@ package io.flutter.plugins.share; import android.app.Activity; +import android.content.Context; import android.content.Intent; +import android.content.pm.PackageManager; +import android.content.pm.ResolveInfo; +import android.net.Uri; +import android.os.Environment; +import androidx.annotation.NonNull; +import androidx.core.content.FileProvider; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.List; /** Handles share intent. */ class Share { + private Context context; private Activity activity; /** - * Constructs a Share object. The {@code activity} is used to start the share intent. It might be - * null when constructing the {@link Share} object and set to non-null when an activity is - * available using {@link #setActivity(Activity)}. + * Constructs a Share object. The {@code context} and {@code activity} are used to start the share + * intent. The {@code activity} might be null when constructing the {@link Share} object and set + * to non-null when an activity is available using {@link #setActivity(Activity)}. */ - Share(Activity activity) { + Share(Context context, Activity activity) { + this.context = context; this.activity = activity; } @@ -40,11 +57,177 @@ void share(String text, String subject) { shareIntent.putExtra(Intent.EXTRA_SUBJECT, subject); shareIntent.setType("text/plain"); Intent chooserIntent = Intent.createChooser(shareIntent, null /* dialog title optional */); + startActivity(chooserIntent); + } + + void shareFiles(List paths, List mimeTypes, String text, String subject) + throws IOException { + if (paths == null || paths.isEmpty()) { + throw new IllegalArgumentException("Non-empty path expected"); + } + + clearExternalShareFolder(); + ArrayList fileUris = getUrisForPaths(paths); + + Intent shareIntent = new Intent(); + if (fileUris.isEmpty()) { + share(text, subject); + return; + } else if (fileUris.size() == 1) { + shareIntent.setAction(Intent.ACTION_SEND); + shareIntent.putExtra(Intent.EXTRA_STREAM, fileUris.get(0)); + shareIntent.setType( + !mimeTypes.isEmpty() && mimeTypes.get(0) != null ? mimeTypes.get(0) : "*/*"); + } else { + shareIntent.setAction(Intent.ACTION_SEND_MULTIPLE); + shareIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, fileUris); + shareIntent.setType(reduceMimeTypes(mimeTypes)); + } + if (text != null) shareIntent.putExtra(Intent.EXTRA_TEXT, text); + if (subject != null) shareIntent.putExtra(Intent.EXTRA_SUBJECT, subject); + shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); + Intent chooserIntent = Intent.createChooser(shareIntent, null /* dialog title optional */); + + List resInfoList = + getContext() + .getPackageManager() + .queryIntentActivities(chooserIntent, PackageManager.MATCH_DEFAULT_ONLY); + for (ResolveInfo resolveInfo : resInfoList) { + String packageName = resolveInfo.activityInfo.packageName; + for (Uri fileUri : fileUris) { + getContext() + .grantUriPermission( + packageName, + fileUri, + Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION); + } + } + + startActivity(chooserIntent); + } + + private void startActivity(Intent intent) { if (activity != null) { - activity.startActivity(chooserIntent); + activity.startActivity(intent); + } else if (context != null) { + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + context.startActivity(intent); + } else { + throw new IllegalStateException("Both context and activity are null"); + } + } + + private ArrayList getUrisForPaths(List paths) throws IOException { + ArrayList uris = new ArrayList<>(paths.size()); + for (String path : paths) { + File file = new File(path); + if (!fileIsOnExternal(file)) { + file = copyToExternalShareFolder(file); + } + + uris.add( + FileProvider.getUriForFile( + getContext(), getContext().getPackageName() + ".flutter.share_provider", file)); + } + return uris; + } + + private String reduceMimeTypes(List mimeTypes) { + if (mimeTypes.size() > 1) { + String reducedMimeType = mimeTypes.get(0); + for (int i = 1; i < mimeTypes.size(); i++) { + String mimeType = mimeTypes.get(i); + if (!reducedMimeType.equals(mimeType)) { + if (getMimeTypeBase(mimeType).equals(getMimeTypeBase(reducedMimeType))) { + reducedMimeType = getMimeTypeBase(mimeType) + "/*"; + } else { + reducedMimeType = "*/*"; + break; + } + } + } + return reducedMimeType; + } else if (mimeTypes.size() == 1) { + return mimeTypes.get(0); } else { - chooserIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - activity.startActivity(chooserIntent); + return "*/*"; + } + } + + @NonNull + private String getMimeTypeBase(String mimeType) { + if (mimeType == null || !mimeType.contains("/")) { + return "*"; + } + + return mimeType.substring(0, mimeType.indexOf("/")); + } + + private boolean fileIsOnExternal(File file) { + try { + String filePath = file.getCanonicalPath(); + File externalDir = Environment.getExternalStorageDirectory(); + return externalDir != null && filePath.startsWith(externalDir.getCanonicalPath()); + } catch (IOException e) { + return false; + } + } + + @SuppressWarnings("ResultOfMethodCallIgnored") + private void clearExternalShareFolder() { + File folder = getExternalShareFolder(); + if (folder.exists()) { + for (File file : folder.listFiles()) { + file.delete(); + } + folder.delete(); + } + } + + @SuppressWarnings("ResultOfMethodCallIgnored") + private File copyToExternalShareFolder(File file) throws IOException { + File folder = getExternalShareFolder(); + if (!folder.exists()) { + folder.mkdirs(); + } + + File newFile = new File(folder, file.getName()); + copy(file, newFile); + return newFile; + } + + @NonNull + private File getExternalShareFolder() { + return new File(getContext().getExternalCacheDir(), "share"); + } + + private Context getContext() { + if (activity != null) { + return activity; + } + if (context != null) { + return context; + } + + throw new IllegalStateException("Both context and activity are null"); + } + + private static void copy(File src, File dst) throws IOException { + InputStream in = new FileInputStream(src); + try { + OutputStream out = new FileOutputStream(dst); + try { + // Transfer bytes from in to out + byte[] buf = new byte[1024]; + int len; + while ((len = in.read(buf)) > 0) { + out.write(buf, 0, len); + } + } finally { + out.close(); + } + } finally { + in.close(); } } } diff --git a/packages/share/android/src/main/java/io/flutter/plugins/share/ShareFileProvider.java b/packages/share/android/src/main/java/io/flutter/plugins/share/ShareFileProvider.java new file mode 100644 index 000000000000..87e4e42a03d4 --- /dev/null +++ b/packages/share/android/src/main/java/io/flutter/plugins/share/ShareFileProvider.java @@ -0,0 +1,14 @@ +// Copyright 2019 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package io.flutter.plugins.share; + +import androidx.core.content.FileProvider; + +/** + * Providing a custom {@code FileProvider} prevents manifest {@code } name collisions. + * + *

See https://developer.android.com/guide/topics/manifest/provider-element.html for details. + */ +public class ShareFileProvider extends FileProvider {} diff --git a/packages/share/android/src/main/java/io/flutter/plugins/share/SharePlugin.java b/packages/share/android/src/main/java/io/flutter/plugins/share/SharePlugin.java index fdb9dc4fe644..bd7dfc22a3cd 100644 --- a/packages/share/android/src/main/java/io/flutter/plugins/share/SharePlugin.java +++ b/packages/share/android/src/main/java/io/flutter/plugins/share/SharePlugin.java @@ -5,6 +5,7 @@ package io.flutter.plugins.share; import android.app.Activity; +import android.content.Context; import io.flutter.embedding.engine.plugins.FlutterPlugin; import io.flutter.embedding.engine.plugins.activity.ActivityAware; import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding; @@ -22,12 +23,12 @@ public class SharePlugin implements FlutterPlugin, ActivityAware { public static void registerWith(Registrar registrar) { SharePlugin plugin = new SharePlugin(); - plugin.setUpChannel(registrar.activity(), registrar.messenger()); + plugin.setUpChannel(registrar.context(), registrar.activity(), registrar.messenger()); } @Override public void onAttachedToEngine(FlutterPluginBinding binding) { - setUpChannel(null, binding.getBinaryMessenger()); + setUpChannel(binding.getApplicationContext(), null, binding.getBinaryMessenger()); } @Override @@ -57,9 +58,9 @@ public void onDetachedFromActivityForConfigChanges() { onDetachedFromActivity(); } - private void setUpChannel(Activity activity, BinaryMessenger messenger) { + private void setUpChannel(Context context, Activity activity, BinaryMessenger messenger) { methodChannel = new MethodChannel(messenger, CHANNEL); - share = new Share(activity); + share = new Share(context, activity); handler = new MethodCallHandler(share); methodChannel.setMethodCallHandler(handler); } diff --git a/packages/share/android/src/main/res/xml/flutter_share_file_paths.xml b/packages/share/android/src/main/res/xml/flutter_share_file_paths.xml new file mode 100644 index 000000000000..e68bf916a30b --- /dev/null +++ b/packages/share/android/src/main/res/xml/flutter_share_file_paths.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/share/example/ios/Runner/Info.plist b/packages/share/example/ios/Runner/Info.plist index ac44e05ef845..71656105a1fa 100644 --- a/packages/share/example/ios/Runner/Info.plist +++ b/packages/share/example/ios/Runner/Info.plist @@ -45,5 +45,11 @@ UIViewControllerBasedStatusBarAppearance + NSPhotoLibraryUsageDescription + This app requires access to the photo library for sharing images. + NSMicrophoneUsageDescription + This app does not require access to the microphone for sharing images. + NSCameraUsageDescription + This app requires access to the camera for sharing images. diff --git a/packages/share/example/lib/image_previews.dart b/packages/share/example/lib/image_previews.dart new file mode 100644 index 000000000000..61ecec43bdc7 --- /dev/null +++ b/packages/share/example/lib/image_previews.dart @@ -0,0 +1,75 @@ +import 'dart:io'; + +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; + +/// Widget for displaying a preview of images +class ImagePreviews extends StatelessWidget { + /// The image paths of the displayed images + final List imagePaths; + + /// Callback when an image should be removed + final Function(int) onDelete; + + /// Creates a widget for preview of images. [imagePaths] can not be empty + /// and all contained paths need to be non empty. + const ImagePreviews(this.imagePaths, {Key key, this.onDelete}) + : super(key: key); + + @override + Widget build(BuildContext context) { + if (imagePaths.isEmpty) { + return Container(); + } + + List imageWidgets = []; + for (int i = 0; i < imagePaths.length; i++) { + imageWidgets.add(_ImagePreview( + imagePaths[i], + onDelete: onDelete != null ? () => onDelete(i) : null, + )); + } + + return SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row(children: imageWidgets), + ); + } +} + +class _ImagePreview extends StatelessWidget { + final String imagePath; + final VoidCallback onDelete; + + const _ImagePreview(this.imagePath, {Key key, this.onDelete}) + : super(key: key); + + @override + Widget build(BuildContext context) { + File imageFile = File(imagePath); + return Padding( + padding: const EdgeInsets.all(8.0), + child: Stack( + children: [ + ConstrainedBox( + constraints: BoxConstraints( + maxWidth: 200, + maxHeight: 200, + ), + child: Image.file(imageFile), + ), + Positioned( + right: 0, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: FloatingActionButton( + backgroundColor: Colors.red, + child: Icon(Icons.delete), + onPressed: onDelete), + ), + ), + ], + ), + ); + } +} diff --git a/packages/share/example/lib/main.dart b/packages/share/example/lib/main.dart index b68195cd3507..d6f1a1622b3c 100644 --- a/packages/share/example/lib/main.dart +++ b/packages/share/example/lib/main.dart @@ -5,8 +5,11 @@ // ignore_for_file: public_member_api_docs import 'package:flutter/material.dart'; +import 'package:image_picker/image_picker.dart'; import 'package:share/share.dart'; +import 'image_previews.dart'; + void main() { runApp(DemoApp()); } @@ -19,6 +22,7 @@ class DemoApp extends StatefulWidget { class DemoAppState extends State { String text = ''; String subject = ''; + List imagePaths = []; @override Widget build(BuildContext context) { @@ -28,59 +32,92 @@ class DemoAppState extends State { appBar: AppBar( title: const Text('Share Plugin Demo'), ), - body: Padding( - padding: const EdgeInsets.all(24.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - TextField( - decoration: const InputDecoration( - labelText: 'Share text:', - hintText: 'Enter some text and/or link to share', + body: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.all(24.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + TextField( + decoration: const InputDecoration( + labelText: 'Share text:', + hintText: 'Enter some text and/or link to share', + ), + maxLines: 2, + onChanged: (String value) => setState(() { + text = value; + }), + ), + TextField( + decoration: const InputDecoration( + labelText: 'Share subject:', + hintText: 'Enter subject to share (optional)', + ), + maxLines: 2, + onChanged: (String value) => setState(() { + subject = value; + }), ), - maxLines: 2, - onChanged: (String value) => setState(() { - text = value; - }), - ), - TextField( - decoration: const InputDecoration( - labelText: 'Share subject:', - hintText: 'Enter subject to share (optional)', + const Padding(padding: EdgeInsets.only(top: 12.0)), + ImagePreviews(imagePaths, onDelete: _onDeleteImage), + ListTile( + leading: Icon(Icons.add), + title: Text("Add image"), + onTap: () async { + final imagePicker = ImagePicker(); + final pickedFile = await imagePicker.getImage( + source: ImageSource.gallery, + ); + if (pickedFile != null) { + setState(() { + imagePaths.add(pickedFile.path); + }); + } + }, ), - maxLines: 2, - onChanged: (String value) => setState(() { - subject = value; - }), - ), - const Padding(padding: EdgeInsets.only(top: 24.0)), - Builder( - builder: (BuildContext context) { - return RaisedButton( - child: const Text('Share'), - onPressed: text.isEmpty - ? null - : () { - // A builder is used to retrieve the context immediately - // surrounding the RaisedButton. - // - // The context's `findRenderObject` returns the first - // RenderObject in its descendent tree when it's not - // a RenderObjectWidget. The RaisedButton's RenderObject - // has its position and size after it's built. - final RenderBox box = context.findRenderObject(); - Share.share(text, - subject: subject, - sharePositionOrigin: - box.localToGlobal(Offset.zero) & - box.size); - }, - ); - }, - ), - ], + const Padding(padding: EdgeInsets.only(top: 12.0)), + Builder( + builder: (BuildContext context) { + return RaisedButton( + child: const Text('Share'), + onPressed: text.isEmpty && imagePaths.isEmpty + ? null + : () => _onShare(context), + ); + }, + ), + ], + ), ), )), ); } + + _onDeleteImage(int position) { + setState(() { + imagePaths.removeAt(position); + }); + } + + _onShare(BuildContext context) async { + // A builder is used to retrieve the context immediately + // surrounding the RaisedButton. + // + // The context's `findRenderObject` returns the first + // RenderObject in its descendent tree when it's not + // a RenderObjectWidget. The RaisedButton's RenderObject + // has its position and size after it's built. + final RenderBox box = context.findRenderObject(); + + if (imagePaths.isNotEmpty) { + await Share.shareFiles(imagePaths, + text: text, + subject: subject, + sharePositionOrigin: box.localToGlobal(Offset.zero) & box.size); + } else { + await Share.share(text, + subject: subject, + sharePositionOrigin: box.localToGlobal(Offset.zero) & box.size); + } + } } diff --git a/packages/share/example/pubspec.yaml b/packages/share/example/pubspec.yaml index 4830b7186019..8b8623910b7a 100644 --- a/packages/share/example/pubspec.yaml +++ b/packages/share/example/pubspec.yaml @@ -6,6 +6,7 @@ dependencies: sdk: flutter share: path: ../ + image_picker: ^0.6.7+4 dev_dependencies: flutter_driver: @@ -20,4 +21,3 @@ flutter: environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" flutter: ">=1.9.1+hotfix.2 <2.0.0" - diff --git a/packages/share/ios/Classes/FLTSharePlugin.m b/packages/share/ios/Classes/FLTSharePlugin.m index 335ba5b819e5..837623a0119a 100644 --- a/packages/share/ios/Classes/FLTSharePlugin.m +++ b/packages/share/ios/Classes/FLTSharePlugin.m @@ -10,8 +10,12 @@ @interface ShareData : NSObject @property(readonly, nonatomic, copy) NSString *subject; @property(readonly, nonatomic, copy) NSString *text; +@property(readonly, nonatomic, copy) NSString *path; +@property(readonly, nonatomic, copy) NSString *mimeType; - (instancetype)initWithSubject:(NSString *)subject text:(NSString *)text NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithFile:(NSString *)path + mimeType:(NSString *)mimeType NS_DESIGNATED_INITIALIZER; - (instancetype)init __attribute__((unavailable("Use initWithSubject:text: instead"))); @@ -27,24 +31,62 @@ - (instancetype)init { - (instancetype)initWithSubject:(NSString *)subject text:(NSString *)text { self = [super init]; if (self) { - _subject = subject; + _subject = [subject isKindOfClass:NSNull.class] ? @"" : subject; _text = text; } return self; } +- (instancetype)initWithFile:(NSString *)path mimeType:(NSString *)mimeType { + self = [super init]; + if (self) { + _path = path; + _mimeType = mimeType; + } + return self; +} + - (id)activityViewControllerPlaceholderItem:(UIActivityViewController *)activityViewController { return @""; } - (id)activityViewController:(UIActivityViewController *)activityViewController itemForActivityType:(UIActivityType)activityType { - return _text; + if (!_path || !_mimeType) { + return _text; + } + + if ([_mimeType hasPrefix:@"image/"]) { + UIImage *image = [UIImage imageWithContentsOfFile:_path]; + return image; + } else { + NSURL *url = [NSURL fileURLWithPath:_path]; + return url; + } } - (NSString *)activityViewController:(UIActivityViewController *)activityViewController subjectForActivityType:(UIActivityType)activityType { - return [_subject isKindOfClass:NSNull.class] ? @"" : _subject; + return _subject; +} + +- (UIImage *)activityViewController:(UIActivityViewController *)activityViewController + thumbnailImageForActivityType:(UIActivityType)activityType + suggestedSize:(CGSize)suggestedSize { + if (!_path || !_mimeType || ![_mimeType hasPrefix:@"image/"]) { + return nil; + } + + UIImage *image = [UIImage imageWithContentsOfFile:_path]; + return [self imageWithImage:image scaledToSize:suggestedSize]; +} + +- (UIImage *)imageWithImage:(UIImage *)image scaledToSize:(CGSize)newSize { + UIGraphicsBeginImageContext(newSize); + [image drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)]; + UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + return newImage; } @end @@ -57,8 +99,19 @@ + (void)registerWithRegistrar:(NSObject *)registrar { binaryMessenger:registrar.messenger]; [shareChannel setMethodCallHandler:^(FlutterMethodCall *call, FlutterResult result) { + NSDictionary *arguments = [call arguments]; + NSNumber *originX = arguments[@"originX"]; + NSNumber *originY = arguments[@"originY"]; + NSNumber *originWidth = arguments[@"originWidth"]; + NSNumber *originHeight = arguments[@"originHeight"]; + + CGRect originRect = CGRectZero; + if (originX && originY && originWidth && originHeight) { + originRect = CGRectMake([originX doubleValue], [originY doubleValue], + [originWidth doubleValue], [originHeight doubleValue]); + } + if ([@"share" isEqualToString:call.method]) { - NSDictionary *arguments = [call arguments]; NSString *shareText = arguments[@"text"]; NSString *shareSubject = arguments[@"subject"]; @@ -69,19 +122,37 @@ + (void)registerWithRegistrar:(NSObject *)registrar { return; } - NSNumber *originX = arguments[@"originX"]; - NSNumber *originY = arguments[@"originY"]; - NSNumber *originWidth = arguments[@"originWidth"]; - NSNumber *originHeight = arguments[@"originHeight"]; + [self shareText:shareText + subject:shareSubject + withController:[UIApplication sharedApplication].keyWindow.rootViewController + atSource:originRect]; + result(nil); + } else if ([@"shareFiles" isEqualToString:call.method]) { + NSArray *paths = arguments[@"paths"]; + NSArray *mimeTypes = arguments[@"mimeTypes"]; + NSString *subject = arguments[@"subject"]; + NSString *text = arguments[@"text"]; + + if (paths.count == 0) { + result([FlutterError errorWithCode:@"error" + message:@"Non-empty paths expected" + details:nil]); + return; + } - CGRect originRect = CGRectZero; - if (originX != nil && originY != nil && originWidth != nil && originHeight != nil) { - originRect = CGRectMake([originX doubleValue], [originY doubleValue], - [originWidth doubleValue], [originHeight doubleValue]); + for (NSString *path in paths) { + if (path.length == 0) { + result([FlutterError errorWithCode:@"error" + message:@"Each path must not be empty" + details:nil]); + return; + } } - [self share:shareText - subject:shareSubject + [self shareFiles:paths + withMimeType:mimeTypes + withSubject:subject + withText:text withController:[UIApplication sharedApplication].keyWindow.rootViewController atSource:originRect]; result(nil); @@ -91,13 +162,11 @@ + (void)registerWithRegistrar:(NSObject *)registrar { }]; } -+ (void)share:(NSString *)shareText - subject:(NSString *)subject ++ (void)share:(NSArray *)shareItems withController:(UIViewController *)controller atSource:(CGRect)origin { - ShareData *data = [[ShareData alloc] initWithSubject:subject text:shareText]; UIActivityViewController *activityViewController = - [[UIActivityViewController alloc] initWithActivityItems:@[ data ] applicationActivities:nil]; + [[UIActivityViewController alloc] initWithActivityItems:shareItems applicationActivities:nil]; activityViewController.popoverPresentationController.sourceView = controller.view; if (!CGRectIsEmpty(origin)) { activityViewController.popoverPresentationController.sourceRect = origin; @@ -105,4 +174,44 @@ + (void)share:(NSString *)shareText [controller presentViewController:activityViewController animated:YES completion:nil]; } ++ (void)shareText:(NSString *)shareText + subject:(NSString *)subject + withController:(UIViewController *)controller + atSource:(CGRect)origin { + ShareData *data = [[ShareData alloc] initWithSubject:subject text:shareText]; + [self share:@[ data ] withController:controller atSource:origin]; +} + ++ (void)shareFiles:(NSArray *)paths + withMimeType:(NSArray *)mimeTypes + withSubject:(NSString *)subject + withText:(NSString *)text + withController:(UIViewController *)controller + atSource:(CGRect)origin { + NSMutableArray *items = [[NSMutableArray alloc] init]; + + if (text || subject) { + [items addObject:[[ShareData alloc] initWithSubject:subject text:text]]; + } + + for (int i = 0; i < [paths count]; i++) { + NSString *path = paths[i]; + NSString *pathExtension = [path pathExtension]; + NSString *mimeType = mimeTypes[i]; + if ([pathExtension.lowercaseString isEqualToString:@"jpg"] || + [pathExtension.lowercaseString isEqualToString:@"jpeg"] || + [pathExtension.lowercaseString isEqualToString:@"png"] || + [mimeType.lowercaseString isEqualToString:@"image/jpg"] || + [mimeType.lowercaseString isEqualToString:@"image/jpeg"] || + [mimeType.lowercaseString isEqualToString:@"image/png"]) { + UIImage *image = [UIImage imageWithContentsOfFile:path]; + [items addObject:image]; + } else { + [items addObject:[[ShareData alloc] initWithFile:path mimeType:mimeType]]; + } + } + + [self share:items withController:controller atSource:origin]; +} + @end diff --git a/packages/share/lib/share.dart b/packages/share/lib/share.dart index ff20d194f9e5..4a3ff6f1de09 100644 --- a/packages/share/lib/share.dart +++ b/packages/share/lib/share.dart @@ -7,6 +7,7 @@ import 'dart:ui'; import 'package:flutter/services.dart'; import 'package:meta/meta.dart' show visibleForTesting; +import 'package:mime/mime.dart' show lookupMimeType; /// Plugin for summoning a platform share sheet. class Share { @@ -51,4 +52,50 @@ class Share { return channel.invokeMethod('share', params); } + + /// Summons the platform's share sheet to share multiple files. + /// + /// Wraps the platform's native share dialog. Can share a file. + /// It uses the `ACTION_SEND` Intent on Android and `UIActivityViewController` + /// on iOS. + /// + /// The optional `sharePositionOrigin` parameter can be used to specify a global + /// origin rect for the share sheet to popover from on iPads. It has no effect + /// on non-iPads. + /// + /// May throw [PlatformException] or [FormatException] + /// from [MethodChannel]. + static Future shareFiles( + List paths, { + List mimeTypes, + String subject, + String text, + Rect sharePositionOrigin, + }) { + assert(paths != null); + assert(paths.isNotEmpty); + assert(paths.every((element) => element != null && element.isNotEmpty)); + final Map params = { + 'paths': paths, + 'mimeTypes': mimeTypes ?? + paths.map((String path) => _mimeTypeForPath(path)).toList(), + }; + + if (subject != null) params['subject'] = subject; + if (text != null) params['text'] = text; + + if (sharePositionOrigin != null) { + params['originX'] = sharePositionOrigin.left; + params['originY'] = sharePositionOrigin.top; + params['originWidth'] = sharePositionOrigin.width; + params['originHeight'] = sharePositionOrigin.height; + } + + return channel.invokeMethod('shareFiles', params); + } + + static String _mimeTypeForPath(String path) { + assert(path != null); + return lookupMimeType(path) ?? 'application/octet-stream'; + } } diff --git a/packages/share/pubspec.yaml b/packages/share/pubspec.yaml index f5e545ca112e..918087b139ec 100644 --- a/packages/share/pubspec.yaml +++ b/packages/share/pubspec.yaml @@ -5,7 +5,7 @@ homepage: https://github.com/flutter/plugins/tree/master/packages/share # 0.6.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.6.4+5 +version: 0.6.5 flutter: plugin: @@ -18,6 +18,7 @@ flutter: dependencies: meta: ^1.0.5 + mime: ^0.9.7 flutter: sdk: flutter diff --git a/packages/share/test/share_test.dart b/packages/share/test/share_test.dart index c03f8fb439df..e862d1baf579 100644 --- a/packages/share/test/share_test.dart +++ b/packages/share/test/share_test.dart @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'dart:io'; import 'dart:ui'; import 'package:flutter_test/flutter_test.dart' show TestWidgetsFlutterBinding; @@ -56,6 +57,52 @@ void main() { 'originHeight': 4.0, })); }); + + test('sharing null file fails', () { + expect( + () => Share.shareFiles([null]), + throwsA(const TypeMatcher()), + ); + verifyZeroInteractions(mockChannel); + }); + + test('sharing empty file fails', () { + expect( + () => Share.shareFiles(['']), + throwsA(const TypeMatcher()), + ); + verifyZeroInteractions(mockChannel); + }); + + test('sharing file sets correct mimeType', () async { + final String path = 'tempfile-83649a.png'; + final File file = File(path); + try { + file.createSync(); + await Share.shareFiles([path]); + verify(mockChannel.invokeMethod('shareFiles', { + 'paths': [path], + 'mimeTypes': ['image/png'], + })); + } finally { + file.deleteSync(); + } + }); + + test('sharing file sets passed mimeType', () async { + final String path = 'tempfile-83649a.png'; + final File file = File(path); + try { + file.createSync(); + await Share.shareFiles([path], mimeTypes: ['*/*']); + verify(mockChannel.invokeMethod('shareFiles', { + 'paths': [file.path], + 'mimeTypes': ['*/*'], + })); + } finally { + file.deleteSync(); + } + }); } class MockMethodChannel extends Mock implements MethodChannel {} From 2f33166863a61d8ecb92748c6c01110f99f8264e Mon Sep 17 00:00:00 2001 From: Balvinder Singh Gambhir Date: Sat, 29 Aug 2020 00:57:24 +0530 Subject: [PATCH 062/233] [url_launcher_platform_interface] Add webOnlyWindowName parameter to launch() (#2974) --- .../url_launcher/url_launcher_platform_interface/CHANGELOG.md | 4 ++++ .../lib/method_channel_url_launcher.dart | 1 + .../lib/url_launcher_platform_interface.dart | 1 + .../url_launcher/url_launcher_platform_interface/pubspec.yaml | 2 +- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/url_launcher/url_launcher_platform_interface/CHANGELOG.md b/packages/url_launcher/url_launcher_platform_interface/CHANGELOG.md index 8766d7a3f239..768042be4cef 100644 --- a/packages/url_launcher/url_launcher_platform_interface/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.8 + +* Added webOnlyWindowName parameter + ## 1.0.7 * Update lower bound of dart dependency to 2.1.0. diff --git a/packages/url_launcher/url_launcher_platform_interface/lib/method_channel_url_launcher.dart b/packages/url_launcher/url_launcher_platform_interface/lib/method_channel_url_launcher.dart index 3fbd2ee01843..f87630ee3045 100644 --- a/packages/url_launcher/url_launcher_platform_interface/lib/method_channel_url_launcher.dart +++ b/packages/url_launcher/url_launcher_platform_interface/lib/method_channel_url_launcher.dart @@ -35,6 +35,7 @@ class MethodChannelUrlLauncher extends UrlLauncherPlatform { @required bool enableDomStorage, @required bool universalLinksOnly, @required Map headers, + String webOnlyWindowName, }) { return _channel.invokeMethod( 'launch', diff --git a/packages/url_launcher/url_launcher_platform_interface/lib/url_launcher_platform_interface.dart b/packages/url_launcher/url_launcher_platform_interface/lib/url_launcher_platform_interface.dart index 164555d63e0c..1de5742c1f6f 100644 --- a/packages/url_launcher/url_launcher_platform_interface/lib/url_launcher_platform_interface.dart +++ b/packages/url_launcher/url_launcher_platform_interface/lib/url_launcher_platform_interface.dart @@ -55,6 +55,7 @@ abstract class UrlLauncherPlatform extends PlatformInterface { @required bool enableDomStorage, @required bool universalLinksOnly, @required Map headers, + String webOnlyWindowName, }) { throw UnimplementedError('launch() has not been implemented.'); } diff --git a/packages/url_launcher/url_launcher_platform_interface/pubspec.yaml b/packages/url_launcher/url_launcher_platform_interface/pubspec.yaml index 4486134310c2..0c4096278bcb 100644 --- a/packages/url_launcher/url_launcher_platform_interface/pubspec.yaml +++ b/packages/url_launcher/url_launcher_platform_interface/pubspec.yaml @@ -3,7 +3,7 @@ description: A common platform interface for the url_launcher plugin. homepage: https://github.com/flutter/plugins/tree/master/packages/url_launcher/url_launcher_platform_interface # NOTE: We strongly prefer non-breaking changes, even at the expense of a # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes -version: 1.0.7 +version: 1.0.8 dependencies: flutter: From 161aed20fcd5a502b03208ec459782a5d8d76cfc Mon Sep 17 00:00:00 2001 From: Yash Johri Date: Sat, 29 Aug 2020 01:57:40 +0530 Subject: [PATCH 063/233] [battery_platform_interface] Introduce package. (#2975) --- .../battery_platform_interface/CHANGELOG.md | 3 + .../battery_platform_interface/LICENSE | 27 ++++++++ .../battery_platform_interface/README.md | 26 ++++++++ .../lib/battery_platform_interface.dart | 51 +++++++++++++++ .../lib/enums/battery_state.dart | 11 ++++ .../method_channel_battery.dart | 51 +++++++++++++++ .../battery_platform_interface/pubspec.yaml | 22 +++++++ .../test/method_channel_battery_test.dart | 63 +++++++++++++++++++ 8 files changed, 254 insertions(+) create mode 100644 packages/battery/battery_platform_interface/CHANGELOG.md create mode 100644 packages/battery/battery_platform_interface/LICENSE create mode 100644 packages/battery/battery_platform_interface/README.md create mode 100644 packages/battery/battery_platform_interface/lib/battery_platform_interface.dart create mode 100644 packages/battery/battery_platform_interface/lib/enums/battery_state.dart create mode 100644 packages/battery/battery_platform_interface/lib/method_channel/method_channel_battery.dart create mode 100644 packages/battery/battery_platform_interface/pubspec.yaml create mode 100644 packages/battery/battery_platform_interface/test/method_channel_battery_test.dart diff --git a/packages/battery/battery_platform_interface/CHANGELOG.md b/packages/battery/battery_platform_interface/CHANGELOG.md new file mode 100644 index 000000000000..6fadda91b380 --- /dev/null +++ b/packages/battery/battery_platform_interface/CHANGELOG.md @@ -0,0 +1,3 @@ +## 1.0.0 + +- Initial open-source release. diff --git a/packages/battery/battery_platform_interface/LICENSE b/packages/battery/battery_platform_interface/LICENSE new file mode 100644 index 000000000000..c89293372cf3 --- /dev/null +++ b/packages/battery/battery_platform_interface/LICENSE @@ -0,0 +1,27 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/battery/battery_platform_interface/README.md b/packages/battery/battery_platform_interface/README.md new file mode 100644 index 000000000000..e1a42571c6b3 --- /dev/null +++ b/packages/battery/battery_platform_interface/README.md @@ -0,0 +1,26 @@ +# battery_platform_interface + +A common platform interface for the [`battery`][1] plugin. + +This interface allows platform-specific implementations of the `battery` +plugin, as well as the plugin itself, to ensure they are supporting the +same interface. + +# Usage + +To implement a new platform-specific implementation of `battery`, extend +[`BatteryPlatform`][2] with an implementation that performs the +platform-specific behavior, and when you register your plugin, set the default +`BatteryPlatform` by calling +`BatteryPlatform.instance = MyPlatformBattery()`. + +# Note on breaking changes + +Strongly prefer non-breaking changes (such as adding a method to the interface) +over breaking changes for this package. + +See https://flutter.dev/go/platform-interface-breaking-changes for a discussion +on why a less-clean interface is preferable to a breaking change. + +[1]: ../battery +[2]: lib/battery_platform_interface.dart diff --git a/packages/battery/battery_platform_interface/lib/battery_platform_interface.dart b/packages/battery/battery_platform_interface/lib/battery_platform_interface.dart new file mode 100644 index 000000000000..f803c7aaa8fd --- /dev/null +++ b/packages/battery/battery_platform_interface/lib/battery_platform_interface.dart @@ -0,0 +1,51 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:async'; + +import 'package:plugin_platform_interface/plugin_platform_interface.dart'; + +import 'method_channel/method_channel_battery.dart'; +import 'enums/battery_state.dart'; + +export 'enums/battery_state.dart'; + +/// The interface that implementations of battery must implement. +/// +/// Platform implementations should extend this class rather than implement it as `battery` +/// does not consider newly added methods to be breaking changes. Extending this class +/// (using `extends`) ensures that the subclass will get the default implementation, while +/// platform implementations that `implements` this interface will be broken by newly added +/// [BatteryPlatform] methods. +abstract class BatteryPlatform extends PlatformInterface { + /// Constructs a BatteryPlatform. + BatteryPlatform() : super(token: _token); + + static final Object _token = Object(); + + static BatteryPlatform _instance = MethodChannelBattery(); + + /// The default instance of [BatteryPlatform] to use. + /// + /// Defaults to [MethodChannelBattery]. + static BatteryPlatform get instance => _instance; + + /// Platform-specific plugins should set this with their own platform-specific + /// class that extends [BatteryPlatform] when they register themselves. + static set instance(BatteryPlatform instance) { + PlatformInterface.verifyToken(instance, _token); + _instance = instance; + } + + /// Gets the battery level from device. + Future batteryLevel() { + throw UnimplementedError('batteryLevel() has not been implemented.'); + } + + /// gets battery state from device. + Stream onBatteryStateChanged() { + throw UnimplementedError( + 'onBatteryStateChanged() has not been implemented.'); + } +} diff --git a/packages/battery/battery_platform_interface/lib/enums/battery_state.dart b/packages/battery/battery_platform_interface/lib/enums/battery_state.dart new file mode 100644 index 000000000000..7dd5e400faf2 --- /dev/null +++ b/packages/battery/battery_platform_interface/lib/enums/battery_state.dart @@ -0,0 +1,11 @@ +/// Indicates the current battery state. +enum BatteryState { + /// The battery is completely full of energy. + full, + + /// The battery is currently storing energy. + charging, + + /// The battery is currently losing energy. + discharging +} diff --git a/packages/battery/battery_platform_interface/lib/method_channel/method_channel_battery.dart b/packages/battery/battery_platform_interface/lib/method_channel/method_channel_battery.dart new file mode 100644 index 000000000000..4a3365cc2475 --- /dev/null +++ b/packages/battery/battery_platform_interface/lib/method_channel/method_channel_battery.dart @@ -0,0 +1,51 @@ +import 'dart:async'; + +import 'package:flutter/services.dart'; +import 'package:meta/meta.dart'; + +import 'package:battery_platform_interface/battery_platform_interface.dart'; + +import '../battery_platform_interface.dart'; + +/// An implementation of [BatteryPlatform] that uses method channels. +class MethodChannelBattery extends BatteryPlatform { + /// The method channel used to interact with the native platform. + @visibleForTesting + MethodChannel channel = MethodChannel('plugins.flutter.io/battery'); + + /// The event channel used to interact with the native platform. + @visibleForTesting + EventChannel eventChannel = EventChannel('plugins.flutter.io/charging'); + + /// Method channel for getting battery level. + Future batteryLevel() async { + return (await channel.invokeMethod('getBatteryLevel')).toInt(); + } + + /// Stream variable for storing battery state. + Stream _onBatteryStateChanged; + + /// Event channel for getting battery change state. + Stream onBatteryStateChanged() { + if (_onBatteryStateChanged == null) { + _onBatteryStateChanged = eventChannel + .receiveBroadcastStream() + .map((dynamic event) => _parseBatteryState(event)); + } + return _onBatteryStateChanged; + } +} + +/// Method for parsing battery state. +BatteryState _parseBatteryState(String state) { + switch (state) { + case 'full': + return BatteryState.full; + case 'charging': + return BatteryState.charging; + case 'discharging': + return BatteryState.discharging; + default: + throw ArgumentError('$state is not a valid BatteryState.'); + } +} diff --git a/packages/battery/battery_platform_interface/pubspec.yaml b/packages/battery/battery_platform_interface/pubspec.yaml new file mode 100644 index 000000000000..6c571debc7b0 --- /dev/null +++ b/packages/battery/battery_platform_interface/pubspec.yaml @@ -0,0 +1,22 @@ +name: battery_platform_interface +description: A common platform interface for the battery plugin. +homepage: https://github.com/flutter/plugins/tree/master/packages/battery +# NOTE: We strongly prefer non-breaking changes, even at the expense of a +# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes +version: 1.0.0 + +dependencies: + flutter: + sdk: flutter + meta: ^1.1.8 + plugin_platform_interface: ^1.0.2 + +dev_dependencies: + flutter_test: + sdk: flutter + mockito: ^4.1.1 + pedantic: ^1.8.0 + +environment: + sdk: ">=2.7.0 <3.0.0" + flutter: ">=1.9.1+hotfix.4 <2.0.0" diff --git a/packages/battery/battery_platform_interface/test/method_channel_battery_test.dart b/packages/battery/battery_platform_interface/test/method_channel_battery_test.dart new file mode 100644 index 000000000000..65323e4044de --- /dev/null +++ b/packages/battery/battery_platform_interface/test/method_channel_battery_test.dart @@ -0,0 +1,63 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:flutter/services.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:battery_platform_interface/battery_platform_interface.dart'; + +import 'package:battery_platform_interface/method_channel/method_channel_battery.dart'; + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + + group("$MethodChannelBattery", () { + MethodChannelBattery methodChannelBattery; + + setUp(() async { + methodChannelBattery = MethodChannelBattery(); + + methodChannelBattery.channel + .setMockMethodCallHandler((MethodCall methodCall) async { + switch (methodCall.method) { + case 'getBatteryLevel': + return 90; + default: + return null; + } + }); + + MethodChannel(methodChannelBattery.eventChannel.name) + .setMockMethodCallHandler((MethodCall methodCall) async { + switch (methodCall.method) { + case 'listen': + await ServicesBinding.instance.defaultBinaryMessenger + .handlePlatformMessage( + methodChannelBattery.eventChannel.name, + methodChannelBattery.eventChannel.codec + .encodeSuccessEnvelope('full'), + (_) {}, + ); + break; + case 'cancel': + default: + return null; + } + }); + }); + + /// Test for batetry level call. + test("getBatteryLevel", () async { + final int result = await methodChannelBattery.batteryLevel(); + expect(result, 90); + }); + + /// Test for battery changed state call. + test("onBatteryChanged", () async { + final BatteryState result = + await methodChannelBattery.onBatteryStateChanged().first; + expect(result, BatteryState.full); + }); + }); +} From 7c493614fe14fa7d2fee49e600b76eca437bb7c1 Mon Sep 17 00:00:00 2001 From: Balvinder Singh Gambhir Date: Sat, 29 Aug 2020 02:44:39 +0530 Subject: [PATCH 064/233] [url_launcher, url_launcher_web]Added webOnlyWindowName parameter to launch() (#2979) --- .../url_launcher/url_launcher/CHANGELOG.md | 4 ++++ .../url_launcher/lib/url_launcher.dart | 5 +++++ .../url_launcher/url_launcher/pubspec.yaml | 2 +- .../url_launcher_web/CHANGELOG.md | 4 ++++ .../lib/url_launcher_web.dart | 12 ++++++----- .../url_launcher_web/pubspec.yaml | 2 +- .../test/url_launcher_web_test.dart | 20 +++++++++++++++++++ 7 files changed, 42 insertions(+), 7 deletions(-) diff --git a/packages/url_launcher/url_launcher/CHANGELOG.md b/packages/url_launcher/url_launcher/CHANGELOG.md index a5364726bee3..845fec757163 100644 --- a/packages/url_launcher/url_launcher/CHANGELOG.md +++ b/packages/url_launcher/url_launcher/CHANGELOG.md @@ -1,3 +1,7 @@ +## 5.5.1 + +* Added webOnlyWindowName parameter to launch() + ## 5.5.0 * Support Linux by default. diff --git a/packages/url_launcher/url_launcher/lib/url_launcher.dart b/packages/url_launcher/url_launcher/lib/url_launcher.dart index 2ce725da8642..bc171062093c 100644 --- a/packages/url_launcher/url_launcher/lib/url_launcher.dart +++ b/packages/url_launcher/url_launcher/lib/url_launcher.dart @@ -44,6 +44,9 @@ import 'package:url_launcher_platform_interface/url_launcher_platform_interface. /// [enableDomStorage] is an Android only setting. If true, WebView enable /// DOM storage. /// [headers] is an Android only setting that adds headers to the WebView. +/// [webOnlyWindowName] is an Web only setting . _blank opens the new url in new tab , +/// _self opens the new url in current tab. +/// Default behaviour is to open the url in new tab. /// /// Note that if any of the above are set to true but the URL is not a web URL, /// this will throw a [PlatformException]. @@ -63,6 +66,7 @@ Future launch( bool universalLinksOnly, Map headers, Brightness statusBarBrightness, + String webOnlyWindowName, }) async { assert(urlString != null); final Uri url = Uri.parse(urlString.trimLeft()); @@ -93,6 +97,7 @@ Future launch( enableDomStorage: enableDomStorage ?? false, universalLinksOnly: universalLinksOnly ?? false, headers: headers ?? {}, + webOnlyWindowName: webOnlyWindowName, ); assert(previousAutomaticSystemUiAdjustment != null); if (statusBarBrightness != null) { diff --git a/packages/url_launcher/url_launcher/pubspec.yaml b/packages/url_launcher/url_launcher/pubspec.yaml index 299de938165f..a3955226aed3 100644 --- a/packages/url_launcher/url_launcher/pubspec.yaml +++ b/packages/url_launcher/url_launcher/pubspec.yaml @@ -2,7 +2,7 @@ name: url_launcher description: Flutter plugin for launching a URL on Android and iOS. Supports web, phone, SMS, and email schemes. homepage: https://github.com/flutter/plugins/tree/master/packages/url_launcher/url_launcher -version: 5.5.0 +version: 5.5.1 flutter: plugin: diff --git a/packages/url_launcher/url_launcher_web/CHANGELOG.md b/packages/url_launcher/url_launcher_web/CHANGELOG.md index ed8014297776..2f33ffbe1d50 100644 --- a/packages/url_launcher/url_launcher_web/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_web/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.1.3 + +- Added webOnlyWindowName parameter to launch() + # 0.1.2+1 - Update docs diff --git a/packages/url_launcher/url_launcher_web/lib/url_launcher_web.dart b/packages/url_launcher/url_launcher_web/lib/url_launcher_web.dart index 1bac4d524122..da73cd8b6350 100644 --- a/packages/url_launcher/url_launcher_web/lib/url_launcher_web.dart +++ b/packages/url_launcher/url_launcher_web/lib/url_launcher_web.dart @@ -39,15 +39,15 @@ class UrlLauncherPlugin extends UrlLauncherPlatform { bool _isSafariTargetTopScheme(String url) => _safariTargetTopSchemes.contains(_getUrlScheme(url)); - /// Opens the given [url] in a new window. + /// Opens the given [url] in the specified [webOnlyWindowName]. /// /// Returns the newly created window. @visibleForTesting - html.WindowBase openNewWindow(String url) { + html.WindowBase openNewWindow(String url, {String webOnlyWindowName}) { // We need to open mailto, tel and sms urls on the _top window context on safari browsers. // See https://github.com/flutter/flutter/issues/51461 for reference. - final target = - browser.isSafari && _isSafariTargetTopScheme(url) ? '_top' : ''; + final target = webOnlyWindowName ?? + ((browser.isSafari && _isSafariTargetTopScheme(url)) ? '_top' : ''); return _window.open(url, target); } @@ -65,7 +65,9 @@ class UrlLauncherPlugin extends UrlLauncherPlatform { @required bool enableDomStorage, @required bool universalLinksOnly, @required Map headers, + String webOnlyWindowName, }) { - return Future.value(openNewWindow(url) != null); + return Future.value( + openNewWindow(url, webOnlyWindowName: webOnlyWindowName) != null); } } diff --git a/packages/url_launcher/url_launcher_web/pubspec.yaml b/packages/url_launcher/url_launcher_web/pubspec.yaml index 727b396ba2e6..a77692df63e8 100644 --- a/packages/url_launcher/url_launcher_web/pubspec.yaml +++ b/packages/url_launcher/url_launcher_web/pubspec.yaml @@ -4,7 +4,7 @@ homepage: https://github.com/flutter/plugins/tree/master/packages/url_launcher/u # 0.1.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.1.2+1 +version: 0.1.3 flutter: plugin: diff --git a/packages/url_launcher/url_launcher_web/test/url_launcher_web_test.dart b/packages/url_launcher/url_launcher_web/test/url_launcher_web_test.dart index b7e107d892cf..9cbaf686069f 100644 --- a/packages/url_launcher/url_launcher_web/test/url_launcher_web_test.dart +++ b/packages/url_launcher/url_launcher_web/test/url_launcher_web_test.dart @@ -145,6 +145,19 @@ void main() { verify(mockWindow.open('sms:+19725551212?body=hello%20there', '')); }); + test('setting oOnlyLinkTarget as _self opens the url in the same tab', + () { + plugin.openNewWindow("https://www.google.com", + webOnlyWindowName: "_self"); + verify(mockWindow.open('https://www.google.com', '_self')); + }); + + test('setting webOnlyLinkTarget as _blank opens the url in a new tab', + () { + plugin.openNewWindow("https://www.google.com", + webOnlyWindowName: "_blank"); + verify(mockWindow.open('https://www.google.com', '_blank')); + }); group('Safari', () { setUp(() { @@ -181,6 +194,13 @@ void main() { verify( mockWindow.open('sms:+19725551212?body=hello%20there', '_top')); }); + test( + 'mailto urls should use _blank if webOnlyWindowName is set as _blank', + () { + plugin.openNewWindow("mailto:name@mydomain.com", + webOnlyWindowName: "_blank"); + verify(mockWindow.open("mailto:name@mydomain.com", "_blank")); + }); }); }); }); From b93268e043e265e1a9bffce7c59b6adfa07e8a7c Mon Sep 17 00:00:00 2001 From: David Iglesias Date: Mon, 31 Aug 2020 12:18:47 -0700 Subject: [PATCH 065/233] [url_launcher, url_launcher_web] Fix API dependencies. (#2984) --- packages/url_launcher/url_launcher/CHANGELOG.md | 4 ++++ packages/url_launcher/url_launcher/pubspec.yaml | 6 +++--- packages/url_launcher/url_launcher_web/CHANGELOG.md | 4 ++++ packages/url_launcher/url_launcher_web/pubspec.yaml | 4 ++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/url_launcher/url_launcher/CHANGELOG.md b/packages/url_launcher/url_launcher/CHANGELOG.md index 845fec757163..d20eb9117440 100644 --- a/packages/url_launcher/url_launcher/CHANGELOG.md +++ b/packages/url_launcher/url_launcher/CHANGELOG.md @@ -1,3 +1,7 @@ +## 5.5.2 + +* Depend explicitly on the `platform_interface` package that adds the `webOnlyWindowName` parameter. + ## 5.5.1 * Added webOnlyWindowName parameter to launch() diff --git a/packages/url_launcher/url_launcher/pubspec.yaml b/packages/url_launcher/url_launcher/pubspec.yaml index a3955226aed3..7fc824c74f9a 100644 --- a/packages/url_launcher/url_launcher/pubspec.yaml +++ b/packages/url_launcher/url_launcher/pubspec.yaml @@ -2,7 +2,7 @@ name: url_launcher description: Flutter plugin for launching a URL on Android and iOS. Supports web, phone, SMS, and email schemes. homepage: https://github.com/flutter/plugins/tree/master/packages/url_launcher/url_launcher -version: 5.5.1 +version: 5.5.2 flutter: plugin: @@ -22,13 +22,13 @@ flutter: dependencies: flutter: sdk: flutter - url_launcher_platform_interface: ^1.0.4 + url_launcher_platform_interface: ^1.0.8 # The design on https://flutter.dev/go/federated-plugins was to leave # this constraint as "any". We cannot do it right now as it fails pub publish # validation, so we set a ^ constraint. # TODO(amirh): Revisit this (either update this part in the design or the pub tool). # https://github.com/flutter/flutter/issues/46264 - url_launcher_web: ^0.1.0+1 + url_launcher_web: ^0.1.3 url_launcher_linux: ^0.0.1 url_launcher_macos: ^0.0.1 diff --git a/packages/url_launcher/url_launcher_web/CHANGELOG.md b/packages/url_launcher/url_launcher_web/CHANGELOG.md index 2f33ffbe1d50..4bf47fe2c1fb 100644 --- a/packages/url_launcher/url_launcher_web/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_web/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.1.3+1 + +- Depend explicitly on the `platform_interface` package that adds the `webOnlyWindowName` parameter. + # 0.1.3 - Added webOnlyWindowName parameter to launch() diff --git a/packages/url_launcher/url_launcher_web/pubspec.yaml b/packages/url_launcher/url_launcher_web/pubspec.yaml index a77692df63e8..6c1285f22090 100644 --- a/packages/url_launcher/url_launcher_web/pubspec.yaml +++ b/packages/url_launcher/url_launcher_web/pubspec.yaml @@ -4,7 +4,7 @@ homepage: https://github.com/flutter/plugins/tree/master/packages/url_launcher/u # 0.1.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.1.3 +version: 0.1.3+1 flutter: plugin: @@ -14,7 +14,7 @@ flutter: fileName: url_launcher_web.dart dependencies: - url_launcher_platform_interface: ^1.0.1 + url_launcher_platform_interface: ^1.0.8 platform_detect: ^1.4.0 flutter: sdk: flutter From ce2c15529c2ceb8cf1a2dd12bbea1fca7f4a37c2 Mon Sep 17 00:00:00 2001 From: nturgut Date: Mon, 31 Aug 2020 15:00:34 -0700 Subject: [PATCH 066/233] [web] Adding capability to e2e to take screenshot for web tests. (#2904) * screenshot taking works * squash commits. addressing reviewer comments. making drivercommandmanager->callback manager * addressing reviewer comment. mostly name changes * major rename on all files webdriveraction->webdrivercommand * remove files. use implements * remove timeout. add onScreenshot callback * remove remaning timeouts. add an error message for screenshots. use an object instead of strings for status messages * created a new issue * remove example screenshot saving since it's failing on android. examples in integration_test package is common * changing the version and the change log --- packages/integration_test/CHANGELOG.md | 4 + .../example_integration_extended.dart | 18 ++ .../example_integration_extended_test.dart | 14 ++ .../example_integration_io_extended.dart | 38 ++++ .../example_integration_web_extended.dart | 52 ++++++ .../integration_test/lib/_callback_io.dart | 62 ++++++ .../integration_test/lib/_callback_web.dart | 170 +++++++++++++++++ packages/integration_test/lib/common.dart | 176 ++++++++++++++++++ .../lib/integration_test.dart | 56 +++--- .../lib/integration_test_driver_extended.dart | 75 ++++++++ packages/integration_test/pubspec.yaml | 2 +- 11 files changed, 638 insertions(+), 29 deletions(-) create mode 100644 packages/integration_test/example/test_driver/example_integration_extended.dart create mode 100644 packages/integration_test/example/test_driver/example_integration_extended_test.dart create mode 100644 packages/integration_test/example/test_driver/example_integration_io_extended.dart create mode 100644 packages/integration_test/example/test_driver/example_integration_web_extended.dart create mode 100644 packages/integration_test/lib/_callback_io.dart create mode 100644 packages/integration_test/lib/_callback_web.dart create mode 100644 packages/integration_test/lib/integration_test_driver_extended.dart diff --git a/packages/integration_test/CHANGELOG.md b/packages/integration_test/CHANGELOG.md index d57819e331ea..3bed2b8b73b4 100644 --- a/packages/integration_test/CHANGELOG.md +++ b/packages/integration_test/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.9.0 + +* Add screenshot capability to web tests. + ## 0.8.2 * Add support to get timeline. diff --git a/packages/integration_test/example/test_driver/example_integration_extended.dart b/packages/integration_test/example/test_driver/example_integration_extended.dart new file mode 100644 index 000000000000..79ed2762165e --- /dev/null +++ b/packages/integration_test/example/test_driver/example_integration_extended.dart @@ -0,0 +1,18 @@ +// This is a Flutter widget test can take a screenshot. +// +// NOTE: Screenshots are only supported on Web for now. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility that Flutter provides. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:integration_test/integration_test.dart'; + +import 'example_integration_io_extended.dart' + if (dart.library.html) 'example_integration_web_extended.dart' as tests; + +void main() { + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + tests.main(); +} diff --git a/packages/integration_test/example/test_driver/example_integration_extended_test.dart b/packages/integration_test/example/test_driver/example_integration_extended_test.dart new file mode 100644 index 000000000000..1428a5092a78 --- /dev/null +++ b/packages/integration_test/example/test_driver/example_integration_extended_test.dart @@ -0,0 +1,14 @@ +import 'dart:async'; + +import 'package:flutter_driver/flutter_driver.dart'; +import 'package:integration_test/integration_test_driver_extended.dart'; + +Future main() async { + final FlutterDriver driver = await FlutterDriver.connect(); + await integrationDriver( + driver: driver, + onScreenshot: (String screenshotName, List screenshotBytes) async { + return true; + }, + ); +} diff --git a/packages/integration_test/example/test_driver/example_integration_io_extended.dart b/packages/integration_test/example/test_driver/example_integration_io_extended.dart new file mode 100644 index 000000000000..56fee6f7179c --- /dev/null +++ b/packages/integration_test/example/test_driver/example_integration_io_extended.dart @@ -0,0 +1,38 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility that Flutter provides. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'dart:io' show Platform; +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:integration_test/integration_test.dart'; + +import 'package:integration_test_example/main.dart' as app; + +void main() { + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + + testWidgets('verify text', (WidgetTester tester) async { + // Build our app and trigger a frame. + app.main(); + + // Trigger a frame. + await tester.pumpAndSettle(); + + // TODO: https://github.com/flutter/flutter/issues/51890 + // Add screenshot capability for mobile platforms. + + // Verify that platform version is retrieved. + expect( + find.byWidgetPredicate( + (Widget widget) => + widget is Text && + widget.data.startsWith('Platform: ${Platform.operatingSystem}'), + ), + findsOneWidget, + ); + }); +} diff --git a/packages/integration_test/example/test_driver/example_integration_web_extended.dart b/packages/integration_test/example/test_driver/example_integration_web_extended.dart new file mode 100644 index 000000000000..210c2dac75ba --- /dev/null +++ b/packages/integration_test/example/test_driver/example_integration_web_extended.dart @@ -0,0 +1,52 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility that Flutter provides. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'dart:html' as html; +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:integration_test/integration_test.dart'; + +import 'package:integration_test_example/main.dart' as app; + +void main() { + final IntegrationTestWidgetsFlutterBinding binding = + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + + testWidgets('verify text', (WidgetTester tester) async { + // Build our app and trigger a frame. + app.main(); + + // Trigger a frame. + await tester.pumpAndSettle(); + + // Take a screenshot. + await binding.takeScreenshot('platform_name'); + + // Verify that platform is retrieved. + expect( + find.byWidgetPredicate( + (Widget widget) => + widget is Text && + widget.data + .startsWith('Platform: ${html.window.navigator.platform}\n'), + ), + findsOneWidget, + ); + }); + + testWidgets('verify screenshot', (WidgetTester tester) async { + // Build our app and trigger a frame. + app.main(); + + // Trigger a frame. + await tester.pumpAndSettle(); + + // Multiple methods can take screenshots. Screenshots are taken with the + // same order the methods run. + await binding.takeScreenshot('platform_name_2'); + }); +} diff --git a/packages/integration_test/lib/_callback_io.dart b/packages/integration_test/lib/_callback_io.dart new file mode 100644 index 000000000000..c1a447e27cab --- /dev/null +++ b/packages/integration_test/lib/_callback_io.dart @@ -0,0 +1,62 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'common.dart'; + +/// The dart:io implementation of [CallbackManager]. +/// +/// See also: +/// +/// * [_callback_web.dart], which has the dart:html implementation +CallbackManager get callbackManager => _singletonCallbackManager; + +/// IOCallbackManager singleton. +final IOCallbackManager _singletonCallbackManager = IOCallbackManager(); + +/// Manages communication between `integration_tests` and the `driver_tests`. +/// +/// This is the dart:io implementation. +class IOCallbackManager implements CallbackManager { + @override + Future> callback( + Map params, IntegrationTestResults testRunner) async { + final String command = params['command']; + Map response; + switch (command) { + case 'request_data': + final bool allTestsPassed = await testRunner.allTestsPassed.future; + response = { + 'message': allTestsPassed + ? Response.allTestsPassed(data: testRunner.reportData).toJson() + : Response.someTestsFailed( + testRunner.failureMethodsDetails, + data: testRunner.reportData, + ).toJson(), + }; + break; + case 'get_health': + response = {'status': 'ok'}; + break; + default: + throw UnimplementedError('$command is not implemented'); + } + return { + 'isError': false, + 'response': response, + }; + } + + @override + void cleanup() { + // no-op. + // Add any IO platform specific Completer/Future cleanups to here if any + // comes up in the future. For example: `WebCallbackManager.cleanup`. + } + + @override + Future takeScreenshot(String screenshot) { + throw UnimplementedError( + 'Screenshots are not implemented on this platform'); + } +} diff --git a/packages/integration_test/lib/_callback_web.dart b/packages/integration_test/lib/_callback_web.dart new file mode 100644 index 000000000000..036098148d99 --- /dev/null +++ b/packages/integration_test/lib/_callback_web.dart @@ -0,0 +1,170 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:async'; + +import 'package:flutter_test/flutter_test.dart'; + +import 'common.dart'; + +/// The dart:html implementation of [CallbackManager]. +/// +/// See also: +/// +/// * [_callback_io.dart], which has the dart:io implementation +CallbackManager get callbackManager => _singletonWebDriverCommandManager; + +/// WebDriverCommandManager singleton. +final WebCallbackManager _singletonWebDriverCommandManager = + WebCallbackManager(); + +/// Manages communication between `integration_tests` and the `driver_tests`. +/// +/// Along with responding to callbacks from the driver side this calls enables +/// usage of Web Driver commands by sending [WebDriverCommand]s to driver side. +/// +/// Tests can execute an Web Driver commands such as `screenshot` using browsers' +/// WebDriver APIs. +/// +/// See: https://www.w3.org/TR/webdriver/ +class WebCallbackManager implements CallbackManager { + /// App side tests will put the command requests from WebDriver to this pipe. + Completer _webDriverCommandPipe = + Completer(); + + /// Updated when WebDriver completes the request by the test method. + /// + /// For example, a test method will ask for a screenshot by calling + /// `takeScreenshot`. When this screenshot is taken [_driverCommandComplete] + /// will complete. + Completer _driverCommandComplete = Completer(); + + /// Takes screenshot using WebDriver screenshot command. + /// + /// Only works on Web when tests are run via `flutter driver` command. + /// + /// See: https://www.w3.org/TR/webdriver/#screen-capture. + @override + Future takeScreenshot(String screenshotName) async { + await _sendWebDriverCommand(WebDriverCommand.screenshot(screenshotName)); + } + + Future _sendWebDriverCommand(WebDriverCommand command) async { + try { + _webDriverCommandPipe.complete(Future.value(command)); + final bool awaitCommand = await _driverCommandComplete.future; + if (!awaitCommand) { + throw Exception( + 'Web Driver Command ${command.type} failed while waiting for ' + 'driver side'); + } + } catch (exception) { + throw Exception('Web Driver Command failed: ${command.type} with ' + 'exception $exception'); + } finally { + // Reset the completer. + _driverCommandComplete = Completer(); + } + } + + /// The callback function to response the driver side input. + /// + /// Provides a handshake mechanism for executing [WebDriverCommand]s on the + /// driver side. + @override + Future> callback( + Map params, IntegrationTestResults testRunner) async { + final String command = params['command']; + Map response; + switch (command) { + case 'request_data': + return params['message'] == null + ? _requestData(testRunner) + : _requestDataWithMessage(params['message'], testRunner); + break; + case 'get_health': + response = {'status': 'ok'}; + break; + default: + throw UnimplementedError('$command is not implemented'); + } + return { + 'isError': false, + 'response': response, + }; + } + + Future> _requestDataWithMessage( + String extraMessage, IntegrationTestResults testRunner) async { + Map response; + // Driver side tests' status is added as an extra message. + final DriverTestMessage message = + DriverTestMessage.fromString(extraMessage); + // If driver side tests are pending send the first command in the + // `commandPipe` to the tests. + if (message.isPending) { + final WebDriverCommand command = await _webDriverCommandPipe.future; + switch (command.type) { + case WebDriverCommandType.screenshot: + final Map data = Map.from(command.values); + data.addAll( + WebDriverCommand.typeToMap(WebDriverCommandType.screenshot)); + response = { + 'message': Response.webDriverCommand(data: data).toJson(), + }; + break; + case WebDriverCommandType.noop: + final Map data = Map(); + data.addAll(WebDriverCommand.typeToMap(WebDriverCommandType.noop)); + response = { + 'message': Response.webDriverCommand(data: data).toJson(), + }; + break; + default: + throw UnimplementedError('${command.type} is not implemented'); + } + } else { + final Map data = Map(); + data.addAll(WebDriverCommand.typeToMap(WebDriverCommandType.ack)); + response = { + 'message': Response.webDriverCommand(data: data).toJson(), + }; + _driverCommandComplete.complete(Future.value(message.isSuccess)); + _webDriverCommandPipe = Completer(); + } + return { + 'isError': false, + 'response': response, + }; + } + + Future> _requestData( + IntegrationTestResults testRunner) async { + final bool allTestsPassed = await testRunner.allTestsPassed.future; + final Map response = { + 'message': allTestsPassed + ? Response.allTestsPassed(data: testRunner.reportData).toJson() + : Response.someTestsFailed( + testRunner.failureMethodsDetails, + data: testRunner.reportData, + ).toJson(), + }; + return { + 'isError': false, + 'response': response, + }; + } + + @override + void cleanup() { + if (!_webDriverCommandPipe.isCompleted) { + _webDriverCommandPipe + .complete(Future.value(WebDriverCommand.noop())); + } + + if (!_driverCommandComplete.isCompleted) { + _driverCommandComplete.complete(Future.value(false)); + } + } +} diff --git a/packages/integration_test/lib/common.dart b/packages/integration_test/lib/common.dart index 789b1fa54948..53714a8e97ee 100644 --- a/packages/integration_test/lib/common.dart +++ b/packages/integration_test/lib/common.dart @@ -2,8 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'dart:async'; import 'dart:convert'; +/// Classes shared between `integration_test.dart` and `flutter drive` based +/// adoptor (ex: `integration_test_driver.dart`). + /// An object sent from integration_test back to the Flutter Driver in response to /// `request_data` command. class Response { @@ -23,6 +27,16 @@ class Response { Response.someTestsFailed(this._failureDetails, {this.data}) : this._allTestsPassed = false; + /// Constructor for failure response. + Response.toolException({String ex}) + : this._allTestsPassed = false, + this._failureDetails = [Failure('ToolException', ex)]; + + /// Constructor for web driver commands response. + Response.webDriverCommand({this.data}) + : this._allTestsPassed = false, + this._failureDetails = null; + /// Whether the test ran successfully or not. bool get allTestsPassed => _allTestsPassed; @@ -123,3 +137,165 @@ class Failure { return Failure(failure['methodName'], failure['details']); } } + +/// Message used to communicate between app side tests and driver tests. +/// +/// Not all `integration_tests` use this message. They are only used when app +/// side tests are sending [WebDriverCommand]s to the driver side. +/// +/// These messages are used for the handshake since they carry information on +/// the driver side test such as: status pending or tests failed. +class DriverTestMessage { + final bool _isSuccess; + final bool _isPending; + + /// When tests are failed on the driver side. + DriverTestMessage.error() + : _isSuccess = false, + _isPending = false; + + /// When driver side is waiting on [WebDriverCommand]s to be sent from the + /// app side. + DriverTestMessage.pending() + : _isSuccess = false, + _isPending = true; + + /// When driver side successfully completed executing the [WebDriverCommand]. + DriverTestMessage.complete() + : _isSuccess = true, + _isPending = false; + + // /// Status of this message. + // /// + // /// The status will be use to notify `integration_test` of driver side's + // /// state. + // String get status => _status; + + /// Has the command completed successfully by the driver. + bool get isSuccess => _isSuccess; + + /// Is the driver waiting for a command. + bool get isPending => _isPending; + + /// Depending on the values of [isPending] and [isSuccess], returns a string + /// to represent the [DriverTestMessage]. + /// + /// Used as an alternative method to converting the object to json since + /// [RequestData] is only accepting string as `message`. + @override + String toString() { + if (isPending) { + return 'pending'; + } else if (isSuccess) { + return 'complete'; + } else { + return 'error'; + } + } + + /// Return a DriverTestMessage depending on `status`. + static DriverTestMessage fromString(String status) { + switch (status) { + case 'error': + return DriverTestMessage.error(); + case 'pending': + return DriverTestMessage.pending(); + case 'complete': + return DriverTestMessage.complete(); + default: + throw StateError('This type of status does not exist: $status'); + } + } +} + +/// Types of different WebDriver commands that can be used in web integration +/// tests. +/// +/// These commands are either commands that WebDriver can execute or used +/// for the communication between `integration_test` and the driver test. +enum WebDriverCommandType { + /// Acknowlegement for the previously sent message. + ack, + + /// No further WebDriver commands is requested by the app-side tests. + noop, + + /// Asking WebDriver to take a screenshot of the Web page. + screenshot, +} + +/// Command for WebDriver to execute. +/// +/// Only works on Web when tests are run via `flutter driver` command. +/// +/// See: https://www.w3.org/TR/webdriver/ +class WebDriverCommand { + /// Type of the [WebDriverCommand]. + /// + /// Currently the only command that triggers a WebDriver API is `screenshot`. + /// + /// There are also `ack` and `noop` commands defined to manage the handshake + /// during the communication. + final WebDriverCommandType type; + + /// Used for adding extra values to the commands such as file name for + /// `screenshot`. + final Map values; + + /// Constructor for [WebDriverCommandType.noop] command. + WebDriverCommand.noop() + : this.type = WebDriverCommandType.noop, + this.values = Map(); + + /// Constructor for [WebDriverCommandType.noop] screenshot. + WebDriverCommand.screenshot(String screenshot_name) + : this.type = WebDriverCommandType.screenshot, + this.values = {'screenshot_name': screenshot_name}; + + /// Util method for converting [WebDriverCommandType] to a map entry. + /// + /// Used for converting messages to json format. + static Map typeToMap(WebDriverCommandType type) => { + 'web_driver_command': '${type}', + }; +} + +/// Template methods each class that responses the driver side inputs must +/// implement. +/// +/// Depending on the platform the communication between `integration_tests` and +/// the `driver_tests` can be different. +/// +/// For the web implementation [WebCallbackManager]. +/// For the io implementation [IOCallbackManager]. +abstract class CallbackManager { + /// The callback function to response the driver side input. + Future> callback( + Map params, IntegrationTestResults testRunner); + + /// Request to take a screenshot of the application. + Future takeScreenshot(String screenshot); + + /// Cleanup and completers or locks used during the communication. + void cleanup(); +} + +/// Interface that surfaces test results of integration tests. +/// +/// Implemented by [IntegrationTestWidgetsFlutterBinding]s. +/// +/// Any class which needs to access the test results but do not want to create +/// a cyclic dependency [IntegrationTestWidgetsFlutterBinding]s can use this +/// interface. Example [CallbackManager]. +abstract class IntegrationTestResults { + /// Stores failure details. + /// + /// Failed test method's names used as key. + List get failureMethodsDetails; + + /// The extra data for the reported result. + Map get reportData; + + /// Whether all the test methods completed succesfully. + Completer get allTestsPassed; +} diff --git a/packages/integration_test/lib/integration_test.dart b/packages/integration_test/lib/integration_test.dart index f6980bc9d6d1..4176c1c2c5e1 100644 --- a/packages/integration_test/lib/integration_test.dart +++ b/packages/integration_test/lib/integration_test.dart @@ -15,13 +15,15 @@ import 'package:vm_service/vm_service_io.dart' as vm_io; import 'common.dart'; import '_extension_io.dart' if (dart.library.html) '_extension_web.dart'; +import '_callback_io.dart' if (dart.library.html) '_callback_web.dart' + as driver_actions; const String _success = 'success'; /// A subclass of [LiveTestWidgetsFlutterBinding] that reports tests results /// on a channel to adapt them to native instrumentation test format. -class IntegrationTestWidgetsFlutterBinding - extends LiveTestWidgetsFlutterBinding { +class IntegrationTestWidgetsFlutterBinding extends LiveTestWidgetsFlutterBinding + implements IntegrationTestResults { /// Sets up a listener to report that the tests are finished when everything is /// torn down. IntegrationTestWidgetsFlutterBinding() { @@ -36,6 +38,7 @@ class IntegrationTestWidgetsFlutterBinding _allTestsPassed.complete(true); } } + callbackManager.cleanup(); await _channel.invokeMethod( 'allTestsFinished', { @@ -104,8 +107,13 @@ class IntegrationTestWidgetsFlutterBinding ); } + @override + Completer get allTestsPassed => _allTestsPassed; final Completer _allTestsPassed = Completer(); + @override + List get failureMethodsDetails => _failures; + /// Similar to [WidgetsFlutterBinding.ensureInitialized]. /// /// Returns an instance of the [IntegrationTestWidgetsFlutterBinding], creating and @@ -136,35 +144,27 @@ class IntegrationTestWidgetsFlutterBinding /// If it's `null`, no extra data is attached to the result. /// /// The default value is `null`. - Map reportData; + @override + Map get reportData => _reportData; + Map _reportData; + set reportData(Map data) => this._reportData = data; + + /// Manages callbacks received from driver side and commands send to driver + /// side. + final CallbackManager callbackManager = driver_actions.callbackManager; - /// the callback function to response the driver side input. + /// Taking a screenshot. + /// + /// Called by test methods. Implementation differs for each platform. + Future takeScreenshot(String screenshotName) async { + await callbackManager.takeScreenshot(screenshotName); + } + + /// The callback function to response the driver side input. @visibleForTesting Future> callback(Map params) async { - final String command = params['command']; - Map response; - switch (command) { - case 'request_data': - final bool allTestsPassed = await _allTestsPassed.future; - response = { - 'message': allTestsPassed - ? Response.allTestsPassed(data: reportData).toJson() - : Response.someTestsFailed( - _failures, - data: reportData, - ).toJson(), - }; - break; - case 'get_health': - response = {'status': 'ok'}; - break; - default: - throw UnimplementedError('$command is not implemented'); - } - return { - 'isError': false, - 'response': response, - }; + return await callbackManager.callback( + params, this /* as IntegrationTestResults */); } // Emulates the Flutter driver extension, returning 'pass' or 'fail'. diff --git a/packages/integration_test/lib/integration_test_driver_extended.dart b/packages/integration_test/lib/integration_test_driver_extended.dart new file mode 100644 index 000000000000..bc38bb71de50 --- /dev/null +++ b/packages/integration_test/lib/integration_test_driver_extended.dart @@ -0,0 +1,75 @@ +import 'dart:async'; +import 'dart:io'; + +import 'common.dart'; + +import 'package:flutter_driver/flutter_driver.dart'; + +/// Example Integration Test which can also run WebDriver command depending on +/// the requests coming from the test methods. +Future integrationDriver( + {FlutterDriver driver, Function onScreenshot}) async { + if (driver == null) { + driver = await FlutterDriver.connect(); + } + // Test states that it's waiting on web driver commands. + // [DriverTestMessage] is converted to string since json format causes an + // error if it's used as a message for requestData. + String jsonResponse = + await driver.requestData(DriverTestMessage.pending().toString()); + + Response response = Response.fromJson(jsonResponse); + + // Until `integration_test` returns a [WebDriverCommandType.noop], keep + // executing WebDriver commands. + while (response.data != null && + response.data['web_driver_command'] != null && + response.data['web_driver_command'] != '${WebDriverCommandType.noop}') { + final String webDriverCommand = response.data['web_driver_command']; + if (webDriverCommand == '${WebDriverCommandType.screenshot}') { + // Use `driver.screenshot()` method to get a screenshot of the web page. + final List screenshotImage = await driver.screenshot(); + final String screenshotName = response.data['screenshot_name']; + + final bool screenshotSuccess = + await onScreenshot(screenshotName, screenshotImage); + if (screenshotSuccess) { + jsonResponse = + await driver.requestData(DriverTestMessage.complete().toString()); + } else { + jsonResponse = + await driver.requestData(DriverTestMessage.error().toString()); + } + + response = Response.fromJson(jsonResponse); + } else if (webDriverCommand == '${WebDriverCommandType.ack}') { + // Previous command completed ask for a new one. + jsonResponse = + await driver.requestData(DriverTestMessage.pending().toString()); + + response = Response.fromJson(jsonResponse); + } else { + break; + } + } + + // If No-op command is sent, ask for the result of all tests. + if (response.data != null && + response.data['web_driver_command'] != null && + response.data['web_driver_command'] == '${WebDriverCommandType.noop}') { + jsonResponse = await driver.requestData(null); + + response = Response.fromJson(jsonResponse); + print('result $jsonResponse'); + } + + await driver.close(); + + if (response.allTestsPassed) { + print('All tests passed.'); + exit(0); + } else { + print('Failure Details:\n${response.formattedFailureDetails}'); + exit(1); + } +} diff --git a/packages/integration_test/pubspec.yaml b/packages/integration_test/pubspec.yaml index 9dd4ade6ce49..6e0412924748 100644 --- a/packages/integration_test/pubspec.yaml +++ b/packages/integration_test/pubspec.yaml @@ -1,6 +1,6 @@ name: integration_test description: Runs tests that use the flutter_test API as integration tests. -version: 0.8.2 +version: 0.9.0 homepage: https://github.com/flutter/plugins/tree/master/packages/integration_test environment: From 90924b5727a9dbadbff8aa51db704c007188dd71 Mon Sep 17 00:00:00 2001 From: xster Date: Mon, 31 Aug 2020 17:58:57 -0700 Subject: [PATCH 067/233] [google_maps_flutter] Fix Android unit test. (#2985) --- .../plugins/googlemaps/GoogleMapControllerTest.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter/example/android/app/src/test/java/io/flutter/plugins/googlemaps/GoogleMapControllerTest.java b/packages/google_maps_flutter/google_maps_flutter/example/android/app/src/test/java/io/flutter/plugins/googlemaps/GoogleMapControllerTest.java index 8401a3836c31..04b5f6fd3793 100644 --- a/packages/google_maps_flutter/google_maps_flutter/example/android/app/src/test/java/io/flutter/plugins/googlemaps/GoogleMapControllerTest.java +++ b/packages/google_maps_flutter/google_maps_flutter/example/android/app/src/test/java/io/flutter/plugins/googlemaps/GoogleMapControllerTest.java @@ -9,10 +9,8 @@ import androidx.test.core.app.ApplicationProvider; import com.google.android.gms.maps.GoogleMap; import io.flutter.plugin.common.BinaryMessenger; -import io.flutter.view.FlutterMain; import java.util.concurrent.atomic.AtomicInteger; import org.junit.Before; -import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; @@ -30,11 +28,6 @@ public class GoogleMapControllerTest { @Mock GoogleMap mockGoogleMap; @Mock LifecycleOwner lifecycleOwner; - @BeforeClass() - public static void BeforeClass() { - FlutterMain.setIsRunningInRobolectricTest(true); - } - @Before public void before() { MockitoAnnotations.initMocks(this); From ae806dec62fe2f58923dbf9ebe186e272b4ab164 Mon Sep 17 00:00:00 2001 From: raees Date: Tue, 1 Sep 2020 20:33:15 +0300 Subject: [PATCH 068/233] [google_maps_flutter] Geodesic Polyline support in iOS (#2964) --- .../google_maps_flutter/google_maps_flutter/CHANGELOG.md | 6 +++++- .../ios/Classes/GoogleMapPolylineController.h | 1 + .../ios/Classes/GoogleMapPolylineController.m | 9 +++++++++ .../google_maps_flutter/google_maps_flutter/pubspec.yaml | 2 +- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md index 02b257d6b168..0476f8c9a744 100644 --- a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.5.31 + +* Geodesic Polyline support for iOS + ## 0.5.30 * Add a `dispose` method to the controller to let the native side know that we're done with said controller. @@ -412,4 +416,4 @@ ## 0.0.2 -* Initial developers preview release. \ No newline at end of file +* Initial developers preview release. diff --git a/packages/google_maps_flutter/google_maps_flutter/ios/Classes/GoogleMapPolylineController.h b/packages/google_maps_flutter/google_maps_flutter/ios/Classes/GoogleMapPolylineController.h index a5977bf75e1e..d1e10ace462e 100644 --- a/packages/google_maps_flutter/google_maps_flutter/ios/Classes/GoogleMapPolylineController.h +++ b/packages/google_maps_flutter/google_maps_flutter/ios/Classes/GoogleMapPolylineController.h @@ -13,6 +13,7 @@ - (void)setStrokeWidth:(CGFloat)width; - (void)setPoints:(NSArray*)points; - (void)setZIndex:(int)zIndex; +- (void)setGeodesic:(BOOL)isGeodesic; @end // Defines polyline controllable by Flutter. diff --git a/packages/google_maps_flutter/google_maps_flutter/ios/Classes/GoogleMapPolylineController.m b/packages/google_maps_flutter/google_maps_flutter/ios/Classes/GoogleMapPolylineController.m index b701a5f3a6b5..9bb57ed897ac 100644 --- a/packages/google_maps_flutter/google_maps_flutter/ios/Classes/GoogleMapPolylineController.m +++ b/packages/google_maps_flutter/google_maps_flutter/ios/Classes/GoogleMapPolylineController.m @@ -52,6 +52,10 @@ - (void)setColor:(UIColor*)color { - (void)setStrokeWidth:(CGFloat)width { _polyline.strokeWidth = width; } + +- (void)setGeodesic:(BOOL)isGeodesic { + _polyline.geodesic = isGeodesic; +} @end static int ToInt(NSNumber* data) { return [FLTGoogleMapJsonConversions toInt:data]; } @@ -95,6 +99,11 @@ static void InterpretPolylineOptions(NSDictionary* data, id Date: Tue, 1 Sep 2020 23:57:56 +0530 Subject: [PATCH 069/233] [battery] Port battery to use platform interface (#2980) --- packages/battery/battery/CHANGELOG.md | 4 + packages/battery/battery/lib/battery.dart | 67 ++------------- packages/battery/battery/pubspec.yaml | 6 +- .../battery/battery/test/battery_test.dart | 82 +++++++------------ 4 files changed, 43 insertions(+), 116 deletions(-) diff --git a/packages/battery/battery/CHANGELOG.md b/packages/battery/battery/CHANGELOG.md index 2cf470d17e00..a36ee67172bb 100644 --- a/packages/battery/battery/CHANGELOG.md +++ b/packages/battery/battery/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.5 + +* Ported to use platform interface. + ## 1.0.4+1 * Moved everything from battery to battery/battery diff --git a/packages/battery/battery/lib/battery.dart b/packages/battery/battery/lib/battery.dart index 091b001f749f..e3943e49599a 100644 --- a/packages/battery/battery/lib/battery.dart +++ b/packages/battery/battery/lib/battery.dart @@ -4,72 +4,19 @@ import 'dart:async'; -import 'package:flutter/services.dart'; -import 'package:meta/meta.dart' show visibleForTesting; +import 'package:battery_platform_interface/battery_platform_interface.dart'; -/// Indicates the current battery state. -enum BatteryState { - /// The battery is completely full of energy. - full, - - /// The battery is currently storing energy. - charging, - - /// The battery is currently losing energy. - discharging -} +export 'package:battery_platform_interface/battery_platform_interface.dart' + show BatteryState; /// API for accessing information about the battery of the device the Flutter /// app is currently running on. class Battery { - /// Initializes the plugin and starts listening for potential platform events. - factory Battery() { - if (_instance == null) { - final MethodChannel methodChannel = - const MethodChannel('plugins.flutter.io/battery'); - final EventChannel eventChannel = - const EventChannel('plugins.flutter.io/charging'); - _instance = Battery.private(methodChannel, eventChannel); - } - return _instance; - } - - /// This constructor is only used for testing and shouldn't be accessed by - /// users of the plugin. It may break or change at any time. - @visibleForTesting - Battery.private(this._methodChannel, this._eventChannel); - - static Battery _instance; - - final MethodChannel _methodChannel; - final EventChannel _eventChannel; - Stream _onBatteryStateChanged; - /// Returns the current battery level in percent. - Future get batteryLevel => _methodChannel - .invokeMethod('getBatteryLevel') - .then((dynamic result) => result); + Future get batteryLevel async => + await BatteryPlatform.instance.batteryLevel(); /// Fires whenever the battery state changes. - Stream get onBatteryStateChanged { - if (_onBatteryStateChanged == null) { - _onBatteryStateChanged = _eventChannel - .receiveBroadcastStream() - .map((dynamic event) => _parseBatteryState(event)); - } - return _onBatteryStateChanged; - } -} - -BatteryState _parseBatteryState(String state) { - switch (state) { - case 'full': - return BatteryState.full; - case 'charging': - return BatteryState.charging; - case 'discharging': - return BatteryState.discharging; - default: - throw ArgumentError('$state is not a valid BatteryState.'); - } + Stream get onBatteryStateChanged => + BatteryPlatform.instance.onBatteryStateChanged(); } diff --git a/packages/battery/battery/pubspec.yaml b/packages/battery/battery/pubspec.yaml index 5e0549a07f97..7cd1b761f0f8 100644 --- a/packages/battery/battery/pubspec.yaml +++ b/packages/battery/battery/pubspec.yaml @@ -2,7 +2,7 @@ name: battery description: Flutter plugin for accessing information about the battery state (full, charging, discharging) on Android and iOS. homepage: https://github.com/flutter/plugins/tree/master/packages/battery/battery -version: 1.0.4+1 +version: 1.0.5 flutter: plugin: @@ -17,13 +17,15 @@ dependencies: flutter: sdk: flutter meta: ^1.0.5 + battery_platform_interface: ^1.0.0 dev_dependencies: async: ^2.0.8 test: ^1.3.0 - mockito: 3.0.0 + mockito: ^4.1.1 flutter_test: sdk: flutter + plugin_platform_interface: ^1.0.0 integration_test: path: ../../integration_test pedantic: ^1.8.0 diff --git a/packages/battery/battery/test/battery_test.dart b/packages/battery/battery/test/battery_test.dart index 93d69604c83a..5c789207d7eb 100644 --- a/packages/battery/battery/test/battery_test.dart +++ b/packages/battery/battery/test/battery_test.dart @@ -4,68 +4,42 @@ import 'dart:async'; -import 'package:async/async.dart'; -import 'package:flutter/services.dart'; +import 'package:battery_platform_interface/battery_platform_interface.dart'; +import 'package:plugin_platform_interface/plugin_platform_interface.dart'; import 'package:test/test.dart'; import 'package:battery/battery.dart'; import 'package:mockito/mockito.dart'; void main() { - MockMethodChannel methodChannel; - MockEventChannel eventChannel; - Battery battery; - - setUp(() { - methodChannel = MockMethodChannel(); - eventChannel = MockEventChannel(); - battery = Battery.private(methodChannel, eventChannel); - }); - - test('batteryLevel', () async { - when(methodChannel.invokeMethod('getBatteryLevel')) - .thenAnswer((Invocation invoke) => Future.value(42)); - expect(await battery.batteryLevel, 42); - }); - - group('battery state', () { - StreamController controller; - - setUp(() { - controller = StreamController(); - when(eventChannel.receiveBroadcastStream()) - .thenAnswer((Invocation invoke) => controller.stream); - }); - - tearDown(() { - controller.close(); + group('battery', () { + Battery battery; + MockBatteryPlatform fakePlatform; + setUp(() async { + fakePlatform = MockBatteryPlatform(); + BatteryPlatform.instance = fakePlatform; + battery = Battery(); }); - - test('calls receiveBroadcastStream once', () { - battery.onBatteryStateChanged; - battery.onBatteryStateChanged; - battery.onBatteryStateChanged; - verify(eventChannel.receiveBroadcastStream()).called(1); + test('batteryLevel', () async { + int result = await battery.batteryLevel; + expect(result, 42); }); - - test('receive values', () async { - final StreamQueue queue = - StreamQueue(battery.onBatteryStateChanged); - - controller.add("full"); - expect(await queue.next, BatteryState.full); - - controller.add("discharging"); - expect(await queue.next, BatteryState.discharging); - - controller.add("charging"); - expect(await queue.next, BatteryState.charging); - - controller.add("illegal"); - expect(queue.next, throwsArgumentError); + test('onBatteryStateChanged', () async { + BatteryState result = await battery.onBatteryStateChanged.first; + expect(result, BatteryState.full); }); }); } -class MockMethodChannel extends Mock implements MethodChannel {} - -class MockEventChannel extends Mock implements EventChannel {} +class MockBatteryPlatform extends Mock + with MockPlatformInterfaceMixin + implements BatteryPlatform { + Future batteryLevel() async { + return 42; + } + + Stream onBatteryStateChanged() { + StreamController result = StreamController(); + result.add(BatteryState.full); + return result.stream; + } +} From 7027e9decf11f8f9b83af3099b006494c475ab8e Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Tue, 1 Sep 2020 16:36:02 -0400 Subject: [PATCH 070/233] Support Windows in incremental_build.sh (#2989) Allow running incremental_build.sh on Windows under Git Bash. Longer term this script should be re-written in Dart (#64025), but for now this allows running the script on Windows bots. --- script/incremental_build.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/script/incremental_build.sh b/script/incremental_build.sh index 5351926b0051..30c166b4c666 100755 --- a/script/incremental_build.sh +++ b/script/incremental_build.sh @@ -6,6 +6,12 @@ readonly REPO_DIR="$(dirname "$SCRIPT_DIR")" source "$SCRIPT_DIR/common.sh" +if [ "$(expr substr $(uname -s) 1 5)" == "MINGW" ]; then + PUB=pub.bat +else + PUB=pub +fi + # Plugins that deliberately use their own analysis_options.yaml. # # This list should only be deleted from, never added to. This only exists @@ -37,7 +43,7 @@ PLUGIN_SHARDING=($PLUGIN_SHARDING) if [[ "${BRANCH_NAME}" == "master" ]]; then echo "Running for all packages" - (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" ${PLUGIN_SHARDING[@]}) + (cd "$REPO_DIR" && $PUB global run flutter_plugin_tools "${ACTIONS[@]}" ${PLUGIN_SHARDING[@]}) else # Sets CHANGED_PACKAGES check_changed_packages @@ -45,11 +51,11 @@ else if [[ "$CHANGED_PACKAGES" == "" ]]; then echo "No changes detected in packages." echo "Running for all packages" - (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" ${PLUGIN_SHARDING[@]}) + (cd "$REPO_DIR" && $PUB global run flutter_plugin_tools "${ACTIONS[@]}" ${PLUGIN_SHARDING[@]}) else echo running "${ACTIONS[@]}" - (cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" --plugins="$CHANGED_PACKAGES" ${PLUGIN_SHARDING[@]}) + (cd "$REPO_DIR" && $PUB global run flutter_plugin_tools "${ACTIONS[@]}" --plugins="$CHANGED_PACKAGES" ${PLUGIN_SHARDING[@]}) echo "Running version check for changed packages" - (cd "$REPO_DIR" && pub global run flutter_plugin_tools version-check --base_sha="$(get_branch_base_sha)") + (cd "$REPO_DIR" && $PUB global run flutter_plugin_tools version-check --base_sha="$(get_branch_base_sha)") fi fi From ee4b263c975640bb837e531cdb0f13180587cf3d Mon Sep 17 00:00:00 2001 From: keyonghan <54558023+keyonghan@users.noreply.github.com> Date: Thu, 3 Sep 2020 09:56:58 -0700 Subject: [PATCH 071/233] Add LUCI try builders json config file (#2993) * add json config * mv to .ci --- .ci/dev/README.md | 19 +++++++++++++++++++ .ci/dev/try_builders.json | 9 +++++++++ 2 files changed, 28 insertions(+) create mode 100644 .ci/dev/README.md create mode 100644 .ci/dev/try_builders.json diff --git a/.ci/dev/README.md b/.ci/dev/README.md new file mode 100644 index 000000000000..d266afbf2687 --- /dev/null +++ b/.ci/dev/README.md @@ -0,0 +1,19 @@ +This directory contains resources that the Flutter team uses during +the development of plugins. + +## Luci builder file +`try_builders.json` contains the supported luci try builders +for plugins. It follows format: +```json +{ + "builders":[ + { + "name":"yyy", + "repo":"plugins", + "enabled":true + } + ] +} +``` +This file will be mainly used in [`flutter/cocoon`](https://github.com/flutter/cocoon) +to trigger/update pre-submit luci tasks. diff --git a/.ci/dev/try_builders.json b/.ci/dev/try_builders.json new file mode 100644 index 000000000000..6334a3d64fa4 --- /dev/null +++ b/.ci/dev/try_builders.json @@ -0,0 +1,9 @@ +{ + "builders":[ + { + "name":"Windows Plugins", + "repo":"plugins", + "enabled":true + } + ] +} From 2d9472765d4078f3e99cdbd7bb06c6912f8c2636 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Thu, 3 Sep 2020 14:13:34 -0400 Subject: [PATCH 072/233] Standardize LICENSE body text formatting (#2992) This cleans up a number of unnecessary differences in the LICENSE files: - Removes C++ comments ("// ") from the beginnings of all the lines in license files that had them. - Standardizes on having a blank line after the copyright line. - Standardizes on having the final newline in the file. - Standardizes on the indentation of the bulleted conditions. - Standardizes on the locations of line breaks (re-wrapping the text) This makes the license bodies--not including the copyright line--in almost all files the same, and matches the exact formatting already used in flutter/flutter and flutter/engine. The only remaining non-copyright-line differences should now be: - packages/image_picker/image_picker/LICENSE has an extra license - packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/LICENSE use "Google LLC" rather than "Google Inc." in the third condition. --- LICENSE | 44 ++++++++-------- packages/android_alarm_manager/LICENSE | 52 +++++++++---------- packages/android_intent/LICENSE | 52 +++++++++---------- packages/battery/battery/LICENSE | 52 +++++++++---------- .../battery_platform_interface/LICENSE | 52 +++++++++---------- packages/camera/LICENSE | 52 +++++++++---------- packages/connectivity/connectivity/LICENSE | 52 +++++++++---------- .../connectivity/connectivity_for_web/LICENSE | 27 +++++----- .../connectivity/connectivity_macos/LICENSE | 52 +++++++++---------- .../connectivity_platform_interface/LICENSE | 52 +++++++++---------- packages/device_info/device_info/LICENSE | 52 +++++++++---------- .../device_info_platform_interface/LICENSE | 52 +++++++++---------- packages/espresso/LICENSE | 52 +++++++++---------- .../flutter_plugin_android_lifecycle/LICENSE | 52 +++++++++---------- .../google_maps_flutter/LICENSE | 52 +++++++++---------- .../LICENSE | 52 +++++++++---------- .../google_maps_flutter_web/LICENSE | 27 +++++----- .../LICENSE | 44 ++++++++-------- .../google_sign_in/google_sign_in/LICENSE | 27 +++++----- .../google_sign_in_platform_interface/LICENSE | 52 +++++++++---------- .../google_sign_in/google_sign_in_web/LICENSE | 27 +++++----- packages/image_picker/image_picker/LICENSE | 29 +++++------ .../image_picker/image_picker_for_web/LICENSE | 52 +++++++++---------- .../image_picker_platform_interface/LICENSE | 52 +++++++++---------- packages/in_app_purchase/LICENSE | 52 +++++++++---------- packages/integration_test/LICENSE | 52 +++++++++---------- .../integration_test_macos/LICENSE | 52 +++++++++---------- packages/ios_platform_images/LICENSE | 44 ++++++++-------- packages/local_auth/LICENSE | 52 +++++++++---------- packages/package_info/LICENSE | 52 +++++++++---------- packages/path_provider/path_provider/LICENSE | 27 +++++----- .../path_provider/path_provider_linux/LICENSE | 52 +++++++++---------- .../path_provider/path_provider_macos/LICENSE | 44 ++++++++-------- .../path_provider_platform_interface/LICENSE | 52 +++++++++---------- packages/plugin_platform_interface/LICENSE | 52 +++++++++---------- packages/quick_actions/LICENSE | 52 +++++++++---------- packages/sensors/LICENSE | 52 +++++++++---------- packages/share/LICENSE | 52 +++++++++---------- .../shared_preferences/LICENSE | 52 +++++++++---------- .../shared_preferences_linux/LICENSE | 52 +++++++++---------- .../shared_preferences_macos/LICENSE | 27 +++++----- .../LICENSE | 52 +++++++++---------- .../shared_preferences_web/LICENSE | 52 +++++++++---------- packages/url_launcher/url_launcher/LICENSE | 52 +++++++++---------- .../url_launcher/url_launcher_linux/LICENSE | 52 +++++++++---------- .../url_launcher/url_launcher_macos/LICENSE | 52 +++++++++---------- .../url_launcher_platform_interface/LICENSE | 52 +++++++++---------- .../url_launcher/url_launcher_web/LICENSE | 52 +++++++++---------- packages/video_player/video_player/LICENSE | 52 +++++++++---------- .../video_player_platform_interface/LICENSE | 52 +++++++++---------- .../video_player/video_player_web/LICENSE | 52 +++++++++---------- packages/webview_flutter/LICENSE | 52 +++++++++---------- 52 files changed, 1201 insertions(+), 1298 deletions(-) mode change 100755 => 100644 packages/google_sign_in/google_sign_in/LICENSE mode change 100755 => 100644 packages/image_picker/image_picker/LICENSE diff --git a/LICENSE b/LICENSE index 7b995420294b..a6d6c0749818 100644 --- a/LICENSE +++ b/LICENSE @@ -1,27 +1,25 @@ Copyright 2017 The Chromium Authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/android_alarm_manager/LICENSE b/packages/android_alarm_manager/LICENSE index c89293372cf3..a6d6c0749818 100644 --- a/packages/android_alarm_manager/LICENSE +++ b/packages/android_alarm_manager/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2017 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/android_intent/LICENSE b/packages/android_intent/LICENSE index c89293372cf3..a6d6c0749818 100644 --- a/packages/android_intent/LICENSE +++ b/packages/android_intent/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2017 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/battery/battery/LICENSE b/packages/battery/battery/LICENSE index c89293372cf3..a6d6c0749818 100644 --- a/packages/battery/battery/LICENSE +++ b/packages/battery/battery/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2017 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/battery/battery_platform_interface/LICENSE b/packages/battery/battery_platform_interface/LICENSE index c89293372cf3..a6d6c0749818 100644 --- a/packages/battery/battery_platform_interface/LICENSE +++ b/packages/battery/battery_platform_interface/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2017 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/camera/LICENSE b/packages/camera/LICENSE index c89293372cf3..a6d6c0749818 100644 --- a/packages/camera/LICENSE +++ b/packages/camera/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2017 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/connectivity/connectivity/LICENSE b/packages/connectivity/connectivity/LICENSE index c89293372cf3..a6d6c0749818 100644 --- a/packages/connectivity/connectivity/LICENSE +++ b/packages/connectivity/connectivity/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2017 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/connectivity/connectivity_for_web/LICENSE b/packages/connectivity/connectivity_for_web/LICENSE index 4da9688730d1..26351460d9de 100644 --- a/packages/connectivity/connectivity_for_web/LICENSE +++ b/packages/connectivity/connectivity_for_web/LICENSE @@ -1,7 +1,7 @@ Copyright 2016, the Flutter project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. @@ -13,14 +13,13 @@ met: contributors may be used to endorse or promote products derived from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/connectivity/connectivity_macos/LICENSE b/packages/connectivity/connectivity_macos/LICENSE index 0c382ce171cc..507569823f1b 100644 --- a/packages/connectivity/connectivity_macos/LICENSE +++ b/packages/connectivity/connectivity_macos/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2019 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/connectivity/connectivity_platform_interface/LICENSE b/packages/connectivity/connectivity_platform_interface/LICENSE index 0c91662b3f2f..d7412e0a1e0c 100644 --- a/packages/connectivity/connectivity_platform_interface/LICENSE +++ b/packages/connectivity/connectivity_platform_interface/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2020 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/device_info/device_info/LICENSE b/packages/device_info/device_info/LICENSE index c89293372cf3..a6d6c0749818 100644 --- a/packages/device_info/device_info/LICENSE +++ b/packages/device_info/device_info/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2017 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/device_info/device_info_platform_interface/LICENSE b/packages/device_info/device_info_platform_interface/LICENSE index c89293372cf3..a6d6c0749818 100644 --- a/packages/device_info/device_info_platform_interface/LICENSE +++ b/packages/device_info/device_info_platform_interface/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2017 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/espresso/LICENSE b/packages/espresso/LICENSE index 0c382ce171cc..507569823f1b 100644 --- a/packages/espresso/LICENSE +++ b/packages/espresso/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2019 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/flutter_plugin_android_lifecycle/LICENSE b/packages/flutter_plugin_android_lifecycle/LICENSE index 0c382ce171cc..507569823f1b 100644 --- a/packages/flutter_plugin_android_lifecycle/LICENSE +++ b/packages/flutter_plugin_android_lifecycle/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2019 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/google_maps_flutter/google_maps_flutter/LICENSE b/packages/google_maps_flutter/google_maps_flutter/LICENSE index 8940a4be1b58..ad33cf3c3ed1 100644 --- a/packages/google_maps_flutter/google_maps_flutter/LICENSE +++ b/packages/google_maps_flutter/google_maps_flutter/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2018 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/LICENSE b/packages/google_maps_flutter/google_maps_flutter_platform_interface/LICENSE index 8940a4be1b58..ad33cf3c3ed1 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/LICENSE +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2018 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/google_maps_flutter/google_maps_flutter_web/LICENSE b/packages/google_maps_flutter/google_maps_flutter_web/LICENSE index 282a0f51aa4a..447867e0637e 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/LICENSE +++ b/packages/google_maps_flutter/google_maps_flutter_web/LICENSE @@ -1,7 +1,7 @@ Copyright 2017, the Flutter project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. @@ -13,14 +13,13 @@ met: contributors may be used to endorse or promote products derived from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/LICENSE b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/LICENSE index 14fbc7c48e1c..b707cc8221fb 100644 --- a/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/LICENSE +++ b/packages/google_sign_in/extension_google_sign_in_as_googleapis_auth/LICENSE @@ -1,27 +1,25 @@ Copyright 2020 The Flutter Authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google LLC nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/google_sign_in/google_sign_in/LICENSE b/packages/google_sign_in/google_sign_in/LICENSE old mode 100755 new mode 100644 index 4da9688730d1..26351460d9de --- a/packages/google_sign_in/google_sign_in/LICENSE +++ b/packages/google_sign_in/google_sign_in/LICENSE @@ -1,7 +1,7 @@ Copyright 2016, the Flutter project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. @@ -13,14 +13,13 @@ met: contributors may be used to endorse or promote products derived from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/google_sign_in/google_sign_in_platform_interface/LICENSE b/packages/google_sign_in/google_sign_in_platform_interface/LICENSE index c89293372cf3..a6d6c0749818 100644 --- a/packages/google_sign_in/google_sign_in_platform_interface/LICENSE +++ b/packages/google_sign_in/google_sign_in_platform_interface/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2017 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/google_sign_in/google_sign_in_web/LICENSE b/packages/google_sign_in/google_sign_in_web/LICENSE index 4da9688730d1..26351460d9de 100644 --- a/packages/google_sign_in/google_sign_in_web/LICENSE +++ b/packages/google_sign_in/google_sign_in_web/LICENSE @@ -1,7 +1,7 @@ Copyright 2016, the Flutter project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. @@ -13,14 +13,13 @@ met: contributors may be used to endorse or promote products derived from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/image_picker/image_picker/LICENSE b/packages/image_picker/image_picker/LICENSE old mode 100755 new mode 100644 index 63b955309caf..c4e4de2acfcd --- a/packages/image_picker/image_picker/LICENSE +++ b/packages/image_picker/image_picker/LICENSE @@ -1,9 +1,9 @@ image_picker Copyright 2017, the Flutter project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. @@ -15,17 +15,16 @@ met: contributors may be used to endorse or promote products derived from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- aFileChooser @@ -229,4 +228,4 @@ aFileChooser distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file + limitations under the License. diff --git a/packages/image_picker/image_picker_for_web/LICENSE b/packages/image_picker/image_picker_for_web/LICENSE index 0c382ce171cc..507569823f1b 100644 --- a/packages/image_picker/image_picker_for_web/LICENSE +++ b/packages/image_picker/image_picker_for_web/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2019 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/image_picker/image_picker_platform_interface/LICENSE b/packages/image_picker/image_picker_platform_interface/LICENSE index c89293372cf3..a6d6c0749818 100644 --- a/packages/image_picker/image_picker_platform_interface/LICENSE +++ b/packages/image_picker/image_picker_platform_interface/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2017 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/in_app_purchase/LICENSE b/packages/in_app_purchase/LICENSE index 8940a4be1b58..ad33cf3c3ed1 100644 --- a/packages/in_app_purchase/LICENSE +++ b/packages/in_app_purchase/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2018 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/integration_test/LICENSE b/packages/integration_test/LICENSE index 0c382ce171cc..507569823f1b 100644 --- a/packages/integration_test/LICENSE +++ b/packages/integration_test/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2019 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/integration_test/integration_test_macos/LICENSE b/packages/integration_test/integration_test_macos/LICENSE index 0c382ce171cc..507569823f1b 100644 --- a/packages/integration_test/integration_test_macos/LICENSE +++ b/packages/integration_test/integration_test_macos/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2019 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/ios_platform_images/LICENSE b/packages/ios_platform_images/LICENSE index 18c6ba2786d6..a6d6c0749818 100644 --- a/packages/ios_platform_images/LICENSE +++ b/packages/ios_platform_images/LICENSE @@ -1,27 +1,25 @@ Copyright 2017 The Chromium Authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/local_auth/LICENSE b/packages/local_auth/LICENSE index c89293372cf3..a6d6c0749818 100644 --- a/packages/local_auth/LICENSE +++ b/packages/local_auth/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2017 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/package_info/LICENSE b/packages/package_info/LICENSE index c89293372cf3..a6d6c0749818 100644 --- a/packages/package_info/LICENSE +++ b/packages/package_info/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2017 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/path_provider/path_provider/LICENSE b/packages/path_provider/path_provider/LICENSE index 566f5b5e7c78..447867e0637e 100644 --- a/packages/path_provider/path_provider/LICENSE +++ b/packages/path_provider/path_provider/LICENSE @@ -1,7 +1,7 @@ Copyright 2017, the Flutter project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. @@ -13,14 +13,13 @@ met: contributors may be used to endorse or promote products derived from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/path_provider/path_provider_linux/LICENSE b/packages/path_provider/path_provider_linux/LICENSE index 9dfb0c8a77b0..d7412e0a1e0c 100644 --- a/packages/path_provider/path_provider_linux/LICENSE +++ b/packages/path_provider/path_provider_linux/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file +Copyright 2020 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/path_provider/path_provider_macos/LICENSE b/packages/path_provider/path_provider_macos/LICENSE index 7b995420294b..a6d6c0749818 100644 --- a/packages/path_provider/path_provider_macos/LICENSE +++ b/packages/path_provider/path_provider_macos/LICENSE @@ -1,27 +1,25 @@ Copyright 2017 The Chromium Authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/path_provider/path_provider_platform_interface/LICENSE b/packages/path_provider/path_provider_platform_interface/LICENSE index 0c91662b3f2f..d7412e0a1e0c 100644 --- a/packages/path_provider/path_provider_platform_interface/LICENSE +++ b/packages/path_provider/path_provider_platform_interface/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2020 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/plugin_platform_interface/LICENSE b/packages/plugin_platform_interface/LICENSE index 03118dc2b39b..507569823f1b 100644 --- a/packages/plugin_platform_interface/LICENSE +++ b/packages/plugin_platform_interface/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file +Copyright 2019 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/quick_actions/LICENSE b/packages/quick_actions/LICENSE index c89293372cf3..a6d6c0749818 100644 --- a/packages/quick_actions/LICENSE +++ b/packages/quick_actions/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2017 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/sensors/LICENSE b/packages/sensors/LICENSE index c89293372cf3..a6d6c0749818 100644 --- a/packages/sensors/LICENSE +++ b/packages/sensors/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2017 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/share/LICENSE b/packages/share/LICENSE index 176a661f7e48..447867e0637e 100644 --- a/packages/share/LICENSE +++ b/packages/share/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2017, the Flutter project authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2017, the Flutter project authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/shared_preferences/shared_preferences/LICENSE b/packages/shared_preferences/shared_preferences/LICENSE index 000b4618d2bd..a6d6c0749818 100644 --- a/packages/shared_preferences/shared_preferences/LICENSE +++ b/packages/shared_preferences/shared_preferences/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file +Copyright 2017 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/shared_preferences/shared_preferences_linux/LICENSE b/packages/shared_preferences/shared_preferences_linux/LICENSE index 0c91662b3f2f..d7412e0a1e0c 100644 --- a/packages/shared_preferences/shared_preferences_linux/LICENSE +++ b/packages/shared_preferences/shared_preferences_linux/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2020 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/shared_preferences/shared_preferences_macos/LICENSE b/packages/shared_preferences/shared_preferences_macos/LICENSE index 566f5b5e7c78..447867e0637e 100644 --- a/packages/shared_preferences/shared_preferences_macos/LICENSE +++ b/packages/shared_preferences/shared_preferences_macos/LICENSE @@ -1,7 +1,7 @@ Copyright 2017, the Flutter project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. @@ -13,14 +13,13 @@ met: contributors may be used to endorse or promote products derived from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/shared_preferences/shared_preferences_platform_interface/LICENSE b/packages/shared_preferences/shared_preferences_platform_interface/LICENSE index 000b4618d2bd..a6d6c0749818 100644 --- a/packages/shared_preferences/shared_preferences_platform_interface/LICENSE +++ b/packages/shared_preferences/shared_preferences_platform_interface/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file +Copyright 2017 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/shared_preferences/shared_preferences_web/LICENSE b/packages/shared_preferences/shared_preferences_web/LICENSE index 0c382ce171cc..507569823f1b 100644 --- a/packages/shared_preferences/shared_preferences_web/LICENSE +++ b/packages/shared_preferences/shared_preferences_web/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2019 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/url_launcher/url_launcher/LICENSE b/packages/url_launcher/url_launcher/LICENSE index 000b4618d2bd..a6d6c0749818 100644 --- a/packages/url_launcher/url_launcher/LICENSE +++ b/packages/url_launcher/url_launcher/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file +Copyright 2017 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/url_launcher/url_launcher_linux/LICENSE b/packages/url_launcher/url_launcher_linux/LICENSE index 0c91662b3f2f..d7412e0a1e0c 100644 --- a/packages/url_launcher/url_launcher_linux/LICENSE +++ b/packages/url_launcher/url_launcher_linux/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2020 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/url_launcher/url_launcher_macos/LICENSE b/packages/url_launcher/url_launcher_macos/LICENSE index 0c382ce171cc..507569823f1b 100644 --- a/packages/url_launcher/url_launcher_macos/LICENSE +++ b/packages/url_launcher/url_launcher_macos/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2019 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/url_launcher/url_launcher_platform_interface/LICENSE b/packages/url_launcher/url_launcher_platform_interface/LICENSE index c89293372cf3..a6d6c0749818 100644 --- a/packages/url_launcher/url_launcher_platform_interface/LICENSE +++ b/packages/url_launcher/url_launcher_platform_interface/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2017 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/url_launcher/url_launcher_web/LICENSE b/packages/url_launcher/url_launcher_web/LICENSE index 0c382ce171cc..507569823f1b 100644 --- a/packages/url_launcher/url_launcher_web/LICENSE +++ b/packages/url_launcher/url_launcher_web/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2019 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/video_player/video_player/LICENSE b/packages/video_player/video_player/LICENSE index c89293372cf3..a6d6c0749818 100644 --- a/packages/video_player/video_player/LICENSE +++ b/packages/video_player/video_player/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2017 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/video_player/video_player_platform_interface/LICENSE b/packages/video_player/video_player_platform_interface/LICENSE index c89293372cf3..a6d6c0749818 100644 --- a/packages/video_player/video_player_platform_interface/LICENSE +++ b/packages/video_player/video_player_platform_interface/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2017 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/video_player/video_player_web/LICENSE b/packages/video_player/video_player_web/LICENSE index c89293372cf3..a6d6c0749818 100644 --- a/packages/video_player/video_player_web/LICENSE +++ b/packages/video_player/video_player_web/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2017 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/webview_flutter/LICENSE b/packages/webview_flutter/LICENSE index 8940a4be1b58..ad33cf3c3ed1 100644 --- a/packages/webview_flutter/LICENSE +++ b/packages/webview_flutter/LICENSE @@ -1,27 +1,25 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright 2018 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. From 5d869c49b34a0fa71e1ac69fbe431408a15d4671 Mon Sep 17 00:00:00 2001 From: Sebastian Roth Date: Fri, 4 Sep 2020 09:17:40 +0100 Subject: [PATCH 073/233] [flutter_plugin_android_lifecycle] add no-op v2 plugin (#2977) * Implement FlutterPlugin interface on the no-op plugin --- .../flutter_plugin_android_lifecycle/CHANGELOG.md | 4 ++++ .../FlutterAndroidLifecyclePlugin.java | 14 +++++++++++++- .../flutter_plugin_android_lifecycle/pubspec.yaml | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/packages/flutter_plugin_android_lifecycle/CHANGELOG.md b/packages/flutter_plugin_android_lifecycle/CHANGELOG.md index 60ac1c7de347..cf37870e2a14 100644 --- a/packages/flutter_plugin_android_lifecycle/CHANGELOG.md +++ b/packages/flutter_plugin_android_lifecycle/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.9 + +* Let the no-op plugin implement the `FlutterPlugin` interface. + ## 1.0.8 * Post-v2 Android embedding cleanup. diff --git a/packages/flutter_plugin_android_lifecycle/android/src/main/java/io/flutter/plugins/flutter_plugin_android_lifecycle/FlutterAndroidLifecyclePlugin.java b/packages/flutter_plugin_android_lifecycle/android/src/main/java/io/flutter/plugins/flutter_plugin_android_lifecycle/FlutterAndroidLifecyclePlugin.java index 7abf1d67667c..cb346f7c20fe 100644 --- a/packages/flutter_plugin_android_lifecycle/android/src/main/java/io/flutter/plugins/flutter_plugin_android_lifecycle/FlutterAndroidLifecyclePlugin.java +++ b/packages/flutter_plugin_android_lifecycle/android/src/main/java/io/flutter/plugins/flutter_plugin_android_lifecycle/FlutterAndroidLifecyclePlugin.java @@ -4,6 +4,8 @@ // package io.flutter.plugins.flutter_plugin_android_lifecycle; +import androidx.annotation.NonNull; +import io.flutter.embedding.engine.plugins.FlutterPlugin; import io.flutter.plugin.common.PluginRegistry.Registrar; /** @@ -12,8 +14,18 @@ * *

DO NOT USE THIS CLASS. */ -public class FlutterAndroidLifecyclePlugin { +public class FlutterAndroidLifecyclePlugin implements FlutterPlugin { public static void registerWith(Registrar registrar) { // no-op } + + @Override + public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) { + // no-op + } + + @Override + public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) { + // no-op + } } diff --git a/packages/flutter_plugin_android_lifecycle/pubspec.yaml b/packages/flutter_plugin_android_lifecycle/pubspec.yaml index eced211c889d..ec3aa9812ebf 100644 --- a/packages/flutter_plugin_android_lifecycle/pubspec.yaml +++ b/packages/flutter_plugin_android_lifecycle/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_plugin_android_lifecycle description: Flutter plugin for accessing an Android Lifecycle within other plugins. -version: 1.0.8 +version: 1.0.9 homepage: https://github.com/flutter/plugins/tree/master/packages/flutter_plugin_android_lifecycle environment: From 00d85b068715254992b1c940f2c8697791bf1507 Mon Sep 17 00:00:00 2001 From: Maurits van Beusekom Date: Tue, 8 Sep 2020 21:20:58 +0200 Subject: [PATCH 074/233] [url_launcher] Suppress deprecation warning in WebViewActivity (#3008) The url_launcher overrides the deprecated shouldOverrideUrlLoading(WebView view, String url) method to be backwards compatible with versions before Android API 24. This however currently displays the warning "WebViewActivity.java uses or overrides a deprecated API." when building for Android. This is causing some problems for developers who treat these warnings as errors as part of their build configuration. This PR addresses this issue by annotating the shouldOverrideUrlLoading(WebView view, String url) method with the @SuppressWarnings("deprecation") attribute. This PR also adds the @RequiresApi(Build.VERSION_CODES.N) annotation to the shouldOverrideUrlLoading(WebView view, WebResourceRequest request) method, which gives the Android/ Java tooling an indication this method should only by used from API 24 and higher. --- packages/url_launcher/url_launcher/CHANGELOG.md | 4 ++++ .../io/flutter/plugins/urllauncher/WebViewActivity.java | 7 +++++++ packages/url_launcher/url_launcher/pubspec.yaml | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/url_launcher/url_launcher/CHANGELOG.md b/packages/url_launcher/url_launcher/CHANGELOG.md index d20eb9117440..e7e31acfd968 100644 --- a/packages/url_launcher/url_launcher/CHANGELOG.md +++ b/packages/url_launcher/url_launcher/CHANGELOG.md @@ -1,3 +1,7 @@ +## 5.5.3 + +* Suppress deprecation warning on the `shouldOverrideUrlLoading` method on Android. + ## 5.5.2 * Depend explicitly on the `platform_interface` package that adds the `webOnlyWindowName` parameter. diff --git a/packages/url_launcher/url_launcher/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java b/packages/url_launcher/url_launcher/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java index 52714790a25c..5624d75b22eb 100644 --- a/packages/url_launcher/url_launcher/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java +++ b/packages/url_launcher/url_launcher/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java @@ -12,6 +12,7 @@ import android.webkit.WebResourceRequest; import android.webkit.WebView; import android.webkit.WebViewClient; +import androidx.annotation.RequiresApi; import java.util.HashMap; import java.util.Map; @@ -38,6 +39,11 @@ public void onReceive(Context context, Intent intent) { private final WebViewClient webViewClient = new WebViewClient() { + /* + * This method is deprecated in API 24. Still overridden to support + * earlier Android versions. + */ + @SuppressWarnings("deprecation") @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { @@ -47,6 +53,7 @@ public boolean shouldOverrideUrlLoading(WebView view, String url) { return super.shouldOverrideUrlLoading(view, url); } + @RequiresApi(Build.VERSION_CODES.N) @Override public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { diff --git a/packages/url_launcher/url_launcher/pubspec.yaml b/packages/url_launcher/url_launcher/pubspec.yaml index 7fc824c74f9a..57048a2b3f98 100644 --- a/packages/url_launcher/url_launcher/pubspec.yaml +++ b/packages/url_launcher/url_launcher/pubspec.yaml @@ -2,7 +2,7 @@ name: url_launcher description: Flutter plugin for launching a URL on Android and iOS. Supports web, phone, SMS, and email schemes. homepage: https://github.com/flutter/plugins/tree/master/packages/url_launcher/url_launcher -version: 5.5.2 +version: 5.5.3 flutter: plugin: From 8cdb21d19ceeac4e4b887a686bf808f7501a2206 Mon Sep 17 00:00:00 2001 From: Yash Johri Date: Wed, 9 Sep 2020 23:51:29 +0530 Subject: [PATCH 075/233] [device_info_platform_interface] Typo in doc fixed (#3006) --- .../device_info_platform_interface/CHANGELOG.md | 4 ++++ .../lib/device_info_platform_interface.dart | 8 +++----- .../device_info_platform_interface/pubspec.yaml | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/device_info/device_info_platform_interface/CHANGELOG.md b/packages/device_info/device_info_platform_interface/CHANGELOG.md index 6fadda91b380..8a7eb6c46be3 100644 --- a/packages/device_info/device_info_platform_interface/CHANGELOG.md +++ b/packages/device_info/device_info_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.1 + +- Documentation typo fixed. + ## 1.0.0 - Initial open-source release. diff --git a/packages/device_info/device_info_platform_interface/lib/device_info_platform_interface.dart b/packages/device_info/device_info_platform_interface/lib/device_info_platform_interface.dart index 253d6d036123..808b7adf9dc7 100644 --- a/packages/device_info/device_info_platform_interface/lib/device_info_platform_interface.dart +++ b/packages/device_info/device_info_platform_interface/lib/device_info_platform_interface.dart @@ -22,7 +22,7 @@ export 'model/ios_device_info.dart'; /// platform implementations that `implements` this interface will be broken by newly added /// [DeviceInfoPlatform] methods. abstract class DeviceInfoPlatform extends PlatformInterface { - /// Constructs a UrlLauncherPlatform. + /// Constructs a DeviceInfoPlatform. DeviceInfoPlatform() : super(token: _token); static final Object _token = Object(); @@ -41,14 +41,12 @@ abstract class DeviceInfoPlatform extends PlatformInterface { _instance = instance; } - // Gets the Android device information. - // ignore: public_member_api_docs + /// Gets the Android device information. Future androidInfo() { throw UnimplementedError('androidInfo() has not been implemented.'); } - // Gets the iOS device information. - // ignore: public_member_api_docs + /// Gets the iOS device information. Future iosInfo() { throw UnimplementedError('iosInfo() has not been implemented.'); } diff --git a/packages/device_info/device_info_platform_interface/pubspec.yaml b/packages/device_info/device_info_platform_interface/pubspec.yaml index 3adfb93fa27a..656e5b24c373 100644 --- a/packages/device_info/device_info_platform_interface/pubspec.yaml +++ b/packages/device_info/device_info_platform_interface/pubspec.yaml @@ -3,7 +3,7 @@ description: A common platform interface for the device_info plugin. homepage: https://github.com/flutter/plugins/tree/master/packages/device_info # NOTE: We strongly prefer non-breaking changes, even at the expense of a # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes -version: 1.0.0 +version: 1.0.1 dependencies: flutter: From 0007ce3550f132deabd54ea1be312f054e6521cd Mon Sep 17 00:00:00 2001 From: Marius Preikschat Date: Wed, 9 Sep 2020 22:00:32 +0200 Subject: [PATCH 076/233] [image_picker_for_web] Safari now can pick more video formats (3gp, mp4, possibly others...) (#3007) --- packages/image_picker/image_picker_for_web/CHANGELOG.md | 4 ++++ .../image_picker_for_web/lib/image_picker_for_web.dart | 3 +-- packages/image_picker/image_picker_for_web/pubspec.yaml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/image_picker/image_picker_for_web/CHANGELOG.md b/packages/image_picker/image_picker_for_web/CHANGELOG.md index 67320bcb3de2..604314240a1e 100644 --- a/packages/image_picker/image_picker_for_web/CHANGELOG.md +++ b/packages/image_picker/image_picker_for_web/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.1.0+2 + +* Adds Video MIME Types for the safari browser for acception + # 0.1.0+1 * Remove `android` directory. diff --git a/packages/image_picker/image_picker_for_web/lib/image_picker_for_web.dart b/packages/image_picker/image_picker_for_web/lib/image_picker_for_web.dart index ce99dd6d5fc6..e50b4aad3c8d 100644 --- a/packages/image_picker/image_picker_for_web/lib/image_picker_for_web.dart +++ b/packages/image_picker/image_picker_for_web/lib/image_picker_for_web.dart @@ -7,8 +7,7 @@ import 'package:image_picker_platform_interface/image_picker_platform_interface. final String _kImagePickerInputsDomId = '__image_picker_web-file-input'; final String _kAcceptImageMimeType = 'image/*'; -// TODO The value below seems to not be enough for Safari (https://github.com/flutter/flutter/issues/58532) -final String _kAcceptVideoMimeType = 'video/*'; +final String _kAcceptVideoMimeType = 'video/3gpp,video/x-m4v,video/mp4,video/*'; /// The web implementation of [ImagePickerPlatform]. /// diff --git a/packages/image_picker/image_picker_for_web/pubspec.yaml b/packages/image_picker/image_picker_for_web/pubspec.yaml index 29b9b185cb90..32e89437415e 100644 --- a/packages/image_picker/image_picker_for_web/pubspec.yaml +++ b/packages/image_picker/image_picker_for_web/pubspec.yaml @@ -4,7 +4,7 @@ homepage: https://github.com/flutter/plugins/tree/master/packages/image_picker/i # 0.1.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.1.0+1 +version: 0.1.0+2 flutter: plugin: From d6fdbbd89f541516dbd55bc1099b7373963a257c Mon Sep 17 00:00:00 2001 From: Vitalii Vyrodov Date: Thu, 10 Sep 2020 00:24:33 +0300 Subject: [PATCH 077/233] [google_maps_flutter] Fix typo in User Interface example (#3011) --- packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md | 4 ++++ .../google_maps_flutter/example/lib/map_ui.dart | 4 ++-- packages/google_maps_flutter/google_maps_flutter/pubspec.yaml | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md index 0476f8c9a744..32cb61c3661a 100644 --- a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.5.32 + +* Fix typo in google_maps_flutter/example/map_ui.dart. + ## 0.5.31 * Geodesic Polyline support for iOS diff --git a/packages/google_maps_flutter/google_maps_flutter/example/lib/map_ui.dart b/packages/google_maps_flutter/google_maps_flutter/example/lib/map_ui.dart index 051d658ddff8..f117c3a48b22 100644 --- a/packages/google_maps_flutter/google_maps_flutter/example/lib/map_ui.dart +++ b/packages/google_maps_flutter/google_maps_flutter/example/lib/map_ui.dart @@ -5,8 +5,8 @@ // ignore_for_file: public_member_api_docs import 'package:flutter/material.dart'; -import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:flutter/services.dart' show rootBundle; +import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'page.dart'; @@ -206,7 +206,7 @@ class MapUiBodyState extends State { Widget _myLocationToggler() { return FlatButton( child: Text( - '${_myLocationButtonEnabled ? 'disable' : 'enable'} my location button'), + '${_myLocationEnabled ? 'disable' : 'enable'} my location marker'), onPressed: () { setState(() { _myLocationEnabled = !_myLocationEnabled; diff --git a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml index 9d2468ac1eaf..42033770e46e 100644 --- a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml @@ -1,7 +1,7 @@ name: google_maps_flutter description: A Flutter plugin for integrating Google Maps in iOS and Android applications. homepage: https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter/google_maps_flutter -version: 0.5.31 +version: 0.5.32 dependencies: flutter: From ba09b7f37c6f2e81d1ba67fc2542ce80a555691d Mon Sep 17 00:00:00 2001 From: Ziggy Crane Date: Thu, 10 Sep 2020 00:56:27 +0300 Subject: [PATCH 078/233] [in_app_purchase] Fix the bug that prevent restored subscription transactions from being completed (#2872) * Fix the bug that prevent restored subscription transactions from being completed * Update changelog * increased version * fixed removing transactions from transactionsSetter * Fixed CHANGELOGS conflicts * transactionsSetter code formating updates * fixed formating --- packages/in_app_purchase/CHANGELOG.md | 4 +++ .../ios/Classes/FIAPaymentQueueHandler.h | 3 +- .../ios/Classes/FIAPaymentQueueHandler.m | 28 ++++++++++++++++--- .../ios/Classes/InAppPurchasePlugin.m | 11 ++++---- packages/in_app_purchase/pubspec.yaml | 2 +- 5 files changed, 37 insertions(+), 11 deletions(-) diff --git a/packages/in_app_purchase/CHANGELOG.md b/packages/in_app_purchase/CHANGELOG.md index 65f7f86a16e6..d12fd807969b 100644 --- a/packages/in_app_purchase/CHANGELOG.md +++ b/packages/in_app_purchase/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.3.4+6 + +* iOS: Fix the bug that prevent restored subscription transactions from being completed + ## 0.3.4+5 * Added necessary README docs for getting started with Android. diff --git a/packages/in_app_purchase/ios/Classes/FIAPaymentQueueHandler.h b/packages/in_app_purchase/ios/Classes/FIAPaymentQueueHandler.h index ed1788186909..6f0c64bb85df 100644 --- a/packages/in_app_purchase/ios/Classes/FIAPaymentQueueHandler.h +++ b/packages/in_app_purchase/ios/Classes/FIAPaymentQueueHandler.h @@ -19,7 +19,8 @@ typedef void (^UpdatedDownloads)(NSArray *downloads); @interface FIAPaymentQueueHandler : NSObject // Unfinished transactions. -@property(nonatomic, readonly) NSDictionary *transactions; +@property(nonatomic, readonly) + NSDictionary *> *transactions; - (instancetype)initWithQueue:(nonnull SKPaymentQueue *)queue transactionsUpdated:(nullable TransactionsUpdated)transactionsUpdated diff --git a/packages/in_app_purchase/ios/Classes/FIAPaymentQueueHandler.m b/packages/in_app_purchase/ios/Classes/FIAPaymentQueueHandler.m index 57370e16fcbb..ddf9b2736a77 100644 --- a/packages/in_app_purchase/ios/Classes/FIAPaymentQueueHandler.m +++ b/packages/in_app_purchase/ios/Classes/FIAPaymentQueueHandler.m @@ -16,7 +16,7 @@ @interface FIAPaymentQueueHandler () @property(nullable, copy, nonatomic) UpdatedDownloads updatedDownloads; @property(strong, nonatomic) - NSMutableDictionary *transactionsSetter; + NSMutableDictionary *> *transactionsSetter; @end @@ -81,7 +81,13 @@ - (void)paymentQueue:(SKPaymentQueue *)queue // will become impossible for clients to finish deferred transactions when needed. // 2. Using product identifiers can help prevent clients from purchasing the same // subscription more than once by accident. - self.transactionsSetter[transaction.payment.productIdentifier] = transaction; + NSMutableArray *transactionArray = + [self.transactionsSetter objectForKey:transaction.payment.productIdentifier]; + if (transactionArray == nil) { + transactionArray = [NSMutableArray array]; + } + [transactionArray addObject:transaction]; + self.transactionsSetter[transaction.payment.productIdentifier] = transactionArray; } } // notify dart through callbacks. @@ -92,7 +98,21 @@ - (void)paymentQueue:(SKPaymentQueue *)queue - (void)paymentQueue:(SKPaymentQueue *)queue removedTransactions:(NSArray *)transactions { for (SKPaymentTransaction *transaction in transactions) { - [self.transactionsSetter removeObjectForKey:transaction.payment.productIdentifier]; + NSString *productId = transaction.payment.productIdentifier; + + if ([self.transactionsSetter objectForKey:productId] == nil) { + continue; + } + + NSPredicate *predicate = [NSPredicate + predicateWithFormat:@"transactionIdentifier == %@", transaction.transactionIdentifier]; + NSArray *filteredTransactions = + [self.transactionsSetter[productId] filteredArrayUsingPredicate:predicate]; + [self.transactionsSetter[productId] removeObjectsInArray:filteredTransactions]; + + if (!self.transactionsSetter[productId] || !self.transactionsSetter[productId].count) { + [self.transactionsSetter removeObjectForKey:productId]; + } } self.transactionsRemoved(transactions); } @@ -128,7 +148,7 @@ - (BOOL)paymentQueue:(SKPaymentQueue *)queue #pragma mark - getter -- (NSDictionary *)transactions { +- (NSDictionary *> *)transactions { return [self.transactionsSetter copy]; } diff --git a/packages/in_app_purchase/ios/Classes/InAppPurchasePlugin.m b/packages/in_app_purchase/ios/Classes/InAppPurchasePlugin.m index 06fe74a613ae..62b86bf9d82e 100644 --- a/packages/in_app_purchase/ios/Classes/InAppPurchasePlugin.m +++ b/packages/in_app_purchase/ios/Classes/InAppPurchasePlugin.m @@ -204,9 +204,8 @@ - (void)finishTransaction:(FlutterMethodCall *)call result:(FlutterResult)result return; } NSString *identifier = call.arguments; - SKPaymentTransaction *transaction = - [self.paymentQueueHandler.transactions objectForKey:identifier]; - if (!transaction) { + NSMutableArray *transactions = [self.paymentQueueHandler.transactions objectForKey:identifier]; + if (!transactions) { result([FlutterError errorWithCode:@"storekit_platform_invalid_transaction" message:[NSString @@ -214,14 +213,16 @@ - (void)finishTransaction:(FlutterMethodCall *)call result:(FlutterResult)result @"exist. Note that if the transactionState is " @"purchasing, the transactionIdentifier will be " @"nil(null).", - transaction.transactionIdentifier] + identifier] details:call.arguments]); return; } @try { + for (SKPaymentTransaction *transaction in transactions) { + [self.paymentQueueHandler finishTransaction:transaction]; + } // finish transaction will throw exception if the transaction type is purchasing. Notify dart // about this exception. - [self.paymentQueueHandler finishTransaction:transaction]; } @catch (NSException *e) { result([FlutterError errorWithCode:@"storekit_finish_transaction_exception" message:e.name diff --git a/packages/in_app_purchase/pubspec.yaml b/packages/in_app_purchase/pubspec.yaml index 42bb0d8f4619..55ac120b30c6 100644 --- a/packages/in_app_purchase/pubspec.yaml +++ b/packages/in_app_purchase/pubspec.yaml @@ -1,7 +1,7 @@ name: in_app_purchase description: A Flutter plugin for in-app purchases. Exposes APIs for making in-app purchases through the App Store and Google Play. homepage: https://github.com/flutter/plugins/tree/master/packages/in_app_purchase -version: 0.3.4+5 +version: 0.3.4+6 dependencies: async: ^2.0.8 From 1ac29789900f0d02d434a2909c7888d9b59223bf Mon Sep 17 00:00:00 2001 From: "James D. Lin" Date: Wed, 9 Sep 2020 15:40:54 -0700 Subject: [PATCH 079/233] [url_launcher_web] Fix a typo in a test name and fix quote consistency (#3010) Fix a typo in a test name and fix quote consistency. --- .../url_launcher/url_launcher_web/CHANGELOG.md | 4 ++++ .../url_launcher/url_launcher_web/pubspec.yaml | 2 +- .../test/url_launcher_web_test.dart | 16 ++++++++-------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/packages/url_launcher/url_launcher_web/CHANGELOG.md b/packages/url_launcher/url_launcher_web/CHANGELOG.md index 4bf47fe2c1fb..b12189336e74 100644 --- a/packages/url_launcher/url_launcher_web/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_web/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.1.3+2 + +- Fix a typo in a test name and fix some style inconsistencies. + # 0.1.3+1 - Depend explicitly on the `platform_interface` package that adds the `webOnlyWindowName` parameter. diff --git a/packages/url_launcher/url_launcher_web/pubspec.yaml b/packages/url_launcher/url_launcher_web/pubspec.yaml index 6c1285f22090..d206c0f1bbb9 100644 --- a/packages/url_launcher/url_launcher_web/pubspec.yaml +++ b/packages/url_launcher/url_launcher_web/pubspec.yaml @@ -4,7 +4,7 @@ homepage: https://github.com/flutter/plugins/tree/master/packages/url_launcher/u # 0.1.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.1.3+1 +version: 0.1.3+2 flutter: plugin: diff --git a/packages/url_launcher/url_launcher_web/test/url_launcher_web_test.dart b/packages/url_launcher/url_launcher_web/test/url_launcher_web_test.dart index 9cbaf686069f..56f23a464f1d 100644 --- a/packages/url_launcher/url_launcher_web/test/url_launcher_web_test.dart +++ b/packages/url_launcher/url_launcher_web/test/url_launcher_web_test.dart @@ -145,17 +145,17 @@ void main() { verify(mockWindow.open('sms:+19725551212?body=hello%20there', '')); }); - test('setting oOnlyLinkTarget as _self opens the url in the same tab', + test('setting webOnlyLinkTarget as _self opens the url in the same tab', () { - plugin.openNewWindow("https://www.google.com", - webOnlyWindowName: "_self"); + plugin.openNewWindow('https://www.google.com', + webOnlyWindowName: '_self'); verify(mockWindow.open('https://www.google.com', '_self')); }); test('setting webOnlyLinkTarget as _blank opens the url in a new tab', () { - plugin.openNewWindow("https://www.google.com", - webOnlyWindowName: "_blank"); + plugin.openNewWindow('https://www.google.com', + webOnlyWindowName: '_blank'); verify(mockWindow.open('https://www.google.com', '_blank')); }); @@ -197,9 +197,9 @@ void main() { test( 'mailto urls should use _blank if webOnlyWindowName is set as _blank', () { - plugin.openNewWindow("mailto:name@mydomain.com", - webOnlyWindowName: "_blank"); - verify(mockWindow.open("mailto:name@mydomain.com", "_blank")); + plugin.openNewWindow('mailto:name@mydomain.com', + webOnlyWindowName: '_blank'); + verify(mockWindow.open('mailto:name@mydomain.com', '_blank')); }); }); }); From da1ecffb18b27170cb293ff8095b5c5acc289e0c Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Fri, 11 Sep 2020 09:58:24 -0700 Subject: [PATCH 080/233] [in_app_purchase] Fix typo on `simulatesAskToBuyInSandBox` (#3016) --- packages/in_app_purchase/CHANGELOG.md | 4 ++++ packages/in_app_purchase/ios/Classes/InAppPurchasePlugin.m | 2 +- .../in_app_purchase/ios/Tests/InAppPurchasePluginTest.m | 6 +++--- packages/in_app_purchase/pubspec.yaml | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/in_app_purchase/CHANGELOG.md b/packages/in_app_purchase/CHANGELOG.md index d12fd807969b..ade5dbe57bc1 100644 --- a/packages/in_app_purchase/CHANGELOG.md +++ b/packages/in_app_purchase/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.3.4+7 + +* iOS: Fix typo of the `simulatesAskToBuyInSandbox` key. + ## 0.3.4+6 * iOS: Fix the bug that prevent restored subscription transactions from being completed diff --git a/packages/in_app_purchase/ios/Classes/InAppPurchasePlugin.m b/packages/in_app_purchase/ios/Classes/InAppPurchasePlugin.m index 62b86bf9d82e..dcf27147eb1d 100644 --- a/packages/in_app_purchase/ios/Classes/InAppPurchasePlugin.m +++ b/packages/in_app_purchase/ios/Classes/InAppPurchasePlugin.m @@ -180,7 +180,7 @@ - (void)addPayment:(FlutterMethodCall *)call result:(FlutterResult)result { payment.quantity = (quantity != nil) ? quantity.integerValue : 1; if (@available(iOS 8.3, *)) { payment.simulatesAskToBuyInSandbox = - [[paymentMap objectForKey:@"simulatesAskToBuyInSandBox"] boolValue]; + [[paymentMap objectForKey:@"simulatesAskToBuyInSandbox"] boolValue]; } if (![self.paymentQueueHandler addPayment:payment]) { diff --git a/packages/in_app_purchase/ios/Tests/InAppPurchasePluginTest.m b/packages/in_app_purchase/ios/Tests/InAppPurchasePluginTest.m index f1290b074ad9..9c654b0e9c4c 100644 --- a/packages/in_app_purchase/ios/Tests/InAppPurchasePluginTest.m +++ b/packages/in_app_purchase/ios/Tests/InAppPurchasePluginTest.m @@ -81,7 +81,7 @@ - (void)testAddPaymentFailure { arguments:@{ @"productIdentifier" : @"123", @"quantity" : @(1), - @"simulatesAskToBuyInSandBox" : @YES, + @"simulatesAskToBuyInSandbox" : @YES, }]; SKPaymentQueueStub* queue = [SKPaymentQueueStub new]; queue.testState = SKPaymentTransactionStateFailed; @@ -118,7 +118,7 @@ - (void)testAddPaymentWithSameProductIDWillFail { arguments:@{ @"productIdentifier" : @"123", @"quantity" : @(1), - @"simulatesAskToBuyInSandBox" : @YES, + @"simulatesAskToBuyInSandbox" : @YES, }]; SKPaymentQueueStub* queue = [SKPaymentQueueStub new]; queue.testState = SKPaymentTransactionStatePurchased; @@ -163,7 +163,7 @@ - (void)testAddPaymentSuccessWithMockQueue { arguments:@{ @"productIdentifier" : @"123", @"quantity" : @(1), - @"simulatesAskToBuyInSandBox" : @YES, + @"simulatesAskToBuyInSandbox" : @YES, }]; SKPaymentQueueStub* queue = [SKPaymentQueueStub new]; queue.testState = SKPaymentTransactionStatePurchased; diff --git a/packages/in_app_purchase/pubspec.yaml b/packages/in_app_purchase/pubspec.yaml index 55ac120b30c6..e831d902c91f 100644 --- a/packages/in_app_purchase/pubspec.yaml +++ b/packages/in_app_purchase/pubspec.yaml @@ -1,7 +1,7 @@ name: in_app_purchase description: A Flutter plugin for in-app purchases. Exposes APIs for making in-app purchases through the App Store and Google Play. homepage: https://github.com/flutter/plugins/tree/master/packages/in_app_purchase -version: 0.3.4+6 +version: 0.3.4+7 dependencies: async: ^2.0.8 From b453d8f44935def6f48e500209ba18412048a6f7 Mon Sep 17 00:00:00 2001 From: David Iglesias Date: Fri, 11 Sep 2020 12:23:43 -0700 Subject: [PATCH 081/233] [google_maps_flutter_web] Allow Markers with icon:null (#2998) --- .../google_maps_flutter_web/CHANGELOG.md | 4 +++ .../lib/src/convert.dart | 31 ++++++++++--------- .../google_maps_flutter_web/pubspec.yaml | 2 +- .../test/test_driver/markers_integration.dart | 12 +++++++ 4 files changed, 34 insertions(+), 15 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md index 1c4272849c05..0121042b1a02 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.0+2 + +* Fix crash when converting Markers with icon explicitly set to null. [Issue](https://github.com/flutter/flutter/issues/64938). + ## 0.1.0+1 * Port e2e tests to use the new integration_test package. diff --git a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart index 2eeaa0202995..0ec00871e676 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart @@ -379,22 +379,25 @@ gmaps.MarkerOptions _markerOptionsFromMarker( Marker marker, gmaps.Marker currentMarker, ) { - final iconConfig = marker.icon.toJson() as List; + final iconConfig = marker.icon?.toJson() as List; gmaps.Icon icon; - if (iconConfig[0] == 'fromAssetImage') { - // iconConfig[2] contains the DPIs of the screen, but that information is - // already encoded in the iconConfig[1] - - icon = gmaps.Icon() - ..url = ui.webOnlyAssetManager.getAssetUrl(iconConfig[1]); - - // iconConfig[3] may contain the [width, height] of the image, if passed! - if (iconConfig.length >= 4 && iconConfig[3] != null) { - final size = gmaps.Size(iconConfig[3][0], iconConfig[3][1]); - icon - ..size = size - ..scaledSize = size; + if (iconConfig != null) { + if (iconConfig[0] == 'fromAssetImage') { + assert(iconConfig.length >= 2); + // iconConfig[2] contains the DPIs of the screen, but that information is + // already encoded in the iconConfig[1] + + icon = gmaps.Icon() + ..url = ui.webOnlyAssetManager.getAssetUrl(iconConfig[1]); + + // iconConfig[3] may contain the [width, height] of the image, if passed! + if (iconConfig.length >= 4 && iconConfig[3] != null) { + final size = gmaps.Size(iconConfig[3][0], iconConfig[3][1]); + icon + ..size = size + ..scaledSize = size; + } } } return gmaps.MarkerOptions() diff --git a/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml index e916f7aa6590..5a879c2b39b0 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml @@ -1,7 +1,7 @@ name: google_maps_flutter_web description: Web platform implementation of google_maps_flutter homepage: https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter -version: 0.1.0+1 +version: 0.1.0+2 flutter: plugin: diff --git a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/markers_integration.dart b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/markers_integration.dart index f447535668b9..76ddf017985c 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/markers_integration.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/test/test_driver/markers_integration.dart @@ -98,5 +98,17 @@ void main() { expect(controller.markers[MarkerId('1')].infoWindowShown, isFalse); }); + + // https://github.com/flutter/flutter/issues/64938 + testWidgets('markers with icon:null work', (WidgetTester tester) async { + final markers = { + Marker(markerId: MarkerId('1'), icon: null), + }; + + controller.addMarkers(markers); + + expect(controller.markers.length, 1); + expect(controller.markers[MarkerId('1')].marker.icon, isNull); + }); }); } From 46119361e2a09b3e44716c2bd335fea67baad9c0 Mon Sep 17 00:00:00 2001 From: kinex Date: Fri, 11 Sep 2020 22:29:00 +0300 Subject: [PATCH 082/233] [in_app_purchase] Removed maintaining own cache of transactions (#2911) * - Removed maintaining own cache of transactions, it is better to use SKPaymentQueue.transactions where needed - Removed unnecessary and broken payment validation from addPayment - Refactored finishTransaction for finishing transactions properly - Fixed: restoreTransactions did not call result(nil) causing the call never complete * - Updated changelog * - Fixed call to finishTransaction: parameter must be transactionIdentifier, not productIdentifier * - review fixes: verify in addPayment there are no pending transactions for the same product * - reverted accidental change * - fixed formatting issues * - fixed formatting issues * - fixed test (removed obsolete references to old transactions cache) * - removed obsolete test testAddPaymentWithSameProductIDWillFail - fixed sk_methodchannel_apis_test * - removed testDuplicateTransactionsWillTriggerAnError Co-authored-by: LHLL --- packages/in_app_purchase/CHANGELOG.md | 6 +++ .../ios/Classes/FIAPaymentQueueHandler.h | 4 -- .../ios/Classes/FIAPaymentQueueHandler.m | 49 ++----------------- .../ios/Classes/InAppPurchasePlugin.m | 41 +++++++--------- .../ios/Tests/InAppPurchasePluginTest.m | 45 ----------------- .../ios/Tests/PaymentQueueTest.m | 22 --------- .../sk_payment_queue_wrapper.dart | 2 +- .../sk_methodchannel_apis_test.dart | 2 +- 8 files changed, 29 insertions(+), 142 deletions(-) diff --git a/packages/in_app_purchase/CHANGELOG.md b/packages/in_app_purchase/CHANGELOG.md index ade5dbe57bc1..fe601c2d5728 100644 --- a/packages/in_app_purchase/CHANGELOG.md +++ b/packages/in_app_purchase/CHANGELOG.md @@ -1,3 +1,9 @@ +## 0.3.4+8 + +* [iOS] Fixed: purchase dialog not showing always. +* [iOS] Fixed: completing purchases could fail. +* [iOS] Fixed: restorePurchases caused hang (call never returned). + ## 0.3.4+7 * iOS: Fix typo of the `simulatesAskToBuyInSandbox` key. diff --git a/packages/in_app_purchase/ios/Classes/FIAPaymentQueueHandler.h b/packages/in_app_purchase/ios/Classes/FIAPaymentQueueHandler.h index 6f0c64bb85df..54898d170304 100644 --- a/packages/in_app_purchase/ios/Classes/FIAPaymentQueueHandler.h +++ b/packages/in_app_purchase/ios/Classes/FIAPaymentQueueHandler.h @@ -18,10 +18,6 @@ typedef void (^UpdatedDownloads)(NSArray *downloads); @interface FIAPaymentQueueHandler : NSObject -// Unfinished transactions. -@property(nonatomic, readonly) - NSDictionary *> *transactions; - - (instancetype)initWithQueue:(nonnull SKPaymentQueue *)queue transactionsUpdated:(nullable TransactionsUpdated)transactionsUpdated transactionRemoved:(nullable TransactionsRemoved)transactionsRemoved diff --git a/packages/in_app_purchase/ios/Classes/FIAPaymentQueueHandler.m b/packages/in_app_purchase/ios/Classes/FIAPaymentQueueHandler.m index ddf9b2736a77..ecbd237c90ce 100644 --- a/packages/in_app_purchase/ios/Classes/FIAPaymentQueueHandler.m +++ b/packages/in_app_purchase/ios/Classes/FIAPaymentQueueHandler.m @@ -15,9 +15,6 @@ @interface FIAPaymentQueueHandler () @property(nullable, copy, nonatomic) ShouldAddStorePayment shouldAddStorePayment; @property(nullable, copy, nonatomic) UpdatedDownloads updatedDownloads; -@property(strong, nonatomic) - NSMutableDictionary *> *transactionsSetter; - @end @implementation FIAPaymentQueueHandler @@ -39,7 +36,6 @@ - (instancetype)initWithQueue:(nonnull SKPaymentQueue *)queue _paymentQueueRestoreCompletedTransactionsFinished = restoreCompletedTransactionsFinished; _shouldAddStorePayment = shouldAddStorePayment; _updatedDownloads = updatedDownloads; - _transactionsSetter = [NSMutableDictionary dictionary]; } return self; } @@ -49,8 +45,10 @@ - (void)startObservingPaymentQueue { } - (BOOL)addPayment:(SKPayment *)payment { - if (self.transactionsSetter[payment.productIdentifier]) { - return NO; + for (SKPaymentTransaction *transaction in self.queue.transactions) { + if ([transaction.payment.productIdentifier isEqualToString:payment.productIdentifier]) { + return NO; + } } [self.queue addPayment:payment]; return YES; @@ -74,22 +72,6 @@ - (void)restoreTransactions:(nullable NSString *)applicationName { // state of transactions and finish as appropriate. - (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions { - for (SKPaymentTransaction *transaction in transactions) { - if (transaction.transactionState != SKPaymentTransactionStatePurchasing) { - // Use product identifier instead of transaction identifier for few reasons: - // 1. Only transactions with purchased state and failed state will have a transaction id, it - // will become impossible for clients to finish deferred transactions when needed. - // 2. Using product identifiers can help prevent clients from purchasing the same - // subscription more than once by accident. - NSMutableArray *transactionArray = - [self.transactionsSetter objectForKey:transaction.payment.productIdentifier]; - if (transactionArray == nil) { - transactionArray = [NSMutableArray array]; - } - [transactionArray addObject:transaction]; - self.transactionsSetter[transaction.payment.productIdentifier] = transactionArray; - } - } // notify dart through callbacks. self.transactionsUpdated(transactions); } @@ -97,23 +79,6 @@ - (void)paymentQueue:(SKPaymentQueue *)queue // Sent when transactions are removed from the queue (via finishTransaction:). - (void)paymentQueue:(SKPaymentQueue *)queue removedTransactions:(NSArray *)transactions { - for (SKPaymentTransaction *transaction in transactions) { - NSString *productId = transaction.payment.productIdentifier; - - if ([self.transactionsSetter objectForKey:productId] == nil) { - continue; - } - - NSPredicate *predicate = [NSPredicate - predicateWithFormat:@"transactionIdentifier == %@", transaction.transactionIdentifier]; - NSArray *filteredTransactions = - [self.transactionsSetter[productId] filteredArrayUsingPredicate:predicate]; - [self.transactionsSetter[productId] removeObjectsInArray:filteredTransactions]; - - if (!self.transactionsSetter[productId] || !self.transactionsSetter[productId].count) { - [self.transactionsSetter removeObjectForKey:productId]; - } - } self.transactionsRemoved(transactions); } @@ -146,10 +111,4 @@ - (BOOL)paymentQueue:(SKPaymentQueue *)queue return self.queue.transactions; } -#pragma mark - getter - -- (NSDictionary *> *)transactions { - return [self.transactionsSetter copy]; -} - @end diff --git a/packages/in_app_purchase/ios/Classes/InAppPurchasePlugin.m b/packages/in_app_purchase/ios/Classes/InAppPurchasePlugin.m index dcf27147eb1d..156ce0c33e8f 100644 --- a/packages/in_app_purchase/ios/Classes/InAppPurchasePlugin.m +++ b/packages/in_app_purchase/ios/Classes/InAppPurchasePlugin.m @@ -203,32 +203,24 @@ - (void)finishTransaction:(FlutterMethodCall *)call result:(FlutterResult)result details:call.arguments]); return; } - NSString *identifier = call.arguments; - NSMutableArray *transactions = [self.paymentQueueHandler.transactions objectForKey:identifier]; - if (!transactions) { - result([FlutterError - errorWithCode:@"storekit_platform_invalid_transaction" - message:[NSString - stringWithFormat:@"The transaction with transactionIdentifer:%@ does not " - @"exist. Note that if the transactionState is " - @"purchasing, the transactionIdentifier will be " - @"nil(null).", - identifier] - details:call.arguments]); - return; - } - @try { - for (SKPaymentTransaction *transaction in transactions) { - [self.paymentQueueHandler finishTransaction:transaction]; + NSString *transactionIdentifier = call.arguments; + + NSArray *pendingTransactions = + [self.paymentQueueHandler getUnfinishedTransactions]; + + for (SKPaymentTransaction *transaction in pendingTransactions) { + if ([transaction.transactionIdentifier isEqualToString:transactionIdentifier]) { + @try { + [self.paymentQueueHandler finishTransaction:transaction]; + } @catch (NSException *e) { + result([FlutterError errorWithCode:@"storekit_finish_transaction_exception" + message:e.name + details:e.description]); + return; + } } - // finish transaction will throw exception if the transaction type is purchasing. Notify dart - // about this exception. - } @catch (NSException *e) { - result([FlutterError errorWithCode:@"storekit_finish_transaction_exception" - message:e.name - details:e.description]); - return; } + result(nil); } @@ -241,6 +233,7 @@ - (void)restoreTransactions:(FlutterMethodCall *)call result:(FlutterResult)resu return; } [self.paymentQueueHandler restoreTransactions:call.arguments]; + result(nil); } - (void)retrieveReceiptData:(FlutterMethodCall *)call result:(FlutterResult)result { diff --git a/packages/in_app_purchase/ios/Tests/InAppPurchasePluginTest.m b/packages/in_app_purchase/ios/Tests/InAppPurchasePluginTest.m index 9c654b0e9c4c..369e0ead0ba7 100644 --- a/packages/in_app_purchase/ios/Tests/InAppPurchasePluginTest.m +++ b/packages/in_app_purchase/ios/Tests/InAppPurchasePluginTest.m @@ -110,51 +110,6 @@ - (void)testAddPaymentFailure { XCTAssertEqual(transactionForUpdateBlock.transactionState, SKPaymentTransactionStateFailed); } -- (void)testAddPaymentWithSameProductIDWillFail { - XCTestExpectation* expectation = - [self expectationWithDescription:@"result should return expected error"]; - FlutterMethodCall* call = - [FlutterMethodCall methodCallWithMethodName:@"-[InAppPurchasePlugin addPayment:result:]" - arguments:@{ - @"productIdentifier" : @"123", - @"quantity" : @(1), - @"simulatesAskToBuyInSandbox" : @YES, - }]; - SKPaymentQueueStub* queue = [SKPaymentQueueStub new]; - queue.testState = SKPaymentTransactionStatePurchased; - self.plugin.paymentQueueHandler = [[FIAPaymentQueueHandler alloc] initWithQueue:queue - transactionsUpdated:^(NSArray* _Nonnull transactions) { - } - transactionRemoved:nil - restoreTransactionFailed:nil - restoreCompletedTransactionsFinished:nil - shouldAddStorePayment:^BOOL(SKPayment* _Nonnull payment, SKProduct* _Nonnull product) { - return YES; - } - updatedDownloads:nil]; - [queue addTransactionObserver:self.plugin.paymentQueueHandler]; - - FlutterResult addDuplicatePaymentBlock = ^(id r) { - XCTAssertNil(r); - [self.plugin - handleMethodCall:call - result:^(id result) { - XCTAssertNotNil(result); - XCTAssertTrue([result isKindOfClass:[FlutterError class]]); - FlutterError* error = (FlutterError*)result; - XCTAssertEqualObjects(error.code, @"storekit_duplicate_product_object"); - XCTAssertEqualObjects( - error.message, - @"There is a pending transaction for the same product identifier. Please " - @"either wait for it to be finished or finish it manually using " - @"`completePurchase` to avoid edge cases."); - [expectation fulfill]; - }]; - }; - [self.plugin handleMethodCall:call result:addDuplicatePaymentBlock]; - [self waitForExpectations:@[ expectation ] timeout:5]; -} - - (void)testAddPaymentSuccessWithMockQueue { XCTestExpectation* expectation = [self expectationWithDescription:@"result should return success state"]; diff --git a/packages/in_app_purchase/ios/Tests/PaymentQueueTest.m b/packages/in_app_purchase/ios/Tests/PaymentQueueTest.m index 8f5b66496f69..07b6bbb42a65 100644 --- a/packages/in_app_purchase/ios/Tests/PaymentQueueTest.m +++ b/packages/in_app_purchase/ios/Tests/PaymentQueueTest.m @@ -69,26 +69,6 @@ - (void)testTransactionPurchased { XCTAssertEqual(tran.transactionIdentifier, @"fakeID"); } -- (void)testDuplicateTransactionsWillTriggerAnError { - SKPaymentQueueStub *queue = [[SKPaymentQueueStub alloc] init]; - queue.testState = SKPaymentTransactionStatePurchased; - FIAPaymentQueueHandler *handler = [[FIAPaymentQueueHandler alloc] initWithQueue:queue - transactionsUpdated:^(NSArray *_Nonnull transactions) { - } - transactionRemoved:nil - restoreTransactionFailed:nil - restoreCompletedTransactionsFinished:nil - shouldAddStorePayment:^BOOL(SKPayment *_Nonnull payment, SKProduct *_Nonnull product) { - return YES; - } - updatedDownloads:nil]; - [queue addTransactionObserver:handler]; - SKPayment *payment = - [SKPayment paymentWithProduct:[[SKProductStub alloc] initWithMap:self.productResponseMap]]; - XCTAssertTrue([handler addPayment:payment]); - XCTAssertFalse([handler addPayment:payment]); -} - - (void)testTransactionFailed { XCTestExpectation *expectation = [self expectationWithDescription:@"expect to get failed transcation."]; @@ -208,13 +188,11 @@ - (void)testFinishTransaction { queue.testState = SKPaymentTransactionStateDeferred; __block FIAPaymentQueueHandler *handler = [[FIAPaymentQueueHandler alloc] initWithQueue:queue transactionsUpdated:^(NSArray *_Nonnull transactions) { - XCTAssertEqual(handler.transactions.count, 1); XCTAssertEqual(transactions.count, 1); SKPaymentTransaction *transaction = transactions[0]; [handler finishTransaction:transaction]; } transactionRemoved:^(NSArray *_Nonnull transactions) { - XCTAssertEqual(handler.transactions.count, 0); XCTAssertEqual(transactions.count, 1); [expectation fulfill]; } diff --git a/packages/in_app_purchase/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart b/packages/in_app_purchase/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart index 33d9281d3ce0..7f20736afbf8 100644 --- a/packages/in_app_purchase/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart +++ b/packages/in_app_purchase/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart @@ -105,7 +105,7 @@ class SKPaymentQueueWrapper { SKPaymentTransactionWrapper transaction) async { await channel.invokeMethod( '-[InAppPurchasePlugin finishTransaction:result:]', - transaction.payment.productIdentifier); + transaction.transactionIdentifier); } /// Restore previously purchased transactions. diff --git a/packages/in_app_purchase/test/store_kit_wrappers/sk_methodchannel_apis_test.dart b/packages/in_app_purchase/test/store_kit_wrappers/sk_methodchannel_apis_test.dart index c8da68ab823a..3a08d9e8e45d 100644 --- a/packages/in_app_purchase/test/store_kit_wrappers/sk_methodchannel_apis_test.dart +++ b/packages/in_app_purchase/test/store_kit_wrappers/sk_methodchannel_apis_test.dart @@ -110,7 +110,7 @@ void main() { queue.setTransactionObserver(observer); await queue.finishTransaction(dummyTransaction); expect(fakeIOSPlatform.transactionsFinished.first, - equals(dummyTransaction.payment.productIdentifier)); + equals(dummyTransaction.transactionIdentifier)); }); test('should restore transaction', () async { From fd6d45c006dbe9384502f66c4d2e360425d4d1ad Mon Sep 17 00:00:00 2001 From: Jia Hao Date: Sat, 12 Sep 2020 10:25:01 +0800 Subject: [PATCH 083/233] [integration_test] Recommend tests to be in `integration_test/`, fix example (#2986) * [integration_test] Recommend tests to be in `integration_test/`, fix example In this way, there is a clear distinction between integration tests that run on a device (in `integration_test/`, and widget tests that run with the flutter tester in `test/`. Fix flutter/flutter#64690 --- .cirrus.yml | 2 +- packages/integration_test/README.md | 91 +++++++++++-------- packages/integration_test/example/README.md | 22 +++-- .../_example_test_io.dart} | 0 .../_example_test_web.dart} | 0 .../_extended_test_io.dart} | 0 .../_extended_test_web.dart} | 0 .../example_test.dart} | 4 +- .../extended_test.dart} | 7 +- .../failure_test.dart} | 0 .../test_driver/example_integration_test.dart | 5 - .../test_driver/integration_test_driver.dart | 3 + ... => integration_test_extended_driver.dart} | 2 - ...t => integration_test_failure_driver.dart} | 4 +- 14 files changed, 79 insertions(+), 61 deletions(-) rename packages/integration_test/example/{test_driver/example_integration_io.dart => integration_test/_example_test_io.dart} (100%) rename packages/integration_test/example/{test_driver/example_integration_web.dart => integration_test/_example_test_web.dart} (100%) rename packages/integration_test/example/{test_driver/example_integration_io_extended.dart => integration_test/_extended_test_io.dart} (100%) rename packages/integration_test/example/{test_driver/example_integration_web_extended.dart => integration_test/_extended_test_web.dart} (100%) rename packages/integration_test/example/{test_driver/example_integration.dart => integration_test/example_test.dart} (82%) rename packages/integration_test/example/{test_driver/example_integration_extended.dart => integration_test/extended_test.dart} (67%) rename packages/integration_test/example/{test_driver/failure.dart => integration_test/failure_test.dart} (100%) delete mode 100644 packages/integration_test/example/test_driver/example_integration_test.dart create mode 100644 packages/integration_test/example/test_driver/integration_test_driver.dart rename packages/integration_test/example/test_driver/{example_integration_extended_test.dart => integration_test_extended_driver.dart} (94%) rename packages/integration_test/example/test_driver/{failure_test.dart => integration_test_failure_driver.dart} (96%) diff --git a/.cirrus.yml b/.cirrus.yml index d5a1ac82f6d5..25396ea3faf4 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -59,7 +59,7 @@ task: - ./chromedriver/chromedriver --port=4444 & test_script: - cd $INTEGRATION_TEST_PATH/example/ - - flutter drive -v --target=test_driver/example_integration.dart -d web-server --release --browser-name=chrome + - flutter drive -v --driver=test_driver/integration_test_driver.dart --target=integration_test/example_test.dart -d web-server --release --browser-name=chrome - name: build-apks+java-test+firebase-test-lab env: matrix: diff --git a/packages/integration_test/README.md b/packages/integration_test/README.md index a48210beacf8..a6b1726475e2 100644 --- a/packages/integration_test/README.md +++ b/packages/integration_test/README.md @@ -7,11 +7,12 @@ and native Android instrumentation testing. ## Usage Add a dependency on the `integration_test` and `flutter_test` package in the -`dev_dependencies` section of pubspec.yaml. For plugins, do this in the -pubspec.yaml of the example app. +`dev_dependencies` section of `pubspec.yaml`. For plugins, do this in the +`pubspec.yaml` of the example app. -Invoke `IntegrationTestWidgetsFlutterBinding.ensureInitialized()` at the start -of a test file, e.g. +Create a `integration_test/` directory for your package. In this directory, +create a `_test.dart`, using the following as a starting point to make +assertions. ```dart import 'package:flutter_test/flutter_test.dart'; @@ -19,66 +20,82 @@ import 'package:integration_test/integration_test.dart'; void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + testWidgets("failing test example", (WidgetTester tester) async { expect(2 + 2, equals(5)); }); } ``` -## Test locations +### Driver Entrypoint -It is recommended to put integration_test tests in the `test/` folder of the app -or package. For example apps, if the integration_test test references example -app code, it should go in `example/test/`. It is also acceptable to put -integration_test tests in `test_driver/` folder so that they're alongside the -runner app (see below). +An accompanying driver script will be needed that can be shared across all +integration tests. Create a `integration_test_driver.dart` in the `test_driver/` +directory with the following contents: -## Using Flutter Driver to Run Tests +```dart +import 'package:integration_test/integration_test_driver.dart'; -`IntegrationTestWidgetsTestBinding` supports launching the on-device tests with -`flutter drive`. Note that the tests don't use the `FlutterDriver` API, they -use `testWidgets` instead. +Future main() => integrationDriver(); +``` -Put the a file named `_integration_test.dart` in the app' -`test_driver` directory: +You can also use different driver scripts to customize the behavior of the app +under test. For example, `FlutterDriver` can also be parameterized with +different [options](https://api.flutter.dev/flutter/flutter_driver/FlutterDriver/connect.html). +See the [extended driver](https://github.com/flutter/plugins/tree/master/packages/integration_test/example/test_driver/integration_test_extended_driver.dart) for an example. -```dart -import 'dart:async'; +### Package Structure -import 'package:integration_test/integration_test_driver.dart'; +Your package should have a structure that looks like this: -Future main() async => integrationDriver(); +``` +lib/ + ... +integration_test/ + foo_test.dart + bar_test.dart +test/ + # Other unit tests go here. +test_driver/ + integration_test_driver.dart ``` -To run a example app test with Flutter driver: +[Example](https://github.com/flutter/plugins/tree/master/packages/integration_test/example) -```sh -cd example -flutter drive test/_integration.dart -``` +## Using Flutter Driver to Run Tests + +These tests can be launched with the `flutter drive` command. -To test plugin APIs using Flutter driver: +To run the `integration_test/foo_test.dart` test with the +`test_driver/integration_test_driver.dart` driver, use the following command: ```sh -cd example -flutter drive --driver=test_driver/_test.dart test/_integration_test.dart +flutter drive \ + --driver=test_driver/integration_test_driver.dart \ + --target=integration_test/foo_test.dart ``` -You can run tests on web in release or profile mode. +### Web + +Make sure you have [enabled web support](https://flutter.dev/docs/get-started/web#set-up) +then [download and run](https://flutter.dev/docs/cookbook/testing/integration/introduction#6b-web) +the web driver in another process. -First you need to make sure you have downloaded the driver for the browser. +Use following command to execute the tests: ```sh -cd example -flutter drive -v --target=test_driver/dart -d web-server --release --browser-name=chrome +flutter drive \ + --driver=test_driver/integration_test_driver.dart \ + --target=integration_test/foo_test.dart \ + -d web-server ``` -## Android device testing +## Android Device Testing Create an instrumentation test file in your application's **android/app/src/androidTest/java/com/example/myapp/** directory (replacing com, example, and myapp with values from your app's package name). You can name -this test file MainActivityTest.java or another name of your choice. +this test file `MainActivityTest.java` or another name of your choice. ```java package com.example.myapp; @@ -96,7 +113,7 @@ public class MainActivityTest { ``` Update your application's **myapp/android/app/build.gradle** to make sure it -uses androidx's version of AndroidJUnitRunner and has androidx libraries as a +uses androidx's version of `AndroidJUnitRunner` and has androidx libraries as a dependency. ```gradle @@ -160,7 +177,7 @@ You can pass additional parameters on the command line, such as the devices you want to test on. See [gcloud firebase test android run](https://cloud.google.com/sdk/gcloud/reference/firebase/test/android/run). -## iOS device testing +## iOS Device Testing You need to change `iOS/Podfile` to avoid test target statically linking to the plugins. One way is to link all of the plugins dynamically: @@ -189,4 +206,4 @@ change the code. You can change `RunnerTests.m` to the name of your choice. INTEGRATION_TEST_IOS_RUNNER(RunnerTests) ``` -Now you can start RunnerTests to kick out integration tests! +Now you can start RunnerTests to kick-off integration tests! diff --git a/packages/integration_test/example/README.md b/packages/integration_test/example/README.md index 7c61fbf5c8de..7e6317fcf96f 100644 --- a/packages/integration_test/example/README.md +++ b/packages/integration_test/example/README.md @@ -2,15 +2,21 @@ Demonstrates how to use the `package:integration_test`. -## Getting Started +To run `integration_test/example_test.dart`, -This project is a starting point for a Flutter application. +Android / iOS: -A few resources to get you started if this is your first Flutter project: +```sh +flutter drive \ + --driver=test_driver/integration_test_driver.dart \ + --target=integration_test/example_test.dart +``` -- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) -- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) +Web: -For help getting started with Flutter, view our -[online documentation](https://flutter.dev/docs), which offers tutorials, -samples, guidance on mobile development, and a full API reference. +```sh +flutter drive \ + --driver=test_driver/integration_test_driver.dart \ + --target=integration_test/example_test.dart \ + -d web-server +``` diff --git a/packages/integration_test/example/test_driver/example_integration_io.dart b/packages/integration_test/example/integration_test/_example_test_io.dart similarity index 100% rename from packages/integration_test/example/test_driver/example_integration_io.dart rename to packages/integration_test/example/integration_test/_example_test_io.dart diff --git a/packages/integration_test/example/test_driver/example_integration_web.dart b/packages/integration_test/example/integration_test/_example_test_web.dart similarity index 100% rename from packages/integration_test/example/test_driver/example_integration_web.dart rename to packages/integration_test/example/integration_test/_example_test_web.dart diff --git a/packages/integration_test/example/test_driver/example_integration_io_extended.dart b/packages/integration_test/example/integration_test/_extended_test_io.dart similarity index 100% rename from packages/integration_test/example/test_driver/example_integration_io_extended.dart rename to packages/integration_test/example/integration_test/_extended_test_io.dart diff --git a/packages/integration_test/example/test_driver/example_integration_web_extended.dart b/packages/integration_test/example/integration_test/_extended_test_web.dart similarity index 100% rename from packages/integration_test/example/test_driver/example_integration_web_extended.dart rename to packages/integration_test/example/integration_test/_extended_test_web.dart diff --git a/packages/integration_test/example/test_driver/example_integration.dart b/packages/integration_test/example/integration_test/example_test.dart similarity index 82% rename from packages/integration_test/example/test_driver/example_integration.dart rename to packages/integration_test/example/integration_test/example_test.dart index 3ee993b911b9..918aec8777de 100644 --- a/packages/integration_test/example/test_driver/example_integration.dart +++ b/packages/integration_test/example/integration_test/example_test.dart @@ -7,8 +7,8 @@ import 'package:integration_test/integration_test.dart'; -import 'example_integration_io.dart' - if (dart.library.html) 'example_integration_web.dart' as tests; +import '_example_test_io.dart' if (dart.library.html) '_example_test_web.dart' + as tests; void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); diff --git a/packages/integration_test/example/test_driver/example_integration_extended.dart b/packages/integration_test/example/integration_test/extended_test.dart similarity index 67% rename from packages/integration_test/example/test_driver/example_integration_extended.dart rename to packages/integration_test/example/integration_test/extended_test.dart index 79ed2762165e..23d69a8f9438 100644 --- a/packages/integration_test/example/test_driver/example_integration_extended.dart +++ b/packages/integration_test/example/integration_test/extended_test.dart @@ -1,6 +1,7 @@ // This is a Flutter widget test can take a screenshot. // -// NOTE: Screenshots are only supported on Web for now. +// NOTE: Screenshots are only supported on Web for now. For Web, this needs to +// be executed with the `test_driver/integration_test_extended_driver.dart`. // // To perform an interaction with a widget in your test, use the WidgetTester // utility that Flutter provides. For example, you can send tap and scroll @@ -9,8 +10,8 @@ import 'package:integration_test/integration_test.dart'; -import 'example_integration_io_extended.dart' - if (dart.library.html) 'example_integration_web_extended.dart' as tests; +import '_extended_test_io.dart' if (dart.library.html) '_extended_test_web.dart' + as tests; void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); diff --git a/packages/integration_test/example/test_driver/failure.dart b/packages/integration_test/example/integration_test/failure_test.dart similarity index 100% rename from packages/integration_test/example/test_driver/failure.dart rename to packages/integration_test/example/integration_test/failure_test.dart diff --git a/packages/integration_test/example/test_driver/example_integration_test.dart b/packages/integration_test/example/test_driver/example_integration_test.dart deleted file mode 100644 index 10acaa69a42e..000000000000 --- a/packages/integration_test/example/test_driver/example_integration_test.dart +++ /dev/null @@ -1,5 +0,0 @@ -import 'dart:async'; - -import 'package:integration_test/integration_test_driver.dart'; - -Future main() async => integrationDriver(); diff --git a/packages/integration_test/example/test_driver/integration_test_driver.dart b/packages/integration_test/example/test_driver/integration_test_driver.dart new file mode 100644 index 000000000000..b38629cca97b --- /dev/null +++ b/packages/integration_test/example/test_driver/integration_test_driver.dart @@ -0,0 +1,3 @@ +import 'package:integration_test/integration_test_driver.dart'; + +Future main() => integrationDriver(); diff --git a/packages/integration_test/example/test_driver/example_integration_extended_test.dart b/packages/integration_test/example/test_driver/integration_test_extended_driver.dart similarity index 94% rename from packages/integration_test/example/test_driver/example_integration_extended_test.dart rename to packages/integration_test/example/test_driver/integration_test_extended_driver.dart index 1428a5092a78..056ba4bad722 100644 --- a/packages/integration_test/example/test_driver/example_integration_extended_test.dart +++ b/packages/integration_test/example/test_driver/integration_test_extended_driver.dart @@ -1,5 +1,3 @@ -import 'dart:async'; - import 'package:flutter_driver/flutter_driver.dart'; import 'package:integration_test/integration_test_driver_extended.dart'; diff --git a/packages/integration_test/example/test_driver/failure_test.dart b/packages/integration_test/example/test_driver/integration_test_failure_driver.dart similarity index 96% rename from packages/integration_test/example/test_driver/failure_test.dart rename to packages/integration_test/example/test_driver/integration_test_failure_driver.dart index bd9302f39409..0b60e471d711 100644 --- a/packages/integration_test/example/test_driver/failure_test.dart +++ b/packages/integration_test/example/test_driver/integration_test_failure_driver.dart @@ -1,7 +1,5 @@ -import 'dart:async'; - -import 'package:integration_test/common.dart' as common; import 'package:flutter_driver/flutter_driver.dart'; +import 'package:integration_test/common.dart' as common; import 'package:test/test.dart'; Future main() async { From 97429bdf1c96b8d8385448d0a26a6b982ea3c135 Mon Sep 17 00:00:00 2001 From: Jia Hao Date: Sun, 13 Sep 2020 00:58:50 +0800 Subject: [PATCH 084/233] Fix formatting (#3023) A new version of the formatter or something might have rolled in, causing CI to break --- .../example/linux/flutter/generated_plugin_registrant.cc | 4 +--- .../shared_preferences_linux/example/linux/my_application.cc | 2 +- .../example/linux/flutter/generated_plugin_registrant.cc | 3 ++- .../url_launcher/url_launcher/example/linux/my_application.cc | 2 +- .../example/linux/flutter/generated_plugin_registrant.cc | 3 ++- .../url_launcher_linux/example/linux/my_application.cc | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/shared_preferences/shared_preferences_linux/example/linux/flutter/generated_plugin_registrant.cc b/packages/shared_preferences/shared_preferences_linux/example/linux/flutter/generated_plugin_registrant.cc index d38195aa0412..890de29bbab1 100644 --- a/packages/shared_preferences/shared_preferences_linux/example/linux/flutter/generated_plugin_registrant.cc +++ b/packages/shared_preferences/shared_preferences_linux/example/linux/flutter/generated_plugin_registrant.cc @@ -4,6 +4,4 @@ #include "generated_plugin_registrant.h" - -void fl_register_plugins(FlPluginRegistry* registry) { -} +void fl_register_plugins(FlPluginRegistry* registry) {} diff --git a/packages/shared_preferences/shared_preferences_linux/example/linux/my_application.cc b/packages/shared_preferences/shared_preferences_linux/example/linux/my_application.cc index c2357f17ea9c..f079e19eb396 100644 --- a/packages/shared_preferences/shared_preferences_linux/example/linux/my_application.cc +++ b/packages/shared_preferences/shared_preferences_linux/example/linux/my_application.cc @@ -14,7 +14,7 @@ G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) static void my_application_activate(GApplication* application) { GtkWindow* window = GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); - GtkHeaderBar *header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); + GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); gtk_widget_show(GTK_WIDGET(header_bar)); gtk_header_bar_set_title(header_bar, "example"); gtk_header_bar_set_show_close_button(header_bar, TRUE); diff --git a/packages/url_launcher/url_launcher/example/linux/flutter/generated_plugin_registrant.cc b/packages/url_launcher/url_launcher/example/linux/flutter/generated_plugin_registrant.cc index 026851fa2f96..36185a63f2fd 100644 --- a/packages/url_launcher/url_launcher/example/linux/flutter/generated_plugin_registrant.cc +++ b/packages/url_launcher/url_launcher/example/linux/flutter/generated_plugin_registrant.cc @@ -8,6 +8,7 @@ void fl_register_plugins(FlPluginRegistry* registry) { g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); + fl_plugin_registry_get_registrar_for_plugin(registry, + "UrlLauncherPlugin"); url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); } diff --git a/packages/url_launcher/url_launcher/example/linux/my_application.cc b/packages/url_launcher/url_launcher/example/linux/my_application.cc index c2357f17ea9c..f079e19eb396 100644 --- a/packages/url_launcher/url_launcher/example/linux/my_application.cc +++ b/packages/url_launcher/url_launcher/example/linux/my_application.cc @@ -14,7 +14,7 @@ G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) static void my_application_activate(GApplication* application) { GtkWindow* window = GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); - GtkHeaderBar *header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); + GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); gtk_widget_show(GTK_WIDGET(header_bar)); gtk_header_bar_set_title(header_bar, "example"); gtk_header_bar_set_show_close_button(header_bar, TRUE); diff --git a/packages/url_launcher/url_launcher_linux/example/linux/flutter/generated_plugin_registrant.cc b/packages/url_launcher/url_launcher_linux/example/linux/flutter/generated_plugin_registrant.cc index 026851fa2f96..36185a63f2fd 100644 --- a/packages/url_launcher/url_launcher_linux/example/linux/flutter/generated_plugin_registrant.cc +++ b/packages/url_launcher/url_launcher_linux/example/linux/flutter/generated_plugin_registrant.cc @@ -8,6 +8,7 @@ void fl_register_plugins(FlPluginRegistry* registry) { g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); + fl_plugin_registry_get_registrar_for_plugin(registry, + "UrlLauncherPlugin"); url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); } diff --git a/packages/url_launcher/url_launcher_linux/example/linux/my_application.cc b/packages/url_launcher/url_launcher_linux/example/linux/my_application.cc index c2357f17ea9c..f079e19eb396 100644 --- a/packages/url_launcher/url_launcher_linux/example/linux/my_application.cc +++ b/packages/url_launcher/url_launcher_linux/example/linux/my_application.cc @@ -14,7 +14,7 @@ G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) static void my_application_activate(GApplication* application) { GtkWindow* window = GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); - GtkHeaderBar *header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); + GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); gtk_widget_show(GTK_WIDGET(header_bar)); gtk_header_bar_set_title(header_bar, "example"); gtk_header_bar_set_show_close_button(header_bar, TRUE); From c194de200cc69940d9ac0ee26b1778265ee35865 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Sat, 12 Sep 2020 14:14:08 -0400 Subject: [PATCH 085/233] Add url_launcher_windows (#3015) Adds a federated Windows implementation of url_launcher (not yet endorsed). Since this is the first C++ plugin, this also adds a .clang-format file to the repo root for formatting C++ plugins. Part of flutter/flutter#41721 (will need follow-up to endorse it in url_launcher) --- .clang-format | 1 + .../url_launcher_windows/.gitignore | 3 + .../url_launcher_windows/.metadata | 10 ++ .../url_launcher_windows/CHANGELOG.md | 3 + .../url_launcher/url_launcher_windows/LICENSE | 25 +++ .../url_launcher_windows/README.md | 31 ++++ .../url_launcher_windows/example/.gitignore | 41 +++++ .../url_launcher_windows/example/.metadata | 10 ++ .../url_launcher_windows/example/README.md | 3 + .../example/lib/main.dart | 93 +++++++++++ .../url_launcher_windows/example/pubspec.yaml | 19 +++ .../example/test_driver/url_launcher_e2e.dart | 20 +++ .../test_driver/url_launcher_e2e_test.dart | 17 ++ .../lib/url_launcher_windows.dart | 3 + .../url_launcher_windows/pubspec.yaml | 21 +++ .../url_launcher_windows/windows/.gitignore | 17 ++ .../windows/CMakeLists.txt | 22 +++ .../url_launcher_plugin.h | 26 +++ .../windows/url_launcher_plugin.cpp | 148 ++++++++++++++++++ 19 files changed, 513 insertions(+) create mode 100644 .clang-format create mode 100644 packages/url_launcher/url_launcher_windows/.gitignore create mode 100644 packages/url_launcher/url_launcher_windows/.metadata create mode 100644 packages/url_launcher/url_launcher_windows/CHANGELOG.md create mode 100644 packages/url_launcher/url_launcher_windows/LICENSE create mode 100644 packages/url_launcher/url_launcher_windows/README.md create mode 100644 packages/url_launcher/url_launcher_windows/example/.gitignore create mode 100644 packages/url_launcher/url_launcher_windows/example/.metadata create mode 100644 packages/url_launcher/url_launcher_windows/example/README.md create mode 100644 packages/url_launcher/url_launcher_windows/example/lib/main.dart create mode 100644 packages/url_launcher/url_launcher_windows/example/pubspec.yaml create mode 100644 packages/url_launcher/url_launcher_windows/example/test_driver/url_launcher_e2e.dart create mode 100644 packages/url_launcher/url_launcher_windows/example/test_driver/url_launcher_e2e_test.dart create mode 100644 packages/url_launcher/url_launcher_windows/lib/url_launcher_windows.dart create mode 100644 packages/url_launcher/url_launcher_windows/pubspec.yaml create mode 100644 packages/url_launcher/url_launcher_windows/windows/.gitignore create mode 100644 packages/url_launcher/url_launcher_windows/windows/CMakeLists.txt create mode 100644 packages/url_launcher/url_launcher_windows/windows/include/url_launcher_windows/url_launcher_plugin.h create mode 100644 packages/url_launcher/url_launcher_windows/windows/url_launcher_plugin.cpp diff --git a/.clang-format b/.clang-format new file mode 100644 index 000000000000..f6cb8ad931f5 --- /dev/null +++ b/.clang-format @@ -0,0 +1 @@ +BasedOnStyle: Google diff --git a/packages/url_launcher/url_launcher_windows/.gitignore b/packages/url_launcher/url_launcher_windows/.gitignore new file mode 100644 index 000000000000..53e92cc4181f --- /dev/null +++ b/packages/url_launcher/url_launcher_windows/.gitignore @@ -0,0 +1,3 @@ +.packages +.flutter-plugins +pubspec.lock diff --git a/packages/url_launcher/url_launcher_windows/.metadata b/packages/url_launcher/url_launcher_windows/.metadata new file mode 100644 index 000000000000..720a4596c087 --- /dev/null +++ b/packages/url_launcher/url_launcher_windows/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 6d1c244b79f3a2747281f718297ce248bd5ad099 + channel: master + +project_type: plugin diff --git a/packages/url_launcher/url_launcher_windows/CHANGELOG.md b/packages/url_launcher/url_launcher_windows/CHANGELOG.md new file mode 100644 index 000000000000..dd3395afab0a --- /dev/null +++ b/packages/url_launcher/url_launcher_windows/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.0.1 + +* Initial Windows implementation of `url_launcher`. diff --git a/packages/url_launcher/url_launcher_windows/LICENSE b/packages/url_launcher/url_launcher_windows/LICENSE new file mode 100644 index 000000000000..507569823f1b --- /dev/null +++ b/packages/url_launcher/url_launcher_windows/LICENSE @@ -0,0 +1,25 @@ +Copyright 2019 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/url_launcher/url_launcher_windows/README.md b/packages/url_launcher/url_launcher_windows/README.md new file mode 100644 index 000000000000..685adc59a1a4 --- /dev/null +++ b/packages/url_launcher/url_launcher_windows/README.md @@ -0,0 +1,31 @@ +# url_launcher_windows + +The Windows implementation of [`url_launcher`][1]. + +## Backward compatible 1.0.0 version is coming +The plugin has reached a stable API, we guarantee that version `1.0.0` will be backward compatible with `0.0.y+z`. If you use +url_launcher_windows directly, rather than as an implementation detail +of `url_launcher`, please use `url_launcher_windows: '>=0.0.y+x <2.0.0'` +as your dependency constraint to allow a smoother ecosystem migration. +For more details see: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 + +## Usage + +### Import the package + +This package has not yet been endorsed. Once it is you only need to add +`url_launcher` as a dependency in your `pubspec.yaml`, but for now you +need to include both `url_launcher` and `url_launcher_windows`. + +This is what the above means to your `pubspec.yaml`: + +```yaml +... +dependencies: + ... + url_launcher: ^5.5.3 + url_launcher_windows: ^0.0.1 + ... +``` + +[1]: ../url_launcher/url_launcher diff --git a/packages/url_launcher/url_launcher_windows/example/.gitignore b/packages/url_launcher/url_launcher_windows/example/.gitignore new file mode 100644 index 000000000000..9d532b18a01f --- /dev/null +++ b/packages/url_launcher/url_launcher_windows/example/.gitignore @@ -0,0 +1,41 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Web related +lib/generated_plugin_registrant.dart + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json diff --git a/packages/url_launcher/url_launcher_windows/example/.metadata b/packages/url_launcher/url_launcher_windows/example/.metadata new file mode 100644 index 000000000000..82cce8b18642 --- /dev/null +++ b/packages/url_launcher/url_launcher_windows/example/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 6d1c244b79f3a2747281f718297ce248bd5ad099 + channel: master + +project_type: app diff --git a/packages/url_launcher/url_launcher_windows/example/README.md b/packages/url_launcher/url_launcher_windows/example/README.md new file mode 100644 index 000000000000..e444852697b9 --- /dev/null +++ b/packages/url_launcher/url_launcher_windows/example/README.md @@ -0,0 +1,3 @@ +# url_launcher_windows_example + +Demonstrates the url_launcher_windows plugin. diff --git a/packages/url_launcher/url_launcher_windows/example/lib/main.dart b/packages/url_launcher/url_launcher_windows/example/lib/main.dart new file mode 100644 index 000000000000..db59af1e5b95 --- /dev/null +++ b/packages/url_launcher/url_launcher_windows/example/lib/main.dart @@ -0,0 +1,93 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// ignore_for_file: public_member_api_docs + +import 'dart:async'; +import 'package:flutter/material.dart'; +import 'package:url_launcher_platform_interface/url_launcher_platform_interface.dart'; + +void main() { + runApp(MyApp()); +} + +class MyApp extends StatelessWidget { + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'URL Launcher', + theme: ThemeData( + primarySwatch: Colors.blue, + ), + home: MyHomePage(title: 'URL Launcher'), + ); + } +} + +class MyHomePage extends StatefulWidget { + MyHomePage({Key key, this.title}) : super(key: key); + final String title; + + @override + _MyHomePageState createState() => _MyHomePageState(); +} + +class _MyHomePageState extends State { + Future _launched; + + Future _launchInBrowser(String url) async { + if (await UrlLauncherPlatform.instance.canLaunch(url)) { + await UrlLauncherPlatform.instance.launch( + url, + useSafariVC: false, + useWebView: false, + enableJavaScript: false, + enableDomStorage: false, + universalLinksOnly: false, + headers: {}, + ); + } else { + throw 'Could not launch $url'; + } + } + + Widget _launchStatus(BuildContext context, AsyncSnapshot snapshot) { + if (snapshot.hasError) { + return Text('Error: ${snapshot.error}'); + } else { + return const Text(''); + } + } + + @override + Widget build(BuildContext context) { + const String toLaunch = 'https://www.cylog.org/headers/'; + return Scaffold( + appBar: AppBar( + title: Text(widget.title), + ), + body: ListView( + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Padding( + padding: EdgeInsets.all(16.0), + child: Text(toLaunch), + ), + RaisedButton( + onPressed: () => setState(() { + _launched = _launchInBrowser(toLaunch); + }), + child: const Text('Launch in browser'), + ), + const Padding(padding: EdgeInsets.all(16.0)), + FutureBuilder(future: _launched, builder: _launchStatus), + ], + ), + ], + ), + ); + } +} diff --git a/packages/url_launcher/url_launcher_windows/example/pubspec.yaml b/packages/url_launcher/url_launcher_windows/example/pubspec.yaml new file mode 100644 index 000000000000..8d6c22057bc2 --- /dev/null +++ b/packages/url_launcher/url_launcher_windows/example/pubspec.yaml @@ -0,0 +1,19 @@ +name: url_launcher_example +description: Demonstrates the Windows implementation of the url_launcher plugin. + +dependencies: + flutter: + sdk: flutter + url_launcher_platform_interface: any + url_launcher_windows: + path: ../ + +dev_dependencies: + integration_test: + path: ../../../integration_test + flutter_driver: + sdk: flutter + pedantic: ^1.8.0 + +flutter: + uses-material-design: true diff --git a/packages/url_launcher/url_launcher_windows/example/test_driver/url_launcher_e2e.dart b/packages/url_launcher/url_launcher_windows/example/test_driver/url_launcher_e2e.dart new file mode 100644 index 000000000000..7a33e00fec0a --- /dev/null +++ b/packages/url_launcher/url_launcher_windows/example/test_driver/url_launcher_e2e.dart @@ -0,0 +1,20 @@ +// Copyright 2019, the Chromium project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:flutter_test/flutter_test.dart'; +import 'package:integration_test/integration_test.dart'; +import 'package:url_launcher_platform_interface/url_launcher_platform_interface.dart'; + +void main() { + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + + test('canLaunch', () async { + UrlLauncherPlatform launcher = UrlLauncherPlatform.instance; + + expect(await launcher.canLaunch('randomstring'), false); + + // Generally all devices should have some default browser. + expect(await launcher.canLaunch('http://flutter.dev'), true); + }); +} diff --git a/packages/url_launcher/url_launcher_windows/example/test_driver/url_launcher_e2e_test.dart b/packages/url_launcher/url_launcher_windows/example/test_driver/url_launcher_e2e_test.dart new file mode 100644 index 000000000000..7a2c21338786 --- /dev/null +++ b/packages/url_launcher/url_launcher_windows/example/test_driver/url_launcher_e2e_test.dart @@ -0,0 +1,17 @@ +// Copyright 2019, the Chromium project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:async'; +import 'dart:convert'; +import 'dart:io'; +import 'package:flutter_driver/flutter_driver.dart'; + +Future main() async { + final FlutterDriver driver = await FlutterDriver.connect(); + final String data = + await driver.requestData(null, timeout: const Duration(minutes: 1)); + await driver.close(); + final Map result = jsonDecode(data); + exit(result['result'] == 'true' ? 0 : 1); +} diff --git a/packages/url_launcher/url_launcher_windows/lib/url_launcher_windows.dart b/packages/url_launcher/url_launcher_windows/lib/url_launcher_windows.dart new file mode 100644 index 000000000000..83435f981838 --- /dev/null +++ b/packages/url_launcher/url_launcher_windows/lib/url_launcher_windows.dart @@ -0,0 +1,3 @@ +// The url_launcher_platform_interface defaults to MethodChannelUrlLauncher +// as its instance, which is all the Windows implementation needs. This file +// is here to silence warnings when publishing to pub. diff --git a/packages/url_launcher/url_launcher_windows/pubspec.yaml b/packages/url_launcher/url_launcher_windows/pubspec.yaml new file mode 100644 index 000000000000..8a0beb70163a --- /dev/null +++ b/packages/url_launcher/url_launcher_windows/pubspec.yaml @@ -0,0 +1,21 @@ +name: url_launcher_windows +description: Windows implementation of the url_launcher plugin. +# 0.0.y+z is compatible with 1.0.0, if you land a breaking change bump +# the version to 2.0.0. +# See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 +version: 0.0.1 +homepage: https://github.com/flutter/plugins/tree/master/packages/url_launcher/url_launcher_windows + +flutter: + plugin: + platforms: + windows: + pluginClass: UrlLauncherPlugin + +environment: + sdk: ">=2.1.0 <3.0.0" + flutter: ">=1.12.8 <2.0.0" + +dependencies: + flutter: + sdk: flutter diff --git a/packages/url_launcher/url_launcher_windows/windows/.gitignore b/packages/url_launcher/url_launcher_windows/windows/.gitignore new file mode 100644 index 000000000000..b3eb2be169a5 --- /dev/null +++ b/packages/url_launcher/url_launcher_windows/windows/.gitignore @@ -0,0 +1,17 @@ +flutter/ + +# Visual Studio user-specific files. +*.suo +*.user +*.userosscache +*.sln.docstates + +# Visual Studio build-related files. +x64/ +x86/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ diff --git a/packages/url_launcher/url_launcher_windows/windows/CMakeLists.txt b/packages/url_launcher/url_launcher_windows/windows/CMakeLists.txt new file mode 100644 index 000000000000..57d87e3f6f85 --- /dev/null +++ b/packages/url_launcher/url_launcher_windows/windows/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.10) +set(PROJECT_NAME "url_launcher_windows") +project(${PROJECT_NAME} LANGUAGES CXX) + +set(PLUGIN_NAME "${PROJECT_NAME}_plugin") + +add_library(${PLUGIN_NAME} SHARED + "url_launcher_plugin.cpp" +) +apply_standard_settings(${PLUGIN_NAME}) +set_target_properties(${PLUGIN_NAME} PROPERTIES + CXX_VISIBILITY_PRESET hidden) +target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL) +target_include_directories(${PLUGIN_NAME} INTERFACE + "${CMAKE_CURRENT_SOURCE_DIR}/include") +target_link_libraries(${PLUGIN_NAME} PRIVATE flutter flutter_wrapper_plugin) + +# List of absolute paths to libraries that should be bundled with the plugin +set(file_chooser_bundled_libraries + "" + PARENT_SCOPE +) diff --git a/packages/url_launcher/url_launcher_windows/windows/include/url_launcher_windows/url_launcher_plugin.h b/packages/url_launcher/url_launcher_windows/windows/include/url_launcher_windows/url_launcher_plugin.h new file mode 100644 index 000000000000..cdd018a0924e --- /dev/null +++ b/packages/url_launcher/url_launcher_windows/windows/include/url_launcher_windows/url_launcher_plugin.h @@ -0,0 +1,26 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +#ifndef PACKAGES_URL_LAUNCHER_URL_LAUNCHER_WINDOWS_WINDOWS_INCLUDE_URL_LAUNCHER_WINDOWS_URL_LAUNCHER_PLUGIN_H_ +#define PACKAGES_URL_LAUNCHER_URL_LAUNCHER_WINDOWS_WINDOWS_INCLUDE_URL_LAUNCHER_WINDOWS_URL_LAUNCHER_PLUGIN_H_ + +#include + +#ifdef FLUTTER_PLUGIN_IMPL +#define FLUTTER_PLUGIN_EXPORT __declspec(dllexport) +#else +#define FLUTTER_PLUGIN_EXPORT __declspec(dllimport) +#endif + +#if defined(__cplusplus) +extern "C" { +#endif + +FLUTTER_PLUGIN_EXPORT void UrlLauncherPluginRegisterWithRegistrar( + FlutterDesktopPluginRegistrarRef registrar); + +#if defined(__cplusplus) +} // extern "C" +#endif + +#endif // PACKAGES_URL_LAUNCHER_URL_LAUNCHER_WINDOWS_WINDOWS_INCLUDE_URL_LAUNCHER_WINDOWS_URL_LAUNCHER_PLUGIN_H_ diff --git a/packages/url_launcher/url_launcher_windows/windows/url_launcher_plugin.cpp b/packages/url_launcher/url_launcher_windows/windows/url_launcher_plugin.cpp new file mode 100644 index 000000000000..dfb406385787 --- /dev/null +++ b/packages/url_launcher/url_launcher_windows/windows/url_launcher_plugin.cpp @@ -0,0 +1,148 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +#include "include/url_launcher_windows/url_launcher_plugin.h" + +#include +#include +#include +#include + +#include +#include +#include + +namespace { + +using flutter::EncodableMap; +using flutter::EncodableValue; + +// Converts the given UTF-8 string to UTF-16. +std::wstring Utf16FromUtf8(const std::string& utf8_string) { + if (utf8_string.empty()) { + return std::wstring(); + } + int target_length = + ::MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, utf8_string.data(), + static_cast(utf8_string.length()), nullptr, 0); + if (target_length == 0) { + return std::wstring(); + } + std::wstring utf16_string; + utf16_string.resize(target_length); + int converted_length = + ::MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, utf8_string.data(), + static_cast(utf8_string.length()), + utf16_string.data(), target_length); + if (converted_length == 0) { + return std::wstring(); + } + return utf16_string; +} + +// Returns the URL argument from |method_call| if it is present, otherwise +// returns an empty string. +std::string GetUrlArgument(const flutter::MethodCall<>& method_call) { + std::string url; + const auto* arguments = std::get_if(method_call.arguments()); + if (arguments) { + auto url_it = arguments->find(EncodableValue("url")); + if (url_it != arguments->end()) { + url = std::get(url_it->second); + } + } + return url; +} + +class UrlLauncherPlugin : public flutter::Plugin { + public: + static void RegisterWithRegistrar(flutter::PluginRegistrar* registrar); + + virtual ~UrlLauncherPlugin(); + + private: + UrlLauncherPlugin(); + + // Called when a method is called on plugin channel; + void HandleMethodCall(const flutter::MethodCall<>& method_call, + std::unique_ptr> result); +}; + +// static +void UrlLauncherPlugin::RegisterWithRegistrar( + flutter::PluginRegistrar* registrar) { + auto channel = std::make_unique>( + registrar->messenger(), "plugins.flutter.io/url_launcher", + &flutter::StandardMethodCodec::GetInstance()); + + // Uses new instead of make_unique due to private constructor. + std::unique_ptr plugin(new UrlLauncherPlugin()); + + channel->SetMethodCallHandler( + [plugin_pointer = plugin.get()](const auto& call, auto result) { + plugin_pointer->HandleMethodCall(call, std::move(result)); + }); + + registrar->AddPlugin(std::move(plugin)); +} + +UrlLauncherPlugin::UrlLauncherPlugin() = default; + +UrlLauncherPlugin::~UrlLauncherPlugin() = default; + +void UrlLauncherPlugin::HandleMethodCall( + const flutter::MethodCall<>& method_call, + std::unique_ptr> result) { + if (method_call.method_name().compare("launch") == 0) { + std::string url = GetUrlArgument(method_call); + if (url.empty()) { + result->Error("argument_error", "No URL provided"); + return; + } + std::wstring url_wide = Utf16FromUtf8(url); + + int status = static_cast(reinterpret_cast( + ::ShellExecute(nullptr, TEXT("open"), url_wide.c_str(), nullptr, + nullptr, SW_SHOWNORMAL))); + + if (status <= 32) { + std::ostringstream error_message; + error_message << "Failed to open " << url << ": ShellExecute error code " + << status; + result->Error("open_error", error_message.str()); + return; + } + result->Success(EncodableValue(true)); + } else if (method_call.method_name().compare("canLaunch") == 0) { + std::string url = GetUrlArgument(method_call); + if (url.empty()) { + result->Error("argument_error", "No URL provided"); + return; + } + + bool can_launch = false; + size_t separator_location = url.find(":"); + if (separator_location != std::string::npos) { + std::wstring scheme = Utf16FromUtf8(url.substr(0, separator_location)); + HKEY key = nullptr; + if (::RegOpenKeyEx(HKEY_CLASSES_ROOT, scheme.c_str(), 0, KEY_QUERY_VALUE, + &key) == ERROR_SUCCESS) { + can_launch = ::RegQueryValueEx(key, L"URL Protocol", nullptr, nullptr, + nullptr, nullptr) == ERROR_SUCCESS; + ::RegCloseKey(key); + } + } + result->Success(EncodableValue(can_launch)); + } else { + result->NotImplemented(); + } +} + +} // namespace + +void UrlLauncherPluginRegisterWithRegistrar( + FlutterDesktopPluginRegistrarRef registrar) { + UrlLauncherPlugin::RegisterWithRegistrar( + flutter::PluginRegistrarManager::GetInstance() + ->GetRegistrar(registrar)); +} From 7e0fc944b8444d6a32c3a5538706e9eada2b39c6 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Sat, 12 Sep 2020 12:17:34 -0700 Subject: [PATCH 086/233] [in_app_purchase]fix version (#3022) --- packages/in_app_purchase/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/in_app_purchase/pubspec.yaml b/packages/in_app_purchase/pubspec.yaml index e831d902c91f..52abe9680329 100644 --- a/packages/in_app_purchase/pubspec.yaml +++ b/packages/in_app_purchase/pubspec.yaml @@ -1,7 +1,7 @@ name: in_app_purchase description: A Flutter plugin for in-app purchases. Exposes APIs for making in-app purchases through the App Store and Google Play. homepage: https://github.com/flutter/plugins/tree/master/packages/in_app_purchase -version: 0.3.4+7 +version: 0.3.4+8 dependencies: async: ^2.0.8 From 4eb849afcd672e43b68139b27c258fad2434733d Mon Sep 17 00:00:00 2001 From: Hamdi Kahloun <32666446+hamdikahloun@users.noreply.github.com> Date: Mon, 14 Sep 2020 18:16:35 +0100 Subject: [PATCH 087/233] [android_alarm_manager] Android Code Inspection and Clean up (#3020) -Werror and code cleanup for Java code. --- packages/android_alarm_manager/CHANGELOG.md | 4 ++ .../android/build.gradle | 5 ++ .../androidalarmmanager/AlarmService.java | 21 +++--- .../AndroidAlarmManagerPlugin.java | 68 ++++++++++--------- .../FlutterBackgroundExecutor.java | 9 +-- packages/android_alarm_manager/pubspec.yaml | 2 +- 6 files changed, 58 insertions(+), 51 deletions(-) diff --git a/packages/android_alarm_manager/CHANGELOG.md b/packages/android_alarm_manager/CHANGELOG.md index faa2c731873d..22c3d822ec04 100644 --- a/packages/android_alarm_manager/CHANGELOG.md +++ b/packages/android_alarm_manager/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.4.5+13 + +* Android Code Inspection and Clean up. + ## 0.4.5+12 * Update package:e2e reference to use the local version in the flutter/plugins diff --git a/packages/android_alarm_manager/android/build.gradle b/packages/android_alarm_manager/android/build.gradle index 04d09f62d936..8a59fed74438 100644 --- a/packages/android_alarm_manager/android/build.gradle +++ b/packages/android_alarm_manager/android/build.gradle @@ -1,5 +1,6 @@ group 'io.flutter.plugins.androidalarmmanager' version '1.0-SNAPSHOT' +def args = ["-Xlint:deprecation","-Xlint:unchecked","-Werror"] buildscript { repositories { @@ -19,6 +20,10 @@ rootProject.allprojects { } } +project.getTasks().withType(JavaCompile){ + options.compilerArgs.addAll(args) +} + apply plugin: 'com.android.library' android { diff --git a/packages/android_alarm_manager/android/src/main/java/io/flutter/plugins/androidalarmmanager/AlarmService.java b/packages/android_alarm_manager/android/src/main/java/io/flutter/plugins/androidalarmmanager/AlarmService.java index fb6e7f85b317..107d76738fe3 100644 --- a/packages/android_alarm_manager/android/src/main/java/io/flutter/plugins/androidalarmmanager/AlarmService.java +++ b/packages/android_alarm_manager/android/src/main/java/io/flutter/plugins/androidalarmmanager/AlarmService.java @@ -17,7 +17,6 @@ import java.util.Collections; import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Set; @@ -76,9 +75,8 @@ public static void startBackgroundIsolate(Context context, long callbackHandle) synchronized (alarmQueue) { // Handle all the alarm events received before the Dart isolate was // initialized, then clear the queue. - Iterator i = alarmQueue.iterator(); - while (i.hasNext()) { - flutterBackgroundExecutor.executeDartCallbackInBackgroundIsolate(i.next(), null); + for (Intent intent : alarmQueue) { + flutterBackgroundExecutor.executeDartCallbackInBackgroundIsolate(intent, null); } alarmQueue.clear(); } @@ -231,7 +229,7 @@ public static void cancel(Context context, int requestCode) { } private static String getPersistentAlarmKey(int requestCode) { - return "android_alarm_manager/persistent_alarm_" + Integer.toString(requestCode); + return "android_alarm_manager/persistent_alarm_" + requestCode; } private static void addPersistentAlarm( @@ -276,13 +274,14 @@ private static void addPersistentAlarm( } private static void clearPersistentAlarm(Context context, int requestCode) { + String request = String.valueOf(requestCode); SharedPreferences p = context.getSharedPreferences(SHARED_PREFERENCES_KEY, 0); synchronized (persistentAlarmsLock) { Set persistentAlarms = p.getStringSet(PERSISTENT_ALARMS_SET_KEY, null); - if ((persistentAlarms == null) || !persistentAlarms.contains(requestCode)) { + if ((persistentAlarms == null) || !persistentAlarms.contains(request)) { return; } - persistentAlarms.remove(requestCode); + persistentAlarms.remove(request); String key = getPersistentAlarmKey(requestCode); p.edit().remove(key).putStringSet(PERSISTENT_ALARMS_SET_KEY, persistentAlarms).apply(); @@ -301,14 +300,12 @@ public static void reschedulePersistentAlarms(Context context) { return; } - Iterator it = persistentAlarms.iterator(); - while (it.hasNext()) { - int requestCode = Integer.parseInt(it.next()); + for (String persistentAlarm : persistentAlarms) { + int requestCode = Integer.parseInt(persistentAlarm); String key = getPersistentAlarmKey(requestCode); String json = p.getString(key, null); if (json == null) { - Log.e( - TAG, "Data for alarm request code " + Integer.toString(requestCode) + " is invalid."); + Log.e(TAG, "Data for alarm request code " + requestCode + " is invalid."); continue; } try { diff --git a/packages/android_alarm_manager/android/src/main/java/io/flutter/plugins/androidalarmmanager/AndroidAlarmManagerPlugin.java b/packages/android_alarm_manager/android/src/main/java/io/flutter/plugins/androidalarmmanager/AndroidAlarmManagerPlugin.java index 2f3f5f9f2925..5a135f95e631 100644 --- a/packages/android_alarm_manager/android/src/main/java/io/flutter/plugins/androidalarmmanager/AndroidAlarmManagerPlugin.java +++ b/packages/android_alarm_manager/android/src/main/java/io/flutter/plugins/androidalarmmanager/AndroidAlarmManagerPlugin.java @@ -107,37 +107,43 @@ public void onMethodCall(MethodCall call, Result result) { String method = call.method; Object arguments = call.arguments; try { - if (method.equals("AlarmService.start")) { - // This message is sent when the Dart side of this plugin is told to initialize. - long callbackHandle = ((JSONArray) arguments).getLong(0); - // In response, this (native) side of the plugin needs to spin up a background - // Dart isolate by using the given callbackHandle, and then setup a background - // method channel to communicate with the new background isolate. Once completed, - // this onMethodCall() method will receive messages from both the primary and background - // method channels. - AlarmService.setCallbackDispatcher(context, callbackHandle); - AlarmService.startBackgroundIsolate(context, callbackHandle); - result.success(true); - } else if (method.equals("Alarm.periodic")) { - // This message indicates that the Flutter app would like to schedule a periodic - // task. - PeriodicRequest periodicRequest = PeriodicRequest.fromJson((JSONArray) arguments); - AlarmService.setPeriodic(context, periodicRequest); - result.success(true); - } else if (method.equals("Alarm.oneShotAt")) { - // This message indicates that the Flutter app would like to schedule a one-time - // task. - OneShotRequest oneShotRequest = OneShotRequest.fromJson((JSONArray) arguments); - AlarmService.setOneShot(context, oneShotRequest); - result.success(true); - } else if (method.equals("Alarm.cancel")) { - // This message indicates that the Flutter app would like to cancel a previously - // scheduled task. - int requestCode = ((JSONArray) arguments).getInt(0); - AlarmService.cancel(context, requestCode); - result.success(true); - } else { - result.notImplemented(); + switch (method) { + case "AlarmService.start": + // This message is sent when the Dart side of this plugin is told to initialize. + long callbackHandle = ((JSONArray) arguments).getLong(0); + // In response, this (native) side of the plugin needs to spin up a background + // Dart isolate by using the given callbackHandle, and then setup a background + // method channel to communicate with the new background isolate. Once completed, + // this onMethodCall() method will receive messages from both the primary and background + // method channels. + AlarmService.setCallbackDispatcher(context, callbackHandle); + AlarmService.startBackgroundIsolate(context, callbackHandle); + result.success(true); + break; + case "Alarm.periodic": + // This message indicates that the Flutter app would like to schedule a periodic + // task. + PeriodicRequest periodicRequest = PeriodicRequest.fromJson((JSONArray) arguments); + AlarmService.setPeriodic(context, periodicRequest); + result.success(true); + break; + case "Alarm.oneShotAt": + // This message indicates that the Flutter app would like to schedule a one-time + // task. + OneShotRequest oneShotRequest = OneShotRequest.fromJson((JSONArray) arguments); + AlarmService.setOneShot(context, oneShotRequest); + result.success(true); + break; + case "Alarm.cancel": + // This message indicates that the Flutter app would like to cancel a previously + // scheduled task. + int requestCode = ((JSONArray) arguments).getInt(0); + AlarmService.cancel(context, requestCode); + result.success(true); + break; + default: + result.notImplemented(); + break; } } catch (JSONException e) { result.error("error", "JSON error: " + e.getMessage(), null); diff --git a/packages/android_alarm_manager/android/src/main/java/io/flutter/plugins/androidalarmmanager/FlutterBackgroundExecutor.java b/packages/android_alarm_manager/android/src/main/java/io/flutter/plugins/androidalarmmanager/FlutterBackgroundExecutor.java index 4e755c315528..8d5290842e14 100644 --- a/packages/android_alarm_manager/android/src/main/java/io/flutter/plugins/androidalarmmanager/FlutterBackgroundExecutor.java +++ b/packages/android_alarm_manager/android/src/main/java/io/flutter/plugins/androidalarmmanager/FlutterBackgroundExecutor.java @@ -78,7 +78,6 @@ private void onInitialized() { @Override public void onMethodCall(MethodCall call, Result result) { String method = call.method; - Object arguments = call.arguments; try { if (method.equals("AlarmService.initialized")) { // This message is sent by the background method channel as soon as the background isolate @@ -152,9 +151,9 @@ public void startBackgroundIsolate(Context context, long callbackHandle) { } Log.i(TAG, "Starting AlarmService..."); - String appBundlePath = FlutterMain.findAppBundlePath(context); + String appBundlePath = FlutterMain.findAppBundlePath(); AssetManager assets = context.getAssets(); - if (appBundlePath != null && !isRunning()) { + if (!isRunning()) { backgroundFlutterEngine = new FlutterEngine(context); // We need to create an instance of `FlutterEngine` before looking up the @@ -162,10 +161,6 @@ public void startBackgroundIsolate(Context context, long callbackHandle) { // lookup will fail. FlutterCallbackInformation flutterCallback = FlutterCallbackInformation.lookupCallbackInformation(callbackHandle); - if (flutterCallback == null) { - Log.e(TAG, "Fatal: failed to find callback"); - return; - } DartExecutor executor = backgroundFlutterEngine.getDartExecutor(); initializeMethodChannel(executor); diff --git a/packages/android_alarm_manager/pubspec.yaml b/packages/android_alarm_manager/pubspec.yaml index 8e46b8c202eb..85c6609d5780 100644 --- a/packages/android_alarm_manager/pubspec.yaml +++ b/packages/android_alarm_manager/pubspec.yaml @@ -4,7 +4,7 @@ description: Flutter plugin for accessing the Android AlarmManager service, and # 0.4.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.4.5+11 +version: 0.4.5+12 homepage: https://github.com/flutter/plugins/tree/master/packages/android_alarm_manager dependencies: From 56410f5d2caf3fa0cd1d416f1fae126f70d24954 Mon Sep 17 00:00:00 2001 From: David Iglesias Date: Mon, 14 Sep 2020 12:38:11 -0700 Subject: [PATCH 088/233] [google_sign_in_web] Ensure plugin throws PlatformExceptions (#2943) Instead of throwing JS objects, or attempting to access undefined properties. This change also migrates tests to the `integration_test` package. --- .../google_sign_in_web/CHANGELOG.md | 7 + .../google_sign_in_web/README.md | 6 +- .../lib/google_sign_in_web.dart | 27 ++- .../lib/src/generated/gapiauth2.dart | 19 +- .../google_sign_in_web/pubspec.yaml | 4 +- .../google_sign_in_web/test/README.md | 17 ++ .../google_sign_in_web/test/auth2_test.dart | 83 -------- .../test/gapi_mocks/src/auth2_init.dart | 47 ----- .../google_sign_in_web/test/lib/main.dart | 22 ++ .../google_sign_in_web/test/pubspec.yaml | 24 +++ .../google_sign_in_web/test/run_test | 17 ++ .../test/test_driver/auth2_integration.dart | 192 ++++++++++++++++++ .../test_driver/auth2_integration_test.dart | 7 + .../gapi_load_integration.dart} | 12 +- .../gapi_load_integration_test.dart | 7 + .../gapi_mocks/gapi_mocks.dart | 0 .../gapi_mocks/src/auth2_init.dart | 107 ++++++++++ .../gapi_mocks/src/gapi.dart | 0 .../gapi_mocks/src/google_user.dart | 0 .../gapi_mocks/src/test_iife.dart | 0 .../gapi_utils_integration.dart} | 16 +- .../gapi_utils_integration_test.dart | 7 + .../src/test_utils.dart} | 0 .../google_sign_in_web/test/web/index.html | 13 ++ 24 files changed, 477 insertions(+), 157 deletions(-) create mode 100644 packages/google_sign_in/google_sign_in_web/test/README.md delete mode 100644 packages/google_sign_in/google_sign_in_web/test/auth2_test.dart delete mode 100644 packages/google_sign_in/google_sign_in_web/test/gapi_mocks/src/auth2_init.dart create mode 100644 packages/google_sign_in/google_sign_in_web/test/lib/main.dart create mode 100644 packages/google_sign_in/google_sign_in_web/test/pubspec.yaml create mode 100755 packages/google_sign_in/google_sign_in_web/test/run_test create mode 100644 packages/google_sign_in/google_sign_in_web/test/test_driver/auth2_integration.dart create mode 100644 packages/google_sign_in/google_sign_in_web/test/test_driver/auth2_integration_test.dart rename packages/google_sign_in/google_sign_in_web/test/{gapi_load_test.dart => test_driver/gapi_load_integration.dart} (83%) create mode 100644 packages/google_sign_in/google_sign_in_web/test/test_driver/gapi_load_integration_test.dart rename packages/google_sign_in/google_sign_in_web/test/{ => test_driver}/gapi_mocks/gapi_mocks.dart (100%) create mode 100644 packages/google_sign_in/google_sign_in_web/test/test_driver/gapi_mocks/src/auth2_init.dart rename packages/google_sign_in/google_sign_in_web/test/{ => test_driver}/gapi_mocks/src/gapi.dart (100%) rename packages/google_sign_in/google_sign_in_web/test/{ => test_driver}/gapi_mocks/src/google_user.dart (100%) rename packages/google_sign_in/google_sign_in_web/test/{ => test_driver}/gapi_mocks/src/test_iife.dart (100%) rename packages/google_sign_in/google_sign_in_web/test/{gapi_utils_test.dart => test_driver/gapi_utils_integration.dart} (70%) create mode 100644 packages/google_sign_in/google_sign_in_web/test/test_driver/gapi_utils_integration_test.dart rename packages/google_sign_in/google_sign_in_web/test/{utils.dart => test_driver/src/test_utils.dart} (100%) create mode 100644 packages/google_sign_in/google_sign_in_web/test/web/index.html diff --git a/packages/google_sign_in/google_sign_in_web/CHANGELOG.md b/packages/google_sign_in/google_sign_in_web/CHANGELOG.md index 35a6934f9d4e..d71badc53bfc 100644 --- a/packages/google_sign_in/google_sign_in_web/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in_web/CHANGELOG.md @@ -1,3 +1,10 @@ +## 0.9.2 + +* Throw PlatformExceptions from where the GMaps SDK may throw exceptions: `init()` and `signIn()`. +* Add two new JS-interop types to be able to unwrap JS errors in release mode. +* Align the fields of the thrown PlatformExceptions with the mobile version. +* Migrate tests to run with `flutter drive` + ## 0.9.1+2 * Update package:e2e reference to use the local version in the flutter/plugins diff --git a/packages/google_sign_in/google_sign_in_web/README.md b/packages/google_sign_in/google_sign_in_web/README.md index 930212c17558..7a44e998f3c3 100644 --- a/packages/google_sign_in/google_sign_in_web/README.md +++ b/packages/google_sign_in/google_sign_in_web/README.md @@ -98,11 +98,7 @@ See the [google_sign_in.dart](https://github.com/flutter/plugins/blob/master/pac Tests are a crucial to contributions to this package. All new contributions should be reasonably tested. -In order to run tests in this package, do: - -``` -flutter test --platform chrome -j1 -``` +**Check the [`test/README.md` file](https://github.com/flutter/plugins/blob/master/packages/google_sign_in/google_sign_in_web/test/README.md)** for more information on how to run tests on this package. Contributions to this package are welcome. Read the [Contributing to Flutter Plugins](https://github.com/flutter/plugins/blob/master/CONTRIBUTING.md) guide to get started. diff --git a/packages/google_sign_in/google_sign_in_web/lib/google_sign_in_web.dart b/packages/google_sign_in/google_sign_in_web/lib/google_sign_in_web.dart index bb43ba100c5d..dd82852fa350 100644 --- a/packages/google_sign_in/google_sign_in_web/lib/google_sign_in_web.dart +++ b/packages/google_sign_in/google_sign_in_web/lib/google_sign_in_web.dart @@ -105,16 +105,17 @@ class GoogleSignInPlugin extends GoogleSignInPlatform { // state of the authentication, i.e: if you logout elsewhere... isAuthInitialized.complete(); - }), allowInterop((dynamic reason) { + }), allowInterop((auth2.GoogleAuthInitFailureError reason) { // onError - throw PlatformException( - code: 'google_sign_in', - message: reason.error, - details: reason.details, - ); + isAuthInitialized.completeError(PlatformException( + code: reason.error, + message: reason.details, + details: + 'https://developers.google.com/identity/sign-in/web/reference#error_codes', + )); })); - return null; + return _isAuthInitialized; } @override @@ -128,8 +129,16 @@ class GoogleSignInPlugin extends GoogleSignInPlatform { @override Future signIn() async { await initialized; - - return gapiUserToPluginUserData(await auth2.getAuthInstance().signIn()); + try { + return gapiUserToPluginUserData(await auth2.getAuthInstance().signIn()); + } on auth2.GoogleAuthSignInError catch (reason) { + throw PlatformException( + code: reason.error, + message: 'Exception raised from GoogleAuth.signIn()', + details: + 'https://developers.google.com/identity/sign-in/web/reference#error_codes_2', + ); + } } @override diff --git a/packages/google_sign_in/google_sign_in_web/lib/src/generated/gapiauth2.dart b/packages/google_sign_in/google_sign_in_web/lib/src/generated/gapiauth2.dart index e05bedf3af1e..ed7a2816d55e 100644 --- a/packages/google_sign_in/google_sign_in_web/lib/src/generated/gapiauth2.dart +++ b/packages/google_sign_in/google_sign_in_web/lib/src/generated/gapiauth2.dart @@ -16,6 +16,23 @@ import "package:js/js_util.dart" show promiseToFuture; /// +@anonymous +@JS() +class GoogleAuthInitFailureError { + external String get error; + external set error(String value); + + external String get details; + external set details(String value); +} + +@anonymous +@JS() +class GoogleAuthSignInError { + external String get error; + external set error(String value); +} + // Module gapi.auth2 /// GoogleAuth is a singleton class that provides methods to allow the user to sign in with a Google account, /// get the user's current sign-in status, get specific data from the user's Google profile, @@ -30,7 +47,7 @@ class GoogleAuth { /// Calls the onInit function when the GoogleAuth object is fully initialized, or calls the onFailure function if /// initialization fails. external dynamic then(dynamic onInit(GoogleAuth googleAuth), - [dynamic onFailure(dynamic /*{error: string, details: string}*/ reason)]); + [dynamic onFailure(GoogleAuthInitFailureError reason)]); /// Signs out all accounts from the application. external dynamic signOut(); diff --git a/packages/google_sign_in/google_sign_in_web/pubspec.yaml b/packages/google_sign_in/google_sign_in_web/pubspec.yaml index 8b48d36fde3c..70758ac6830d 100644 --- a/packages/google_sign_in/google_sign_in_web/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in_web/pubspec.yaml @@ -2,7 +2,7 @@ name: google_sign_in_web description: Flutter plugin for Google Sign-In, a secure authentication system for signing in with a Google account on Android, iOS and Web. homepage: https://github.com/flutter/plugins/tree/master/packages/google_sign_in/google_sign_in_web -version: 0.9.1+2 +version: 0.9.2 flutter: plugin: @@ -26,6 +26,8 @@ dev_dependencies: google_sign_in: ^4.0.14 pedantic: ^1.8.0 mockito: ^4.1.1 + integration_test: + path: ../../integration_test environment: sdk: ">=2.6.0 <3.0.0" diff --git a/packages/google_sign_in/google_sign_in_web/test/README.md b/packages/google_sign_in/google_sign_in_web/test/README.md new file mode 100644 index 000000000000..7c48d024ba57 --- /dev/null +++ b/packages/google_sign_in/google_sign_in_web/test/README.md @@ -0,0 +1,17 @@ +# Running browser_tests + +Make sure you have updated to the latest Flutter master. + +1. Check what version of Chrome is running on the machine you're running tests on. + +2. Download and install driver for that version from here: + * + +3. Start the driver using `chromedriver --port=4444` + +4. Change into the `test` directory of your clone. + +5. Run tests: `flutter drive -d web-server --browser-name=chrome --target=test_driver/TEST_NAME_integration.dart`, or (in Linux): + + * Single: `./run_test test_driver/TEST_NAME_integration.dart` + * All: `./run_test` diff --git a/packages/google_sign_in/google_sign_in_web/test/auth2_test.dart b/packages/google_sign_in/google_sign_in_web/test/auth2_test.dart deleted file mode 100644 index 40bc8a404d06..000000000000 --- a/packages/google_sign_in/google_sign_in_web/test/auth2_test.dart +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -@TestOn('browser') - -import 'package:flutter_test/flutter_test.dart'; -import 'package:google_sign_in_platform_interface/google_sign_in_platform_interface.dart'; -import 'package:google_sign_in_web/google_sign_in_web.dart'; -import 'gapi_mocks/gapi_mocks.dart' as gapi_mocks; -import 'utils.dart'; - -void main() { - GoogleSignInTokenData expectedTokenData = - GoogleSignInTokenData(idToken: '70k3n', accessToken: 'access_70k3n'); - - GoogleSignInUserData expectedUserData = GoogleSignInUserData( - displayName: 'Foo Bar', - email: 'foo@example.com', - id: '123', - photoUrl: 'http://example.com/img.jpg', - idToken: expectedTokenData.idToken, - ); - - // The pre-configured use case for the instances of the plugin in this test - gapiUrl = toBase64Url(gapi_mocks.auth2InitSuccess(expectedUserData)); - - GoogleSignInPlugin plugin; - - setUp(() { - plugin = GoogleSignInPlugin(); - }); - - test('Init requires clientId', () async { - expect(plugin.init(hostedDomain: ''), throwsAssertionError); - }); - - test('Init doesn\'t accept spaces in scopes', () async { - expect( - plugin.init( - hostedDomain: '', - clientId: '', - scopes: ['scope with spaces'], - ), - throwsAssertionError); - }); - - group('Successful .init, then', () { - setUp(() async { - await plugin.init( - hostedDomain: 'foo', - scopes: ['some', 'scope'], - clientId: '1234', - ); - await plugin.initialized; - }); - - test('signInSilently', () async { - GoogleSignInUserData actualUser = await plugin.signInSilently(); - - expect(actualUser, expectedUserData); - }); - - test('signIn', () async { - GoogleSignInUserData actualUser = await plugin.signIn(); - - expect(actualUser, expectedUserData); - }); - - test('getTokens', () async { - GoogleSignInTokenData actualToken = - await plugin.getTokens(email: expectedUserData.email); - - expect(actualToken, expectedTokenData); - }); - - test('requestScopes', () async { - bool scopeGranted = await plugin.requestScopes(['newScope']); - - expect(scopeGranted, isTrue); - }); - }); -} diff --git a/packages/google_sign_in/google_sign_in_web/test/gapi_mocks/src/auth2_init.dart b/packages/google_sign_in/google_sign_in_web/test/gapi_mocks/src/auth2_init.dart deleted file mode 100644 index 1846033151c1..000000000000 --- a/packages/google_sign_in/google_sign_in_web/test/gapi_mocks/src/auth2_init.dart +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of gapi_mocks; - -// JS mock of a gapi.auth2, with a successfully identified user -String auth2InitSuccess(GoogleSignInUserData userData) => testIife(''' -${gapi()} - -var mockUser = ${googleUser(userData)}; - -function GapiAuth2() {} -GapiAuth2.prototype.init = function (initOptions) { - return { - then: (onSuccess, onError) => { - window.setTimeout(() => { - onSuccess(window.gapi.auth2); - }, 30); - }, - currentUser: { - listen: (cb) => { - window.setTimeout(() => { - cb(mockUser); - }, 30); - } - } - } -}; - -GapiAuth2.prototype.getAuthInstance = function () { - return { - signIn: () => { - return new Promise((resolve, reject) => { - window.setTimeout(() => { - resolve(mockUser); - }, 30); - }); - }, - currentUser: { - get: () => mockUser, - }, - } -}; - -window.gapi.auth2 = new GapiAuth2(); -'''); diff --git a/packages/google_sign_in/google_sign_in_web/test/lib/main.dart b/packages/google_sign_in/google_sign_in_web/test/lib/main.dart new file mode 100644 index 000000000000..10415204570c --- /dev/null +++ b/packages/google_sign_in/google_sign_in_web/test/lib/main.dart @@ -0,0 +1,22 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:flutter/material.dart'; + +void main() { + runApp(MyApp()); +} + +/// App for testing +class MyApp extends StatefulWidget { + @override + _MyAppState createState() => _MyAppState(); +} + +class _MyAppState extends State { + @override + Widget build(BuildContext context) { + return Text('Testing... Look at the console output for results!'); + } +} diff --git a/packages/google_sign_in/google_sign_in_web/test/pubspec.yaml b/packages/google_sign_in/google_sign_in_web/test/pubspec.yaml new file mode 100644 index 000000000000..dd0354e81498 --- /dev/null +++ b/packages/google_sign_in/google_sign_in_web/test/pubspec.yaml @@ -0,0 +1,24 @@ +name: regular_integration_tests +publish_to: none + +environment: + sdk: ">=2.2.2 <3.0.0" + +dependencies: + flutter: + sdk: flutter + +dev_dependencies: + google_sign_in: ^4.5.3 + flutter_driver: + sdk: flutter + flutter_test: + sdk: flutter + http: ^0.12.2 + mockito: ^4.1.1 + integration_test: + path: ../../../integration_test + +dependency_overrides: + google_sign_in_web: + path: ../ diff --git a/packages/google_sign_in/google_sign_in_web/test/run_test b/packages/google_sign_in/google_sign_in_web/test/run_test new file mode 100755 index 000000000000..74a8526a0fa3 --- /dev/null +++ b/packages/google_sign_in/google_sign_in_web/test/run_test @@ -0,0 +1,17 @@ +#!/usr/bin/bash +if pgrep -lf chromedriver > /dev/null; then + echo "chromedriver is running." + + if [ $# -eq 0 ]; then + echo "No target specified, running all tests..." + find test_driver/ -iname *_integration.dart | xargs -n1 -i -t flutter drive -d web-server --web-port=7357 --browser-name=chrome --target='{}' + else + echo "Running test target: $1..." + set -x + flutter drive -d web-server --web-port=7357 --browser-name=chrome --target=$1 + fi + + else + echo "chromedriver is not running." +fi + diff --git a/packages/google_sign_in/google_sign_in_web/test/test_driver/auth2_integration.dart b/packages/google_sign_in/google_sign_in_web/test/test_driver/auth2_integration.dart new file mode 100644 index 000000000000..e2f16f2aee43 --- /dev/null +++ b/packages/google_sign_in/google_sign_in_web/test/test_driver/auth2_integration.dart @@ -0,0 +1,192 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:flutter/services.dart'; +import 'package:integration_test/integration_test.dart'; + +import 'package:flutter_test/flutter_test.dart'; +import 'package:google_sign_in_platform_interface/google_sign_in_platform_interface.dart'; +import 'package:google_sign_in_web/google_sign_in_web.dart'; +import 'gapi_mocks/gapi_mocks.dart' as gapi_mocks; +import 'src/test_utils.dart'; + +void main() { + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + + GoogleSignInTokenData expectedTokenData = + GoogleSignInTokenData(idToken: '70k3n', accessToken: 'access_70k3n'); + + GoogleSignInUserData expectedUserData = GoogleSignInUserData( + displayName: 'Foo Bar', + email: 'foo@example.com', + id: '123', + photoUrl: 'http://example.com/img.jpg', + idToken: expectedTokenData.idToken, + ); + + GoogleSignInPlugin plugin; + + group('plugin.init() throws a catchable exception', () { + setUp(() { + // The pre-configured use case for the instances of the plugin in this test + gapiUrl = toBase64Url(gapi_mocks.auth2InitError()); + plugin = GoogleSignInPlugin(); + }); + + testWidgets('init throws PlatformException', (WidgetTester tester) async { + await expectLater( + plugin.init( + hostedDomain: 'foo', + scopes: ['some', 'scope'], + clientId: '1234', + ), + throwsA(isA())); + }); + + testWidgets('init forwards error code from JS', + (WidgetTester tester) async { + try { + await plugin.init( + hostedDomain: 'foo', + scopes: ['some', 'scope'], + clientId: '1234', + ); + fail('plugin.init should have thrown an exception!'); + } catch (e) { + expect(e.code, 'idpiframe_initialization_failed'); + } + }); + }); + + group('other methods also throw catchable exceptions on init fail', () { + // This function ensures that init gets called, but for some reason, we + // ignored that it has thrown stuff... + void _discardInit() async { + try { + await plugin.init( + hostedDomain: 'foo', + scopes: ['some', 'scope'], + clientId: '1234', + ); + } catch (e) { + // Noop so we can call other stuff + } + } + + setUp(() { + gapiUrl = toBase64Url(gapi_mocks.auth2InitError()); + plugin = GoogleSignInPlugin(); + }); + + testWidgets('signInSilently throws', (WidgetTester tester) async { + await _discardInit(); + await expectLater( + plugin.signInSilently(), throwsA(isA())); + }); + + testWidgets('signIn throws', (WidgetTester tester) async { + await _discardInit(); + await expectLater(plugin.signIn(), throwsA(isA())); + }); + + testWidgets('getTokens throws', (WidgetTester tester) async { + await _discardInit(); + await expectLater(plugin.getTokens(email: 'test@example.com'), + throwsA(isA())); + }); + testWidgets('requestScopes', (WidgetTester tester) async { + await _discardInit(); + await expectLater(plugin.requestScopes(['newScope']), + throwsA(isA())); + }); + }); + + group('auth2 Init Successful', () { + setUp(() { + // The pre-configured use case for the instances of the plugin in this test + gapiUrl = toBase64Url(gapi_mocks.auth2InitSuccess(expectedUserData)); + plugin = GoogleSignInPlugin(); + }); + + testWidgets('Init requires clientId', (WidgetTester tester) async { + expect(plugin.init(hostedDomain: ''), throwsAssertionError); + }); + + testWidgets('Init doesn\'t accept spaces in scopes', + (WidgetTester tester) async { + expect( + plugin.init( + hostedDomain: '', + clientId: '', + scopes: ['scope with spaces'], + ), + throwsAssertionError); + }); + + group('Successful .init, then', () { + setUp(() async { + await plugin.init( + hostedDomain: 'foo', + scopes: ['some', 'scope'], + clientId: '1234', + ); + await plugin.initialized; + }); + + testWidgets('signInSilently', (WidgetTester tester) async { + GoogleSignInUserData actualUser = await plugin.signInSilently(); + + expect(actualUser, expectedUserData); + }); + + testWidgets('signIn', (WidgetTester tester) async { + GoogleSignInUserData actualUser = await plugin.signIn(); + + expect(actualUser, expectedUserData); + }); + + testWidgets('getTokens', (WidgetTester tester) async { + GoogleSignInTokenData actualToken = + await plugin.getTokens(email: expectedUserData.email); + + expect(actualToken, expectedTokenData); + }); + + testWidgets('requestScopes', (WidgetTester tester) async { + bool scopeGranted = await plugin.requestScopes(['newScope']); + + expect(scopeGranted, isTrue); + }); + }); + }); + + group('auth2 Init successful, but exception on signIn() method', () { + setUp(() async { + // The pre-configured use case for the instances of the plugin in this test + gapiUrl = toBase64Url(gapi_mocks.auth2SignInError()); + plugin = GoogleSignInPlugin(); + await plugin.init( + hostedDomain: 'foo', + scopes: ['some', 'scope'], + clientId: '1234', + ); + await plugin.initialized; + }); + + testWidgets('User aborts sign in flow, throws PlatformException', + (WidgetTester tester) async { + await expectLater(plugin.signIn(), throwsA(isA())); + }); + + testWidgets('User aborts sign in flow, error code is forwarded from JS', + (WidgetTester tester) async { + try { + await plugin.signIn(); + fail('plugin.signIn() should have thrown an exception!'); + } catch (e) { + expect(e.code, 'popup_closed_by_user'); + } + }); + }); +} diff --git a/packages/google_sign_in/google_sign_in_web/test/test_driver/auth2_integration_test.dart b/packages/google_sign_in/google_sign_in_web/test/test_driver/auth2_integration_test.dart new file mode 100644 index 000000000000..39444c0daa24 --- /dev/null +++ b/packages/google_sign_in/google_sign_in_web/test/test_driver/auth2_integration_test.dart @@ -0,0 +1,7 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:integration_test/integration_test_driver.dart'; + +Future main() async => integrationDriver(); diff --git a/packages/google_sign_in/google_sign_in_web/test/gapi_load_test.dart b/packages/google_sign_in/google_sign_in_web/test/test_driver/gapi_load_integration.dart similarity index 83% rename from packages/google_sign_in/google_sign_in_web/test/gapi_load_test.dart rename to packages/google_sign_in/google_sign_in_web/test/test_driver/gapi_load_integration.dart index 6703beca2cad..540369cae370 100644 --- a/packages/google_sign_in/google_sign_in_web/test/gapi_load_test.dart +++ b/packages/google_sign_in/google_sign_in_web/test/test_driver/gapi_load_integration.dart @@ -2,21 +2,23 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -@TestOn('browser') - import 'dart:html' as html; +import 'package:integration_test/integration_test.dart'; + import 'package:flutter_test/flutter_test.dart'; import 'package:google_sign_in_platform_interface/google_sign_in_platform_interface.dart'; import 'package:google_sign_in_web/google_sign_in_web.dart'; import 'gapi_mocks/gapi_mocks.dart' as gapi_mocks; -import 'utils.dart'; +import 'src/test_utils.dart'; void main() { + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + gapiUrl = toBase64Url(gapi_mocks.auth2InitSuccess(GoogleSignInUserData())); - test('Plugin is initialized after GAPI fully loads and init is called', - () async { + testWidgets('Plugin is initialized after GAPI fully loads and init is called', + (WidgetTester tester) async { expect( html.querySelector('script[src^="data:"]'), isNull, diff --git a/packages/google_sign_in/google_sign_in_web/test/test_driver/gapi_load_integration_test.dart b/packages/google_sign_in/google_sign_in_web/test/test_driver/gapi_load_integration_test.dart new file mode 100644 index 000000000000..39444c0daa24 --- /dev/null +++ b/packages/google_sign_in/google_sign_in_web/test/test_driver/gapi_load_integration_test.dart @@ -0,0 +1,7 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:integration_test/integration_test_driver.dart'; + +Future main() async => integrationDriver(); diff --git a/packages/google_sign_in/google_sign_in_web/test/gapi_mocks/gapi_mocks.dart b/packages/google_sign_in/google_sign_in_web/test/test_driver/gapi_mocks/gapi_mocks.dart similarity index 100% rename from packages/google_sign_in/google_sign_in_web/test/gapi_mocks/gapi_mocks.dart rename to packages/google_sign_in/google_sign_in_web/test/test_driver/gapi_mocks/gapi_mocks.dart diff --git a/packages/google_sign_in/google_sign_in_web/test/test_driver/gapi_mocks/src/auth2_init.dart b/packages/google_sign_in/google_sign_in_web/test/test_driver/gapi_mocks/src/auth2_init.dart new file mode 100644 index 000000000000..79d798ad2c85 --- /dev/null +++ b/packages/google_sign_in/google_sign_in_web/test/test_driver/gapi_mocks/src/auth2_init.dart @@ -0,0 +1,107 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +part of gapi_mocks; + +// JS mock of a gapi.auth2, with a successfully identified user +String auth2InitSuccess(GoogleSignInUserData userData) => testIife(''' +${gapi()} + +var mockUser = ${googleUser(userData)}; + +function GapiAuth2() {} +GapiAuth2.prototype.init = function (initOptions) { + return { + then: (onSuccess, onError) => { + window.setTimeout(() => { + onSuccess(window.gapi.auth2); + }, 30); + }, + currentUser: { + listen: (cb) => { + window.setTimeout(() => { + cb(mockUser); + }, 30); + } + } + } +}; + +GapiAuth2.prototype.getAuthInstance = function () { + return { + signIn: () => { + return new Promise((resolve, reject) => { + window.setTimeout(() => { + resolve(mockUser); + }, 30); + }); + }, + currentUser: { + get: () => mockUser, + }, + } +}; + +window.gapi.auth2 = new GapiAuth2(); +'''); + +String auth2InitError() => testIife(''' +${gapi()} + +function GapiAuth2() {} +GapiAuth2.prototype.init = function (initOptions) { + return { + then: (onSuccess, onError) => { + window.setTimeout(() => { + onError({ + error: 'idpiframe_initialization_failed', + details: 'This error was raised from a test.', + }); + }, 30); + } + } +}; + +window.gapi.auth2 = new GapiAuth2(); +'''); + +String auth2SignInError([String error = 'popup_closed_by_user']) => testIife(''' +${gapi()} + +var mockUser = null; + +function GapiAuth2() {} +GapiAuth2.prototype.init = function (initOptions) { + return { + then: (onSuccess, onError) => { + window.setTimeout(() => { + onSuccess(window.gapi.auth2); + }, 30); + }, + currentUser: { + listen: (cb) => { + window.setTimeout(() => { + cb(mockUser); + }, 30); + } + } + } +}; + +GapiAuth2.prototype.getAuthInstance = function () { + return { + signIn: () => { + return new Promise((resolve, reject) => { + window.setTimeout(() => { + reject({ + error: '${error}' + }); + }, 30); + }); + }, + } +}; + +window.gapi.auth2 = new GapiAuth2(); +'''); diff --git a/packages/google_sign_in/google_sign_in_web/test/gapi_mocks/src/gapi.dart b/packages/google_sign_in/google_sign_in_web/test/test_driver/gapi_mocks/src/gapi.dart similarity index 100% rename from packages/google_sign_in/google_sign_in_web/test/gapi_mocks/src/gapi.dart rename to packages/google_sign_in/google_sign_in_web/test/test_driver/gapi_mocks/src/gapi.dart diff --git a/packages/google_sign_in/google_sign_in_web/test/gapi_mocks/src/google_user.dart b/packages/google_sign_in/google_sign_in_web/test/test_driver/gapi_mocks/src/google_user.dart similarity index 100% rename from packages/google_sign_in/google_sign_in_web/test/gapi_mocks/src/google_user.dart rename to packages/google_sign_in/google_sign_in_web/test/test_driver/gapi_mocks/src/google_user.dart diff --git a/packages/google_sign_in/google_sign_in_web/test/gapi_mocks/src/test_iife.dart b/packages/google_sign_in/google_sign_in_web/test/test_driver/gapi_mocks/src/test_iife.dart similarity index 100% rename from packages/google_sign_in/google_sign_in_web/test/gapi_mocks/src/test_iife.dart rename to packages/google_sign_in/google_sign_in_web/test/test_driver/gapi_mocks/src/test_iife.dart diff --git a/packages/google_sign_in/google_sign_in_web/test/gapi_utils_test.dart b/packages/google_sign_in/google_sign_in_web/test/test_driver/gapi_utils_integration.dart similarity index 70% rename from packages/google_sign_in/google_sign_in_web/test/gapi_utils_test.dart rename to packages/google_sign_in/google_sign_in_web/test/test_driver/gapi_utils_integration.dart index 2dc49fc5b67a..55b942842b33 100644 --- a/packages/google_sign_in/google_sign_in_web/test/gapi_utils_test.dart +++ b/packages/google_sign_in/google_sign_in_web/test/test_driver/gapi_utils_integration.dart @@ -1,10 +1,10 @@ // Copyright 2019 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -@TestOn('browser') - import 'package:flutter_test/flutter_test.dart'; +import 'package:integration_test/integration_test.dart'; + import 'package:google_sign_in_web/src/generated/gapiauth2.dart' as gapi; import 'package:google_sign_in_web/src/utils.dart'; import 'package:mockito/mockito.dart'; @@ -15,6 +15,7 @@ class MockBasicProfile extends Mock implements gapi.BasicProfile {} void main() { // The non-null use cases are covered by the auth2_test.dart file. + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); group('gapiUserToPluginUserData', () { var mockUser; @@ -23,21 +24,24 @@ void main() { mockUser = MockGoogleUser(); }); - test('null user -> null response', () { + testWidgets('null user -> null response', (WidgetTester tester) async { expect(gapiUserToPluginUserData(null), isNull); }); - test('not signed-in user -> null response', () { + testWidgets('not signed-in user -> null response', + (WidgetTester tester) async { when(mockUser.isSignedIn()).thenReturn(false); expect(gapiUserToPluginUserData(mockUser), isNull); }); - test('signed-in, but null profile user -> null response', () { + testWidgets('signed-in, but null profile user -> null response', + (WidgetTester tester) async { when(mockUser.isSignedIn()).thenReturn(true); expect(gapiUserToPluginUserData(mockUser), isNull); }); - test('signed-in, null userId in profile user -> null response', () { + testWidgets('signed-in, null userId in profile user -> null response', + (WidgetTester tester) async { when(mockUser.isSignedIn()).thenReturn(true); when(mockUser.getBasicProfile()).thenReturn(MockBasicProfile()); expect(gapiUserToPluginUserData(mockUser), isNull); diff --git a/packages/google_sign_in/google_sign_in_web/test/test_driver/gapi_utils_integration_test.dart b/packages/google_sign_in/google_sign_in_web/test/test_driver/gapi_utils_integration_test.dart new file mode 100644 index 000000000000..39444c0daa24 --- /dev/null +++ b/packages/google_sign_in/google_sign_in_web/test/test_driver/gapi_utils_integration_test.dart @@ -0,0 +1,7 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:integration_test/integration_test_driver.dart'; + +Future main() async => integrationDriver(); diff --git a/packages/google_sign_in/google_sign_in_web/test/utils.dart b/packages/google_sign_in/google_sign_in_web/test/test_driver/src/test_utils.dart similarity index 100% rename from packages/google_sign_in/google_sign_in_web/test/utils.dart rename to packages/google_sign_in/google_sign_in_web/test/test_driver/src/test_utils.dart diff --git a/packages/google_sign_in/google_sign_in_web/test/web/index.html b/packages/google_sign_in/google_sign_in_web/test/web/index.html new file mode 100644 index 000000000000..59a832b5de4c --- /dev/null +++ b/packages/google_sign_in/google_sign_in_web/test/web/index.html @@ -0,0 +1,13 @@ + + + + + Browser Tests + + + + + + From 0d17f5f1ef9b2c49ea0e95cceac8e7d82e2d385d Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Mon, 14 Sep 2020 15:55:41 -0700 Subject: [PATCH 089/233] [android_alarm_manager] version fix (#3028) --- packages/android_alarm_manager/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/android_alarm_manager/pubspec.yaml b/packages/android_alarm_manager/pubspec.yaml index 85c6609d5780..90dcbf1f7819 100644 --- a/packages/android_alarm_manager/pubspec.yaml +++ b/packages/android_alarm_manager/pubspec.yaml @@ -4,7 +4,7 @@ description: Flutter plugin for accessing the Android AlarmManager service, and # 0.4.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.4.5+12 +version: 0.4.5+13 homepage: https://github.com/flutter/plugins/tree/master/packages/android_alarm_manager dependencies: From 81023e758aea0746b54e4d7a8e5a82c354c2dd5d Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Tue, 15 Sep 2020 14:28:47 -0400 Subject: [PATCH 090/233] [url_launcher] Endorse Windows implementation (#3024) Endorses url_launcher_windows so that Windows is supported automatically. --- .../url_launcher/url_launcher/CHANGELOG.md | 4 ++++ packages/url_launcher/url_launcher/README.md | 7 +++--- .../example/test_driver/url_launcher_e2e.dart | 2 +- .../url_launcher/url_launcher/pubspec.yaml | 5 ++++- .../url_launcher_windows/CHANGELOG.md | 4 ++++ .../url_launcher_windows/README.md | 18 +++++++++++---- .../ios/url_launcher_windows.podspec | 22 +++++++++++++++++++ .../url_launcher_windows/pubspec.yaml | 2 +- 8 files changed, 54 insertions(+), 10 deletions(-) create mode 100644 packages/url_launcher/url_launcher_windows/ios/url_launcher_windows.podspec diff --git a/packages/url_launcher/url_launcher/CHANGELOG.md b/packages/url_launcher/url_launcher/CHANGELOG.md index e7e31acfd968..063aa99d5d51 100644 --- a/packages/url_launcher/url_launcher/CHANGELOG.md +++ b/packages/url_launcher/url_launcher/CHANGELOG.md @@ -1,3 +1,7 @@ +## 5.6.0 + +* Support Windows by default. + ## 5.5.3 * Suppress deprecation warning on the `shouldOverrideUrlLoading` method on Android. diff --git a/packages/url_launcher/url_launcher/README.md b/packages/url_launcher/url_launcher/README.md index 53c7fe96cde7..811dcd5b4ea1 100644 --- a/packages/url_launcher/url_launcher/README.md +++ b/packages/url_launcher/url_launcher/README.md @@ -2,7 +2,8 @@ [![pub package](https://img.shields.io/pub/v/url_launcher.svg)](https://pub.dartlang.org/packages/url_launcher) -A Flutter plugin for launching a URL in the mobile platform. Supports iOS and Android. +A Flutter plugin for launching a URL in the mobile platform. Supports +iOS, Android, web, Windows, macOS, and Linux. ## Usage To use this plugin, add `url_launcher` as a [dependency in your pubspec.yaml file](https://flutter.dev/platform-plugins/). @@ -91,8 +92,8 @@ web page using a URL following the `http` scheme. ## Browser vs In-app Handling By default, Android opens up a browser when handling URLs. You can pass -`forceWebView: true` parameter to tell the plugin to open a WebView instead. -If you do this for a URL of a page containing JavaScript, make sure to pass in +`forceWebView: true` parameter to tell the plugin to open a WebView instead. +If you do this for a URL of a page containing JavaScript, make sure to pass in `enableJavaScript: true`, or else the launch method will not work properly. On iOS, the default behavior is to open all web URLs within the app. Everything else is redirected to the app handler. diff --git a/packages/url_launcher/url_launcher/example/test_driver/url_launcher_e2e.dart b/packages/url_launcher/url_launcher/example/test_driver/url_launcher_e2e.dart index fe51d94aa3a9..9fb5eaa34b4c 100644 --- a/packages/url_launcher/url_launcher/example/test_driver/url_launcher_e2e.dart +++ b/packages/url_launcher/url_launcher/example/test_driver/url_launcher_e2e.dart @@ -19,7 +19,7 @@ void main() { expect(await canLaunch('http://flutter.dev'), true); // SMS handling is available by default on most platforms. - if (kIsWeb || !Platform.isLinux) { + if (kIsWeb || !(Platform.isLinux || Platform.isWindows)) { expect(await canLaunch('sms:5555555555'), true); } diff --git a/packages/url_launcher/url_launcher/pubspec.yaml b/packages/url_launcher/url_launcher/pubspec.yaml index 57048a2b3f98..965a4318d0f8 100644 --- a/packages/url_launcher/url_launcher/pubspec.yaml +++ b/packages/url_launcher/url_launcher/pubspec.yaml @@ -2,7 +2,7 @@ name: url_launcher description: Flutter plugin for launching a URL on Android and iOS. Supports web, phone, SMS, and email schemes. homepage: https://github.com/flutter/plugins/tree/master/packages/url_launcher/url_launcher -version: 5.5.3 +version: 5.6.0 flutter: plugin: @@ -18,6 +18,8 @@ flutter: default_package: url_laucher_linux macos: default_package: url_laucher_macos + windows: + default_package: url_laucher_windows dependencies: flutter: @@ -31,6 +33,7 @@ dependencies: url_launcher_web: ^0.1.3 url_launcher_linux: ^0.0.1 url_launcher_macos: ^0.0.1 + url_launcher_windows: ^0.0.1 dev_dependencies: flutter_test: diff --git a/packages/url_launcher/url_launcher_windows/CHANGELOG.md b/packages/url_launcher/url_launcher_windows/CHANGELOG.md index dd3395afab0a..7f534a7e5a38 100644 --- a/packages/url_launcher/url_launcher_windows/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_windows/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.1+1 + +* Update README to reflect endorsement. + ## 0.0.1 * Initial Windows implementation of `url_launcher`. diff --git a/packages/url_launcher/url_launcher_windows/README.md b/packages/url_launcher/url_launcher_windows/README.md index 685adc59a1a4..fb5ad6700d26 100644 --- a/packages/url_launcher/url_launcher_windows/README.md +++ b/packages/url_launcher/url_launcher_windows/README.md @@ -13,9 +13,9 @@ For more details see: https://github.com/flutter/flutter/wiki/Package-migration- ### Import the package -This package has not yet been endorsed. Once it is you only need to add -`url_launcher` as a dependency in your `pubspec.yaml`, but for now you -need to include both `url_launcher` and `url_launcher_windows`. +This package has been endorsed, meaning that you only need to add `url_launcher` +as a dependency in your `pubspec.yaml`. It will be automatically included in your app +when you depend on `package:url_launcher`. This is what the above means to your `pubspec.yaml`: @@ -23,7 +23,17 @@ This is what the above means to your `pubspec.yaml`: ... dependencies: ... - url_launcher: ^5.5.3 + url_launcher: ^5.6.0 + ... +``` + +If you wish to use the Windows package only, you can add `url_launcher_windows` as a +dependency: + +```yaml +... +dependencies: + ... url_launcher_windows: ^0.0.1 ... ``` diff --git a/packages/url_launcher/url_launcher_windows/ios/url_launcher_windows.podspec b/packages/url_launcher/url_launcher_windows/ios/url_launcher_windows.podspec new file mode 100644 index 000000000000..1c700d49f4b5 --- /dev/null +++ b/packages/url_launcher/url_launcher_windows/ios/url_launcher_windows.podspec @@ -0,0 +1,22 @@ +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html +# Run `pod lib lint url_launcher_windows.podspec' to validate before publishing. +# +Pod::Spec.new do |s| + s.name = 'url_launcher_windows' + s.version = '0.0.1' + s.summary = 'url_launcher_windows iOS stub' + s.description = <<-DESC + No-op implementation of the windows url_launcher plugin to avoid build issues on iOS + DESC + s.homepage = 'https://github.com/flutter/plugins' + s.license = { :type => 'BSD', :file => '../LICENSE' } + s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } + s.source = { :http => 'https://github.com/flutter/plugins/tree/master/packages/url_launcher/url_launcher_windows' } + s.dependency 'Flutter' + s.platform = :ios, '8.0' + + # Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported. + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' } + s.swift_version = '5.0' +end diff --git a/packages/url_launcher/url_launcher_windows/pubspec.yaml b/packages/url_launcher/url_launcher_windows/pubspec.yaml index 8a0beb70163a..6a653b7f7665 100644 --- a/packages/url_launcher/url_launcher_windows/pubspec.yaml +++ b/packages/url_launcher/url_launcher_windows/pubspec.yaml @@ -3,7 +3,7 @@ description: Windows implementation of the url_launcher plugin. # 0.0.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.0.1 +version: 0.0.1+1 homepage: https://github.com/flutter/plugins/tree/master/packages/url_launcher/url_launcher_windows flutter: From faed100ed7b484e88c862ba20aa696ec9f61278e Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Wed, 16 Sep 2020 09:05:12 -0700 Subject: [PATCH 091/233] remove android folders (#3030) --- .../connectivity_macos/CHANGELOG.md | 1 + .../example/android/app/build.gradle | 58 --------------- .../gradle/wrapper/gradle-wrapper.properties | 5 -- .../android/app/src/main/AndroidManifest.xml | 30 -------- .../EmbeddingV1Activity.java | 18 ----- .../EmbeddingV1ActivityTest.java | 17 ----- .../FlutterActivityTest.java | 17 ----- .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 544 -> 0 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 442 -> 0 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 721 -> 0 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 1031 -> 0 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 1443 -> 0 bytes .../example/android/build.gradle | 29 -------- .../example/android/gradle.properties | 4 -- .../gradle/wrapper/gradle-wrapper.properties | 5 -- .../example/android/settings.gradle | 15 ---- .../connectivity_macos/pubspec.yaml | 2 +- packages/ios_platform_images/CHANGELOG.md | 4 ++ .../example/android/.gitignore | 8 --- .../example/android/app/build.gradle | 67 ------------------ .../android/app/src/debug/AndroidManifest.xml | 7 -- .../android/app/src/main/AndroidManifest.xml | 33 --------- .../main/res/drawable/launch_background.xml | 12 ---- .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 544 -> 0 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 442 -> 0 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 721 -> 0 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 1031 -> 0 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 1443 -> 0 bytes .../app/src/main/res/values/styles.xml | 8 --- .../app/src/profile/AndroidManifest.xml | 7 -- .../example/android/build.gradle | 31 -------- .../example/android/gradle.properties | 4 -- .../gradle/wrapper/gradle-wrapper.properties | 6 -- .../example/android/settings.gradle | 15 ---- packages/ios_platform_images/pubspec.yaml | 2 +- .../path_provider_macos/CHANGELOG.md | 4 ++ .../example/android/app/build.gradle | 64 ----------------- .../gradle/wrapper/gradle-wrapper.properties | 5 -- .../java/EmbeddingV1ActivityTest.java | 15 ---- .../androidTest/java/MainActivityTest.java | 13 ---- .../android/app/src/main/AndroidManifest.xml | 25 ------- .../EmbeddingV1Activity.java | 14 ---- .../pathproviderexample/MainActivity.java | 19 ----- .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 544 -> 0 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 442 -> 0 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 721 -> 0 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 1031 -> 0 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 1443 -> 0 bytes .../example/android/build.gradle | 29 -------- .../example/android/gradle.properties | 4 -- .../gradle/wrapper/gradle-wrapper.properties | 5 -- .../example/android/settings.gradle | 15 ---- .../path_provider_macos/pubspec.yaml | 2 +- .../url_launcher_macos/CHANGELOG.md | 4 ++ .../example/android/app/build.gradle | 60 ---------------- .../gradle/wrapper/gradle-wrapper.properties | 5 -- .../EmbeddingV1ActivityTest.java | 13 ---- .../FlutterActivityTest.java | 13 ---- .../android/app/src/main/AndroidManifest.xml | 40 ----------- .../EmbeddingV1Activity.java | 22 ------ .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 544 -> 0 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 442 -> 0 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 721 -> 0 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 1031 -> 0 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 1443 -> 0 bytes .../example/android/build.gradle | 29 -------- .../example/android/gradle.properties | 4 -- .../gradle/wrapper/gradle-wrapper.properties | 6 -- .../example/android/settings.gradle | 15 ---- .../url_launcher_macos/pubspec.yaml | 2 +- 70 files changed, 17 insertions(+), 815 deletions(-) delete mode 100644 packages/connectivity/connectivity_macos/example/android/app/build.gradle delete mode 100644 packages/connectivity/connectivity_macos/example/android/app/gradle/wrapper/gradle-wrapper.properties delete mode 100644 packages/connectivity/connectivity_macos/example/android/app/src/main/AndroidManifest.xml delete mode 100644 packages/connectivity/connectivity_macos/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/EmbeddingV1Activity.java delete mode 100644 packages/connectivity/connectivity_macos/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/EmbeddingV1ActivityTest.java delete mode 100644 packages/connectivity/connectivity_macos/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/FlutterActivityTest.java delete mode 100644 packages/connectivity/connectivity_macos/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png delete mode 100644 packages/connectivity/connectivity_macos/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png delete mode 100644 packages/connectivity/connectivity_macos/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png delete mode 100644 packages/connectivity/connectivity_macos/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png delete mode 100644 packages/connectivity/connectivity_macos/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png delete mode 100644 packages/connectivity/connectivity_macos/example/android/build.gradle delete mode 100644 packages/connectivity/connectivity_macos/example/android/gradle.properties delete mode 100644 packages/connectivity/connectivity_macos/example/android/gradle/wrapper/gradle-wrapper.properties delete mode 100644 packages/connectivity/connectivity_macos/example/android/settings.gradle delete mode 100644 packages/ios_platform_images/example/android/.gitignore delete mode 100644 packages/ios_platform_images/example/android/app/build.gradle delete mode 100644 packages/ios_platform_images/example/android/app/src/debug/AndroidManifest.xml delete mode 100644 packages/ios_platform_images/example/android/app/src/main/AndroidManifest.xml delete mode 100644 packages/ios_platform_images/example/android/app/src/main/res/drawable/launch_background.xml delete mode 100644 packages/ios_platform_images/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png delete mode 100644 packages/ios_platform_images/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png delete mode 100644 packages/ios_platform_images/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png delete mode 100644 packages/ios_platform_images/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png delete mode 100644 packages/ios_platform_images/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png delete mode 100644 packages/ios_platform_images/example/android/app/src/main/res/values/styles.xml delete mode 100644 packages/ios_platform_images/example/android/app/src/profile/AndroidManifest.xml delete mode 100644 packages/ios_platform_images/example/android/build.gradle delete mode 100644 packages/ios_platform_images/example/android/gradle.properties delete mode 100644 packages/ios_platform_images/example/android/gradle/wrapper/gradle-wrapper.properties delete mode 100644 packages/ios_platform_images/example/android/settings.gradle delete mode 100644 packages/path_provider/path_provider_macos/example/android/app/build.gradle delete mode 100644 packages/path_provider/path_provider_macos/example/android/app/gradle/wrapper/gradle-wrapper.properties delete mode 100644 packages/path_provider/path_provider_macos/example/android/app/src/androidTest/java/EmbeddingV1ActivityTest.java delete mode 100644 packages/path_provider/path_provider_macos/example/android/app/src/androidTest/java/MainActivityTest.java delete mode 100644 packages/path_provider/path_provider_macos/example/android/app/src/main/AndroidManifest.xml delete mode 100644 packages/path_provider/path_provider_macos/example/android/app/src/main/java/io/flutter/plugins/pathproviderexample/EmbeddingV1Activity.java delete mode 100644 packages/path_provider/path_provider_macos/example/android/app/src/main/java/io/flutter/plugins/pathproviderexample/MainActivity.java delete mode 100644 packages/path_provider/path_provider_macos/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png delete mode 100644 packages/path_provider/path_provider_macos/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png delete mode 100644 packages/path_provider/path_provider_macos/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png delete mode 100644 packages/path_provider/path_provider_macos/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png delete mode 100644 packages/path_provider/path_provider_macos/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png delete mode 100644 packages/path_provider/path_provider_macos/example/android/build.gradle delete mode 100644 packages/path_provider/path_provider_macos/example/android/gradle.properties delete mode 100644 packages/path_provider/path_provider_macos/example/android/gradle/wrapper/gradle-wrapper.properties delete mode 100644 packages/path_provider/path_provider_macos/example/android/settings.gradle delete mode 100644 packages/url_launcher/url_launcher_macos/example/android/app/build.gradle delete mode 100644 packages/url_launcher/url_launcher_macos/example/android/app/gradle/wrapper/gradle-wrapper.properties delete mode 100644 packages/url_launcher/url_launcher_macos/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/EmbeddingV1ActivityTest.java delete mode 100644 packages/url_launcher/url_launcher_macos/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/FlutterActivityTest.java delete mode 100644 packages/url_launcher/url_launcher_macos/example/android/app/src/main/AndroidManifest.xml delete mode 100644 packages/url_launcher/url_launcher_macos/example/android/app/src/main/java/io/flutter/plugins/urllauncherexample/EmbeddingV1Activity.java delete mode 100644 packages/url_launcher/url_launcher_macos/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png delete mode 100644 packages/url_launcher/url_launcher_macos/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png delete mode 100644 packages/url_launcher/url_launcher_macos/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png delete mode 100644 packages/url_launcher/url_launcher_macos/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png delete mode 100644 packages/url_launcher/url_launcher_macos/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png delete mode 100644 packages/url_launcher/url_launcher_macos/example/android/build.gradle delete mode 100644 packages/url_launcher/url_launcher_macos/example/android/gradle.properties delete mode 100644 packages/url_launcher/url_launcher_macos/example/android/gradle/wrapper/gradle-wrapper.properties delete mode 100644 packages/url_launcher/url_launcher_macos/example/android/settings.gradle diff --git a/packages/connectivity/connectivity_macos/CHANGELOG.md b/packages/connectivity/connectivity_macos/CHANGELOG.md index ac12b21b531a..c103c51b0d70 100644 --- a/packages/connectivity/connectivity_macos/CHANGELOG.md +++ b/packages/connectivity/connectivity_macos/CHANGELOG.md @@ -2,6 +2,7 @@ * Update package:e2e reference to use the local version in the flutter/plugins repository. +* Remove no-op android folder in the example app. ## 0.1.0+4 diff --git a/packages/connectivity/connectivity_macos/example/android/app/build.gradle b/packages/connectivity/connectivity_macos/example/android/app/build.gradle deleted file mode 100644 index 5d1f138bfe1a..000000000000 --- a/packages/connectivity/connectivity_macos/example/android/app/build.gradle +++ /dev/null @@ -1,58 +0,0 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - compileSdkVersion 28 - - lintOptions { - disable 'InvalidPackage' - } - - defaultConfig { - applicationId "io.flutter.plugins.connectivityexample" - minSdkVersion 16 - targetSdkVersion 28 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test:runner:1.1.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' -} diff --git a/packages/connectivity/connectivity_macos/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/connectivity/connectivity_macos/example/android/app/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 9a4163a4f5ee..000000000000 --- a/packages/connectivity/connectivity_macos/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/packages/connectivity/connectivity_macos/example/android/app/src/main/AndroidManifest.xml b/packages/connectivity/connectivity_macos/example/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index 664b74303548..000000000000 --- a/packages/connectivity/connectivity_macos/example/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/packages/connectivity/connectivity_macos/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/EmbeddingV1Activity.java b/packages/connectivity/connectivity_macos/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/EmbeddingV1Activity.java deleted file mode 100644 index fa10cd5b7f52..000000000000 --- a/packages/connectivity/connectivity_macos/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/EmbeddingV1Activity.java +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.connectivityexample; - -import android.os.Bundle; -import io.flutter.app.FlutterActivity; -import io.flutter.plugins.connectivity.ConnectivityPlugin; - -public class EmbeddingV1Activity extends FlutterActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - ConnectivityPlugin.registerWith( - registrarFor("io.flutter.plugins.connectivity.ConnectivityPlugin")); - } -} diff --git a/packages/connectivity/connectivity_macos/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/EmbeddingV1ActivityTest.java b/packages/connectivity/connectivity_macos/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/EmbeddingV1ActivityTest.java deleted file mode 100644 index 048da070991e..000000000000 --- a/packages/connectivity/connectivity_macos/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/EmbeddingV1ActivityTest.java +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.connectivityexample; - -import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.integration_test.FlutterTestRunner; -import org.junit.Rule; -import org.junit.runner.RunWith; - -@RunWith(FlutterTestRunner.class) -public class EmbeddingV1ActivityTest { - @Rule - public ActivityTestRule rule = - new ActivityTestRule<>(EmbeddingV1Activity.class); -} diff --git a/packages/connectivity/connectivity_macos/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/FlutterActivityTest.java b/packages/connectivity/connectivity_macos/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/FlutterActivityTest.java deleted file mode 100644 index 0f0dcf2555f3..000000000000 --- a/packages/connectivity/connectivity_macos/example/android/app/src/main/java/io/flutter/plugins/connectivityexample/FlutterActivityTest.java +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.connectivityexample; - -import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.integration_test.FlutterTestRunner; -import io.flutter.embedding.android.FlutterActivity; -import org.junit.Rule; -import org.junit.runner.RunWith; - -@RunWith(FlutterTestRunner.class) -public class FlutterActivityTest { - @Rule - public ActivityTestRule rule = new ActivityTestRule<>(FlutterActivity.class); -} diff --git a/packages/connectivity/connectivity_macos/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/connectivity/connectivity_macos/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index db77bb4b7b0906d62b1847e87f15cdcacf6a4f29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 544 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY3?!3`olAj~WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8bpbvhu0Wd6uZuB!w&u2PAxD2eNXD>P5D~Wn-+_Wa#27Xc zC?Zj|6r#X(-D3u$NCt}(Ms06KgJ4FxJVv{GM)!I~&n8Bnc94O7-Hd)cjDZswgC;Qs zO=b+9!WcT8F?0rF7!Uys2bs@gozCP?z~o%U|N3vA*22NaGQG zlg@K`O_XuxvZ&Ks^m&R!`&1=spLvfx7oGDKDwpwW`#iqdw@AL`7MR}m`rwr|mZgU`8P7SBkL78fFf!WnuYWm$5Z0 zNXhDbCv&49sM544K|?c)WrFfiZvCi9h0O)B3Pgg&ebxsLQ05GG~ AQ2+n{ diff --git a/packages/connectivity/connectivity_macos/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/connectivity/connectivity_macos/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 17987b79bb8a35cc66c3c1fd44f5a5526c1b78be..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 442 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5Xx&nMcT!A!W`0S9QKQy;}1Cl^CgaH=;G9cpY;r$Q>i*pfB zP2drbID<_#qf;rPZx^FqH)F_D#*k@@q03KywUtLX8Ua?`H+NMzkczFPK3lFz@i_kW%1NOn0|D2I9n9wzH8m|-tHjsw|9>@K=iMBhxvkv6m8Y-l zytQ?X=U+MF$@3 zt`~i=@j|6y)RWMK--}M|=T`o&^Ni>IoWKHEbBXz7?A@mgWoL>!*SXo`SZH-*HSdS+ yn*9;$7;m`l>wYBC5bq;=U}IMqLzqbYCidGC!)_gkIk_C@Uy!y&wkt5C($~2D>~)O*cj@FGjOCM)M>_ixfudOh)?xMu#Fs z#}Y=@YDTwOM)x{K_j*Q;dPdJ?Mz0n|pLRx{4n|)f>SXlmV)XB04CrSJn#dS5nK2lM zrZ9#~WelCp7&e13Y$jvaEXHskn$2V!!DN-nWS__6T*l;H&Fopn?A6HZ-6WRLFP=R` zqG+CE#d4|IbyAI+rJJ`&x9*T`+a=p|0O(+s{UBcyZdkhj=yS1>AirP+0R;mf2uMgM zC}@~JfByORAh4SyRgi&!(cja>F(l*O+nd+@4m$|6K6KDn_&uvCpV23&>G9HJp{xgg zoq1^2_p9@|WEo z*X_Uko@K)qYYv~>43eQGMdbiGbo>E~Q& zrYBH{QP^@Sti!`2)uG{irBBq@y*$B zi#&(U-*=fp74j)RyIw49+0MRPMRU)+a2r*PJ$L5roHt2$UjExCTZSbq%V!HeS7J$N zdG@vOZB4v_lF7Plrx+hxo7(fCV&}fHq)$ diff --git a/packages/connectivity/connectivity_macos/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/connectivity/connectivity_macos/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index d5f1c8d34e7a88e3f88bea192c3a370d44689c3c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1031 zcmeAS@N?(olHy`uVBq!ia0vp^6F``Q8Ax83A=Cw=BuiW)N`mv#O3D+9QW+dm@{>{( zJaZG%Q-e|yQz{EjrrIztFa`(sgt!6~Yi|1%a`XoT0ojZ}lNrNjb9xjc(B0U1_% zz5^97Xt*%oq$rQy4?0GKNfJ44uvxI)gC`h-NZ|&0-7(qS@?b!5r36oQ}zyZrNO3 zMO=Or+<~>+A&uN&E!^Sl+>xE!QC-|oJv`ApDhqC^EWD|@=#J`=d#Xzxs4ah}w&Jnc z$|q_opQ^2TrnVZ0o~wh<3t%W&flvYGe#$xqda2bR_R zvPYgMcHgjZ5nSA^lJr%;<&0do;O^tDDh~=pIxA#coaCY>&N%M2^tq^U%3DB@ynvKo}b?yu-bFc-u0JHzced$sg7S3zqI(2 z#Km{dPr7I=pQ5>FuK#)QwK?Y`E`B?nP+}U)I#c1+FM*1kNvWG|a(TpksZQ3B@sD~b zpQ2)*V*TdwjFOtHvV|;OsiDqHi=6%)o4b!)x$)%9pGTsE z-JL={-Ffv+T87W(Xpooq<`r*VzWQcgBN$$`u}f>-ZQI1BB8ykN*=e4rIsJx9>z}*o zo~|9I;xof diff --git a/packages/connectivity/connectivity_macos/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/connectivity/connectivity_macos/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 4d6372eebdb28e45604e46eeda8dd24651419bc0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1443 zcmb`G{WsKk6vsdJTdFg%tJav9_E4vzrOaqkWF|A724Nly!y+?N9`YV6wZ}5(X(D_N(?!*n3`|_r0Hc?=PQw&*vnU?QTFY zB_MsH|!j$PP;I}?dppoE_gA(4uc!jV&0!l7_;&p2^pxNo>PEcNJv za5_RT$o2Mf!<+r?&EbHH6nMoTsDOa;mN(wv8RNsHpG)`^ymG-S5By8=l9iVXzN_eG%Xg2@Xeq76tTZ*dGh~Lo9vl;Zfs+W#BydUw zCkZ$o1LqWQO$FC9aKlLl*7x9^0q%0}$OMlp@Kk_jHXOjofdePND+j!A{q!8~Jn+s3 z?~~w@4?egS02}8NuulUA=L~QQfm;MzCGd)XhiftT;+zFO&JVyp2mBww?;QByS_1w! zrQlx%{^cMj0|Bo1FjwY@Q8?Hx0cIPF*@-ZRFpPc#bBw{5@tD(5%sClzIfl8WU~V#u zm5Q;_F!wa$BSpqhN>W@2De?TKWR*!ujY;Yylk_X5#~V!L*Gw~;$%4Q8~Mad z@`-kG?yb$a9cHIApZDVZ^U6Xkp<*4rU82O7%}0jjHlK{id@?-wpN*fCHXyXh(bLt* zPc}H-x0e4E&nQ>y%B-(EL=9}RyC%MyX=upHuFhAk&MLbsF0LP-q`XnH78@fT+pKPW zu72MW`|?8ht^tz$iC}ZwLp4tB;Q49K!QCF3@!iB1qOI=?w z7In!}F~ij(18UYUjnbmC!qKhPo%24?8U1x{7o(+?^Zu0Hx81|FuS?bJ0jgBhEMzf< zCgUq7r2OCB(`XkKcN-TL>u5y#dD6D!)5W?`O5)V^>jb)P)GBdy%t$uUMpf$SNV31$ zb||OojAbvMP?T@$h_ZiFLFVHDmbyMhJF|-_)HX3%m=CDI+ID$0^C>kzxprBW)hw(v zr!Gmda);ICoQyhV_oP5+C%?jcG8v+D@9f?Dk*!BxY}dazmrT@64UrP3hlslANK)bq z$67n83eh}OeW&SV@HG95P|bjfqJ7gw$e+`Hxo!4cx`jdK1bJ>YDSpGKLPZ^1cv$ek zIB?0S<#tX?SJCLWdMd{-ME?$hc7A$zBOdIJ)4!KcAwb=VMov)nK;9z>x~rfT1>dS+ zZ6#`2v@`jgbqq)P22H)Tx2CpmM^o1$B+xT6`(v%5xJ(?j#>Q$+rx_R|7TzDZe{J6q zG1*EcU%tE?!kO%^M;3aM6JN*LAKUVb^xz8-Pxo#jR5(-KBeLJvA@-gxNHx0M-ZJLl z;#JwQoh~9V?`UVo#}{6ka@II>++D@%KqGpMdlQ}?9E*wFcf5(#XQnP$Dk5~%iX^>f z%$y;?M0BLp{O3a(-4A?ewryHrrD%cx#Q^%KY1H zNre$ve+vceSLZcNY4U(RBX&)oZn*Py()h)XkE?PL$!bNb{N5FVI2Y%LKEm%yvpyTP z(1P?z~7YxD~Rf<(a@_y` diff --git a/packages/connectivity/connectivity_macos/example/android/build.gradle b/packages/connectivity/connectivity_macos/example/android/build.gradle deleted file mode 100644 index 541636cc492a..000000000000 --- a/packages/connectivity/connectivity_macos/example/android/build.gradle +++ /dev/null @@ -1,29 +0,0 @@ -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.3.0' - } -} - -allprojects { - repositories { - google() - jcenter() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/packages/connectivity/connectivity_macos/example/android/gradle.properties b/packages/connectivity/connectivity_macos/example/android/gradle.properties deleted file mode 100644 index a6738207fd15..000000000000 --- a/packages/connectivity/connectivity_macos/example/android/gradle.properties +++ /dev/null @@ -1,4 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M -android.useAndroidX=true -android.enableJetifier=true -android.enableR8=true diff --git a/packages/connectivity/connectivity_macos/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/connectivity/connectivity_macos/example/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 019065d1d650..000000000000 --- a/packages/connectivity/connectivity_macos/example/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip diff --git a/packages/connectivity/connectivity_macos/example/android/settings.gradle b/packages/connectivity/connectivity_macos/example/android/settings.gradle deleted file mode 100644 index a159ea7cb99f..000000000000 --- a/packages/connectivity/connectivity_macos/example/android/settings.gradle +++ /dev/null @@ -1,15 +0,0 @@ -include ':app' - -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() - -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withInputStream { stream -> plugins.load(stream) } -} - -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory -} diff --git a/packages/connectivity/connectivity_macos/pubspec.yaml b/packages/connectivity/connectivity_macos/pubspec.yaml index 65888cfb3505..e35becb0ee35 100644 --- a/packages/connectivity/connectivity_macos/pubspec.yaml +++ b/packages/connectivity/connectivity_macos/pubspec.yaml @@ -3,7 +3,7 @@ description: macOS implementation of the connectivity plugin. # 0.1.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.1.0+4 +version: 0.1.0+5 homepage: https://github.com/flutter/plugins/tree/master/packages/connectivity/connectivity_macos flutter: diff --git a/packages/ios_platform_images/CHANGELOG.md b/packages/ios_platform_images/CHANGELOG.md index d34a26253ac8..a83f22ec7571 100644 --- a/packages/ios_platform_images/CHANGELOG.md +++ b/packages/ios_platform_images/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.2+3 + +* Remove no-op android folder in the example app. + ## 0.1.2+2 * Post-v2 Android embedding cleanups. diff --git a/packages/ios_platform_images/example/android/.gitignore b/packages/ios_platform_images/example/android/.gitignore deleted file mode 100644 index cf399e0ef46f..000000000000 --- a/packages/ios_platform_images/example/android/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -gradle-wrapper.jar -/.gradle -/captures/ -/gradlew -/gradlew.bat -/local.properties -GeneratedPluginRegistrant.java -bin/ diff --git a/packages/ios_platform_images/example/android/app/build.gradle b/packages/ios_platform_images/example/android/app/build.gradle deleted file mode 100644 index b70ac6686d86..000000000000 --- a/packages/ios_platform_images/example/android/app/build.gradle +++ /dev/null @@ -1,67 +0,0 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - compileSdkVersion 28 - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - } - - lintOptions { - disable 'InvalidPackage' - } - - defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.example.ios_platform_images_example" - minSdkVersion 16 - targetSdkVersion 28 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test:runner:1.1.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' -} diff --git a/packages/ios_platform_images/example/android/app/src/debug/AndroidManifest.xml b/packages/ios_platform_images/example/android/app/src/debug/AndroidManifest.xml deleted file mode 100644 index 03bcd3294df0..000000000000 --- a/packages/ios_platform_images/example/android/app/src/debug/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/packages/ios_platform_images/example/android/app/src/main/AndroidManifest.xml b/packages/ios_platform_images/example/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index 94cfab63442e..000000000000 --- a/packages/ios_platform_images/example/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - diff --git a/packages/ios_platform_images/example/android/app/src/main/res/drawable/launch_background.xml b/packages/ios_platform_images/example/android/app/src/main/res/drawable/launch_background.xml deleted file mode 100644 index 304732f88420..000000000000 --- a/packages/ios_platform_images/example/android/app/src/main/res/drawable/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/packages/ios_platform_images/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/ios_platform_images/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index db77bb4b7b0906d62b1847e87f15cdcacf6a4f29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 544 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY3?!3`olAj~WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8bpbvhu0Wd6uZuB!w&u2PAxD2eNXD>P5D~Wn-+_Wa#27Xc zC?Zj|6r#X(-D3u$NCt}(Ms06KgJ4FxJVv{GM)!I~&n8Bnc94O7-Hd)cjDZswgC;Qs zO=b+9!WcT8F?0rF7!Uys2bs@gozCP?z~o%U|N3vA*22NaGQG zlg@K`O_XuxvZ&Ks^m&R!`&1=spLvfx7oGDKDwpwW`#iqdw@AL`7MR}m`rwr|mZgU`8P7SBkL78fFf!WnuYWm$5Z0 zNXhDbCv&49sM544K|?c)WrFfiZvCi9h0O)B3Pgg&ebxsLQ05GG~ AQ2+n{ diff --git a/packages/ios_platform_images/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/ios_platform_images/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 17987b79bb8a35cc66c3c1fd44f5a5526c1b78be..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 442 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5Xx&nMcT!A!W`0S9QKQy;}1Cl^CgaH=;G9cpY;r$Q>i*pfB zP2drbID<_#qf;rPZx^FqH)F_D#*k@@q03KywUtLX8Ua?`H+NMzkczFPK3lFz@i_kW%1NOn0|D2I9n9wzH8m|-tHjsw|9>@K=iMBhxvkv6m8Y-l zytQ?X=U+MF$@3 zt`~i=@j|6y)RWMK--}M|=T`o&^Ni>IoWKHEbBXz7?A@mgWoL>!*SXo`SZH-*HSdS+ yn*9;$7;m`l>wYBC5bq;=U}IMqLzqbYCidGC!)_gkIk_C@Uy!y&wkt5C($~2D>~)O*cj@FGjOCM)M>_ixfudOh)?xMu#Fs z#}Y=@YDTwOM)x{K_j*Q;dPdJ?Mz0n|pLRx{4n|)f>SXlmV)XB04CrSJn#dS5nK2lM zrZ9#~WelCp7&e13Y$jvaEXHskn$2V!!DN-nWS__6T*l;H&Fopn?A6HZ-6WRLFP=R` zqG+CE#d4|IbyAI+rJJ`&x9*T`+a=p|0O(+s{UBcyZdkhj=yS1>AirP+0R;mf2uMgM zC}@~JfByORAh4SyRgi&!(cja>F(l*O+nd+@4m$|6K6KDn_&uvCpV23&>G9HJp{xgg zoq1^2_p9@|WEo z*X_Uko@K)qYYv~>43eQGMdbiGbo>E~Q& zrYBH{QP^@Sti!`2)uG{irBBq@y*$B zi#&(U-*=fp74j)RyIw49+0MRPMRU)+a2r*PJ$L5roHt2$UjExCTZSbq%V!HeS7J$N zdG@vOZB4v_lF7Plrx+hxo7(fCV&}fHq)$ diff --git a/packages/ios_platform_images/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/ios_platform_images/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index d5f1c8d34e7a88e3f88bea192c3a370d44689c3c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1031 zcmeAS@N?(olHy`uVBq!ia0vp^6F``Q8Ax83A=Cw=BuiW)N`mv#O3D+9QW+dm@{>{( zJaZG%Q-e|yQz{EjrrIztFa`(sgt!6~Yi|1%a`XoT0ojZ}lNrNjb9xjc(B0U1_% zz5^97Xt*%oq$rQy4?0GKNfJ44uvxI)gC`h-NZ|&0-7(qS@?b!5r36oQ}zyZrNO3 zMO=Or+<~>+A&uN&E!^Sl+>xE!QC-|oJv`ApDhqC^EWD|@=#J`=d#Xzxs4ah}w&Jnc z$|q_opQ^2TrnVZ0o~wh<3t%W&flvYGe#$xqda2bR_R zvPYgMcHgjZ5nSA^lJr%;<&0do;O^tDDh~=pIxA#coaCY>&N%M2^tq^U%3DB@ynvKo}b?yu-bFc-u0JHzced$sg7S3zqI(2 z#Km{dPr7I=pQ5>FuK#)QwK?Y`E`B?nP+}U)I#c1+FM*1kNvWG|a(TpksZQ3B@sD~b zpQ2)*V*TdwjFOtHvV|;OsiDqHi=6%)o4b!)x$)%9pGTsE z-JL={-Ffv+T87W(Xpooq<`r*VzWQcgBN$$`u}f>-ZQI1BB8ykN*=e4rIsJx9>z}*o zo~|9I;xof diff --git a/packages/ios_platform_images/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/ios_platform_images/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 4d6372eebdb28e45604e46eeda8dd24651419bc0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1443 zcmb`G{WsKk6vsdJTdFg%tJav9_E4vzrOaqkWF|A724Nly!y+?N9`YV6wZ}5(X(D_N(?!*n3`|_r0Hc?=PQw&*vnU?QTFY zB_MsH|!j$PP;I}?dppoE_gA(4uc!jV&0!l7_;&p2^pxNo>PEcNJv za5_RT$o2Mf!<+r?&EbHH6nMoTsDOa;mN(wv8RNsHpG)`^ymG-S5By8=l9iVXzN_eG%Xg2@Xeq76tTZ*dGh~Lo9vl;Zfs+W#BydUw zCkZ$o1LqWQO$FC9aKlLl*7x9^0q%0}$OMlp@Kk_jHXOjofdePND+j!A{q!8~Jn+s3 z?~~w@4?egS02}8NuulUA=L~QQfm;MzCGd)XhiftT;+zFO&JVyp2mBww?;QByS_1w! zrQlx%{^cMj0|Bo1FjwY@Q8?Hx0cIPF*@-ZRFpPc#bBw{5@tD(5%sClzIfl8WU~V#u zm5Q;_F!wa$BSpqhN>W@2De?TKWR*!ujY;Yylk_X5#~V!L*Gw~;$%4Q8~Mad z@`-kG?yb$a9cHIApZDVZ^U6Xkp<*4rU82O7%}0jjHlK{id@?-wpN*fCHXyXh(bLt* zPc}H-x0e4E&nQ>y%B-(EL=9}RyC%MyX=upHuFhAk&MLbsF0LP-q`XnH78@fT+pKPW zu72MW`|?8ht^tz$iC}ZwLp4tB;Q49K!QCF3@!iB1qOI=?w z7In!}F~ij(18UYUjnbmC!qKhPo%24?8U1x{7o(+?^Zu0Hx81|FuS?bJ0jgBhEMzf< zCgUq7r2OCB(`XkKcN-TL>u5y#dD6D!)5W?`O5)V^>jb)P)GBdy%t$uUMpf$SNV31$ zb||OojAbvMP?T@$h_ZiFLFVHDmbyMhJF|-_)HX3%m=CDI+ID$0^C>kzxprBW)hw(v zr!Gmda);ICoQyhV_oP5+C%?jcG8v+D@9f?Dk*!BxY}dazmrT@64UrP3hlslANK)bq z$67n83eh}OeW&SV@HG95P|bjfqJ7gw$e+`Hxo!4cx`jdK1bJ>YDSpGKLPZ^1cv$ek zIB?0S<#tX?SJCLWdMd{-ME?$hc7A$zBOdIJ)4!KcAwb=VMov)nK;9z>x~rfT1>dS+ zZ6#`2v@`jgbqq)P22H)Tx2CpmM^o1$B+xT6`(v%5xJ(?j#>Q$+rx_R|7TzDZe{J6q zG1*EcU%tE?!kO%^M;3aM6JN*LAKUVb^xz8-Pxo#jR5(-KBeLJvA@-gxNHx0M-ZJLl z;#JwQoh~9V?`UVo#}{6ka@II>++D@%KqGpMdlQ}?9E*wFcf5(#XQnP$Dk5~%iX^>f z%$y;?M0BLp{O3a(-4A?ewryHrrD%cx#Q^%KY1H zNre$ve+vceSLZcNY4U(RBX&)oZn*Py()h)XkE?PL$!bNb{N5FVI2Y%LKEm%yvpyTP z(1P?z~7YxD~Rf<(a@_y` diff --git a/packages/ios_platform_images/example/android/app/src/main/res/values/styles.xml b/packages/ios_platform_images/example/android/app/src/main/res/values/styles.xml deleted file mode 100644 index 00fa4417cfbe..000000000000 --- a/packages/ios_platform_images/example/android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/packages/ios_platform_images/example/android/app/src/profile/AndroidManifest.xml b/packages/ios_platform_images/example/android/app/src/profile/AndroidManifest.xml deleted file mode 100644 index 03bcd3294df0..000000000000 --- a/packages/ios_platform_images/example/android/app/src/profile/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/packages/ios_platform_images/example/android/build.gradle b/packages/ios_platform_images/example/android/build.gradle deleted file mode 100644 index 3100ad2d5553..000000000000 --- a/packages/ios_platform_images/example/android/build.gradle +++ /dev/null @@ -1,31 +0,0 @@ -buildscript { - ext.kotlin_version = '1.3.50' - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.5.0' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - -allprojects { - repositories { - google() - jcenter() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/packages/ios_platform_images/example/android/gradle.properties b/packages/ios_platform_images/example/android/gradle.properties deleted file mode 100644 index 38c8d4544ff1..000000000000 --- a/packages/ios_platform_images/example/android/gradle.properties +++ /dev/null @@ -1,4 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M -android.enableR8=true -android.useAndroidX=true -android.enableJetifier=true diff --git a/packages/ios_platform_images/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/ios_platform_images/example/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 296b146b7318..000000000000 --- a/packages/ios_platform_images/example/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Fri Jun 23 08:50:38 CEST 2017 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip diff --git a/packages/ios_platform_images/example/android/settings.gradle b/packages/ios_platform_images/example/android/settings.gradle deleted file mode 100644 index 5a2f14fb18f6..000000000000 --- a/packages/ios_platform_images/example/android/settings.gradle +++ /dev/null @@ -1,15 +0,0 @@ -include ':app' - -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() - -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } -} - -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory -} diff --git a/packages/ios_platform_images/pubspec.yaml b/packages/ios_platform_images/pubspec.yaml index 1a47000a0881..482097a515b8 100644 --- a/packages/ios_platform_images/pubspec.yaml +++ b/packages/ios_platform_images/pubspec.yaml @@ -1,6 +1,6 @@ name: ios_platform_images description: A plugin to share images between Flutter and iOS in add-to-app setups. -version: 0.1.2+2 +version: 0.1.2+3 homepage: https://github.com/flutter/plugins/tree/master/packages/ios_platform_images/ios_platform_images environment: diff --git a/packages/path_provider/path_provider_macos/CHANGELOG.md b/packages/path_provider/path_provider_macos/CHANGELOG.md index 037c5153dc3a..406c49f56def 100644 --- a/packages/path_provider/path_provider_macos/CHANGELOG.md +++ b/packages/path_provider/path_provider_macos/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.4+4 + +* Remove no-op android folder in the example app. + ## 0.0.4+3 * Remove Android folder from `path_provider_macos`. diff --git a/packages/path_provider/path_provider_macos/example/android/app/build.gradle b/packages/path_provider/path_provider_macos/example/android/app/build.gradle deleted file mode 100644 index 0404c7203903..000000000000 --- a/packages/path_provider/path_provider_macos/example/android/app/build.gradle +++ /dev/null @@ -1,64 +0,0 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - compileSdkVersion 28 - - lintOptions { - disable 'InvalidPackage' - } - - defaultConfig { - applicationId "io.flutter.plugins.pathproviderexample" - minSdkVersion 16 - targetSdkVersion 28 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { - androidTestImplementation 'androidx.test:runner:1.2.0' - androidTestImplementation 'androidx.test:rules:1.2.0' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' - - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test:runner:1.1.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' -} diff --git a/packages/path_provider/path_provider_macos/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/path_provider/path_provider_macos/example/android/app/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 9a4163a4f5ee..000000000000 --- a/packages/path_provider/path_provider_macos/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/packages/path_provider/path_provider_macos/example/android/app/src/androidTest/java/EmbeddingV1ActivityTest.java b/packages/path_provider/path_provider_macos/example/android/app/src/androidTest/java/EmbeddingV1ActivityTest.java deleted file mode 100644 index 50cb342715cb..000000000000 --- a/packages/path_provider/path_provider_macos/example/android/app/src/androidTest/java/EmbeddingV1ActivityTest.java +++ /dev/null @@ -1,15 +0,0 @@ - -package io.flutter.plugins.pathprovider; - -import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.integration_test.FlutterTestRunner; -import io.flutter.plugins.pathproviderexample.EmbeddingV1Activity; -import org.junit.Rule; -import org.junit.runner.RunWith; - -@RunWith(FlutterTestRunner.class) -public class EmbeddingV1ActivityTest { - @Rule - public ActivityTestRule rule = - new ActivityTestRule<>(EmbeddingV1Activity.class); -} diff --git a/packages/path_provider/path_provider_macos/example/android/app/src/androidTest/java/MainActivityTest.java b/packages/path_provider/path_provider_macos/example/android/app/src/androidTest/java/MainActivityTest.java deleted file mode 100644 index 09e000524a69..000000000000 --- a/packages/path_provider/path_provider_macos/example/android/app/src/androidTest/java/MainActivityTest.java +++ /dev/null @@ -1,13 +0,0 @@ - -package io.flutter.plugins.pathprovider; - -import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.integration_test.FlutterTestRunner; -import io.flutter.plugins.pathproviderexample.MainActivity; -import org.junit.Rule; -import org.junit.runner.RunWith; - -@RunWith(FlutterTestRunner.class) -public class MainActivityTest { - @Rule public ActivityTestRule rule = new ActivityTestRule<>(MainActivity.class); -} diff --git a/packages/path_provider/path_provider_macos/example/android/app/src/main/AndroidManifest.xml b/packages/path_provider/path_provider_macos/example/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index 9e03a9373e33..000000000000 --- a/packages/path_provider/path_provider_macos/example/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/packages/path_provider/path_provider_macos/example/android/app/src/main/java/io/flutter/plugins/pathproviderexample/EmbeddingV1Activity.java b/packages/path_provider/path_provider_macos/example/android/app/src/main/java/io/flutter/plugins/pathproviderexample/EmbeddingV1Activity.java deleted file mode 100644 index a826af36a9d3..000000000000 --- a/packages/path_provider/path_provider_macos/example/android/app/src/main/java/io/flutter/plugins/pathproviderexample/EmbeddingV1Activity.java +++ /dev/null @@ -1,14 +0,0 @@ - -package io.flutter.plugins.pathproviderexample; - -import android.os.Bundle; -import io.flutter.app.FlutterActivity; -import io.flutter.plugins.GeneratedPluginRegistrant; - -public class EmbeddingV1Activity extends FlutterActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - GeneratedPluginRegistrant.registerWith(this); - } -} diff --git a/packages/path_provider/path_provider_macos/example/android/app/src/main/java/io/flutter/plugins/pathproviderexample/MainActivity.java b/packages/path_provider/path_provider_macos/example/android/app/src/main/java/io/flutter/plugins/pathproviderexample/MainActivity.java deleted file mode 100644 index bdecc162446a..000000000000 --- a/packages/path_provider/path_provider_macos/example/android/app/src/main/java/io/flutter/plugins/pathproviderexample/MainActivity.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.pathproviderexample; - -import dev.flutter.plugins.integration_test.IntegrationTestPlugin; -import io.flutter.embedding.android.FlutterActivity; -import io.flutter.embedding.engine.FlutterEngine; -import io.flutter.plugins.pathprovider.PathProviderPlugin; - -public class MainActivity extends FlutterActivity { - // TODO(xster): Remove this once v2 of GeneratedPluginRegistrant rolls to stable. https://github.com/flutter/flutter/issues/42694 - @Override - public void configureFlutterEngine(FlutterEngine flutterEngine) { - flutterEngine.getPlugins().add(new PathProviderPlugin()); - flutterEngine.getPlugins().add(new IntegrationTestPlugin()); - } -} diff --git a/packages/path_provider/path_provider_macos/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/path_provider/path_provider_macos/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index db77bb4b7b0906d62b1847e87f15cdcacf6a4f29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 544 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY3?!3`olAj~WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8bpbvhu0Wd6uZuB!w&u2PAxD2eNXD>P5D~Wn-+_Wa#27Xc zC?Zj|6r#X(-D3u$NCt}(Ms06KgJ4FxJVv{GM)!I~&n8Bnc94O7-Hd)cjDZswgC;Qs zO=b+9!WcT8F?0rF7!Uys2bs@gozCP?z~o%U|N3vA*22NaGQG zlg@K`O_XuxvZ&Ks^m&R!`&1=spLvfx7oGDKDwpwW`#iqdw@AL`7MR}m`rwr|mZgU`8P7SBkL78fFf!WnuYWm$5Z0 zNXhDbCv&49sM544K|?c)WrFfiZvCi9h0O)B3Pgg&ebxsLQ05GG~ AQ2+n{ diff --git a/packages/path_provider/path_provider_macos/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/path_provider/path_provider_macos/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 17987b79bb8a35cc66c3c1fd44f5a5526c1b78be..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 442 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5Xx&nMcT!A!W`0S9QKQy;}1Cl^CgaH=;G9cpY;r$Q>i*pfB zP2drbID<_#qf;rPZx^FqH)F_D#*k@@q03KywUtLX8Ua?`H+NMzkczFPK3lFz@i_kW%1NOn0|D2I9n9wzH8m|-tHjsw|9>@K=iMBhxvkv6m8Y-l zytQ?X=U+MF$@3 zt`~i=@j|6y)RWMK--}M|=T`o&^Ni>IoWKHEbBXz7?A@mgWoL>!*SXo`SZH-*HSdS+ yn*9;$7;m`l>wYBC5bq;=U}IMqLzqbYCidGC!)_gkIk_C@Uy!y&wkt5C($~2D>~)O*cj@FGjOCM)M>_ixfudOh)?xMu#Fs z#}Y=@YDTwOM)x{K_j*Q;dPdJ?Mz0n|pLRx{4n|)f>SXlmV)XB04CrSJn#dS5nK2lM zrZ9#~WelCp7&e13Y$jvaEXHskn$2V!!DN-nWS__6T*l;H&Fopn?A6HZ-6WRLFP=R` zqG+CE#d4|IbyAI+rJJ`&x9*T`+a=p|0O(+s{UBcyZdkhj=yS1>AirP+0R;mf2uMgM zC}@~JfByORAh4SyRgi&!(cja>F(l*O+nd+@4m$|6K6KDn_&uvCpV23&>G9HJp{xgg zoq1^2_p9@|WEo z*X_Uko@K)qYYv~>43eQGMdbiGbo>E~Q& zrYBH{QP^@Sti!`2)uG{irBBq@y*$B zi#&(U-*=fp74j)RyIw49+0MRPMRU)+a2r*PJ$L5roHt2$UjExCTZSbq%V!HeS7J$N zdG@vOZB4v_lF7Plrx+hxo7(fCV&}fHq)$ diff --git a/packages/path_provider/path_provider_macos/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/path_provider/path_provider_macos/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index d5f1c8d34e7a88e3f88bea192c3a370d44689c3c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1031 zcmeAS@N?(olHy`uVBq!ia0vp^6F``Q8Ax83A=Cw=BuiW)N`mv#O3D+9QW+dm@{>{( zJaZG%Q-e|yQz{EjrrIztFa`(sgt!6~Yi|1%a`XoT0ojZ}lNrNjb9xjc(B0U1_% zz5^97Xt*%oq$rQy4?0GKNfJ44uvxI)gC`h-NZ|&0-7(qS@?b!5r36oQ}zyZrNO3 zMO=Or+<~>+A&uN&E!^Sl+>xE!QC-|oJv`ApDhqC^EWD|@=#J`=d#Xzxs4ah}w&Jnc z$|q_opQ^2TrnVZ0o~wh<3t%W&flvYGe#$xqda2bR_R zvPYgMcHgjZ5nSA^lJr%;<&0do;O^tDDh~=pIxA#coaCY>&N%M2^tq^U%3DB@ynvKo}b?yu-bFc-u0JHzced$sg7S3zqI(2 z#Km{dPr7I=pQ5>FuK#)QwK?Y`E`B?nP+}U)I#c1+FM*1kNvWG|a(TpksZQ3B@sD~b zpQ2)*V*TdwjFOtHvV|;OsiDqHi=6%)o4b!)x$)%9pGTsE z-JL={-Ffv+T87W(Xpooq<`r*VzWQcgBN$$`u}f>-ZQI1BB8ykN*=e4rIsJx9>z}*o zo~|9I;xof diff --git a/packages/path_provider/path_provider_macos/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/path_provider/path_provider_macos/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 4d6372eebdb28e45604e46eeda8dd24651419bc0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1443 zcmb`G{WsKk6vsdJTdFg%tJav9_E4vzrOaqkWF|A724Nly!y+?N9`YV6wZ}5(X(D_N(?!*n3`|_r0Hc?=PQw&*vnU?QTFY zB_MsH|!j$PP;I}?dppoE_gA(4uc!jV&0!l7_;&p2^pxNo>PEcNJv za5_RT$o2Mf!<+r?&EbHH6nMoTsDOa;mN(wv8RNsHpG)`^ymG-S5By8=l9iVXzN_eG%Xg2@Xeq76tTZ*dGh~Lo9vl;Zfs+W#BydUw zCkZ$o1LqWQO$FC9aKlLl*7x9^0q%0}$OMlp@Kk_jHXOjofdePND+j!A{q!8~Jn+s3 z?~~w@4?egS02}8NuulUA=L~QQfm;MzCGd)XhiftT;+zFO&JVyp2mBww?;QByS_1w! zrQlx%{^cMj0|Bo1FjwY@Q8?Hx0cIPF*@-ZRFpPc#bBw{5@tD(5%sClzIfl8WU~V#u zm5Q;_F!wa$BSpqhN>W@2De?TKWR*!ujY;Yylk_X5#~V!L*Gw~;$%4Q8~Mad z@`-kG?yb$a9cHIApZDVZ^U6Xkp<*4rU82O7%}0jjHlK{id@?-wpN*fCHXyXh(bLt* zPc}H-x0e4E&nQ>y%B-(EL=9}RyC%MyX=upHuFhAk&MLbsF0LP-q`XnH78@fT+pKPW zu72MW`|?8ht^tz$iC}ZwLp4tB;Q49K!QCF3@!iB1qOI=?w z7In!}F~ij(18UYUjnbmC!qKhPo%24?8U1x{7o(+?^Zu0Hx81|FuS?bJ0jgBhEMzf< zCgUq7r2OCB(`XkKcN-TL>u5y#dD6D!)5W?`O5)V^>jb)P)GBdy%t$uUMpf$SNV31$ zb||OojAbvMP?T@$h_ZiFLFVHDmbyMhJF|-_)HX3%m=CDI+ID$0^C>kzxprBW)hw(v zr!Gmda);ICoQyhV_oP5+C%?jcG8v+D@9f?Dk*!BxY}dazmrT@64UrP3hlslANK)bq z$67n83eh}OeW&SV@HG95P|bjfqJ7gw$e+`Hxo!4cx`jdK1bJ>YDSpGKLPZ^1cv$ek zIB?0S<#tX?SJCLWdMd{-ME?$hc7A$zBOdIJ)4!KcAwb=VMov)nK;9z>x~rfT1>dS+ zZ6#`2v@`jgbqq)P22H)Tx2CpmM^o1$B+xT6`(v%5xJ(?j#>Q$+rx_R|7TzDZe{J6q zG1*EcU%tE?!kO%^M;3aM6JN*LAKUVb^xz8-Pxo#jR5(-KBeLJvA@-gxNHx0M-ZJLl z;#JwQoh~9V?`UVo#}{6ka@II>++D@%KqGpMdlQ}?9E*wFcf5(#XQnP$Dk5~%iX^>f z%$y;?M0BLp{O3a(-4A?ewryHrrD%cx#Q^%KY1H zNre$ve+vceSLZcNY4U(RBX&)oZn*Py()h)XkE?PL$!bNb{N5FVI2Y%LKEm%yvpyTP z(1P?z~7YxD~Rf<(a@_y` diff --git a/packages/path_provider/path_provider_macos/example/android/build.gradle b/packages/path_provider/path_provider_macos/example/android/build.gradle deleted file mode 100644 index 541636cc492a..000000000000 --- a/packages/path_provider/path_provider_macos/example/android/build.gradle +++ /dev/null @@ -1,29 +0,0 @@ -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.3.0' - } -} - -allprojects { - repositories { - google() - jcenter() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/packages/path_provider/path_provider_macos/example/android/gradle.properties b/packages/path_provider/path_provider_macos/example/android/gradle.properties deleted file mode 100644 index 38c8d4544ff1..000000000000 --- a/packages/path_provider/path_provider_macos/example/android/gradle.properties +++ /dev/null @@ -1,4 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M -android.enableR8=true -android.useAndroidX=true -android.enableJetifier=true diff --git a/packages/path_provider/path_provider_macos/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/path_provider/path_provider_macos/example/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index caf54fa2801c..000000000000 --- a/packages/path_provider/path_provider_macos/example/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip diff --git a/packages/path_provider/path_provider_macos/example/android/settings.gradle b/packages/path_provider/path_provider_macos/example/android/settings.gradle deleted file mode 100644 index 6cb349eef1b6..000000000000 --- a/packages/path_provider/path_provider_macos/example/android/settings.gradle +++ /dev/null @@ -1,15 +0,0 @@ -include ':app' - -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() - -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withInputStream { stream -> plugins.load(stream) } -} - -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory -} \ No newline at end of file diff --git a/packages/path_provider/path_provider_macos/pubspec.yaml b/packages/path_provider/path_provider_macos/pubspec.yaml index bcd45c8bd327..00ac8376fca9 100644 --- a/packages/path_provider/path_provider_macos/pubspec.yaml +++ b/packages/path_provider/path_provider_macos/pubspec.yaml @@ -3,7 +3,7 @@ description: macOS implementation of the path_provider plugin # 0.0.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.0.4+3 +version: 0.0.4+4 homepage: https://github.com/flutter/plugins/tree/master/packages/path_provider/path_provider_macos flutter: diff --git a/packages/url_launcher/url_launcher_macos/CHANGELOG.md b/packages/url_launcher/url_launcher_macos/CHANGELOG.md index 8948f50f976c..d52bf8c249e6 100644 --- a/packages/url_launcher/url_launcher_macos/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_macos/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.0.1+8 + +* Remove no-op android folder in the example app. + # 0.0.1+7 * Remove Android folder from url_launcher_web and url_launcher_macos. diff --git a/packages/url_launcher/url_launcher_macos/example/android/app/build.gradle b/packages/url_launcher/url_launcher_macos/example/android/app/build.gradle deleted file mode 100644 index 7a6cf5df0d33..000000000000 --- a/packages/url_launcher/url_launcher_macos/example/android/app/build.gradle +++ /dev/null @@ -1,60 +0,0 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - compileSdkVersion 28 - - lintOptions { - disable 'InvalidPackage' - } - - defaultConfig { - applicationId "io.flutter.plugins.urllauncherexample" - minSdkVersion 16 - targetSdkVersion 28 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test:runner:1.2.0' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' -} diff --git a/packages/url_launcher/url_launcher_macos/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/url_launcher/url_launcher_macos/example/android/app/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 9a4163a4f5ee..000000000000 --- a/packages/url_launcher/url_launcher_macos/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/packages/url_launcher/url_launcher_macos/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/EmbeddingV1ActivityTest.java b/packages/url_launcher/url_launcher_macos/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/EmbeddingV1ActivityTest.java deleted file mode 100644 index fb66478feed8..000000000000 --- a/packages/url_launcher/url_launcher_macos/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/EmbeddingV1ActivityTest.java +++ /dev/null @@ -1,13 +0,0 @@ -package io.flutter.plugins.urllauncherexample; - -import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.integration_test.FlutterTestRunner; -import org.junit.Rule; -import org.junit.runner.RunWith; - -@RunWith(FlutterTestRunner.class) -public class EmbeddingV1ActivityTest { - @Rule - public ActivityTestRule rule = - new ActivityTestRule<>(EmbeddingV1Activity.class); -} diff --git a/packages/url_launcher/url_launcher_macos/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/FlutterActivityTest.java b/packages/url_launcher/url_launcher_macos/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/FlutterActivityTest.java deleted file mode 100644 index 5b50523f7f40..000000000000 --- a/packages/url_launcher/url_launcher_macos/example/android/app/src/androidTestDebug/java/io/flutter/plugins/urllauncherexample/FlutterActivityTest.java +++ /dev/null @@ -1,13 +0,0 @@ -package io.flutter.plugins.urllauncherexample; - -import androidx.test.rule.ActivityTestRule; -import dev.flutter.plugins.integration_test.FlutterTestRunner; -import io.flutter.embedding.android.FlutterActivity; -import org.junit.Rule; -import org.junit.runner.RunWith; - -@RunWith(FlutterTestRunner.class) -public class FlutterActivityTest { - @Rule - public ActivityTestRule rule = new ActivityTestRule<>(FlutterActivity.class); -} diff --git a/packages/url_launcher/url_launcher_macos/example/android/app/src/main/AndroidManifest.xml b/packages/url_launcher/url_launcher_macos/example/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index 37035799fea8..000000000000 --- a/packages/url_launcher/url_launcher_macos/example/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/packages/url_launcher/url_launcher_macos/example/android/app/src/main/java/io/flutter/plugins/urllauncherexample/EmbeddingV1Activity.java b/packages/url_launcher/url_launcher_macos/example/android/app/src/main/java/io/flutter/plugins/urllauncherexample/EmbeddingV1Activity.java deleted file mode 100644 index 39afc642ddb9..000000000000 --- a/packages/url_launcher/url_launcher_macos/example/android/app/src/main/java/io/flutter/plugins/urllauncherexample/EmbeddingV1Activity.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.urllauncherexample; - -import android.os.Bundle; -import dev.flutter.plugins.integration_test.IntegrationTestPlugin; -import io.flutter.app.FlutterActivity; -import io.flutter.plugins.urllauncher.UrlLauncherPlugin; - -public class EmbeddingV1Activity extends FlutterActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - IntegrationTestPlugin.registerWith( - registrarFor("dev.flutter.plugins.integration_test.IntegrationTestPlugin")); - UrlLauncherPlugin.registerWith( - registrarFor("io.flutter.plugins.urllauncher.UrlLauncherPlugin")); - } -} diff --git a/packages/url_launcher/url_launcher_macos/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/url_launcher/url_launcher_macos/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index db77bb4b7b0906d62b1847e87f15cdcacf6a4f29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 544 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY3?!3`olAj~WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8bpbvhu0Wd6uZuB!w&u2PAxD2eNXD>P5D~Wn-+_Wa#27Xc zC?Zj|6r#X(-D3u$NCt}(Ms06KgJ4FxJVv{GM)!I~&n8Bnc94O7-Hd)cjDZswgC;Qs zO=b+9!WcT8F?0rF7!Uys2bs@gozCP?z~o%U|N3vA*22NaGQG zlg@K`O_XuxvZ&Ks^m&R!`&1=spLvfx7oGDKDwpwW`#iqdw@AL`7MR}m`rwr|mZgU`8P7SBkL78fFf!WnuYWm$5Z0 zNXhDbCv&49sM544K|?c)WrFfiZvCi9h0O)B3Pgg&ebxsLQ05GG~ AQ2+n{ diff --git a/packages/url_launcher/url_launcher_macos/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/url_launcher/url_launcher_macos/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 17987b79bb8a35cc66c3c1fd44f5a5526c1b78be..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 442 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5Xx&nMcT!A!W`0S9QKQy;}1Cl^CgaH=;G9cpY;r$Q>i*pfB zP2drbID<_#qf;rPZx^FqH)F_D#*k@@q03KywUtLX8Ua?`H+NMzkczFPK3lFz@i_kW%1NOn0|D2I9n9wzH8m|-tHjsw|9>@K=iMBhxvkv6m8Y-l zytQ?X=U+MF$@3 zt`~i=@j|6y)RWMK--}M|=T`o&^Ni>IoWKHEbBXz7?A@mgWoL>!*SXo`SZH-*HSdS+ yn*9;$7;m`l>wYBC5bq;=U}IMqLzqbYCidGC!)_gkIk_C@Uy!y&wkt5C($~2D>~)O*cj@FGjOCM)M>_ixfudOh)?xMu#Fs z#}Y=@YDTwOM)x{K_j*Q;dPdJ?Mz0n|pLRx{4n|)f>SXlmV)XB04CrSJn#dS5nK2lM zrZ9#~WelCp7&e13Y$jvaEXHskn$2V!!DN-nWS__6T*l;H&Fopn?A6HZ-6WRLFP=R` zqG+CE#d4|IbyAI+rJJ`&x9*T`+a=p|0O(+s{UBcyZdkhj=yS1>AirP+0R;mf2uMgM zC}@~JfByORAh4SyRgi&!(cja>F(l*O+nd+@4m$|6K6KDn_&uvCpV23&>G9HJp{xgg zoq1^2_p9@|WEo z*X_Uko@K)qYYv~>43eQGMdbiGbo>E~Q& zrYBH{QP^@Sti!`2)uG{irBBq@y*$B zi#&(U-*=fp74j)RyIw49+0MRPMRU)+a2r*PJ$L5roHt2$UjExCTZSbq%V!HeS7J$N zdG@vOZB4v_lF7Plrx+hxo7(fCV&}fHq)$ diff --git a/packages/url_launcher/url_launcher_macos/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/url_launcher/url_launcher_macos/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index d5f1c8d34e7a88e3f88bea192c3a370d44689c3c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1031 zcmeAS@N?(olHy`uVBq!ia0vp^6F``Q8Ax83A=Cw=BuiW)N`mv#O3D+9QW+dm@{>{( zJaZG%Q-e|yQz{EjrrIztFa`(sgt!6~Yi|1%a`XoT0ojZ}lNrNjb9xjc(B0U1_% zz5^97Xt*%oq$rQy4?0GKNfJ44uvxI)gC`h-NZ|&0-7(qS@?b!5r36oQ}zyZrNO3 zMO=Or+<~>+A&uN&E!^Sl+>xE!QC-|oJv`ApDhqC^EWD|@=#J`=d#Xzxs4ah}w&Jnc z$|q_opQ^2TrnVZ0o~wh<3t%W&flvYGe#$xqda2bR_R zvPYgMcHgjZ5nSA^lJr%;<&0do;O^tDDh~=pIxA#coaCY>&N%M2^tq^U%3DB@ynvKo}b?yu-bFc-u0JHzced$sg7S3zqI(2 z#Km{dPr7I=pQ5>FuK#)QwK?Y`E`B?nP+}U)I#c1+FM*1kNvWG|a(TpksZQ3B@sD~b zpQ2)*V*TdwjFOtHvV|;OsiDqHi=6%)o4b!)x$)%9pGTsE z-JL={-Ffv+T87W(Xpooq<`r*VzWQcgBN$$`u}f>-ZQI1BB8ykN*=e4rIsJx9>z}*o zo~|9I;xof diff --git a/packages/url_launcher/url_launcher_macos/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/url_launcher/url_launcher_macos/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 4d6372eebdb28e45604e46eeda8dd24651419bc0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1443 zcmb`G{WsKk6vsdJTdFg%tJav9_E4vzrOaqkWF|A724Nly!y+?N9`YV6wZ}5(X(D_N(?!*n3`|_r0Hc?=PQw&*vnU?QTFY zB_MsH|!j$PP;I}?dppoE_gA(4uc!jV&0!l7_;&p2^pxNo>PEcNJv za5_RT$o2Mf!<+r?&EbHH6nMoTsDOa;mN(wv8RNsHpG)`^ymG-S5By8=l9iVXzN_eG%Xg2@Xeq76tTZ*dGh~Lo9vl;Zfs+W#BydUw zCkZ$o1LqWQO$FC9aKlLl*7x9^0q%0}$OMlp@Kk_jHXOjofdePND+j!A{q!8~Jn+s3 z?~~w@4?egS02}8NuulUA=L~QQfm;MzCGd)XhiftT;+zFO&JVyp2mBww?;QByS_1w! zrQlx%{^cMj0|Bo1FjwY@Q8?Hx0cIPF*@-ZRFpPc#bBw{5@tD(5%sClzIfl8WU~V#u zm5Q;_F!wa$BSpqhN>W@2De?TKWR*!ujY;Yylk_X5#~V!L*Gw~;$%4Q8~Mad z@`-kG?yb$a9cHIApZDVZ^U6Xkp<*4rU82O7%}0jjHlK{id@?-wpN*fCHXyXh(bLt* zPc}H-x0e4E&nQ>y%B-(EL=9}RyC%MyX=upHuFhAk&MLbsF0LP-q`XnH78@fT+pKPW zu72MW`|?8ht^tz$iC}ZwLp4tB;Q49K!QCF3@!iB1qOI=?w z7In!}F~ij(18UYUjnbmC!qKhPo%24?8U1x{7o(+?^Zu0Hx81|FuS?bJ0jgBhEMzf< zCgUq7r2OCB(`XkKcN-TL>u5y#dD6D!)5W?`O5)V^>jb)P)GBdy%t$uUMpf$SNV31$ zb||OojAbvMP?T@$h_ZiFLFVHDmbyMhJF|-_)HX3%m=CDI+ID$0^C>kzxprBW)hw(v zr!Gmda);ICoQyhV_oP5+C%?jcG8v+D@9f?Dk*!BxY}dazmrT@64UrP3hlslANK)bq z$67n83eh}OeW&SV@HG95P|bjfqJ7gw$e+`Hxo!4cx`jdK1bJ>YDSpGKLPZ^1cv$ek zIB?0S<#tX?SJCLWdMd{-ME?$hc7A$zBOdIJ)4!KcAwb=VMov)nK;9z>x~rfT1>dS+ zZ6#`2v@`jgbqq)P22H)Tx2CpmM^o1$B+xT6`(v%5xJ(?j#>Q$+rx_R|7TzDZe{J6q zG1*EcU%tE?!kO%^M;3aM6JN*LAKUVb^xz8-Pxo#jR5(-KBeLJvA@-gxNHx0M-ZJLl z;#JwQoh~9V?`UVo#}{6ka@II>++D@%KqGpMdlQ}?9E*wFcf5(#XQnP$Dk5~%iX^>f z%$y;?M0BLp{O3a(-4A?ewryHrrD%cx#Q^%KY1H zNre$ve+vceSLZcNY4U(RBX&)oZn*Py()h)XkE?PL$!bNb{N5FVI2Y%LKEm%yvpyTP z(1P?z~7YxD~Rf<(a@_y` diff --git a/packages/url_launcher/url_launcher_macos/example/android/build.gradle b/packages/url_launcher/url_launcher_macos/example/android/build.gradle deleted file mode 100644 index 6b1a639efd76..000000000000 --- a/packages/url_launcher/url_launcher_macos/example/android/build.gradle +++ /dev/null @@ -1,29 +0,0 @@ -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.4.2' - } -} - -allprojects { - repositories { - google() - jcenter() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/packages/url_launcher/url_launcher_macos/example/android/gradle.properties b/packages/url_launcher/url_launcher_macos/example/android/gradle.properties deleted file mode 100644 index a6738207fd15..000000000000 --- a/packages/url_launcher/url_launcher_macos/example/android/gradle.properties +++ /dev/null @@ -1,4 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M -android.useAndroidX=true -android.enableJetifier=true -android.enableR8=true diff --git a/packages/url_launcher/url_launcher_macos/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/url_launcher/url_launcher_macos/example/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 1cedb28ea41f..000000000000 --- a/packages/url_launcher/url_launcher_macos/example/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Wed Jul 31 20:16:04 BRT 2019 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip diff --git a/packages/url_launcher/url_launcher_macos/example/android/settings.gradle b/packages/url_launcher/url_launcher_macos/example/android/settings.gradle deleted file mode 100644 index 115da6cb4f4d..000000000000 --- a/packages/url_launcher/url_launcher_macos/example/android/settings.gradle +++ /dev/null @@ -1,15 +0,0 @@ -include ':app' - -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() - -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withInputStream { stream -> plugins.load(stream) } -} - -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory -} diff --git a/packages/url_launcher/url_launcher_macos/pubspec.yaml b/packages/url_launcher/url_launcher_macos/pubspec.yaml index 5312921f2d72..4775f23fe36a 100644 --- a/packages/url_launcher/url_launcher_macos/pubspec.yaml +++ b/packages/url_launcher/url_launcher_macos/pubspec.yaml @@ -3,7 +3,7 @@ description: macOS implementation of the url_launcher plugin. # 0.0.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.0.1+7 +version: 0.0.1+8 homepage: https://github.com/flutter/plugins/tree/master/packages/url_launcher/url_launcher_macos flutter: From 26bf10f3c82279ffae4f98c67a5d1e43f5ce5f35 Mon Sep 17 00:00:00 2001 From: creativecreatorormaybenot Date: Wed, 16 Sep 2020 16:41:40 +0000 Subject: [PATCH 092/233] Update CODEOWNERS (#3034) --- CODEOWNERS | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index 97f8bf388697..2d4bff36c9eb 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -4,22 +4,22 @@ # These names are just suggestions. It is fine to have your changes # reviewed by someone else. -packages/android_alarm_manager/* @bkonyi -packages/android_intent/* @mklim @matthew-carroll -packages/battery/* @amirh @matthew-carroll -packages/camera/* @bparrishMines -packages/connectivity/* @cyanglaz @matthew-carroll -packages/device_info/* @matthew-carroll -packages/espresso/* @collinjackson @adazh -packages/google_maps_flutter/* @cyanglaz -packages/google_sign_in/* @cyanglaz @mehmetf -packages/image_picker/* @cyanglaz -packages/integration_test/* @dnfield -packages/in_app_purchase/* @mklim @cyanglaz @LHLL -packages/ios_platform_images/* @gaaclarke -packages/package_info/* @cyanglaz @matthew-carroll -packages/path_provider/* @matthew-carroll -packages/shared_preferences/* @matthew-carroll -packages/url_launcher/* @mklim -packages/video_player/* @iskakaushik @cyanglaz -packages/webview_flutter/* @amirh +packages/android_alarm_manager/** @bkonyi +packages/android_intent/** @mklim @matthew-carroll +packages/battery/** @amirh @matthew-carroll +packages/camera/** @bparrishMines +packages/connectivity/** @cyanglaz @matthew-carroll +packages/device_info/** @matthew-carroll +packages/espresso/** @collinjackson @adazh +packages/google_maps_flutter/** @cyanglaz +packages/google_sign_in/** @cyanglaz @mehmetf +packages/image_picker/** @cyanglaz +packages/integration_test/** @dnfield +packages/in_app_purchase/** @mklim @cyanglaz @LHLL +packages/ios_platform_images/** @gaaclarke +packages/package_info/** @cyanglaz @matthew-carroll +packages/path_provider/** @matthew-carroll +packages/shared_preferences/** @matthew-carroll +packages/url_launcher/** @mklim +packages/video_player/** @iskakaushik @cyanglaz +packages/webview_flutter/** @amirh From 17d7548bf571cca8ee7167bcb9605a694181cdb6 Mon Sep 17 00:00:00 2001 From: Hamdi Kahloun <32666446+hamdikahloun@users.noreply.github.com> Date: Thu, 17 Sep 2020 18:01:35 +0100 Subject: [PATCH 093/233] [share] MethodCallHandler.java uses unchecked or unsafe operations (#3004) --- packages/share/CHANGELOG.md | 4 ++++ packages/share/android/build.gradle | 5 +++++ .../flutter/plugins/share/MethodCallHandler.java | 14 ++++++++------ packages/share/pubspec.yaml | 2 +- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/packages/share/CHANGELOG.md b/packages/share/CHANGELOG.md index c4ee830ed34f..8037c75943df 100644 --- a/packages/share/CHANGELOG.md +++ b/packages/share/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.6.5+1 + +* Avoiding uses unchecked or unsafe Object Type Casting + ## 0.6.5 * Added support for sharing files diff --git a/packages/share/android/build.gradle b/packages/share/android/build.gradle index 7506f4db8261..ffa1432fa17a 100644 --- a/packages/share/android/build.gradle +++ b/packages/share/android/build.gradle @@ -1,5 +1,6 @@ group 'io.flutter.plugins.share' version '1.0-SNAPSHOT' +def args = ["-Xlint:deprecation","-Xlint:unchecked","-Werror"] buildscript { repositories { @@ -19,6 +20,10 @@ rootProject.allprojects { } } +project.getTasks().withType(JavaCompile){ + options.compilerArgs.addAll(args) +} + apply plugin: 'com.android.library' android { diff --git a/packages/share/android/src/main/java/io/flutter/plugins/share/MethodCallHandler.java b/packages/share/android/src/main/java/io/flutter/plugins/share/MethodCallHandler.java index 02841d3a4ae2..99baabeab6b7 100644 --- a/packages/share/android/src/main/java/io/flutter/plugins/share/MethodCallHandler.java +++ b/packages/share/android/src/main/java/io/flutter/plugins/share/MethodCallHandler.java @@ -25,19 +25,21 @@ public void onMethodCall(MethodCall call, MethodChannel.Result result) { case "share": expectMapArguments(call); // Android does not support showing the share sheet at a particular point on screen. - share.share((String) call.argument("text"), (String) call.argument("subject")); + String text = call.argument("text"); + String subject = call.argument("subject"); + share.share(text, subject); result.success(null); break; case "shareFiles": expectMapArguments(call); + List paths = call.argument("paths"); + List mimeTypes = call.argument("mimeTypes"); + text = call.argument("text"); + subject = call.argument("subject"); // Android does not support showing the share sheet at a particular point on screen. try { - share.shareFiles( - (List) call.argument("paths"), - (List) call.argument("mimeTypes"), - (String) call.argument("text"), - (String) call.argument("subject")); + share.shareFiles(paths, mimeTypes, text, subject); result.success(null); } catch (IOException e) { result.error(e.getMessage(), null, null); diff --git a/packages/share/pubspec.yaml b/packages/share/pubspec.yaml index 918087b139ec..f9c1f4bad4e6 100644 --- a/packages/share/pubspec.yaml +++ b/packages/share/pubspec.yaml @@ -5,7 +5,7 @@ homepage: https://github.com/flutter/plugins/tree/master/packages/share # 0.6.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.6.5 +version: 0.6.5+1 flutter: plugin: From dc15a36902d084cbebeba2f51a105bc6c75452b7 Mon Sep 17 00:00:00 2001 From: Hamdi Kahloun <32666446+hamdikahloun@users.noreply.github.com> Date: Thu, 17 Sep 2020 18:02:06 +0100 Subject: [PATCH 094/233] [camera] CameraPlugin.java uses or overrides a deprecated API (#3018) --- packages/camera/CHANGELOG.md | 4 ++++ packages/camera/android/build.gradle | 5 +++++ .../main/java/io/flutter/plugins/camera/CameraPlugin.java | 2 +- packages/camera/pubspec.yaml | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/camera/CHANGELOG.md b/packages/camera/CHANGELOG.md index 2cf34dd55588..d405812bce6a 100644 --- a/packages/camera/CHANGELOG.md +++ b/packages/camera/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.5.8+6 + +* Avoiding uses or overrides a deprecated API in CameraPlugin.java. + ## 0.5.8+5 * Fix compilation/availability issues on iOS. diff --git a/packages/camera/android/build.gradle b/packages/camera/android/build.gradle index 95f5a22cfb6d..3ff98a8d7f47 100644 --- a/packages/camera/android/build.gradle +++ b/packages/camera/android/build.gradle @@ -1,5 +1,6 @@ group 'io.flutter.plugins.camera' version '1.0-SNAPSHOT' +def args = ["-Xlint:deprecation","-Xlint:unchecked","-Werror"] buildscript { repositories { @@ -19,6 +20,10 @@ rootProject.allprojects { } } +project.getTasks().withType(JavaCompile){ + options.compilerArgs.addAll(args) +} + apply plugin: 'com.android.library' android { diff --git a/packages/camera/android/src/main/java/io/flutter/plugins/camera/CameraPlugin.java b/packages/camera/android/src/main/java/io/flutter/plugins/camera/CameraPlugin.java index 2511898038bb..4c08b222ba77 100644 --- a/packages/camera/android/src/main/java/io/flutter/plugins/camera/CameraPlugin.java +++ b/packages/camera/android/src/main/java/io/flutter/plugins/camera/CameraPlugin.java @@ -70,7 +70,7 @@ public void onAttachedToActivity(@NonNull ActivityPluginBinding binding) { binding.getActivity(), flutterPluginBinding.getBinaryMessenger(), binding::addRequestPermissionsResultListener, - flutterPluginBinding.getFlutterEngine().getRenderer()); + flutterPluginBinding.getTextureRegistry()); } @Override diff --git a/packages/camera/pubspec.yaml b/packages/camera/pubspec.yaml index 01c7907792b2..9d1f7880df2d 100644 --- a/packages/camera/pubspec.yaml +++ b/packages/camera/pubspec.yaml @@ -2,7 +2,7 @@ name: camera description: A Flutter plugin for getting information about and controlling the camera on Android and iOS. Supports previewing the camera feed, capturing images, capturing video, and streaming image buffers to dart. -version: 0.5.8+5 +version: 0.5.8+6 homepage: https://github.com/flutter/plugins/tree/master/packages/camera From 40d2070635874ca71540d20db1057365246ccb64 Mon Sep 17 00:00:00 2001 From: Hamdi Kahloun <32666446+hamdikahloun@users.noreply.github.com> Date: Thu, 17 Sep 2020 18:02:23 +0100 Subject: [PATCH 095/233] [video_player] VideoPlayerPlugin.java uses or overrides a deprecated API (#3019) --- packages/video_player/video_player/CHANGELOG.md | 4 ++++ packages/video_player/video_player/android/build.gradle | 5 +++++ .../io/flutter/plugins/videoplayer/VideoPlayerPlugin.java | 2 +- packages/video_player/video_player/pubspec.yaml | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/video_player/video_player/CHANGELOG.md b/packages/video_player/video_player/CHANGELOG.md index 35f50419f823..fb26e31c4a45 100644 --- a/packages/video_player/video_player/CHANGELOG.md +++ b/packages/video_player/video_player/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.10.12+3 + +* Avoiding uses or overrides a deprecated API in `VideoPlayerPlugin` class. + ## 0.10.12+2 * Fix `setMixWithOthers` test. diff --git a/packages/video_player/video_player/android/build.gradle b/packages/video_player/video_player/android/build.gradle index edbb4c7acce4..12725f3f7142 100644 --- a/packages/video_player/video_player/android/build.gradle +++ b/packages/video_player/video_player/android/build.gradle @@ -1,5 +1,6 @@ group 'io.flutter.plugins.videoplayer' version '1.0-SNAPSHOT' +def args = ["-Xlint:deprecation","-Xlint:unchecked","-Werror"] buildscript { repositories { @@ -19,6 +20,10 @@ rootProject.allprojects { } } +project.getTasks().withType(JavaCompile){ + options.compilerArgs.addAll(args) +} + apply plugin: 'com.android.library' android { diff --git a/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java b/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java index a22a4f2d7ae4..77fd10a7a69b 100644 --- a/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java +++ b/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java @@ -60,7 +60,7 @@ public void onAttachedToEngine(FlutterPluginBinding binding) { binding.getBinaryMessenger(), FlutterMain::getLookupKeyForAsset, FlutterMain::getLookupKeyForAsset, - binding.getFlutterEngine().getRenderer()); + binding.getTextureRegistry()); flutterState.startListening(this, binding.getBinaryMessenger()); } diff --git a/packages/video_player/video_player/pubspec.yaml b/packages/video_player/video_player/pubspec.yaml index 04c7c6ba3ddb..1d46ea7ebbf9 100644 --- a/packages/video_player/video_player/pubspec.yaml +++ b/packages/video_player/video_player/pubspec.yaml @@ -4,7 +4,7 @@ description: Flutter plugin for displaying inline video with other Flutter # 0.10.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.10.12+2 +version: 0.10.12+3 homepage: https://github.com/flutter/plugins/tree/master/packages/video_player/video_player flutter: From d16fd7a51fc604db6f911ad0034c3fc2b5839788 Mon Sep 17 00:00:00 2001 From: Anniek Date: Thu, 17 Sep 2020 22:39:55 +0200 Subject: [PATCH 096/233] [image_picker] Updated docs getImage() about preference rear front not working on Android (#3037) --- packages/image_picker/image_picker/CHANGELOG.md | 4 ++++ packages/image_picker/image_picker/lib/image_picker.dart | 4 +++- packages/image_picker/image_picker/pubspec.yaml | 2 +- .../image_picker/image_picker_platform_interface/CHANGELOG.md | 4 ++++ .../lib/src/platform_interface/image_picker_platform.dart | 4 +++- .../image_picker/image_picker_platform_interface/pubspec.yaml | 2 +- 6 files changed, 16 insertions(+), 4 deletions(-) diff --git a/packages/image_picker/image_picker/CHANGELOG.md b/packages/image_picker/image_picker/CHANGELOG.md index 07447db130ca..100fe9989354 100644 --- a/packages/image_picker/image_picker/CHANGELOG.md +++ b/packages/image_picker/image_picker/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.6.7+8 + +* Update documentation of getImage() about Android's disability to preference front/rear camera. + ## 0.6.7+7 * Updating documentation to use isEmpty check. diff --git a/packages/image_picker/image_picker/lib/image_picker.dart b/packages/image_picker/image_picker/lib/image_picker.dart index 7dd7e8e52469..6fe513dc25f1 100755 --- a/packages/image_picker/image_picker/lib/image_picker.dart +++ b/packages/image_picker/image_picker/lib/image_picker.dart @@ -87,7 +87,9 @@ class ImagePicker { /// /// Use `preferredCameraDevice` to specify the camera to use when the `source` is [ImageSource.camera]. /// The `preferredCameraDevice` is ignored when `source` is [ImageSource.gallery]. It is also ignored if the chosen camera is not supported on the device. - /// Defaults to [CameraDevice.rear]. + /// Defaults to [CameraDevice.rear]. Note that Android has no documented parameter for an intent to specify if + /// the front or rear camera should be opened, this function is not guaranteed + /// to work on an Android device. /// /// In Android, the MainActivity can be destroyed for various reasons. If that happens, the result will be lost /// in this call. You can then call [getLostData] when your app relaunches to retrieve the lost data. diff --git a/packages/image_picker/image_picker/pubspec.yaml b/packages/image_picker/image_picker/pubspec.yaml index 91338f1e22ee..5a0dfdafe8c2 100755 --- a/packages/image_picker/image_picker/pubspec.yaml +++ b/packages/image_picker/image_picker/pubspec.yaml @@ -2,7 +2,7 @@ name: image_picker description: Flutter plugin for selecting images from the Android and iOS image library, and taking new pictures with the camera. homepage: https://github.com/flutter/plugins/tree/master/packages/image_picker/image_picker -version: 0.6.7+7 +version: 0.6.7+8 flutter: plugin: diff --git a/packages/image_picker/image_picker_platform_interface/CHANGELOG.md b/packages/image_picker/image_picker_platform_interface/CHANGELOG.md index 0a238bcd51bf..33c1cf8ddba7 100644 --- a/packages/image_picker/image_picker_platform_interface/CHANGELOG.md +++ b/packages/image_picker/image_picker_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.1.1 + +* Update documentation of getImage() about Android's disability to preference front/rear camera. + ## 1.1.0 * Introduce PickedFile type for the new API. diff --git a/packages/image_picker/image_picker_platform_interface/lib/src/platform_interface/image_picker_platform.dart b/packages/image_picker/image_picker_platform_interface/lib/src/platform_interface/image_picker_platform.dart index 94be4c2f2ab1..38bf0858dd6f 100644 --- a/packages/image_picker/image_picker_platform_interface/lib/src/platform_interface/image_picker_platform.dart +++ b/packages/image_picker/image_picker_platform_interface/lib/src/platform_interface/image_picker_platform.dart @@ -132,7 +132,9 @@ abstract class ImagePickerPlatform extends PlatformInterface { /// /// Use `preferredCameraDevice` to specify the camera to use when the `source` is [ImageSource.camera]. /// The `preferredCameraDevice` is ignored when `source` is [ImageSource.gallery]. It is also ignored if the chosen camera is not supported on the device. - /// Defaults to [CameraDevice.rear]. + /// Defaults to [CameraDevice.rear]. Note that Android has no documented parameter for an intent to specify if + /// the front or rear camera should be opened, this function is not guaranteed + /// to work on an Android device. /// /// In Android, the MainActivity can be destroyed for various reasons. If that happens, the result will be lost /// in this call. You can then call [retrieveLostData] when your app relaunches to retrieve the lost data. diff --git a/packages/image_picker/image_picker_platform_interface/pubspec.yaml b/packages/image_picker/image_picker_platform_interface/pubspec.yaml index 946cf80c5187..2a5f9d0380d0 100644 --- a/packages/image_picker/image_picker_platform_interface/pubspec.yaml +++ b/packages/image_picker/image_picker_platform_interface/pubspec.yaml @@ -3,7 +3,7 @@ description: A common platform interface for the image_picker plugin. homepage: https://github.com/flutter/plugins/tree/master/packages/image_picker/image_picker_platform_interface # NOTE: We strongly prefer non-breaking changes, even at the expense of a # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes -version: 1.1.0 +version: 1.1.1 dependencies: flutter: From 1685a2849d9fbbb9128c23f40aaf37640b2769d1 Mon Sep 17 00:00:00 2001 From: Tim Sneath Date: Fri, 18 Sep 2020 07:07:11 -0700 Subject: [PATCH 097/233] [path_provider] Add Windows support (#2818) Implements path_provider for Windows, adding path_provider_windows and endorsing it in path_provider. --- .../path_provider/path_provider/CHANGELOG.md | 5 + .../path_provider/path_provider/README.md | 9 +- .../path_provider/lib/path_provider.dart | 47 ++-- .../path_provider/path_provider/pubspec.yaml | 8 +- .../test/path_provider_test.dart | 4 - .../path_provider_windows/.gitignore | 3 + .../path_provider_windows/CHANGELOG.md | 11 + .../path_provider_windows/LICENSE | 25 ++ .../path_provider_windows/README.md | 31 +++ .../path_provider_windows/example/.gitignore | 44 ++++ .../path_provider_windows/example/.metadata | 10 + .../path_provider_windows/example/README.md | 8 + .../example/lib/main.dart | 93 +++++++ .../example/pubspec.yaml | 21 ++ .../test_driver/path_provider_e2e.dart | 53 ++++ .../test_driver/path_provider_e2e_test.dart | 15 ++ .../path_provider_windows/lib/folders.dart | 240 ++++++++++++++++++ .../lib/path_provider_windows.dart | 222 ++++++++++++++++ .../path_provider_windows/pubspec.yaml | 29 +++ .../test/path_provider_windows_test.dart | 109 ++++++++ 20 files changed, 946 insertions(+), 41 deletions(-) create mode 100644 packages/path_provider/path_provider_windows/.gitignore create mode 100644 packages/path_provider/path_provider_windows/CHANGELOG.md create mode 100644 packages/path_provider/path_provider_windows/LICENSE create mode 100644 packages/path_provider/path_provider_windows/README.md create mode 100644 packages/path_provider/path_provider_windows/example/.gitignore create mode 100644 packages/path_provider/path_provider_windows/example/.metadata create mode 100644 packages/path_provider/path_provider_windows/example/README.md create mode 100644 packages/path_provider/path_provider_windows/example/lib/main.dart create mode 100644 packages/path_provider/path_provider_windows/example/pubspec.yaml create mode 100644 packages/path_provider/path_provider_windows/example/test_driver/path_provider_e2e.dart create mode 100644 packages/path_provider/path_provider_windows/example/test_driver/path_provider_e2e_test.dart create mode 100644 packages/path_provider/path_provider_windows/lib/folders.dart create mode 100644 packages/path_provider/path_provider_windows/lib/path_provider_windows.dart create mode 100644 packages/path_provider/path_provider_windows/pubspec.yaml create mode 100644 packages/path_provider/path_provider_windows/test/path_provider_windows_test.dart diff --git a/packages/path_provider/path_provider/CHANGELOG.md b/packages/path_provider/path_provider/CHANGELOG.md index 07778d5ccef3..31f7fa005adb 100644 --- a/packages/path_provider/path_provider/CHANGELOG.md +++ b/packages/path_provider/path_provider/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.6.15 + +* Endorse Windows implementation. +* Remove the need to call disablePathProviderPlatformOverride in tests + ## 1.6.14 * Update package:e2e -> package:integration_test diff --git a/packages/path_provider/path_provider/README.md b/packages/path_provider/path_provider/README.md index 982a9f49cae5..e8d97e0106a3 100644 --- a/packages/path_provider/path_provider/README.md +++ b/packages/path_provider/path_provider/README.md @@ -23,14 +23,7 @@ Please see the example app of this plugin for a full example. ### Usage in tests -`path_provider` now uses a `PlatformInterface`, meaning that not all platforms share the a single `PlatformChannel`-based implementation. +`path_provider` now uses a `PlatformInterface`, meaning that not all platforms share the a single `PlatformChannel`-based implementation. With that change, tests should be updated to mock `PathProviderPlatform` rather than `PlatformChannel`. See this `path_provider` [test](https://github.com/flutter/plugins/blob/master/packages/path_provider/path_provider/test/path_provider_test.dart) for an example. - -You will also have to temporarily add the following line to the setup of your test. -```dart -disablePathProviderPlatformOverride = true; -``` - -See this [issue](https://github.com/flutter/flutter/issues/52267), for more details on why this is needed. \ No newline at end of file diff --git a/packages/path_provider/path_provider/lib/path_provider.dart b/packages/path_provider/path_provider/lib/path_provider.dart index ae959b133094..0fbab57700be 100644 --- a/packages/path_provider/path_provider/lib/path_provider.dart +++ b/packages/path_provider/path_provider/lib/path_provider.dart @@ -7,42 +7,37 @@ import 'dart:io' show Directory, Platform; import 'package:flutter/foundation.dart' show kIsWeb, visibleForTesting; import 'package:path_provider_linux/path_provider_linux.dart'; +import 'package:path_provider_windows/path_provider_windows.dart'; import 'package:path_provider_platform_interface/path_provider_platform_interface.dart'; +import 'package:path_provider_platform_interface/src/method_channel_path_provider.dart'; export 'package:path_provider_platform_interface/path_provider_platform_interface.dart' show StorageDirectory; -/// Disables platform override in order to use a manually registered [PathProviderPlatform], only for testing right now -/// -/// Make sure to disable the override before using any of the `path_provider` methods -/// To use your own [PathProviderPlatform], make sure to include the following lines -/// ``` -/// PathProviderPlatform.instance = YourPathProviderPlatform(); -/// disablePathProviderPlatformOverride = true; -/// // Use the `path_provider` methods: -/// final dir = await getTemporaryDirectory(); -/// ``` -/// See this issue https://github.com/flutter/flutter/issues/52267 for why this is required @visibleForTesting -set disablePathProviderPlatformOverride(bool override) { - _disablePlatformOverride = override; -} +@Deprecated('This is no longer necessary, and is now a no-op') +set disablePathProviderPlatformOverride(bool override) {} -bool _disablePlatformOverride = false; -PathProviderPlatform __platform; +bool _manualDartRegistrationNeeded = true; -// This is to manually endorse the linux path provider until automatic registration of dart plugins is implemented. -// See this issue https://github.com/flutter/flutter/issues/52267 for details PathProviderPlatform get _platform { - if (__platform != null) { - return __platform; - } - if (!kIsWeb && Platform.isLinux && !_disablePlatformOverride) { - __platform = PathProviderLinux(); - } else { - __platform = PathProviderPlatform.instance; + // This is to manually endorse Dart implementations until automatic + // registration of Dart plugins is implemented. For details see + // https://github.com/flutter/flutter/issues/52267. + if (_manualDartRegistrationNeeded) { + // Only do the initial registration if it hasn't already been overridden + // with a non-default instance. + if (!kIsWeb && PathProviderPlatform.instance is MethodChannelPathProvider) { + if (Platform.isLinux) { + PathProviderPlatform.instance = PathProviderLinux(); + } else if (Platform.isWindows) { + PathProviderPlatform.instance = PathProviderWindows(); + } + } + _manualDartRegistrationNeeded = false; } - return __platform; + + return PathProviderPlatform.instance; } /// Path to the temporary directory on the device that is not backed up and is diff --git a/packages/path_provider/path_provider/pubspec.yaml b/packages/path_provider/path_provider/pubspec.yaml index 7781c76331d4..982186a5354c 100644 --- a/packages/path_provider/path_provider/pubspec.yaml +++ b/packages/path_provider/path_provider/pubspec.yaml @@ -1,8 +1,7 @@ name: path_provider -description: Flutter plugin for getting commonly used locations on the Android & - iOS file systems, such as the temp and app data directories. +description: Flutter plugin for getting commonly used locations on host platform file systems, such as the temp and app data directories. homepage: https://github.com/flutter/plugins/tree/master/packages/path_provider/path_provider -version: 1.6.14 +version: 1.6.15 flutter: plugin: @@ -16,6 +15,8 @@ flutter: default_package: path_provider_macos linux: default_package: path_provider_linux + windows: + default_package: path_provider_windows dependencies: flutter: @@ -23,6 +24,7 @@ dependencies: path_provider_platform_interface: ^1.0.1 path_provider_macos: ^0.0.4 path_provider_linux: ^0.0.1 + path_provider_windows: ^0.0.1 dev_dependencies: integration_test: diff --git a/packages/path_provider/path_provider/test/path_provider_test.dart b/packages/path_provider/path_provider/test/path_provider_test.dart index 90a996fd68c8..eb17178b9975 100644 --- a/packages/path_provider/path_provider/test/path_provider_test.dart +++ b/packages/path_provider/path_provider/test/path_provider_test.dart @@ -25,10 +25,6 @@ void main() { setUp(() async { PathProviderPlatform.instance = MockPathProviderPlatform(); - // This is required because we manually register the Linux path provider when on the Linux platform. - // Will be removed when automatic registration of dart plugins is implemented. - // See this issue https://github.com/flutter/flutter/issues/52267 for details - disablePathProviderPlatformOverride = true; }); test('getTemporaryDirectory', () async { diff --git a/packages/path_provider/path_provider_windows/.gitignore b/packages/path_provider/path_provider_windows/.gitignore new file mode 100644 index 000000000000..53e92cc4181f --- /dev/null +++ b/packages/path_provider/path_provider_windows/.gitignore @@ -0,0 +1,3 @@ +.packages +.flutter-plugins +pubspec.lock diff --git a/packages/path_provider/path_provider_windows/CHANGELOG.md b/packages/path_provider/path_provider_windows/CHANGELOG.md new file mode 100644 index 000000000000..982602c3ae1a --- /dev/null +++ b/packages/path_provider/path_provider_windows/CHANGELOG.md @@ -0,0 +1,11 @@ +## 0.0.2 + +* README update for endorsement. +* Changed getApplicationSupportPath location. +* Removed getLibraryPath. + +## 0.0.1+2 + +* The initial implementation of path_provider for Windows + * Implements getTemporaryPath, getApplicationSupportPath, getLibraryPath, + getApplicationDocumentsPath and getDownloadsPath. diff --git a/packages/path_provider/path_provider_windows/LICENSE b/packages/path_provider/path_provider_windows/LICENSE new file mode 100644 index 000000000000..a6d6c0749818 --- /dev/null +++ b/packages/path_provider/path_provider_windows/LICENSE @@ -0,0 +1,25 @@ +Copyright 2017 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/path_provider/path_provider_windows/README.md b/packages/path_provider/path_provider_windows/README.md new file mode 100644 index 000000000000..66a05f9e7347 --- /dev/null +++ b/packages/path_provider/path_provider_windows/README.md @@ -0,0 +1,31 @@ +# path_provider_windows + +The Windows implementation of [`path_provider`][1]. + +**Please set your constraint to `path_provider_windows: '>=0.0.y+x <2.0.0'`** + +## Backward compatible 1.0.0 version is coming + +The plugin has reached a stable API, we guarantee that version `1.0.0` will be backward compatible with `0.0.y+z`. +Please use `path_provider_windows: '>=0.0.y+x <2.0.0'` as your dependency constraint to allow a smoother ecosystem migration. +For more details see: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 + +## Usage + +### Import the package + +This package has been endorsed, meaning that you only need to add `path_provider` +as a dependency in your `pubspec.yaml`. It will be automatically included in your app +when you depend on `package:path_provider`. + +This is what the above means to your `pubspec.yaml`: + +```yaml +... +dependencies: + ... + path_provider: ^1.6.15 + ... +``` + +[1]:../ diff --git a/packages/path_provider/path_provider_windows/example/.gitignore b/packages/path_provider/path_provider_windows/example/.gitignore new file mode 100644 index 000000000000..f3c205341e7d --- /dev/null +++ b/packages/path_provider/path_provider_windows/example/.gitignore @@ -0,0 +1,44 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Web related +lib/generated_plugin_registrant.dart + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Exceptions to above rules. +!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages diff --git a/packages/path_provider/path_provider_windows/example/.metadata b/packages/path_provider/path_provider_windows/example/.metadata new file mode 100644 index 000000000000..bc654e753a99 --- /dev/null +++ b/packages/path_provider/path_provider_windows/example/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: f2320c3b7a42bc27e7f038212eed1b01f4269641 + channel: master + +project_type: app diff --git a/packages/path_provider/path_provider_windows/example/README.md b/packages/path_provider/path_provider_windows/example/README.md new file mode 100644 index 000000000000..f3ca03ff37c3 --- /dev/null +++ b/packages/path_provider/path_provider_windows/example/README.md @@ -0,0 +1,8 @@ +# path_provider_windows_example + +Demonstrates how to use the path_provider_windows plugin. + +## Getting Started + +For help getting started with Flutter, view our online +[documentation](http://flutter.io/). diff --git a/packages/path_provider/path_provider_windows/example/lib/main.dart b/packages/path_provider/path_provider_windows/example/lib/main.dart new file mode 100644 index 000000000000..4fbb1decf2f4 --- /dev/null +++ b/packages/path_provider/path_provider_windows/example/lib/main.dart @@ -0,0 +1,93 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// ignore_for_file: public_member_api_docs + +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:path_provider_windows/path_provider_windows.dart'; + +void main() async { + runApp(MyApp()); +} + +/// Sample app +class MyApp extends StatefulWidget { + @override + _MyAppState createState() => _MyAppState(); +} + +class _MyAppState extends State { + String _tempDirectory = 'Unknown'; + String _downloadsDirectory = 'Unknown'; + String _appSupportDirectory = 'Unknown'; + String _documentsDirectory = 'Unknown'; + + @override + void initState() { + super.initState(); + initDirectories(); + } + + // Platform messages are asynchronous, so we initialize in an async method. + Future initDirectories() async { + String tempDirectory; + String downloadsDirectory; + String appSupportDirectory; + String documentsDirectory; + final PathProviderWindows provider = PathProviderWindows(); + + try { + tempDirectory = await provider.getTemporaryPath(); + } catch (exception) { + tempDirectory = 'Failed to get temp directory: $exception'; + } + try { + downloadsDirectory = await provider.getDownloadsPath(); + } catch (exception) { + downloadsDirectory = 'Failed to get downloads directory: $exception'; + } + + try { + documentsDirectory = await provider.getApplicationDocumentsPath(); + } catch (exception) { + documentsDirectory = 'Failed to get documents directory: $exception'; + } + + try { + appSupportDirectory = await provider.getApplicationSupportPath(); + } catch (exception) { + appSupportDirectory = 'Failed to get app support directory: $exception'; + } + + setState(() { + _tempDirectory = tempDirectory; + _downloadsDirectory = downloadsDirectory; + _appSupportDirectory = appSupportDirectory; + _documentsDirectory = documentsDirectory; + }); + } + + @override + Widget build(BuildContext context) { + return MaterialApp( + home: Scaffold( + appBar: AppBar( + title: const Text('Path Provider example app'), + ), + body: Center( + child: Column( + children: [ + Text('Temp Directory: $_tempDirectory\n'), + Text('Documents Directory: $_documentsDirectory\n'), + Text('Downloads Directory: $_downloadsDirectory\n'), + Text('Application Support Directory: $_appSupportDirectory\n'), + ], + ), + ), + ), + ); + } +} diff --git a/packages/path_provider/path_provider_windows/example/pubspec.yaml b/packages/path_provider/path_provider_windows/example/pubspec.yaml new file mode 100644 index 000000000000..8dbe6e020906 --- /dev/null +++ b/packages/path_provider/path_provider_windows/example/pubspec.yaml @@ -0,0 +1,21 @@ +name: path_provider_example +description: Demonstrates how to use the path_provider plugin. + +dependencies: + flutter: + sdk: flutter + path_provider_windows: any + +dependency_overrides: + path_provider_windows: + path: ../ + +dev_dependencies: + e2e: ^0.2.1 + flutter_driver: + sdk: flutter + test: any + pedantic: ^1.8.0 + +flutter: + uses-material-design: true diff --git a/packages/path_provider/path_provider_windows/example/test_driver/path_provider_e2e.dart b/packages/path_provider/path_provider_windows/example/test_driver/path_provider_e2e.dart new file mode 100644 index 000000000000..ee9427686026 --- /dev/null +++ b/packages/path_provider/path_provider_windows/example/test_driver/path_provider_e2e.dart @@ -0,0 +1,53 @@ +// Copyright 2019, the Chromium project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:io'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:path_provider_windows/path_provider_windows.dart'; +import 'package:e2e/e2e.dart'; + +void main() { + E2EWidgetsFlutterBinding.ensureInitialized(); + + testWidgets('getTemporaryDirectory', (WidgetTester tester) async { + final PathProviderWindows provider = PathProviderWindows(); + final String result = await provider.getTemporaryPath(); + _verifySampleFile(result, 'temporaryDirectory'); + }); + + testWidgets('getApplicationDocumentsDirectory', (WidgetTester tester) async { + final PathProviderWindows provider = PathProviderWindows(); + final String result = await provider.getApplicationDocumentsPath(); + _verifySampleFile(result, 'applicationDocuments'); + }); + + testWidgets('getApplicationSupportDirectory', (WidgetTester tester) async { + final PathProviderWindows provider = PathProviderWindows(); + final String result = await provider.getApplicationSupportPath(); + _verifySampleFile(result, 'applicationSupport'); + }); + + testWidgets('getDownloadsDirectory', (WidgetTester tester) async { + final PathProviderWindows provider = PathProviderWindows(); + final String result = await provider.getDownloadsPath(); + _verifySampleFile(result, 'downloads'); + }); +} + +/// Verify a file called [name] in [directoryPath] by recreating it with test +/// contents when necessary. +void _verifySampleFile(String directoryPath, String name) { + final Directory directory = Directory(directoryPath); + final File file = File('${directory.path}${Platform.pathSeparator}$name'); + + if (file.existsSync()) { + file.deleteSync(); + expect(file.existsSync(), isFalse); + } + + file.writeAsStringSync('Hello world!'); + expect(file.readAsStringSync(), 'Hello world!'); + expect(directory.listSync(), isNotEmpty); + file.deleteSync(); +} diff --git a/packages/path_provider/path_provider_windows/example/test_driver/path_provider_e2e_test.dart b/packages/path_provider/path_provider_windows/example/test_driver/path_provider_e2e_test.dart new file mode 100644 index 000000000000..f3aa9e218d82 --- /dev/null +++ b/packages/path_provider/path_provider_windows/example/test_driver/path_provider_e2e_test.dart @@ -0,0 +1,15 @@ +// Copyright 2019, the Chromium project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:async'; +import 'dart:io'; +import 'package:flutter_driver/flutter_driver.dart'; + +Future main() async { + final FlutterDriver driver = await FlutterDriver.connect(); + final String result = + await driver.requestData(null, timeout: const Duration(minutes: 1)); + await driver.close(); + exit(result == 'pass' ? 0 : 1); +} diff --git a/packages/path_provider/path_provider_windows/lib/folders.dart b/packages/path_provider/path_provider_windows/lib/folders.dart new file mode 100644 index 000000000000..fc2ea8351476 --- /dev/null +++ b/packages/path_provider/path_provider_windows/lib/folders.dart @@ -0,0 +1,240 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:win32/win32.dart'; + +/// A class containing the GUID references for each of the documented Windows +/// known folders. A property of this class may be passed to the `getPath` +/// method in the [PathProvidersWindows] class to retrieve a known folder from +/// Windows. +class WindowsKnownFolder { + /// The file system directory that is used to store administrative tools for + /// an individual user. The MMC will save customized consoles to this + /// directory, and it will roam with the user. + static String get AdminTools => FOLDERID_AdminTools; + + /// The file system directory that acts as a staging area for files waiting to + /// be written to a CD. A typical path is C:\Documents and + /// Settings\username\Local Settings\Application Data\Microsoft\CD Burning. + static String get CDBurning => FOLDERID_CDBurning; + + /// The file system directory that contains administrative tools for all users + /// of the computer. + static String get CommonAdminTools => FOLDERID_CommonAdminTools; + + /// The file system directory that contains the directories for the common + /// program groups that appear on the Start menu for all users. A typical path + /// is C:\Documents and Settings\All Users\Start Menu\Programs. + static String get CommonPrograms => FOLDERID_CommonPrograms; + + /// The file system directory that contains the programs and folders that + /// appear on the Start menu for all users. A typical path is C:\Documents and + /// Settings\All Users\Start Menu. + static String get CommonStartMenu => FOLDERID_CommonStartMenu; + + /// The file system directory that contains the programs that appear in the + /// Startup folder for all users. A typical path is C:\Documents and + /// Settings\All Users\Start Menu\Programs\Startup. + static String get CommonStartup => FOLDERID_CommonStartup; + + /// The file system directory that contains the templates that are available + /// to all users. A typical path is C:\Documents and Settings\All + /// Users\Templates. + static String get CommonTemplates => FOLDERID_CommonTemplates; + + /// The virtual folder that represents My Computer, containing everything on + /// the local computer: storage devices, printers, and Control Panel. The + /// folder can also contain mapped network drives. + static String get ComputerFolder => FOLDERID_ComputerFolder; + + /// The virtual folder that represents Network Connections, that contains + /// network and dial-up connections. + static String get ConnectionsFolder => FOLDERID_ConnectionsFolder; + + /// The virtual folder that contains icons for the Control Panel applications. + static String get ControlPanelFolder => FOLDERID_ControlPanelFolder; + + /// The file system directory that serves as a common repository for Internet + /// cookies. A typical path is C:\Documents and Settings\username\Cookies. + static String get Cookies => FOLDERID_Cookies; + + /// The virtual folder that represents the Windows desktop, the root of the + /// namespace. + static String get Desktop => FOLDERID_Desktop; + + /// The virtual folder that represents the My Documents desktop item. + static String get Documents => FOLDERID_Documents; + + /// The file system directory that serves as a repository for Internet + /// downloads. + static String get Downloads => FOLDERID_Downloads; + + /// The file system directory that serves as a common repository for the + /// user's favorite items. A typical path is C:\Documents and + /// Settings\username\Favorites. + static String get Favorites => FOLDERID_Favorites; + + /// A virtual folder that contains fonts. A typical path is C:\Windows\Fonts. + static String get Fonts => FOLDERID_Fonts; + + /// The file system directory that serves as a common repository for Internet + /// history items. + static String get History => FOLDERID_History; + + /// The file system directory that serves as a common repository for temporary + /// Internet files. A typical path is C:\Documents and Settings\username\Local + /// Settings\Temporary Internet Files. + static String get InternetCache => FOLDERID_InternetCache; + + /// A virtual folder for Internet Explorer. + static String get InternetFolder => FOLDERID_InternetFolder; + + /// The file system directory that serves as a data repository for local + /// (nonroaming) applications. A typical path is C:\Documents and + /// Settings\username\Local Settings\Application Data. + static String get LocalAppData => FOLDERID_LocalAppData; + + /// The file system directory that serves as a common repository for music + /// files. A typical path is C:\Documents and Settings\User\My Documents\My + /// Music. + static String get Music => FOLDERID_Music; + + /// A file system directory that contains the link objects that may exist in + /// the My Network Places virtual folder. A typical path is C:\Documents and + /// Settings\username\NetHood. + static String get NetHood => FOLDERID_NetHood; + + /// The folder that represents other computers in your workgroup. + static String get NetworkFolder => FOLDERID_NetworkFolder; + + /// The file system directory that serves as a common repository for image + /// files. A typical path is C:\Documents and Settings\username\My + /// Documents\My Pictures. + static String get Pictures => FOLDERID_Pictures; + + /// The file system directory that contains the link objects that can exist in + /// the Printers virtual folder. A typical path is C:\Documents and + /// Settings\username\PrintHood. + static String get PrintHood => FOLDERID_PrintHood; + + /// The virtual folder that contains installed printers. + static String get PrintersFolder => FOLDERID_PrintersFolder; + + /// The user's profile folder. A typical path is C:\Users\username. + /// Applications should not create files or folders at this level. + static String get Profile => FOLDERID_Profile; + + /// The file system directory that contains application data for all users. A + /// typical path is C:\Documents and Settings\All Users\Application Data. This + /// folder is used for application data that is not user specific. For + /// example, an application can store a spell-check dictionary, a database of + /// clip art, or a log file in the CSIDL_COMMON_APPDATA folder. This + /// information will not roam and is available to anyone using the computer. + static String get ProgramData => FOLDERID_ProgramData; + + /// The Program Files folder. A typical path is C:\Program Files. + static String get ProgramFiles => FOLDERID_ProgramFiles; + + /// The common Program Files folder. A typical path is C:\Program + /// Files\Common. + static String get ProgramFilesCommon => FOLDERID_ProgramFilesCommon; + + /// On 64-bit systems, a link to the common Program Files folder. A typical path is + /// C:\Program Files\Common Files. + static String get ProgramFilesCommonX64 => FOLDERID_ProgramFilesCommonX64; + + /// On 64-bit systems, a link to the 32-bit common Program Files folder. A + /// typical path is C:\Program Files (x86)\Common Files. On 32-bit systems, a + /// link to the Common Program Files folder. + static String get ProgramFilesCommonX86 => FOLDERID_ProgramFilesCommonX86; + + /// On 64-bit systems, a link to the Program Files folder. A typical path is + /// C:\Program Files. + static String get ProgramFilesX64 => FOLDERID_ProgramFilesX64; + + /// On 64-bit systems, a link to the 32-bit Program Files folder. A typical + /// path is C:\Program Files (x86). On 32-bit systems, a link to the Common + /// Program Files folder. + static String get ProgramFilesX86 => FOLDERID_ProgramFilesX86; + + /// The file system directory that contains the user's program groups (which + /// are themselves file system directories). + static String get Programs => FOLDERID_Programs; + + /// The file system directory that contains files and folders that appear on + /// the desktop for all users. A typical path is C:\Documents and Settings\All + /// Users\Desktop. + static String get PublicDesktop => FOLDERID_PublicDesktop; + + /// The file system directory that contains documents that are common to all + /// users. A typical path is C:\Documents and Settings\All Users\Documents. + static String get PublicDocuments => FOLDERID_PublicDocuments; + + /// The file system directory that serves as a repository for music files + /// common to all users. A typical path is C:\Documents and Settings\All + /// Users\Documents\My Music. + static String get PublicMusic => FOLDERID_PublicMusic; + + /// The file system directory that serves as a repository for image files + /// common to all users. A typical path is C:\Documents and Settings\All + /// Users\Documents\My Pictures. + static String get PublicPictures => FOLDERID_PublicPictures; + + /// The file system directory that serves as a repository for video files + /// common to all users. A typical path is C:\Documents and Settings\All + /// Users\Documents\My Videos. + static String get PublicVideos => FOLDERID_PublicVideos; + + /// The file system directory that contains shortcuts to the user's most + /// recently used documents. A typical path is C:\Documents and + /// Settings\username\My Recent Documents. + static String get Recent => FOLDERID_Recent; + + /// The virtual folder that contains the objects in the user's Recycle Bin. + static String get RecycleBinFolder => FOLDERID_RecycleBinFolder; + + /// The file system directory that contains resource data. A typical path is + /// C:\Windows\Resources. + static String get ResourceDir => FOLDERID_ResourceDir; + + /// The file system directory that serves as a common repository for + /// application-specific data. A typical path is C:\Documents and + /// Settings\username\Application Data. + static String get RoamingAppData => FOLDERID_RoamingAppData; + + /// The file system directory that contains Send To menu items. A typical path + /// is C:\Documents and Settings\username\SendTo. + static String get SendTo => FOLDERID_SendTo; + + /// The file system directory that contains Start menu items. A typical path + /// is C:\Documents and Settings\username\Start Menu. + static String get StartMenu => FOLDERID_StartMenu; + + /// The file system directory that corresponds to the user's Startup program + /// group. The system starts these programs whenever the associated user logs + /// on. A typical path is C:\Documents and Settings\username\Start + /// Menu\Programs\Startup. + static String get Startup => FOLDERID_Startup; + + /// The Windows System folder. A typical path is C:\Windows\System32. + static String get System => FOLDERID_System; + + /// The 32-bit Windows System folder. On 32-bit systems, this is typically + /// C:\Windows\system32. On 64-bit systems, this is typically + /// C:\Windows\syswow64. + static String get SystemX86 => FOLDERID_SystemX86; + + /// The file system directory that serves as a common repository for document + /// templates. A typical path is C:\Documents and Settings\username\Templates. + static String get Templates => FOLDERID_Templates; + + /// The file system directory that serves as a common repository for video + /// files. A typical path is C:\Documents and Settings\username\My + /// Documents\My Videos. + static String get Videos => FOLDERID_Videos; + + /// The Windows directory or SYSROOT. This corresponds to the %windir% or + /// %SYSTEMROOT% environment variables. A typical path is C:\Windows. + static String get Windows => FOLDERID_Windows; +} diff --git a/packages/path_provider/path_provider_windows/lib/path_provider_windows.dart b/packages/path_provider/path_provider_windows/lib/path_provider_windows.dart new file mode 100644 index 000000000000..e29b70a714d9 --- /dev/null +++ b/packages/path_provider/path_provider_windows/lib/path_provider_windows.dart @@ -0,0 +1,222 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:async'; +import 'dart:io'; +import 'dart:ffi'; + +import 'package:ffi/ffi.dart'; +import 'package:meta/meta.dart'; +import 'package:path/path.dart' as path; +import 'package:path_provider_platform_interface/path_provider_platform_interface.dart'; +import 'package:path_provider_windows/folders.dart'; +import 'package:win32/win32.dart'; + +/// Wraps the Win32 VerQueryValue API call. +/// +/// This class exists to allow injecting alternate metadata in tests without +/// building multiple custom test binaries. +@visibleForTesting +class VersionInfoQuerier { + /// Returns the value for [key] in [versionInfo]s English strings section, or + /// null if there is no such entry, or if versionInfo is null. + getStringValue(Pointer versionInfo, key) { + if (versionInfo == null) { + return null; + } + const kEnUsLanguageCode = '040904e4'; + final keyPath = TEXT('\\StringFileInfo\\$kEnUsLanguageCode\\$key'); + final length = allocate(); + final valueAddress = allocate(); + try { + if (VerQueryValue(versionInfo, keyPath, valueAddress, length) == 0) { + return null; + } + return Pointer.fromAddress(valueAddress.value) + .unpackString(length.value); + } finally { + free(keyPath); + free(length); + free(valueAddress); + } + } +} + +/// The Windows implementation of [PathProviderPlatform] +/// +/// This class implements the `package:path_provider` functionality for Windows. +class PathProviderWindows extends PathProviderPlatform { + /// The object to use for performing VerQueryValue calls. + @visibleForTesting + VersionInfoQuerier versionInfoQuerier = VersionInfoQuerier(); + + /// This is typically the same as the TMP environment variable. + @override + Future getTemporaryPath() async { + final buffer = allocate(count: MAX_PATH + 1).cast(); + String path; + + try { + final length = GetTempPath(MAX_PATH, buffer); + + if (length == 0) { + final error = GetLastError(); + throw WindowsException(error); + } else { + path = buffer.unpackString(length); + + // GetTempPath adds a trailing backslash, but SHGetKnownFolderPath does + // not. Strip off trailing backslash for consistency with other methods + // here. + if (path.endsWith('\\')) { + path = path.substring(0, path.length - 1); + } + } + + // Ensure that the directory exists, since GetTempPath doesn't. + final directory = Directory(path); + if (!directory.existsSync()) { + await directory.create(recursive: true); + } + + return Future.value(path); + } finally { + free(buffer); + } + } + + @override + Future getApplicationSupportPath() async { + final appDataRoot = await getPath(WindowsKnownFolder.RoamingAppData); + final directory = Directory( + path.join(appDataRoot, _getApplicationSpecificSubdirectory())); + // Ensure that the directory exists if possible, since it will on other + // platforms. If the name is longer than MAXPATH, creating will fail, so + // skip that step; it's up to the client to decide what to do with the path + // in that case (e.g., using a short path). + if (directory.path.length <= MAX_PATH) { + if (!directory.existsSync()) { + await directory.create(recursive: true); + } + } + return directory.path; + } + + @override + Future getApplicationDocumentsPath() => + getPath(WindowsKnownFolder.Documents); + + @override + Future getDownloadsPath() => getPath(WindowsKnownFolder.Downloads); + + /// Retrieve any known folder from Windows. + /// + /// folderID is a GUID that represents a specific known folder ID, drawn from + /// [WindowsKnownFolder]. + Future getPath(String folderID) { + final pathPtrPtr = allocate(); + Pointer pathPtr; + + try { + GUID knownFolderID = GUID.fromString(folderID); + + final hr = SHGetKnownFolderPath( + knownFolderID.addressOf, KF_FLAG_DEFAULT, NULL, pathPtrPtr); + + if (FAILED(hr)) { + if (hr == E_INVALIDARG || hr == E_FAIL) { + throw WindowsException(hr); + } + } + + pathPtr = Pointer.fromAddress(pathPtrPtr.value); + final path = pathPtr.unpackString(MAX_PATH); + return Future.value(path); + } finally { + CoTaskMemFree(pathPtr.cast()); + free(pathPtrPtr); + } + } + + /// Returns the relative path string to append to the root directory returned + /// by Win32 APIs for application storage (such as RoamingAppDir) to get a + /// directory that is unique to the application. + /// + /// The convention is to use company-name\product-name\. This will use that if + /// possible, using the data in the VERSIONINFO resource, with the following + /// fallbacks: + /// - If the company name isn't there, that component will be dropped. + /// - If the product name isn't there, it will use the exe's filename (without + /// extension). + String _getApplicationSpecificSubdirectory() { + String companyName; + String productName; + + final Pointer moduleNameBuffer = + allocate(count: MAX_PATH + 1).cast(); + final Pointer unused = allocate(); + Pointer infoBuffer; + try { + // Get the module name. + final moduleNameLength = GetModuleFileName(0, moduleNameBuffer, MAX_PATH); + if (moduleNameLength == 0) { + final error = GetLastError(); + throw WindowsException(error); + } + + // From that, load the VERSIONINFO resource + int infoSize = GetFileVersionInfoSize(moduleNameBuffer, unused); + if (infoSize != 0) { + infoBuffer = allocate(count: infoSize); + if (GetFileVersionInfo(moduleNameBuffer, 0, infoSize, infoBuffer) == + 0) { + free(infoBuffer); + infoBuffer = null; + } + } + companyName = _sanitizedDirectoryName( + versionInfoQuerier.getStringValue(infoBuffer, 'CompanyName')); + productName = _sanitizedDirectoryName( + versionInfoQuerier.getStringValue(infoBuffer, 'ProductName')); + + // If there was no product name, use the executable name. + if (productName == null) { + productName = path.basenameWithoutExtension( + moduleNameBuffer.unpackString(moduleNameLength)); + } + + return companyName != null + ? path.join(companyName, productName) + : productName; + } finally { + free(moduleNameBuffer); + free(unused); + if (infoBuffer != null) { + free(infoBuffer); + } + } + } + + /// Makes [rawString] safe as a directory component. See + /// https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions + /// + /// If after sanitizing the string is empty, returns null. + String _sanitizedDirectoryName(String rawString) { + if (rawString == null) { + return null; + } + String sanitized = rawString + // Replace banned characters. + .replaceAll(RegExp(r'[<>:"/\\|?*]'), '_') + // Remove trailing whitespace. + .trimRight() + // Ensure that it does not end with a '.'. + .replaceAll(RegExp(r'[.]+$'), ''); + const kMaxComponentLength = 255; + if (sanitized.length > kMaxComponentLength) { + sanitized = sanitized.substring(0, kMaxComponentLength); + } + return sanitized.isEmpty ? null : sanitized; + } +} diff --git a/packages/path_provider/path_provider_windows/pubspec.yaml b/packages/path_provider/path_provider_windows/pubspec.yaml new file mode 100644 index 000000000000..54d5a5190ddf --- /dev/null +++ b/packages/path_provider/path_provider_windows/pubspec.yaml @@ -0,0 +1,29 @@ +name: path_provider_windows +description: Windows implementation of the path_provider plugin +homepage: https://github.com/flutter/plugins/tree/master/packages/path_provider/path_provider_windows +version: 0.0.2 + +flutter: + plugin: + platforms: + windows: + dartPluginClass: PathProviderWindows + + +dependencies: + path_provider_platform_interface: ^1.0.3 + meta: ^1.0.5 + path: ^1.6.4 + flutter: + sdk: flutter + ffi: ^0.1.3 + win32: ^1.7.1 + +dev_dependencies: + flutter_test: + sdk: flutter + pedantic: ^1.8.0 + +environment: + sdk: ">=2.1.0 <3.0.0" + flutter: ">=1.12.13+hotfix.4 <2.0.0" diff --git a/packages/path_provider/path_provider_windows/test/path_provider_windows_test.dart b/packages/path_provider/path_provider_windows/test/path_provider_windows_test.dart new file mode 100644 index 000000000000..83ceea9cdf0c --- /dev/null +++ b/packages/path_provider/path_provider_windows/test/path_provider_windows_test.dart @@ -0,0 +1,109 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +import 'dart:ffi'; +import 'dart:io'; + +import 'package:flutter_test/flutter_test.dart'; +import 'package:path_provider_windows/path_provider_windows.dart'; + +// A fake VersionInfoQuerier that just returns preset responses. +class FakeVersionInfoQuerier implements VersionInfoQuerier { + FakeVersionInfoQuerier(this.responses); + + final Map responses; + + getStringValue(Pointer versionInfo, key) => responses[key]; +} + +void main() { + test('getTemporaryPath', () async { + final pathProvider = PathProviderWindows(); + expect(await pathProvider.getTemporaryPath(), contains(r'C:\')); + }, skip: !Platform.isWindows); + + test('getApplicationSupportPath with no version info', () async { + final pathProvider = PathProviderWindows(); + pathProvider.versionInfoQuerier = + FakeVersionInfoQuerier({}); + final path = await pathProvider.getApplicationSupportPath(); + expect(path, contains(r'C:\')); + expect(path, contains(r'AppData')); + // The last path component should be the executable name. + expect(path, endsWith(r'flutter_tester')); + }, skip: !Platform.isWindows); + + test('getApplicationSupportPath with full version info', () async { + final pathProvider = PathProviderWindows(); + pathProvider.versionInfoQuerier = FakeVersionInfoQuerier({ + 'CompanyName': 'A Company', + 'ProductName': 'Amazing App', + }); + final path = await pathProvider.getApplicationSupportPath(); + expect(path, endsWith(r'AppData\Roaming\A Company\Amazing App')); + expect(Directory(path).existsSync(), isTrue); + }, skip: !Platform.isWindows); + + test('getApplicationSupportPath with missing company', () async { + final pathProvider = PathProviderWindows(); + pathProvider.versionInfoQuerier = FakeVersionInfoQuerier({ + 'ProductName': 'Amazing App', + }); + final path = await pathProvider.getApplicationSupportPath(); + expect(path, endsWith(r'AppData\Roaming\Amazing App')); + expect(Directory(path).existsSync(), isTrue); + }, skip: !Platform.isWindows); + + test('getApplicationSupportPath with problematic values', () async { + final pathProvider = PathProviderWindows(); + pathProvider.versionInfoQuerier = FakeVersionInfoQuerier({ + 'CompanyName': r'A Company: Name.', + 'ProductName': r'A"/Terrible\|App?*Name', + }); + final path = await pathProvider.getApplicationSupportPath(); + expect( + path, + endsWith(r'AppData\Roaming\' + r'A _Bad_ Company_ Name\' + r'A__Terrible__App__Name')); + expect(Directory(path).existsSync(), isTrue); + }, skip: !Platform.isWindows); + + test('getApplicationSupportPath with a completely invalid company', () async { + final pathProvider = PathProviderWindows(); + pathProvider.versionInfoQuerier = FakeVersionInfoQuerier({ + 'CompanyName': r'..', + 'ProductName': r'Amazing App', + }); + final path = await pathProvider.getApplicationSupportPath(); + expect(path, endsWith(r'AppData\Roaming\Amazing App')); + expect(Directory(path).existsSync(), isTrue); + }, skip: !Platform.isWindows); + + test('getApplicationSupportPath with very long app name', () async { + final pathProvider = PathProviderWindows(); + final truncatedName = 'A' * 255; + pathProvider.versionInfoQuerier = FakeVersionInfoQuerier({ + 'CompanyName': 'A Company', + 'ProductName': truncatedName * 2, + }); + final path = await pathProvider.getApplicationSupportPath(); + expect(path, endsWith('\\$truncatedName')); + // The directory won't exist, since it's longer than MAXPATH, so don't check + // that here. + }, skip: !Platform.isWindows); + + test('getApplicationDocumentsPath', () async { + final pathProvider = PathProviderWindows(); + final path = await pathProvider.getApplicationDocumentsPath(); + expect(path, contains(r'C:\')); + expect(path, contains(r'Documents')); + }, skip: !Platform.isWindows); + + test('getDownloadsPath', () async { + final pathProvider = PathProviderWindows(); + final path = await pathProvider.getDownloadsPath(); + expect(path, contains(r'C:\')); + expect(path, contains(r'Downloads')); + }, skip: !Platform.isWindows); +} From 2d35643615962b71aad72792f6c0217ebd080f6c Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Fri, 18 Sep 2020 11:39:49 -0400 Subject: [PATCH 098/233] badges for pub.dev scores (#3026) --- README.md | 56 +++++++++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index b2015a705e79..42c64e1c6a50 100644 --- a/README.md +++ b/README.md @@ -36,31 +36,31 @@ and send a [pull request](https://github.com/flutter/plugins/pulls). ## Plugins These are the available plugins in this repository. -| Plugin | Pub | -|--------|-----| -| [android_alarm_manager](./packages/android_alarm_manager/) | [![pub package](https://img.shields.io/pub/v/android_alarm_manager.svg)](https://pub.dev/packages/android_alarm_manager) | -| [android_intent](./packages/android_intent/) | [![pub package](https://img.shields.io/pub/v/android_intent.svg)](https://pub.dev/packages/android_intent) | -| [battery](./packages/battery/) | [![pub package](https://img.shields.io/pub/v/battery.svg)](https://pub.dev/packages/battery) | -| [camera](./packages/camera/) | [![pub package](https://img.shields.io/pub/v/camera.svg)](https://pub.dev/packages/camera) | -| [connectivity](./packages/connectivity/) | [![pub package](https://img.shields.io/pub/v/connectivity.svg)](https://pub.dev/packages/connectivity) | -| [device_info](./packages/device_info/) | [![pub package](https://img.shields.io/pub/v/device_info.svg)](https://pub.dev/packages/device_info) | -| [e2e (Discontinued, use integration_test)](./packages/e2e/) | [![pub package](https://img.shields.io/pub/v/e2e.svg)](https://pub.dev/packages/e2e) | -| [espresso](./packages/espresso/) | [![pub package](https://img.shields.io/pub/v/espresso.svg)](https://pub.dev/packages/espresso) | -| [flutter_plugin_android_lifecycle](./packages/flutter_plugin_android_lifecycle/) | [![pub package](https://img.shields.io/pub/v/flutter_plugin_android_lifecycle.svg)](https://pub.dev/packages/flutter_plugin_android_lifecycle) | -| [google_maps_flutter](./packages/google_maps_flutter) | [![pub package](https://img.shields.io/pub/v/google_maps_flutter.svg)](https://pub.dev/packages/google_maps_flutter) | -| [google_sign_in](./packages/google_sign_in/) | [![pub package](https://img.shields.io/pub/v/google_sign_in.svg)](https://pub.dev/packages/google_sign_in) | -| [image_picker](./packages/image_picker/) | [![pub package](https://img.shields.io/pub/v/image_picker.svg)](https://pub.dev/packages/image_picker) | -| [integration_test](./packages/integration_test/) | [![pub package](https://img.shields.io/pub/v/integration_test.svg)](https://pub.dev/packages/integration_test) | -| [in_app_purchase](./packages/in_app_purchase/) | [![pub package](https://img.shields.io/pub/v/in_app_purchase.svg)](https://pub.dev/packages/in_app_purchase) | -| [ios_platform_images](./packages/ios_platform_images/) | [![pub package](https://img.shields.io/pub/v/ios_platform_images.svg)](https://pub.dev/packages/ios_platform_images) | -| [local_auth](./packages/local_auth/) | [![pub package](https://img.shields.io/pub/v/local_auth.svg)](https://pub.dev/packages/local_auth) | -| [package_info](./packages/package_info/) | [![pub package](https://img.shields.io/pub/v/package_info.svg)](https://pub.dev/packages/package_info) | -| [path_provider](./packages/path_provider/) | [![pub package](https://img.shields.io/pub/v/path_provider.svg)](https://pub.dev/packages/path_provider) | -| [plugin_platform_interface](./packages/plugin_platform_interface/) | [![pub package](https://img.shields.io/pub/v/plugin_platform_interface.svg)](https://pub.dev/packages/plugin_platform_interface) | -| [quick_actions](./packages/quick_actions/) | [![pub package](https://img.shields.io/pub/v/quick_actions.svg)](https://pub.dev/packages/quick_actions) | -| [sensors](./packages/sensors/) | [![pub package](https://img.shields.io/pub/v/sensors.svg)](https://pub.dev/packages/sensors) | -| [share](./packages/share/) | [![pub package](https://img.shields.io/pub/v/share.svg)](https://pub.dev/packages/share) | -| [shared_preferences](./packages/shared_preferences/) | [![pub package](https://img.shields.io/pub/v/shared_preferences.svg)](https://pub.dev/packages/shared_preferences) | -| [url_launcher](./packages/url_launcher/) | [![pub package](https://img.shields.io/pub/v/url_launcher.svg)](https://pub.dev/packages/url_launcher) | -| [video_player](./packages/video_player/) | [![pub package](https://img.shields.io/pub/v/video_player.svg)](https://pub.dev/packages/video_player) | -| [webview_flutter](./packages/webview_flutter/) | [![pub package](https://img.shields.io/pub/v/webview_flutter.svg)](https://pub.dev/packages/webview_flutter) | +| Plugin | Pub | Points | Popularity | Likes | +|--------|-----|--------|------------|-------| +| [android_alarm_manager](./packages/android_alarm_manager/) | [![pub package](https://img.shields.io/pub/v/android_alarm_manager.svg)](https://pub.dev/packages/android_alarm_manager) | [![pub points](https://badges.bar/android_alarm_manager/pub%20points)](https://pub.dev/packages/android_alarm_manager/score) | [![popularity](https://badges.bar/android_alarm_manager/popularity)](https://pub.dev/packages/android_alarm_manager/score) | [![likes](https://badges.bar/android_alarm_manager/likes)](https://pub.dev/packages/android_alarm_manager/score) | +| [android_intent](./packages/android_intent/) | [![pub package](https://img.shields.io/pub/v/android_intent.svg)](https://pub.dev/packages/android_intent) | [![pub points](https://badges.bar/android_intent/pub%20points)](https://pub.dev/packages/android_intent/score) | [![popularity](https://badges.bar/android_intent/popularity)](https://pub.dev/packages/android_intent/score) | [![likes](https://badges.bar/android_intent/likes)](https://pub.dev/packages/android_intent/score) | +| [battery](./packages/battery/) | [![pub package](https://img.shields.io/pub/v/battery.svg)](https://pub.dev/packages/battery) | [![pub points](https://badges.bar/battery/pub%20points)](https://pub.dev/packages/battery/score) | [![popularity](https://badges.bar/battery/popularity)](https://pub.dev/packages/battery/score) | [![likes](https://badges.bar/battery/likes)](https://pub.dev/packages/battery/score) | +| [camera](./packages/camera/) | [![pub package](https://img.shields.io/pub/v/camera.svg)](https://pub.dev/packages/camera) | [![pub points](https://badges.bar/camera/pub%20points)](https://pub.dev/packages/camera/score) | [![popularity](https://badges.bar/camera/popularity)](https://pub.dev/packages/camera/score) | [![likes](https://badges.bar/camera/likes)](https://pub.dev/packages/camera/score) | +| [connectivity](./packages/connectivity/) | [![pub package](https://img.shields.io/pub/v/connectivity.svg)](https://pub.dev/packages/connectivity) | [![pub points](https://badges.bar/connectivity/pub%20points)](https://pub.dev/packages/connectivity/score) | [![popularity](https://badges.bar/connectivity/popularity)](https://pub.dev/packages/connectivity/score) | [![likes](https://badges.bar/connectivity/likes)](https://pub.dev/packages/connectivity/score) | +| [device_info](./packages/device_info/) | [![pub package](https://img.shields.io/pub/v/device_info.svg)](https://pub.dev/packages/device_info) | [![pub points](https://badges.bar/device_info/pub%20points)](https://pub.dev/packages/device_info/score) | [![popularity](https://badges.bar/device_info/popularity)](https://pub.dev/packages/device_info/score) | [![likes](https://badges.bar/device_info/likes)](https://pub.dev/packages/device_info/score) | +| [e2e (Discontinued, use integration_test)](./packages/e2e/) | [![pub package](https://img.shields.io/pub/v/e2e.svg)](https://pub.dev/packages/e2e) | [![pub points](https://badges.bar/e2e/pub%20points)](https://pub.dev/packages/e2e/score) | [![popularity](https://badges.bar/e2e/popularity)](https://pub.dev/packages/e2e/score) | [![likes](https://badges.bar/e2e/likes)](https://pub.dev/packages/e2e/score) | +| [espresso](./packages/espresso/) | [![pub package](https://img.shields.io/pub/v/espresso.svg)](https://pub.dev/packages/espresso) | [![pub points](https://badges.bar/espresso/pub%20points)](https://pub.dev/packages/espresso/score) | [![popularity](https://badges.bar/espresso/popularity)](https://pub.dev/packages/espresso/score) | [![likes](https://badges.bar/espresso/likes)](https://pub.dev/packages/espresso/score) | +| [flutter_plugin_android_lifecycle](./packages/flutter_plugin_android_lifecycle/) | [![pub package](https://img.shields.io/pub/v/flutter_plugin_android_lifecycle.svg)](https://pub.dev/packages/flutter_plugin_android_lifecycle) | [![pub points](https://badges.bar/flutter_plugin_android_lifecycle/pub%20points)](https://pub.dev/packages/flutter_plugin_android_lifecycle/score) | [![popularity](https://badges.bar/flutter_plugin_android_lifecycle/popularity)](https://pub.dev/packages/flutter_plugin_android_lifecycle/score) | [![likes](https://badges.bar/flutter_plugin_android_lifecycle/likes)](https://pub.dev/packages/flutter_plugin_android_lifecycle/score) | +| [google_maps_flutter](./packages/google_maps_flutter) | [![pub package](https://img.shields.io/pub/v/google_maps_flutter.svg)](https://pub.dev/packages/google_maps_flutter) | [![pub points](https://badges.bar/google_maps_flutter/pub%20points)](https://pub.dev/packages/google_maps_flutter/score) | [![popularity](https://badges.bar/google_maps_flutter/popularity)](https://pub.dev/packages/google_maps_flutter/score) | [![likes](https://badges.bar/google_maps_flutter/likes)](https://pub.dev/packages/google_maps_flutter/score) | +| [google_sign_in](./packages/google_sign_in/) | [![pub package](https://img.shields.io/pub/v/google_sign_in.svg)](https://pub.dev/packages/google_sign_in) | [![pub points](https://badges.bar/google_sign_in/pub%20points)](https://pub.dev/packages/google_sign_in/score) | [![popularity](https://badges.bar/google_sign_in/popularity)](https://pub.dev/packages/google_sign_in/score) | [![likes](https://badges.bar/google_sign_in/likes)](https://pub.dev/packages/google_sign_in/score) | +| [image_picker](./packages/image_picker/) | [![pub package](https://img.shields.io/pub/v/image_picker.svg)](https://pub.dev/packages/image_picker) | [![pub points](https://badges.bar/image_picker/pub%20points)](https://pub.dev/packages/image_picker/score) | [![popularity](https://badges.bar/image_picker/popularity)](https://pub.dev/packages/image_picker/score) | [![likes](https://badges.bar/image_picker/likes)](https://pub.dev/packages/image_picker/score) | +| [integration_test](./packages/integration_test/) | [![pub package](https://img.shields.io/pub/v/integration_test.svg)](https://pub.dev/packages/integration_test) | [![pub points](https://badges.bar/integration_test/pub%20points)](https://pub.dev/packages/integration_test/score) | [![popularity](https://badges.bar/integration_test/popularity)](https://pub.dev/packages/integration_test/score) | [![likes](https://badges.bar/integration_test/likes)](https://pub.dev/packages/integration_test/score) | +| [in_app_purchase](./packages/in_app_purchase/) | [![pub package](https://img.shields.io/pub/v/in_app_purchase.svg)](https://pub.dev/packages/in_app_purchase) | [![pub points](https://badges.bar/in_app_purchase/pub%20points)](https://pub.dev/packages/in_app_purchase/score) | [![popularity](https://badges.bar/in_app_purchase/popularity)](https://pub.dev/packages/in_app_purchase/score) | [![likes](https://badges.bar/in_app_purchase/likes)](https://pub.dev/packages/in_app_purchase/score) | +| [ios_platform_images](./packages/ios_platform_images/) | [![pub package](https://img.shields.io/pub/v/ios_platform_images.svg)](https://pub.dev/packages/ios_platform_images) | [![pub points](https://badges.bar/ios_platform_images/pub%20points)](https://pub.dev/packages/ios_platform_images/score) | [![popularity](https://badges.bar/ios_platform_images/popularity)](https://pub.dev/packages/ios_platform_images/score) | [![likes](https://badges.bar/ios_platform_images/likes)](https://pub.dev/packages/ios_platform_images/score) | +| [local_auth](./packages/local_auth/) | [![pub package](https://img.shields.io/pub/v/local_auth.svg)](https://pub.dev/packages/local_auth) | [![pub points](https://badges.bar/local_auth/pub%20points)](https://pub.dev/packages/local_auth/score) | [![popularity](https://badges.bar/local_auth/popularity)](https://pub.dev/packages/local_auth/score) | [![likes](https://badges.bar/local_auth/likes)](https://pub.dev/packages/local_auth/score) | +| [package_info](./packages/package_info/) | [![pub package](https://img.shields.io/pub/v/package_info.svg)](https://pub.dev/packages/package_info) | [![pub points](https://badges.bar/package_info/pub%20points)](https://pub.dev/packages/package_info/score) | [![popularity](https://badges.bar/package_info/popularity)](https://pub.dev/packages/package_info/score) | [![likes](https://badges.bar/package_info/likes)](https://pub.dev/packages/package_info/score) | +| [path_provider](./packages/path_provider/) | [![pub package](https://img.shields.io/pub/v/path_provider.svg)](https://pub.dev/packages/path_provider) | [![pub points](https://badges.bar/path_provider/pub%20points)](https://pub.dev/packages/path_provider/score) | [![popularity](https://badges.bar/path_provider/popularity)](https://pub.dev/packages/path_provider/score) | [![likes](https://badges.bar/path_provider/likes)](https://pub.dev/packages/path_provider/score) | +| [plugin_platform_interface](./packages/plugin_platform_interface/) | [![pub package](https://img.shields.io/pub/v/plugin_platform_interface.svg)](https://pub.dev/packages/plugin_platform_interface) | [![pub points](https://badges.bar/plugin_platform_interface/pub%20points)](https://pub.dev/packages/plugin_platform_interface/score) | [![popularity](https://badges.bar/plugin_platform_interface/popularity)](https://pub.dev/packages/plugin_platform_interface/score) | [![likes](https://badges.bar/plugin_platform_interface/likes)](https://pub.dev/packages/plugin_platform_interface/score) | +| [quick_actions](./packages/quick_actions/) | [![pub package](https://img.shields.io/pub/v/quick_actions.svg)](https://pub.dev/packages/quick_actions) | [![pub points](https://badges.bar/quick_actions/pub%20points)](https://pub.dev/packages/quick_actions/score) | [![popularity](https://badges.bar/quick_actions/popularity)](https://pub.dev/packages/quick_actions/score) | [![likes](https://badges.bar/quick_actions/likes)](https://pub.dev/packages/quick_actions/score) | +| [sensors](./packages/sensors/) | [![pub package](https://img.shields.io/pub/v/sensors.svg)](https://pub.dev/packages/sensors) | [![pub points](https://badges.bar/sensors/pub%20points)](https://pub.dev/packages/sensors/score) | [![popularity](https://badges.bar/sensors/popularity)](https://pub.dev/packages/sensors/score) | [![likes](https://badges.bar/sensors/likes)](https://pub.dev/packages/sensors/score) | +| [share](./packages/share/) | [![pub package](https://img.shields.io/pub/v/share.svg)](https://pub.dev/packages/share) | [![pub points](https://badges.bar/share/pub%20points)](https://pub.dev/packages/share/score) | [![popularity](https://badges.bar/share/popularity)](https://pub.dev/packages/share/score) | [![likes](https://badges.bar/share/likes)](https://pub.dev/packages/share/score) | +| [shared_preferences](./packages/shared_preferences/) | [![pub package](https://img.shields.io/pub/v/shared_preferences.svg)](https://pub.dev/packages/shared_preferences) | [![pub points](https://badges.bar/shared_preferences/pub%20points)](https://pub.dev/packages/shared_preferences/score) | [![popularity](https://badges.bar/shared_preferences/popularity)](https://pub.dev/packages/shared_preferences/score) | [![likes](https://badges.bar/shared_preferences/likes)](https://pub.dev/packages/shared_preferences/score) | +| [url_launcher](./packages/url_launcher/) | [![pub package](https://img.shields.io/pub/v/url_launcher.svg)](https://pub.dev/packages/url_launcher) | [![pub points](https://badges.bar/url_launcher/pub%20points)](https://pub.dev/packages/url_launcher/score) | [![popularity](https://badges.bar/url_launcher/popularity)](https://pub.dev/packages/url_launcher/score) | [![likes](https://badges.bar/url_launcher/likes)](https://pub.dev/packages/url_launcher/score) | +| [video_player](./packages/video_player/) | [![pub package](https://img.shields.io/pub/v/video_player.svg)](https://pub.dev/packages/video_player) | [![pub points](https://badges.bar/video_player/pub%20points)](https://pub.dev/packages/video_player/score) | [![popularity](https://badges.bar/video_player/popularity)](https://pub.dev/packages/video_player/score) | [![likes](https://badges.bar/video_player/likes)](https://pub.dev/packages/video_player/score) | +| [webview_flutter](./packages/webview_flutter/) | [![pub package](https://img.shields.io/pub/v/webview_flutter.svg)](https://pub.dev/packages/webview_flutter) | [![pub points](https://badges.bar/webview_flutter/pub%20points)](https://pub.dev/packages/webview_flutter/score) | [![popularity](https://badges.bar/webview_flutter/popularity)](https://pub.dev/packages/webview_flutter/score) | [![likes](https://badges.bar/webview_flutter/likes)](https://pub.dev/packages/webview_flutter/score) | From a83f684401c4571747569fdfd081f64015a34a32 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Fri, 18 Sep 2020 14:38:02 -0400 Subject: [PATCH 099/233] [path_provider] Path provider windows updates (#3049) - Adds missing iOS podspec to path_provider_windows, which was necessary to publish it (since path_provider doesn't require 1.20+) - Requires path_provider_windows 0.0.2, not 0.0.1, in path_provider endorsement. --- .../path_provider/path_provider/CHANGELOG.md | 4 ++++ .../path_provider/path_provider/pubspec.yaml | 4 ++-- .../ios/path_provider_windows.podspec | 22 +++++++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 packages/path_provider/path_provider_windows/ios/path_provider_windows.podspec diff --git a/packages/path_provider/path_provider/CHANGELOG.md b/packages/path_provider/path_provider/CHANGELOG.md index 31f7fa005adb..62cc4d777dd9 100644 --- a/packages/path_provider/path_provider/CHANGELOG.md +++ b/packages/path_provider/path_provider/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.6.16 + +* Update Windows endorsement verison + ## 1.6.15 * Endorse Windows implementation. diff --git a/packages/path_provider/path_provider/pubspec.yaml b/packages/path_provider/path_provider/pubspec.yaml index 982186a5354c..4f574e9bebc9 100644 --- a/packages/path_provider/path_provider/pubspec.yaml +++ b/packages/path_provider/path_provider/pubspec.yaml @@ -1,7 +1,7 @@ name: path_provider description: Flutter plugin for getting commonly used locations on host platform file systems, such as the temp and app data directories. homepage: https://github.com/flutter/plugins/tree/master/packages/path_provider/path_provider -version: 1.6.15 +version: 1.6.16 flutter: plugin: @@ -24,7 +24,7 @@ dependencies: path_provider_platform_interface: ^1.0.1 path_provider_macos: ^0.0.4 path_provider_linux: ^0.0.1 - path_provider_windows: ^0.0.1 + path_provider_windows: ^0.0.2 dev_dependencies: integration_test: diff --git a/packages/path_provider/path_provider_windows/ios/path_provider_windows.podspec b/packages/path_provider/path_provider_windows/ios/path_provider_windows.podspec new file mode 100644 index 000000000000..941a36c1c794 --- /dev/null +++ b/packages/path_provider/path_provider_windows/ios/path_provider_windows.podspec @@ -0,0 +1,22 @@ +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html +# Run `pod lib lint path_provider_windows.podspec' to validate before publishing. +# +Pod::Spec.new do |s| + s.name = 'path_provider_windows' + s.version = '0.0.1' + s.summary = 'path_provider_windows iOS stub' + s.description = <<-DESC + No-op implementation of the windows path_provider plugin to avoid build issues on iOS + DESC + s.homepage = 'https://github.com/flutter/plugins' + s.license = { :type => 'BSD', :file => '../LICENSE' } + s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } + s.source = { :http => 'https://github.com/flutter/plugins/tree/master/packages/path_provider/path_provider_windows' } + s.dependency 'Flutter' + s.platform = :ios, '8.0' + + # Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported. + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' } + s.swift_version = '5.0' +end From f17376fb3d0b6c1682f7eed0fa29e55d027e1ffd Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Fri, 18 Sep 2020 15:09:11 -0400 Subject: [PATCH 100/233] [shared_preferences] Add shared_preferences_windows (#2988) Windows implementation of the shared_preferences plugin, using Dart+FFI. --- .../shared_preferences_windows/.metadata | 10 ++ .../shared_preferences_windows/CHANGELOG.md | 3 + .../shared_preferences_windows/LICENSE | 27 +++++ .../shared_preferences_windows/README.md | 23 ++++ .../example/.gitignore | 43 +++++++ .../example/.metadata | 10 ++ .../example/CHANGELOG.md | 3 + .../example/LICENSE | 27 +++++ .../example/README.md | 16 +++ .../example/lib/main.dart | 87 ++++++++++++++ .../example/pubspec.yaml | 24 ++++ .../test_driver/shared_preferences_e2e.dart | 98 ++++++++++++++++ .../shared_preferences_e2e_test.dart | 15 +++ .../lib/shared_preferences_windows.dart | 103 +++++++++++++++++ .../shared_preferences_windows/pubspec.yaml | 31 +++++ .../test/shared_preferences_windows_test.dart | 109 ++++++++++++++++++ 16 files changed, 629 insertions(+) create mode 100644 packages/shared_preferences/shared_preferences_windows/.metadata create mode 100644 packages/shared_preferences/shared_preferences_windows/CHANGELOG.md create mode 100644 packages/shared_preferences/shared_preferences_windows/LICENSE create mode 100644 packages/shared_preferences/shared_preferences_windows/README.md create mode 100644 packages/shared_preferences/shared_preferences_windows/example/.gitignore create mode 100644 packages/shared_preferences/shared_preferences_windows/example/.metadata create mode 100644 packages/shared_preferences/shared_preferences_windows/example/CHANGELOG.md create mode 100644 packages/shared_preferences/shared_preferences_windows/example/LICENSE create mode 100644 packages/shared_preferences/shared_preferences_windows/example/README.md create mode 100644 packages/shared_preferences/shared_preferences_windows/example/lib/main.dart create mode 100644 packages/shared_preferences/shared_preferences_windows/example/pubspec.yaml create mode 100644 packages/shared_preferences/shared_preferences_windows/example/test_driver/shared_preferences_e2e.dart create mode 100644 packages/shared_preferences/shared_preferences_windows/example/test_driver/shared_preferences_e2e_test.dart create mode 100644 packages/shared_preferences/shared_preferences_windows/lib/shared_preferences_windows.dart create mode 100644 packages/shared_preferences/shared_preferences_windows/pubspec.yaml create mode 100644 packages/shared_preferences/shared_preferences_windows/test/shared_preferences_windows_test.dart diff --git a/packages/shared_preferences/shared_preferences_windows/.metadata b/packages/shared_preferences/shared_preferences_windows/.metadata new file mode 100644 index 000000000000..55d1df5ced9a --- /dev/null +++ b/packages/shared_preferences/shared_preferences_windows/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: df90bb5fd64e2066594151b9e311d45cd687a80c + channel: master + +project_type: plugin diff --git a/packages/shared_preferences/shared_preferences_windows/CHANGELOG.md b/packages/shared_preferences/shared_preferences_windows/CHANGELOG.md new file mode 100644 index 000000000000..b3a547cdac34 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_windows/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.0.1 + +* Initial release to support shared_preferences on Windows. diff --git a/packages/shared_preferences/shared_preferences_windows/LICENSE b/packages/shared_preferences/shared_preferences_windows/LICENSE new file mode 100644 index 000000000000..c89293372cf3 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_windows/LICENSE @@ -0,0 +1,27 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/shared_preferences/shared_preferences_windows/README.md b/packages/shared_preferences/shared_preferences_windows/README.md new file mode 100644 index 000000000000..dd710f4c7336 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_windows/README.md @@ -0,0 +1,23 @@ +# shared_preferences_windows + +The Windows implementation of [`shared_preferences`][1]. + +## Usage + +### Import the package + +This package has been endorsed, meaning that you only need to add `shared_preferences` +as a dependency in your `pubspec.yaml`. It will be automatically included in your app +when you depend on `package:shared_preferences`. + +This is what the above means to your `pubspec.yaml`: + +```yaml +... +dependencies: + ... + shared_preferences: ^0.5.7 + ... +``` + +[1]: ../ diff --git a/packages/shared_preferences/shared_preferences_windows/example/.gitignore b/packages/shared_preferences/shared_preferences_windows/example/.gitignore new file mode 100644 index 000000000000..1ba9c339effb --- /dev/null +++ b/packages/shared_preferences/shared_preferences_windows/example/.gitignore @@ -0,0 +1,43 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Web related +lib/generated_plugin_registrant.dart + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Exceptions to above rules. +!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages diff --git a/packages/shared_preferences/shared_preferences_windows/example/.metadata b/packages/shared_preferences/shared_preferences_windows/example/.metadata new file mode 100644 index 000000000000..d39696748cee --- /dev/null +++ b/packages/shared_preferences/shared_preferences_windows/example/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: df90bb5fd64e2066594151b9e311d45cd687a80c + channel: master + +project_type: app diff --git a/packages/shared_preferences/shared_preferences_windows/example/CHANGELOG.md b/packages/shared_preferences/shared_preferences_windows/example/CHANGELOG.md new file mode 100644 index 000000000000..41cc7d8192ec --- /dev/null +++ b/packages/shared_preferences/shared_preferences_windows/example/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.0.1 + +* TODO: Describe initial release. diff --git a/packages/shared_preferences/shared_preferences_windows/example/LICENSE b/packages/shared_preferences/shared_preferences_windows/example/LICENSE new file mode 100644 index 000000000000..c89293372cf3 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_windows/example/LICENSE @@ -0,0 +1,27 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/shared_preferences/shared_preferences_windows/example/README.md b/packages/shared_preferences/shared_preferences_windows/example/README.md new file mode 100644 index 000000000000..d85bb4107622 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_windows/example/README.md @@ -0,0 +1,16 @@ +# shared_preferences_windows_example + +Demonstrates how to use the shared_preferences_windows plugin. + +## Getting Started + +This project is a starting point for a Flutter application. + +A few resources to get you started if this is your first Flutter project: + +- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) + +For help getting started with Flutter, view our +[online documentation](https://flutter.dev/docs), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/packages/shared_preferences/shared_preferences_windows/example/lib/main.dart b/packages/shared_preferences/shared_preferences_windows/example/lib/main.dart new file mode 100644 index 000000000000..140851c90504 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_windows/example/lib/main.dart @@ -0,0 +1,87 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// ignore_for_file: public_member_api_docs + +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:shared_preferences_windows/shared_preferences_windows.dart'; + +void main() { + runApp(MyApp()); +} + +class MyApp extends StatelessWidget { + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'SharedPreferences Demo', + home: SharedPreferencesDemo(), + ); + } +} + +class SharedPreferencesDemo extends StatefulWidget { + SharedPreferencesDemo({Key key}) : super(key: key); + + @override + SharedPreferencesDemoState createState() => SharedPreferencesDemoState(); +} + +class SharedPreferencesDemoState extends State { + final prefs = SharedPreferencesWindows.instance; + Future _counter; + + Future _incrementCounter() async { + final values = await prefs.getAll(); + final int counter = (values['counter'] as int ?? 0) + 1; + + setState(() { + _counter = prefs.setValue(null, "counter", counter).then((bool success) { + return counter; + }); + }); + } + + @override + void initState() { + super.initState(); + _counter = prefs.getAll().then((Map values) { + return (values['counter'] ?? 0); + }); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text("SharedPreferences Demo"), + ), + body: Center( + child: FutureBuilder( + future: _counter, + builder: (BuildContext context, AsyncSnapshot snapshot) { + switch (snapshot.connectionState) { + case ConnectionState.waiting: + return const CircularProgressIndicator(); + default: + if (snapshot.hasError) { + return Text('Error: ${snapshot.error}'); + } else { + return Text( + 'Button tapped ${snapshot.data} time${snapshot.data == 1 ? '' : 's'}.\n\n' + 'This should persist across restarts.', + ); + } + } + })), + floatingActionButton: FloatingActionButton( + onPressed: _incrementCounter, + tooltip: 'Increment', + child: const Icon(Icons.add), + ), + ); + } +} diff --git a/packages/shared_preferences/shared_preferences_windows/example/pubspec.yaml b/packages/shared_preferences/shared_preferences_windows/example/pubspec.yaml new file mode 100644 index 000000000000..6dd7841ea477 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_windows/example/pubspec.yaml @@ -0,0 +1,24 @@ +name: shared_preferences_windows_example +description: Demonstrates how to use the shared_preferences_windows plugin. + +environment: + sdk: ">=2.7.0 <3.0.0" + +dependencies: + flutter: + sdk: flutter + shared_preferences_windows: ^0.0.1 + +dependency_overrides: + shared_preferences_windows: + path: ../ + +dev_dependencies: + flutter_driver: + sdk: flutter + test: any + e2e: ^0.2.0 + pedantic: ^1.8.0 + +flutter: + uses-material-design: true diff --git a/packages/shared_preferences/shared_preferences_windows/example/test_driver/shared_preferences_e2e.dart b/packages/shared_preferences/shared_preferences_windows/example/test_driver/shared_preferences_e2e.dart new file mode 100644 index 000000000000..44c8129e9405 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_windows/example/test_driver/shared_preferences_e2e.dart @@ -0,0 +1,98 @@ +// Copyright 2017, the Chromium project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:async'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:shared_preferences_windows/shared_preferences_windows.dart'; +import 'package:e2e/e2e.dart'; + +void main() { + E2EWidgetsFlutterBinding.ensureInitialized(); + + group('SharedPreferencesWindows', () { + const Map kTestValues = { + 'flutter.String': 'hello world', + 'flutter.bool': true, + 'flutter.int': 42, + 'flutter.double': 3.14159, + 'flutter.List': ['foo', 'bar'], + }; + + const Map kTestValues2 = { + 'flutter.String': 'goodbye world', + 'flutter.bool': false, + 'flutter.int': 1337, + 'flutter.double': 2.71828, + 'flutter.List': ['baz', 'quox'], + }; + + SharedPreferencesWindows preferences; + + setUp(() async { + preferences = SharedPreferencesWindows.instance; + }); + + tearDown(() { + preferences.clear(); + }); + + test('reading', () async { + final Map values = await preferences.getAll(); + expect(values['String'], isNull); + expect(values['bool'], isNull); + expect(values['int'], isNull); + expect(values['double'], isNull); + expect(values['List'], isNull); + }); + + test('writing', () async { + await Future.wait(>[ + preferences.setValue( + 'String', 'String', kTestValues2['flutter.String']), + preferences.setValue('Bool', 'bool', kTestValues2['flutter.bool']), + preferences.setValue('Int', 'int', kTestValues2['flutter.int']), + preferences.setValue( + 'Double', 'double', kTestValues2['flutter.double']), + preferences.setValue('StringList', 'List', kTestValues2['flutter.List']) + ]); + final Map values = await preferences.getAll(); + expect(values['String'], kTestValues2['flutter.String']); + expect(values['bool'], kTestValues2['flutter.bool']); + expect(values['int'], kTestValues2['flutter.int']); + expect(values['double'], kTestValues2['flutter.double']); + expect(values['List'], kTestValues2['flutter.List']); + }); + + test('removing', () async { + const String key = 'testKey'; + await preferences.setValue('String', key, kTestValues['flutter.String']); + await preferences.setValue('Bool', key, kTestValues['flutter.bool']); + await preferences.setValue('Int', key, kTestValues['flutter.int']); + await preferences.setValue('Double', key, kTestValues['flutter.double']); + await preferences.setValue( + 'StringList', key, kTestValues['flutter.List']); + await preferences.remove(key); + final Map values = await preferences.getAll(); + expect(values[key], isNull); + }); + + test('clearing', () async { + await preferences.setValue( + 'String', 'String', kTestValues['flutter.String']); + await preferences.setValue('Bool', 'bool', kTestValues['flutter.bool']); + await preferences.setValue('Int', 'int', kTestValues['flutter.int']); + await preferences.setValue( + 'Double', 'double', kTestValues['flutter.double']); + await preferences.setValue( + 'StringList', 'List', kTestValues['flutter.List']); + await preferences.clear(); + final Map values = await preferences.getAll(); + expect(values['String'], null); + expect(values['bool'], null); + expect(values['int'], null); + expect(values['double'], null); + expect(values['List'], null); + }); + }); +} diff --git a/packages/shared_preferences/shared_preferences_windows/example/test_driver/shared_preferences_e2e_test.dart b/packages/shared_preferences/shared_preferences_windows/example/test_driver/shared_preferences_e2e_test.dart new file mode 100644 index 000000000000..102dfdfef708 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_windows/example/test_driver/shared_preferences_e2e_test.dart @@ -0,0 +1,15 @@ +// Copyright 2017, the Chromium project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:async'; +import 'dart:io'; +import 'package:flutter_driver/flutter_driver.dart'; + +Future main() async { + final FlutterDriver driver = await FlutterDriver.connect(); + final String result = + await driver.requestData(null, timeout: const Duration(minutes: 1)); + await driver.close(); + exit(result == 'pass' ? 0 : 1); +} diff --git a/packages/shared_preferences/shared_preferences_windows/lib/shared_preferences_windows.dart b/packages/shared_preferences/shared_preferences_windows/lib/shared_preferences_windows.dart new file mode 100644 index 000000000000..dd9ab8a0c38f --- /dev/null +++ b/packages/shared_preferences/shared_preferences_windows/lib/shared_preferences_windows.dart @@ -0,0 +1,103 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:async'; +import 'dart:convert' show json; +import 'package:file/file.dart'; +import 'package:file/local.dart'; +import 'package:meta/meta.dart'; +import 'package:path/path.dart' as path; +import 'package:shared_preferences_platform_interface/shared_preferences_platform_interface.dart'; +import 'package:path_provider_windows/path_provider_windows.dart'; + +/// The Windows implementation of [SharedPreferencesStorePlatform]. +/// +/// This class implements the `package:shared_preferences` functionality for Windows. +class SharedPreferencesWindows extends SharedPreferencesStorePlatform { + /// The default instance of [SharedPreferencesWindows] to use. + static SharedPreferencesWindows instance = SharedPreferencesWindows(); + + /// File system used to store to disk. Exposed for testing only. + @visibleForTesting + FileSystem fs = LocalFileSystem(); + + /// The path_provider_windows instance used to find the support directory. + @visibleForTesting + PathProviderWindows pathProvider = PathProviderWindows(); + + /// Local copy of preferences + Map _cachedPreferences; + + /// Cached file for storing preferences. + File _localDataFilePath; + + /// Gets the file where the preferences are stored. + Future _getLocalDataFile() async { + if (_localDataFilePath == null) { + final directory = await pathProvider.getApplicationSupportPath(); + _localDataFilePath = + fs.file(path.join(directory, 'shared_preferences.json')); + } + return _localDataFilePath; + } + + /// Gets the preferences from the stored file. Once read, the preferences are + /// maintained in memory. + Future> _readPreferences() async { + if (_cachedPreferences == null) { + _cachedPreferences = {}; + File localDataFile = await _getLocalDataFile(); + if (localDataFile.existsSync()) { + String stringMap = localDataFile.readAsStringSync(); + if (stringMap.isNotEmpty) { + _cachedPreferences = json.decode(stringMap) as Map; + } + } + } + return _cachedPreferences; + } + + /// Writes the cached preferences to disk. Returns [true] if the operation + /// succeeded. + Future _writePreferences(Map preferences) async { + try { + File localDataFile = await _getLocalDataFile(); + if (!localDataFile.existsSync()) { + localDataFile.createSync(recursive: true); + } + String stringMap = json.encode(preferences); + localDataFile.writeAsStringSync(stringMap); + } catch (e) { + print("Error saving preferences to disk: $e"); + return false; + } + return true; + } + + @override + Future clear() async { + var preferences = await _readPreferences(); + preferences.clear(); + return _writePreferences(preferences); + } + + @override + Future> getAll() async { + return _readPreferences(); + } + + @override + Future remove(String key) async { + var preferences = await _readPreferences(); + preferences.remove(key); + return _writePreferences(preferences); + } + + @override + Future setValue(String valueType, String key, Object value) async { + var preferences = await _readPreferences(); + preferences[key] = value; + return _writePreferences(preferences); + } +} diff --git a/packages/shared_preferences/shared_preferences_windows/pubspec.yaml b/packages/shared_preferences/shared_preferences_windows/pubspec.yaml new file mode 100644 index 000000000000..ce4dbc603237 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_windows/pubspec.yaml @@ -0,0 +1,31 @@ +name: shared_preferences_windows +description: Windows implementation of shared_preferences +homepage: https://github.com/flutter/plugins/tree/master/packages/shared_preferences/shared_preferences_windows +version: 0.0.1 + +flutter: + plugin: + platforms: + windows: + dartPluginClass: SharedPreferencesWindows + pluginClass: none + +environment: + sdk: ">=2.1.0 <3.0.0" + flutter: ">=1.12.8 <2.0.0" + +dependencies: + shared_preferences_platform_interface: ^1.0.0 + flutter: + sdk: flutter + ffi: ^0.1.3 + file: ">=5.1.0 <7.0.0" + meta: ^1.1.7 + path: ^1.6.4 + path_provider_platform_interface: ^1.0.3 + path_provider_windows: ^0.0.2 + +dev_dependencies: + flutter_test: + sdk: flutter + pedantic: ^1.8.0 diff --git a/packages/shared_preferences/shared_preferences_windows/test/shared_preferences_windows_test.dart b/packages/shared_preferences/shared_preferences_windows/test/shared_preferences_windows_test.dart new file mode 100644 index 000000000000..b0827ca3b36b --- /dev/null +++ b/packages/shared_preferences/shared_preferences_windows/test/shared_preferences_windows_test.dart @@ -0,0 +1,109 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:file/memory.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:path/path.dart' as path; +import 'package:path_provider_platform_interface/path_provider_platform_interface.dart'; +import 'package:path_provider_windows/path_provider_windows.dart'; +import 'package:shared_preferences_windows/shared_preferences_windows.dart'; + +void main() { + MemoryFileSystem fileSystem; + PathProviderWindows pathProvider; + + setUp(() { + fileSystem = MemoryFileSystem.test(); + pathProvider = FakePathProviderWindows(); + }); + + tearDown(() {}); + + Future _getFilePath() async { + final directory = await pathProvider.getApplicationSupportPath(); + return path.join(directory, 'shared_preferences.json'); + } + + _writeTestFile(String value) async { + fileSystem.file(await _getFilePath()) + ..createSync(recursive: true) + ..writeAsStringSync(value); + } + + Future _readTestFile() async { + return fileSystem.file(await _getFilePath()).readAsStringSync(); + } + + SharedPreferencesWindows _getPreferences() { + var prefs = SharedPreferencesWindows(); + prefs.fs = fileSystem; + prefs.pathProvider = pathProvider; + return prefs; + } + + test('getAll', () async { + await _writeTestFile('{"key1": "one", "key2": 2}'); + var prefs = _getPreferences(); + + var values = await prefs.getAll(); + expect(values, hasLength(2)); + expect(values['key1'], 'one'); + expect(values['key2'], 2); + }); + + test('remove', () async { + await _writeTestFile('{"key1":"one","key2":2}'); + var prefs = _getPreferences(); + + await prefs.remove('key2'); + + expect(await _readTestFile(), '{"key1":"one"}'); + }); + + test('setValue', () async { + await _writeTestFile('{}'); + var prefs = _getPreferences(); + + await prefs.setValue('', 'key1', 'one'); + await prefs.setValue('', 'key2', 2); + + expect(await _readTestFile(), '{"key1":"one","key2":2}'); + }); + + test('clear', () async { + await _writeTestFile('{"key1":"one","key2":2}'); + var prefs = _getPreferences(); + + await prefs.clear(); + expect(await _readTestFile(), '{}'); + }); +} + +/// Fake implementation of PathProviderWindows that returns hard-coded paths, +/// allowing tests to run on any platform. +/// +/// Note that this should only be used with an in-memory filesystem, as the +/// path it returns is a root path that does not actually exist on Windows. +class FakePathProviderWindows extends PathProviderPlatform + implements PathProviderWindows { + VersionInfoQuerier versionInfoQuerier; + + @override + Future getApplicationSupportPath() async => r'C:\appsupport'; + + @override + Future getTemporaryPath() async => null; + + @override + Future getLibraryPath() async => null; + + @override + Future getApplicationDocumentsPath() async => null; + + @override + Future getDownloadsPath() async => null; + + @override + Future getPath(String folderID) async => null; +} From b5b88f60e0980057dfd5cfe382a98af0455b988e Mon Sep 17 00:00:00 2001 From: Anniek Date: Fri, 18 Sep 2020 23:30:19 +0200 Subject: [PATCH 101/233] =?UTF-8?q?[image=5Fpicker]=20changed=20ExifInterf?= =?UTF-8?q?ace=20to=20AndroidX=20version,=20including=20d=E2=80=A6=20(#303?= =?UTF-8?q?6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/image_picker/image_picker/CHANGELOG.md | 5 +++++ packages/image_picker/image_picker/android/build.gradle | 1 + .../java/io/flutter/plugins/imagepicker/ExifDataCopier.java | 2 +- packages/image_picker/image_picker/lib/image_picker.dart | 6 +++--- packages/image_picker/image_picker/pubspec.yaml | 2 +- .../image_picker_platform_interface/CHANGELOG.md | 4 ++++ .../lib/src/platform_interface/image_picker_platform.dart | 6 +++--- .../image_picker_platform_interface/pubspec.yaml | 2 +- 8 files changed, 19 insertions(+), 9 deletions(-) diff --git a/packages/image_picker/image_picker/CHANGELOG.md b/packages/image_picker/image_picker/CHANGELOG.md index 100fe9989354..6350b42b6090 100644 --- a/packages/image_picker/image_picker/CHANGELOG.md +++ b/packages/image_picker/image_picker/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.6.7+9 + +* Updated the ExifInterface to the AndroidX version to support more file formats; +* Update documentation of `getImage()` regarding compression support for specific image types. + ## 0.6.7+8 * Update documentation of getImage() about Android's disability to preference front/rear camera. diff --git a/packages/image_picker/image_picker/android/build.gradle b/packages/image_picker/image_picker/android/build.gradle index 19f14a286a61..493d72caf1a8 100755 --- a/packages/image_picker/image_picker/android/build.gradle +++ b/packages/image_picker/image_picker/android/build.gradle @@ -37,5 +37,6 @@ android { dependencies { implementation 'androidx.core:core:1.0.2' implementation 'androidx.annotation:annotation:1.0.0' + implementation 'androidx.exifinterface:exifinterface:1.3.0' } } diff --git a/packages/image_picker/image_picker/android/src/main/java/io/flutter/plugins/imagepicker/ExifDataCopier.java b/packages/image_picker/image_picker/android/src/main/java/io/flutter/plugins/imagepicker/ExifDataCopier.java index fd7db57e96cc..08b010072585 100644 --- a/packages/image_picker/image_picker/android/src/main/java/io/flutter/plugins/imagepicker/ExifDataCopier.java +++ b/packages/image_picker/image_picker/android/src/main/java/io/flutter/plugins/imagepicker/ExifDataCopier.java @@ -4,8 +4,8 @@ package io.flutter.plugins.imagepicker; -import android.media.ExifInterface; import android.util.Log; +import androidx.exifinterface.media.ExifInterface; import java.util.Arrays; import java.util.List; diff --git a/packages/image_picker/image_picker/lib/image_picker.dart b/packages/image_picker/image_picker/lib/image_picker.dart index 6fe513dc25f1..ff9aa2cbecc3 100755 --- a/packages/image_picker/image_picker/lib/image_picker.dart +++ b/packages/image_picker/image_picker/lib/image_picker.dart @@ -81,9 +81,9 @@ class ImagePicker { /// original width and height. /// The `imageQuality` argument modifies the quality of the image, ranging from 0-100 /// where 100 is the original/max quality. If `imageQuality` is null, the image with - /// the original quality will be returned. Compression is only supportted for certain - /// image types such as JPEG. If compression is not supported for the image that is picked, - /// an warning message will be logged. + /// the original quality will be returned. Compression is only supported for certain + /// image types such as JPEG and on Android PNG and WebP, too. If compression is not supported for the image that is picked, + /// a warning message will be logged. /// /// Use `preferredCameraDevice` to specify the camera to use when the `source` is [ImageSource.camera]. /// The `preferredCameraDevice` is ignored when `source` is [ImageSource.gallery]. It is also ignored if the chosen camera is not supported on the device. diff --git a/packages/image_picker/image_picker/pubspec.yaml b/packages/image_picker/image_picker/pubspec.yaml index 5a0dfdafe8c2..15af59536a54 100755 --- a/packages/image_picker/image_picker/pubspec.yaml +++ b/packages/image_picker/image_picker/pubspec.yaml @@ -2,7 +2,7 @@ name: image_picker description: Flutter plugin for selecting images from the Android and iOS image library, and taking new pictures with the camera. homepage: https://github.com/flutter/plugins/tree/master/packages/image_picker/image_picker -version: 0.6.7+8 +version: 0.6.7+9 flutter: plugin: diff --git a/packages/image_picker/image_picker_platform_interface/CHANGELOG.md b/packages/image_picker/image_picker_platform_interface/CHANGELOG.md index 33c1cf8ddba7..e82e62028668 100644 --- a/packages/image_picker/image_picker_platform_interface/CHANGELOG.md +++ b/packages/image_picker/image_picker_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.1.2 + +* Update documentation of `pickImage()` regarding compression support for specific image types. + ## 1.1.1 * Update documentation of getImage() about Android's disability to preference front/rear camera. diff --git a/packages/image_picker/image_picker_platform_interface/lib/src/platform_interface/image_picker_platform.dart b/packages/image_picker/image_picker_platform_interface/lib/src/platform_interface/image_picker_platform.dart index 38bf0858dd6f..f33c80bc4995 100644 --- a/packages/image_picker/image_picker_platform_interface/lib/src/platform_interface/image_picker_platform.dart +++ b/packages/image_picker/image_picker_platform_interface/lib/src/platform_interface/image_picker_platform.dart @@ -50,9 +50,9 @@ abstract class ImagePickerPlatform extends PlatformInterface { /// /// The `imageQuality` argument modifies the quality of the image, ranging from 0-100 /// where 100 is the original/max quality. If `imageQuality` is null, the image with - /// the original quality will be returned. Compression is only supportted for certain - /// image types such as JPEG. If compression is not supported for the image that is picked, - /// an warning message will be logged. + /// the original quality will be returned. Compression is only supported for certain + /// image types such as JPEG and on Android PNG and WebP, too. If compression is not supported for the image that is picked, + /// a warning message will be logged. /// /// Use `preferredCameraDevice` to specify the camera to use when the `source` is [ImageSource.camera]. /// The `preferredCameraDevice` is ignored when `source` is [ImageSource.gallery]. It is also ignored if the chosen camera is not supported on the device. diff --git a/packages/image_picker/image_picker_platform_interface/pubspec.yaml b/packages/image_picker/image_picker_platform_interface/pubspec.yaml index 2a5f9d0380d0..16300488368b 100644 --- a/packages/image_picker/image_picker_platform_interface/pubspec.yaml +++ b/packages/image_picker/image_picker_platform_interface/pubspec.yaml @@ -3,7 +3,7 @@ description: A common platform interface for the image_picker plugin. homepage: https://github.com/flutter/plugins/tree/master/packages/image_picker/image_picker_platform_interface # NOTE: We strongly prefer non-breaking changes, even at the expense of a # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes -version: 1.1.1 +version: 1.1.2 dependencies: flutter: From 8faaed558c1980e20fe783c7639778ca56cd2e0b Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Sat, 19 Sep 2020 19:06:16 -0400 Subject: [PATCH 102/233] [path_provider] Add missing pluginClass: none to path_provider_windows (#3052) Stable channel still needs a 'pluginClass: none' to avoid "Invalid plugin specification" errors when parsing a Dart-only desktop plugin like this one. Fixes https://github.com/flutter/flutter/issues/66158 --- packages/path_provider/path_provider_windows/CHANGELOG.md | 4 ++++ packages/path_provider/path_provider_windows/pubspec.yaml | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/path_provider/path_provider_windows/CHANGELOG.md b/packages/path_provider/path_provider_windows/CHANGELOG.md index 982602c3ae1a..0b7328631f24 100644 --- a/packages/path_provider/path_provider_windows/CHANGELOG.md +++ b/packages/path_provider/path_provider_windows/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.3 + +* Add missing `pluginClass: none` for compatibilty with stable channel. + ## 0.0.2 * README update for endorsement. diff --git a/packages/path_provider/path_provider_windows/pubspec.yaml b/packages/path_provider/path_provider_windows/pubspec.yaml index 54d5a5190ddf..998f4e2c616b 100644 --- a/packages/path_provider/path_provider_windows/pubspec.yaml +++ b/packages/path_provider/path_provider_windows/pubspec.yaml @@ -1,14 +1,14 @@ name: path_provider_windows description: Windows implementation of the path_provider plugin homepage: https://github.com/flutter/plugins/tree/master/packages/path_provider/path_provider_windows -version: 0.0.2 +version: 0.0.3 flutter: plugin: platforms: windows: dartPluginClass: PathProviderWindows - + pluginClass: none dependencies: path_provider_platform_interface: ^1.0.3 From 772a57f0ba60a95ad997440c4116045b02406ba2 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Sun, 20 Sep 2020 21:12:11 -0400 Subject: [PATCH 103/233] [shared_preferences] Add iOS stub to shared_preferences_windows (#3058) shared_preferences supports versions older than 1.18, so this plugin needs the iOS stub to prevent breaking iOS projects via transitive dependencies when shared_preferences endorses the Windows implementation. --- .../shared_preferences_windows/CHANGELOG.md | 4 ++++ .../ios/shared_preferences_windows.podspec | 22 +++++++++++++++++++ .../shared_preferences_windows/pubspec.yaml | 2 +- 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 packages/shared_preferences/shared_preferences_windows/ios/shared_preferences_windows.podspec diff --git a/packages/shared_preferences/shared_preferences_windows/CHANGELOG.md b/packages/shared_preferences/shared_preferences_windows/CHANGELOG.md index b3a547cdac34..7f82e5ba12f1 100644 --- a/packages/shared_preferences/shared_preferences_windows/CHANGELOG.md +++ b/packages/shared_preferences/shared_preferences_windows/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.1+1 + +* Add iOS stub for compatibility with 1.17 and earlier. + ## 0.0.1 * Initial release to support shared_preferences on Windows. diff --git a/packages/shared_preferences/shared_preferences_windows/ios/shared_preferences_windows.podspec b/packages/shared_preferences/shared_preferences_windows/ios/shared_preferences_windows.podspec new file mode 100644 index 000000000000..2e239e607493 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_windows/ios/shared_preferences_windows.podspec @@ -0,0 +1,22 @@ +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html +# Run `pod lib lint shared_preferences_windows.podspec' to validate before publishing. +# +Pod::Spec.new do |s| + s.name = 'shared_preferences_windows' + s.version = '0.0.1' + s.summary = 'shared_preferences_windows iOS stub' + s.description = <<-DESC + No-op implementation of the windows shared_preferences plugin to avoid build issues on iOS + DESC + s.homepage = 'https://github.com/flutter/plugins' + s.license = { :type => 'BSD', :file => '../LICENSE' } + s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } + s.source = { :http => 'https://github.com/flutter/plugins/tree/master/packages/shared_preferences/shared_preferences_windows' } + s.dependency 'Flutter' + s.platform = :ios, '8.0' + + # Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported. + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' } + s.swift_version = '5.0' +end diff --git a/packages/shared_preferences/shared_preferences_windows/pubspec.yaml b/packages/shared_preferences/shared_preferences_windows/pubspec.yaml index ce4dbc603237..f1ce8ecf48d7 100644 --- a/packages/shared_preferences/shared_preferences_windows/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_windows/pubspec.yaml @@ -1,7 +1,7 @@ name: shared_preferences_windows description: Windows implementation of shared_preferences homepage: https://github.com/flutter/plugins/tree/master/packages/shared_preferences/shared_preferences_windows -version: 0.0.1 +version: 0.0.1+1 flutter: plugin: From b6a42c2e7122fdcdae5ef158a0b6a1e852d8989c Mon Sep 17 00:00:00 2001 From: Mehmet Fidanboylu Date: Sun, 20 Sep 2020 22:02:19 -0700 Subject: [PATCH 104/233] [Connectivity] Fix mistake in license headers (#3054) --- .../connectivity/connectivity_macos/CHANGELOG.md | 4 ++++ .../macos/Classes/ConnectivityPlugin.swift | 16 +++------------- .../connectivity_macos/macos/Classes/IPHelper.h | 16 +++------------- .../connectivity/connectivity_macos/pubspec.yaml | 2 +- 4 files changed, 11 insertions(+), 27 deletions(-) diff --git a/packages/connectivity/connectivity_macos/CHANGELOG.md b/packages/connectivity/connectivity_macos/CHANGELOG.md index c103c51b0d70..e997123ecc89 100644 --- a/packages/connectivity/connectivity_macos/CHANGELOG.md +++ b/packages/connectivity/connectivity_macos/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.0+6 + +* Update license headers. + ## 0.1.0+5 * Update package:e2e reference to use the local version in the flutter/plugins diff --git a/packages/connectivity/connectivity_macos/macos/Classes/ConnectivityPlugin.swift b/packages/connectivity/connectivity_macos/macos/Classes/ConnectivityPlugin.swift index 91d8ae1eb3c6..8eafbc3188cf 100644 --- a/packages/connectivity/connectivity_macos/macos/Classes/ConnectivityPlugin.swift +++ b/packages/connectivity/connectivity_macos/macos/Classes/ConnectivityPlugin.swift @@ -1,16 +1,6 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. import Cocoa import CoreWLAN diff --git a/packages/connectivity/connectivity_macos/macos/Classes/IPHelper.h b/packages/connectivity/connectivity_macos/macos/Classes/IPHelper.h index 5fef2b97213c..e5a067b9069f 100644 --- a/packages/connectivity/connectivity_macos/macos/Classes/IPHelper.h +++ b/packages/connectivity/connectivity_macos/macos/Classes/IPHelper.h @@ -1,16 +1,6 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. #import diff --git a/packages/connectivity/connectivity_macos/pubspec.yaml b/packages/connectivity/connectivity_macos/pubspec.yaml index e35becb0ee35..99151ff7418d 100644 --- a/packages/connectivity/connectivity_macos/pubspec.yaml +++ b/packages/connectivity/connectivity_macos/pubspec.yaml @@ -3,7 +3,7 @@ description: macOS implementation of the connectivity plugin. # 0.1.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.1.0+5 +version: 0.1.0+6 homepage: https://github.com/flutter/plugins/tree/master/packages/connectivity/connectivity_macos flutter: From 127344f76d82890cc4014697d303c0a62bb9db21 Mon Sep 17 00:00:00 2001 From: Harsh Sharma <51477130+hs2361@users.noreply.github.com> Date: Mon, 21 Sep 2020 21:32:02 +0530 Subject: [PATCH 105/233] [image_picker] Updated README.md with new example (#3044) --- .../image_picker/image_picker/CHANGELOG.md | 4 ++++ packages/image_picker/image_picker/README.md | 20 ++++++++++++++++++- .../image_picker/image_picker/pubspec.yaml | 2 +- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/packages/image_picker/image_picker/CHANGELOG.md b/packages/image_picker/image_picker/CHANGELOG.md index 6350b42b6090..fc7b11b69aed 100644 --- a/packages/image_picker/image_picker/CHANGELOG.md +++ b/packages/image_picker/image_picker/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.6.7+10 + +* Updated documentation with code that does not throw an error when image is not picked. + ## 0.6.7+9 * Updated the ExifInterface to the AndroidX version to support more file formats; diff --git a/packages/image_picker/image_picker/README.md b/packages/image_picker/image_picker/README.md index 71d20ea4af2c..2e062a024597 100755 --- a/packages/image_picker/image_picker/README.md +++ b/packages/image_picker/image_picker/README.md @@ -29,8 +29,22 @@ Add `android:requestLegacyExternalStorage="true"` as an attribute to the ` runApp(MyApp()); + +class MyApp extends StatelessWidget { + @override + Widget build(BuildContext context) { + return MaterialApp( + home: MyHomePage(), + ); + } +} + class MyHomePage extends StatefulWidget { @override _MyHomePageState createState() => _MyHomePageState(); @@ -44,7 +58,11 @@ class _MyHomePageState extends State { final pickedFile = await picker.getImage(source: ImageSource.camera); setState(() { - _image = File(pickedFile.path); + if (pickedFile != null) { + _image = File(pickedFile.path); + } else { + print('No image selected.'); + } }); } diff --git a/packages/image_picker/image_picker/pubspec.yaml b/packages/image_picker/image_picker/pubspec.yaml index 15af59536a54..47c3e5e205c4 100755 --- a/packages/image_picker/image_picker/pubspec.yaml +++ b/packages/image_picker/image_picker/pubspec.yaml @@ -2,7 +2,7 @@ name: image_picker description: Flutter plugin for selecting images from the Android and iOS image library, and taking new pictures with the camera. homepage: https://github.com/flutter/plugins/tree/master/packages/image_picker/image_picker -version: 0.6.7+9 +version: 0.6.7+10 flutter: plugin: From 052a9159c46c7689575fc3c5b00fef1ed3820fc4 Mon Sep 17 00:00:00 2001 From: Mehmet Fidanboylu Date: Mon, 21 Sep 2020 09:16:46 -0700 Subject: [PATCH 106/233] [path_provider] Fix mistake in license headers (#3055) --- .../path_provider_macos/CHANGELOG.md | 4 ++++ .../macos/Classes/PathProviderPlugin.swift | 16 +++------------- .../path_provider_macos/pubspec.yaml | 2 +- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/packages/path_provider/path_provider_macos/CHANGELOG.md b/packages/path_provider/path_provider_macos/CHANGELOG.md index 406c49f56def..b2ca95fbd10c 100644 --- a/packages/path_provider/path_provider_macos/CHANGELOG.md +++ b/packages/path_provider/path_provider_macos/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.4+5 + +* Update license header. + ## 0.0.4+4 * Remove no-op android folder in the example app. diff --git a/packages/path_provider/path_provider_macos/macos/Classes/PathProviderPlugin.swift b/packages/path_provider/path_provider_macos/macos/Classes/PathProviderPlugin.swift index cb56fc49769c..a1528822893f 100644 --- a/packages/path_provider/path_provider_macos/macos/Classes/PathProviderPlugin.swift +++ b/packages/path_provider/path_provider_macos/macos/Classes/PathProviderPlugin.swift @@ -1,16 +1,6 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. import FlutterMacOS import Foundation diff --git a/packages/path_provider/path_provider_macos/pubspec.yaml b/packages/path_provider/path_provider_macos/pubspec.yaml index 00ac8376fca9..970c8c59fe7a 100644 --- a/packages/path_provider/path_provider_macos/pubspec.yaml +++ b/packages/path_provider/path_provider_macos/pubspec.yaml @@ -3,7 +3,7 @@ description: macOS implementation of the path_provider plugin # 0.0.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.0.4+4 +version: 0.0.4+5 homepage: https://github.com/flutter/plugins/tree/master/packages/path_provider/path_provider_macos flutter: From e80865ac23ca1e70fad2bf22d04ba42c9f3c1341 Mon Sep 17 00:00:00 2001 From: Maurice Parrish Date: Mon, 21 Sep 2020 09:27:16 -0700 Subject: [PATCH 107/233] [webview_flutter] [url_launcher] Handle Multiwindows in WebViews (#2991) --- .../url_launcher/url_launcher/CHANGELOG.md | 4 + .../plugins/urllauncher/WebViewActivity.java | 41 +++++++ .../url_launcher/url_launcher/pubspec.yaml | 2 +- packages/webview_flutter/CHANGELOG.md | 4 + .../webviewflutter/FlutterWebView.java | 49 +++++++++ .../webviewflutter/FlutterWebViewClient.java | 4 +- .../test_driver/webview_flutter_e2e.dart | 102 ++++++++++++++++++ packages/webview_flutter/pubspec.yaml | 2 +- 8 files changed, 204 insertions(+), 4 deletions(-) diff --git a/packages/url_launcher/url_launcher/CHANGELOG.md b/packages/url_launcher/url_launcher/CHANGELOG.md index 063aa99d5d51..d803ddf57ccb 100644 --- a/packages/url_launcher/url_launcher/CHANGELOG.md +++ b/packages/url_launcher/url_launcher/CHANGELOG.md @@ -1,3 +1,7 @@ +## 5.7.0 + +* Handle WebView multi-window support. + ## 5.6.0 * Support Windows by default. diff --git a/packages/url_launcher/url_launcher/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java b/packages/url_launcher/url_launcher/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java index 5624d75b22eb..98c5613e6c62 100644 --- a/packages/url_launcher/url_launcher/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java +++ b/packages/url_launcher/url_launcher/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java @@ -1,5 +1,6 @@ package io.flutter.plugins.urllauncher; +import android.annotation.TargetApi; import android.app.Activity; import android.content.BroadcastReceiver; import android.content.Context; @@ -7,11 +8,14 @@ import android.content.IntentFilter; import android.os.Build; import android.os.Bundle; +import android.os.Message; import android.provider.Browser; import android.view.KeyEvent; +import android.webkit.WebChromeClient; import android.webkit.WebResourceRequest; import android.webkit.WebView; import android.webkit.WebViewClient; +import androidx.annotation.NonNull; import androidx.annotation.RequiresApi; import java.util.HashMap; import java.util.Map; @@ -67,6 +71,39 @@ public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request private IntentFilter closeIntentFilter = new IntentFilter(ACTION_CLOSE); + // Verifies that a url opened by `Window.open` has a secure url. + private class FlutterWebChromeClient extends WebChromeClient { + @Override + public boolean onCreateWindow( + final WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + final WebViewClient webViewClient = + new WebViewClient() { + @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public boolean shouldOverrideUrlLoading( + @NonNull WebView view, @NonNull WebResourceRequest request) { + webview.loadUrl(request.getUrl().toString()); + return true; + } + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + webview.loadUrl(url); + return true; + } + }; + + final WebView newWebView = new WebView(webview.getContext()); + newWebView.setWebViewClient(webViewClient); + + final WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + + return true; + } + } + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -88,6 +125,10 @@ public void onCreate(Bundle savedInstanceState) { // Open new urls inside the webview itself. webview.setWebViewClient(webViewClient); + // Multi windows is set with FlutterWebChromeClient by default to handle internal bug: b/159892679. + webview.getSettings().setSupportMultipleWindows(true); + webview.setWebChromeClient(new FlutterWebChromeClient()); + // Register receiver that may finish this Activity. registerReceiver(broadcastReceiver, closeIntentFilter); } diff --git a/packages/url_launcher/url_launcher/pubspec.yaml b/packages/url_launcher/url_launcher/pubspec.yaml index 965a4318d0f8..a4061af8eadc 100644 --- a/packages/url_launcher/url_launcher/pubspec.yaml +++ b/packages/url_launcher/url_launcher/pubspec.yaml @@ -2,7 +2,7 @@ name: url_launcher description: Flutter plugin for launching a URL on Android and iOS. Supports web, phone, SMS, and email schemes. homepage: https://github.com/flutter/plugins/tree/master/packages/url_launcher/url_launcher -version: 5.6.0 +version: 5.7.0 flutter: plugin: diff --git a/packages/webview_flutter/CHANGELOG.md b/packages/webview_flutter/CHANGELOG.md index baa485ba5b17..e1f4c3c2d1c8 100644 --- a/packages/webview_flutter/CHANGELOG.md +++ b/packages/webview_flutter/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.3.23 + +* Handle WebView multi-window support. + ## 0.3.22+2 * Update package:e2e reference to use the local version in the flutter/plugins diff --git a/packages/webview_flutter/android/src/main/java/io/flutter/plugins/webviewflutter/FlutterWebView.java b/packages/webview_flutter/android/src/main/java/io/flutter/plugins/webviewflutter/FlutterWebView.java index f9659d9873f4..9bec8fa0ef13 100644 --- a/packages/webview_flutter/android/src/main/java/io/flutter/plugins/webviewflutter/FlutterWebView.java +++ b/packages/webview_flutter/android/src/main/java/io/flutter/plugins/webviewflutter/FlutterWebView.java @@ -9,9 +9,14 @@ import android.hardware.display.DisplayManager; import android.os.Build; import android.os.Handler; +import android.os.Message; import android.view.View; +import android.webkit.WebChromeClient; +import android.webkit.WebResourceRequest; import android.webkit.WebStorage; +import android.webkit.WebView; import android.webkit.WebViewClient; +import androidx.annotation.NonNull; import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodChannel; @@ -29,6 +34,46 @@ public class FlutterWebView implements PlatformView, MethodCallHandler { private final FlutterWebViewClient flutterWebViewClient; private final Handler platformThreadHandler; + // Verifies that a url opened by `Window.open` has a secure url. + private class FlutterWebChromeClient extends WebChromeClient { + @Override + public boolean onCreateWindow( + final WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { + final WebViewClient webViewClient = + new WebViewClient() { + @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public boolean shouldOverrideUrlLoading( + @NonNull WebView view, @NonNull WebResourceRequest request) { + final String url = request.getUrl().toString(); + if (!flutterWebViewClient.shouldOverrideUrlLoading( + FlutterWebView.this.webView, request)) { + webView.loadUrl(url); + } + return true; + } + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + if (!flutterWebViewClient.shouldOverrideUrlLoading( + FlutterWebView.this.webView, url)) { + webView.loadUrl(url); + } + return true; + } + }; + + final WebView newWebView = new WebView(view.getContext()); + newWebView.setWebViewClient(webViewClient); + + final WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(newWebView); + resultMsg.sendToTarget(); + + return true; + } + } + @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) @SuppressWarnings("unchecked") FlutterWebView( @@ -50,6 +95,10 @@ public class FlutterWebView implements PlatformView, MethodCallHandler { webView.getSettings().setDomStorageEnabled(true); webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); + // Multi windows is set with FlutterWebChromeClient by default to handle internal bug: b/159892679. + webView.getSettings().setSupportMultipleWindows(true); + webView.setWebChromeClient(new FlutterWebChromeClient()); + methodChannel = new MethodChannel(messenger, "plugins.flutter.io/webview_" + id); methodChannel.setMethodCallHandler(this); diff --git a/packages/webview_flutter/android/src/main/java/io/flutter/plugins/webviewflutter/FlutterWebViewClient.java b/packages/webview_flutter/android/src/main/java/io/flutter/plugins/webviewflutter/FlutterWebViewClient.java index 474435ca3dfe..24926bfc4117 100644 --- a/packages/webview_flutter/android/src/main/java/io/flutter/plugins/webviewflutter/FlutterWebViewClient.java +++ b/packages/webview_flutter/android/src/main/java/io/flutter/plugins/webviewflutter/FlutterWebViewClient.java @@ -77,7 +77,7 @@ private static String errorCodeToString(int errorCode) { } @TargetApi(Build.VERSION_CODES.LOLLIPOP) - private boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { if (!hasNavigationDelegate) { return false; } @@ -97,7 +97,7 @@ private boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest reques return request.isForMainFrame(); } - private boolean shouldOverrideUrlLoading(WebView view, String url) { + boolean shouldOverrideUrlLoading(WebView view, String url) { if (!hasNavigationDelegate) { return false; } diff --git a/packages/webview_flutter/example/test_driver/webview_flutter_e2e.dart b/packages/webview_flutter/example/test_driver/webview_flutter_e2e.dart index 162ca2cdcd9a..53fc991c48f2 100644 --- a/packages/webview_flutter/example/test_driver/webview_flutter_e2e.dart +++ b/packages/webview_flutter/example/test_driver/webview_flutter_e2e.dart @@ -828,6 +828,108 @@ void main() { final String currentUrl = await controller.currentUrl(); expect(currentUrl, 'about:blank'); }); + + testWidgets( + 'can open new window and go back', + (WidgetTester tester) async { + final Completer controllerCompleter = + Completer(); + final Completer pageLoaded = Completer(); + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: WebView( + key: GlobalKey(), + onWebViewCreated: (WebViewController controller) { + controllerCompleter.complete(controller); + }, + javascriptMode: JavascriptMode.unrestricted, + onPageFinished: (String url) { + pageLoaded.complete(); + }, + initialUrl: 'https://flutter.dev', + ), + ), + ); + final WebViewController controller = await controllerCompleter.future; + await controller + .evaluateJavascript('window.open("https://www.google.com")'); + await pageLoaded.future; + expect(controller.currentUrl(), completion('https://www.google.com/')); + + await controller.goBack(); + expect(controller.currentUrl(), completion('https://www.flutter.dev')); + }, + skip: !Platform.isAndroid, + ); + + testWidgets( + 'javascript does not run in parent window', + (WidgetTester tester) async { + final String iframe = ''' + + + '''; + final String iframeTestBase64 = + base64Encode(const Utf8Encoder().convert(iframe)); + + final String openWindowTest = ''' + + + + XSS test + + + + + + '''; + final String openWindowTestBase64 = + base64Encode(const Utf8Encoder().convert(openWindowTest)); + final Completer controllerCompleter = + Completer(); + final Completer pageLoadCompleter = Completer(); + + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: WebView( + key: GlobalKey(), + onWebViewCreated: (WebViewController controller) { + controllerCompleter.complete(controller); + }, + javascriptMode: JavascriptMode.unrestricted, + initialUrl: + 'data:text/html;charset=utf-8;base64,$openWindowTestBase64', + onPageFinished: (String url) { + pageLoadCompleter.complete(); + }, + ), + ), + ); + + final WebViewController controller = await controllerCompleter.future; + await pageLoadCompleter.future; + + expect(controller.evaluateJavascript('iframeLoaded'), completion('true')); + expect( + controller.evaluateJavascript( + 'document.querySelector("p") && document.querySelector("p").textContent'), + completion('null'), + ); + }, + skip: !Platform.isAndroid, + ); } // JavaScript booleans evaluate to different string values on Android and iOS. diff --git a/packages/webview_flutter/pubspec.yaml b/packages/webview_flutter/pubspec.yaml index ec811833c9b8..8a4a62ea76a6 100644 --- a/packages/webview_flutter/pubspec.yaml +++ b/packages/webview_flutter/pubspec.yaml @@ -1,6 +1,6 @@ name: webview_flutter description: A Flutter plugin that provides a WebView widget on Android and iOS. -version: 0.3.22+2 +version: 0.3.23 homepage: https://github.com/flutter/plugins/tree/master/packages/webview_flutter environment: From 25957033132ac17094e82bec58e429fac073a483 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Mon, 21 Sep 2020 16:48:17 -0400 Subject: [PATCH 108/233] [path_provider] Move Windows FFI behind a conditional import (#3056) Moves the real implementation of path_provider_windows behind a conditional export, instead exporting a stub on platforms that don't support dart:ffi. This avoids build breakage in web projects that have transitive dependencies on path_provider (and thus path_provider_windows due to manual endorsement). This will no longer be necessary once https://github.com/flutter/flutter/issues/52267 is fixed, since only Windows builds will ever need to have code-level dependency on path_provider_windows. --- .../path_provider_windows/CHANGELOG.md | 6 + .../lib/path_provider_windows.dart | 223 +----------------- .../lib/{ => src}/folders.dart | 0 .../lib/src/path_provider_windows_real.dart | 223 ++++++++++++++++++ .../lib/src/path_provider_windows_stub.dart | 27 +++ .../path_provider_windows/pubspec.yaml | 2 +- 6 files changed, 262 insertions(+), 219 deletions(-) rename packages/path_provider/path_provider_windows/lib/{ => src}/folders.dart (100%) create mode 100644 packages/path_provider/path_provider_windows/lib/src/path_provider_windows_real.dart create mode 100644 packages/path_provider/path_provider_windows/lib/src/path_provider_windows_stub.dart diff --git a/packages/path_provider/path_provider_windows/CHANGELOG.md b/packages/path_provider/path_provider_windows/CHANGELOG.md index 0b7328631f24..a7cfe1dbb283 100644 --- a/packages/path_provider/path_provider_windows/CHANGELOG.md +++ b/packages/path_provider/path_provider_windows/CHANGELOG.md @@ -1,3 +1,9 @@ +## 0.0.4 + +* Move the actual implementation behind a conditional import, exporting + a stub for platforms that don't support FFI. Fixes web builds in + projects with transitive dependencies on path_provider. + ## 0.0.3 * Add missing `pluginClass: none` for compatibilty with stable channel. diff --git a/packages/path_provider/path_provider_windows/lib/path_provider_windows.dart b/packages/path_provider/path_provider_windows/lib/path_provider_windows.dart index e29b70a714d9..ed96698c9589 100644 --- a/packages/path_provider/path_provider_windows/lib/path_provider_windows.dart +++ b/packages/path_provider/path_provider_windows/lib/path_provider_windows.dart @@ -2,221 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'dart:async'; -import 'dart:io'; -import 'dart:ffi'; - -import 'package:ffi/ffi.dart'; -import 'package:meta/meta.dart'; -import 'package:path/path.dart' as path; -import 'package:path_provider_platform_interface/path_provider_platform_interface.dart'; -import 'package:path_provider_windows/folders.dart'; -import 'package:win32/win32.dart'; - -/// Wraps the Win32 VerQueryValue API call. -/// -/// This class exists to allow injecting alternate metadata in tests without -/// building multiple custom test binaries. -@visibleForTesting -class VersionInfoQuerier { - /// Returns the value for [key] in [versionInfo]s English strings section, or - /// null if there is no such entry, or if versionInfo is null. - getStringValue(Pointer versionInfo, key) { - if (versionInfo == null) { - return null; - } - const kEnUsLanguageCode = '040904e4'; - final keyPath = TEXT('\\StringFileInfo\\$kEnUsLanguageCode\\$key'); - final length = allocate(); - final valueAddress = allocate(); - try { - if (VerQueryValue(versionInfo, keyPath, valueAddress, length) == 0) { - return null; - } - return Pointer.fromAddress(valueAddress.value) - .unpackString(length.value); - } finally { - free(keyPath); - free(length); - free(valueAddress); - } - } -} - -/// The Windows implementation of [PathProviderPlatform] -/// -/// This class implements the `package:path_provider` functionality for Windows. -class PathProviderWindows extends PathProviderPlatform { - /// The object to use for performing VerQueryValue calls. - @visibleForTesting - VersionInfoQuerier versionInfoQuerier = VersionInfoQuerier(); - - /// This is typically the same as the TMP environment variable. - @override - Future getTemporaryPath() async { - final buffer = allocate(count: MAX_PATH + 1).cast(); - String path; - - try { - final length = GetTempPath(MAX_PATH, buffer); - - if (length == 0) { - final error = GetLastError(); - throw WindowsException(error); - } else { - path = buffer.unpackString(length); - - // GetTempPath adds a trailing backslash, but SHGetKnownFolderPath does - // not. Strip off trailing backslash for consistency with other methods - // here. - if (path.endsWith('\\')) { - path = path.substring(0, path.length - 1); - } - } - - // Ensure that the directory exists, since GetTempPath doesn't. - final directory = Directory(path); - if (!directory.existsSync()) { - await directory.create(recursive: true); - } - - return Future.value(path); - } finally { - free(buffer); - } - } - - @override - Future getApplicationSupportPath() async { - final appDataRoot = await getPath(WindowsKnownFolder.RoamingAppData); - final directory = Directory( - path.join(appDataRoot, _getApplicationSpecificSubdirectory())); - // Ensure that the directory exists if possible, since it will on other - // platforms. If the name is longer than MAXPATH, creating will fail, so - // skip that step; it's up to the client to decide what to do with the path - // in that case (e.g., using a short path). - if (directory.path.length <= MAX_PATH) { - if (!directory.existsSync()) { - await directory.create(recursive: true); - } - } - return directory.path; - } - - @override - Future getApplicationDocumentsPath() => - getPath(WindowsKnownFolder.Documents); - - @override - Future getDownloadsPath() => getPath(WindowsKnownFolder.Downloads); - - /// Retrieve any known folder from Windows. - /// - /// folderID is a GUID that represents a specific known folder ID, drawn from - /// [WindowsKnownFolder]. - Future getPath(String folderID) { - final pathPtrPtr = allocate(); - Pointer pathPtr; - - try { - GUID knownFolderID = GUID.fromString(folderID); - - final hr = SHGetKnownFolderPath( - knownFolderID.addressOf, KF_FLAG_DEFAULT, NULL, pathPtrPtr); - - if (FAILED(hr)) { - if (hr == E_INVALIDARG || hr == E_FAIL) { - throw WindowsException(hr); - } - } - - pathPtr = Pointer.fromAddress(pathPtrPtr.value); - final path = pathPtr.unpackString(MAX_PATH); - return Future.value(path); - } finally { - CoTaskMemFree(pathPtr.cast()); - free(pathPtrPtr); - } - } - - /// Returns the relative path string to append to the root directory returned - /// by Win32 APIs for application storage (such as RoamingAppDir) to get a - /// directory that is unique to the application. - /// - /// The convention is to use company-name\product-name\. This will use that if - /// possible, using the data in the VERSIONINFO resource, with the following - /// fallbacks: - /// - If the company name isn't there, that component will be dropped. - /// - If the product name isn't there, it will use the exe's filename (without - /// extension). - String _getApplicationSpecificSubdirectory() { - String companyName; - String productName; - - final Pointer moduleNameBuffer = - allocate(count: MAX_PATH + 1).cast(); - final Pointer unused = allocate(); - Pointer infoBuffer; - try { - // Get the module name. - final moduleNameLength = GetModuleFileName(0, moduleNameBuffer, MAX_PATH); - if (moduleNameLength == 0) { - final error = GetLastError(); - throw WindowsException(error); - } - - // From that, load the VERSIONINFO resource - int infoSize = GetFileVersionInfoSize(moduleNameBuffer, unused); - if (infoSize != 0) { - infoBuffer = allocate(count: infoSize); - if (GetFileVersionInfo(moduleNameBuffer, 0, infoSize, infoBuffer) == - 0) { - free(infoBuffer); - infoBuffer = null; - } - } - companyName = _sanitizedDirectoryName( - versionInfoQuerier.getStringValue(infoBuffer, 'CompanyName')); - productName = _sanitizedDirectoryName( - versionInfoQuerier.getStringValue(infoBuffer, 'ProductName')); - - // If there was no product name, use the executable name. - if (productName == null) { - productName = path.basenameWithoutExtension( - moduleNameBuffer.unpackString(moduleNameLength)); - } - - return companyName != null - ? path.join(companyName, productName) - : productName; - } finally { - free(moduleNameBuffer); - free(unused); - if (infoBuffer != null) { - free(infoBuffer); - } - } - } - - /// Makes [rawString] safe as a directory component. See - /// https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions - /// - /// If after sanitizing the string is empty, returns null. - String _sanitizedDirectoryName(String rawString) { - if (rawString == null) { - return null; - } - String sanitized = rawString - // Replace banned characters. - .replaceAll(RegExp(r'[<>:"/\\|?*]'), '_') - // Remove trailing whitespace. - .trimRight() - // Ensure that it does not end with a '.'. - .replaceAll(RegExp(r'[.]+$'), ''); - const kMaxComponentLength = 255; - if (sanitized.length > kMaxComponentLength) { - sanitized = sanitized.substring(0, kMaxComponentLength); - } - return sanitized.isEmpty ? null : sanitized; - } -} +// path_provider_windows is implemented using FFI; export a stub for platforms +// that don't support FFI (e.g., web) to avoid having transitive dependencies +// break web compilation. +export 'src/path_provider_windows_stub.dart' + if (dart.library.ffi) 'src/path_provider_windows_real.dart'; diff --git a/packages/path_provider/path_provider_windows/lib/folders.dart b/packages/path_provider/path_provider_windows/lib/src/folders.dart similarity index 100% rename from packages/path_provider/path_provider_windows/lib/folders.dart rename to packages/path_provider/path_provider_windows/lib/src/folders.dart diff --git a/packages/path_provider/path_provider_windows/lib/src/path_provider_windows_real.dart b/packages/path_provider/path_provider_windows/lib/src/path_provider_windows_real.dart new file mode 100644 index 000000000000..7ff448abf020 --- /dev/null +++ b/packages/path_provider/path_provider_windows/lib/src/path_provider_windows_real.dart @@ -0,0 +1,223 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:async'; +import 'dart:io'; +import 'dart:ffi'; + +import 'package:ffi/ffi.dart'; +import 'package:meta/meta.dart'; +import 'package:path/path.dart' as path; +import 'package:path_provider_platform_interface/path_provider_platform_interface.dart'; +import 'package:win32/win32.dart'; + +import 'folders.dart'; + +/// Wraps the Win32 VerQueryValue API call. +/// +/// This class exists to allow injecting alternate metadata in tests without +/// building multiple custom test binaries. +@visibleForTesting +class VersionInfoQuerier { + /// Returns the value for [key] in [versionInfo]s English strings section, or + /// null if there is no such entry, or if versionInfo is null. + getStringValue(Pointer versionInfo, key) { + if (versionInfo == null) { + return null; + } + const kEnUsLanguageCode = '040904e4'; + final keyPath = TEXT('\\StringFileInfo\\$kEnUsLanguageCode\\$key'); + final length = allocate(); + final valueAddress = allocate(); + try { + if (VerQueryValue(versionInfo, keyPath, valueAddress, length) == 0) { + return null; + } + return Pointer.fromAddress(valueAddress.value) + .unpackString(length.value); + } finally { + free(keyPath); + free(length); + free(valueAddress); + } + } +} + +/// The Windows implementation of [PathProviderPlatform] +/// +/// This class implements the `package:path_provider` functionality for Windows. +class PathProviderWindows extends PathProviderPlatform { + /// The object to use for performing VerQueryValue calls. + @visibleForTesting + VersionInfoQuerier versionInfoQuerier = VersionInfoQuerier(); + + /// This is typically the same as the TMP environment variable. + @override + Future getTemporaryPath() async { + final buffer = allocate(count: MAX_PATH + 1).cast(); + String path; + + try { + final length = GetTempPath(MAX_PATH, buffer); + + if (length == 0) { + final error = GetLastError(); + throw WindowsException(error); + } else { + path = buffer.unpackString(length); + + // GetTempPath adds a trailing backslash, but SHGetKnownFolderPath does + // not. Strip off trailing backslash for consistency with other methods + // here. + if (path.endsWith('\\')) { + path = path.substring(0, path.length - 1); + } + } + + // Ensure that the directory exists, since GetTempPath doesn't. + final directory = Directory(path); + if (!directory.existsSync()) { + await directory.create(recursive: true); + } + + return Future.value(path); + } finally { + free(buffer); + } + } + + @override + Future getApplicationSupportPath() async { + final appDataRoot = await getPath(WindowsKnownFolder.RoamingAppData); + final directory = Directory( + path.join(appDataRoot, _getApplicationSpecificSubdirectory())); + // Ensure that the directory exists if possible, since it will on other + // platforms. If the name is longer than MAXPATH, creating will fail, so + // skip that step; it's up to the client to decide what to do with the path + // in that case (e.g., using a short path). + if (directory.path.length <= MAX_PATH) { + if (!directory.existsSync()) { + await directory.create(recursive: true); + } + } + return directory.path; + } + + @override + Future getApplicationDocumentsPath() => + getPath(WindowsKnownFolder.Documents); + + @override + Future getDownloadsPath() => getPath(WindowsKnownFolder.Downloads); + + /// Retrieve any known folder from Windows. + /// + /// folderID is a GUID that represents a specific known folder ID, drawn from + /// [WindowsKnownFolder]. + Future getPath(String folderID) { + final pathPtrPtr = allocate(); + Pointer pathPtr; + + try { + GUID knownFolderID = GUID.fromString(folderID); + + final hr = SHGetKnownFolderPath( + knownFolderID.addressOf, KF_FLAG_DEFAULT, NULL, pathPtrPtr); + + if (FAILED(hr)) { + if (hr == E_INVALIDARG || hr == E_FAIL) { + throw WindowsException(hr); + } + } + + pathPtr = Pointer.fromAddress(pathPtrPtr.value); + final path = pathPtr.unpackString(MAX_PATH); + return Future.value(path); + } finally { + CoTaskMemFree(pathPtr.cast()); + free(pathPtrPtr); + } + } + + /// Returns the relative path string to append to the root directory returned + /// by Win32 APIs for application storage (such as RoamingAppDir) to get a + /// directory that is unique to the application. + /// + /// The convention is to use company-name\product-name\. This will use that if + /// possible, using the data in the VERSIONINFO resource, with the following + /// fallbacks: + /// - If the company name isn't there, that component will be dropped. + /// - If the product name isn't there, it will use the exe's filename (without + /// extension). + String _getApplicationSpecificSubdirectory() { + String companyName; + String productName; + + final Pointer moduleNameBuffer = + allocate(count: MAX_PATH + 1).cast(); + final Pointer unused = allocate(); + Pointer infoBuffer; + try { + // Get the module name. + final moduleNameLength = GetModuleFileName(0, moduleNameBuffer, MAX_PATH); + if (moduleNameLength == 0) { + final error = GetLastError(); + throw WindowsException(error); + } + + // From that, load the VERSIONINFO resource + int infoSize = GetFileVersionInfoSize(moduleNameBuffer, unused); + if (infoSize != 0) { + infoBuffer = allocate(count: infoSize); + if (GetFileVersionInfo(moduleNameBuffer, 0, infoSize, infoBuffer) == + 0) { + free(infoBuffer); + infoBuffer = null; + } + } + companyName = _sanitizedDirectoryName( + versionInfoQuerier.getStringValue(infoBuffer, 'CompanyName')); + productName = _sanitizedDirectoryName( + versionInfoQuerier.getStringValue(infoBuffer, 'ProductName')); + + // If there was no product name, use the executable name. + if (productName == null) { + productName = path.basenameWithoutExtension( + moduleNameBuffer.unpackString(moduleNameLength)); + } + + return companyName != null + ? path.join(companyName, productName) + : productName; + } finally { + free(moduleNameBuffer); + free(unused); + if (infoBuffer != null) { + free(infoBuffer); + } + } + } + + /// Makes [rawString] safe as a directory component. See + /// https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions + /// + /// If after sanitizing the string is empty, returns null. + String _sanitizedDirectoryName(String rawString) { + if (rawString == null) { + return null; + } + String sanitized = rawString + // Replace banned characters. + .replaceAll(RegExp(r'[<>:"/\\|?*]'), '_') + // Remove trailing whitespace. + .trimRight() + // Ensure that it does not end with a '.'. + .replaceAll(RegExp(r'[.]+$'), ''); + const kMaxComponentLength = 255; + if (sanitized.length > kMaxComponentLength) { + sanitized = sanitized.substring(0, kMaxComponentLength); + } + return sanitized.isEmpty ? null : sanitized; + } +} diff --git a/packages/path_provider/path_provider_windows/lib/src/path_provider_windows_stub.dart b/packages/path_provider/path_provider_windows/lib/src/path_provider_windows_stub.dart new file mode 100644 index 000000000000..fedb53735fb1 --- /dev/null +++ b/packages/path_provider/path_provider_windows/lib/src/path_provider_windows_stub.dart @@ -0,0 +1,27 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:path_provider_platform_interface/path_provider_platform_interface.dart'; + +/// A stub implementation to satisfy compilation of multi-platform packages that +/// depend on path_provider_windows. This should never actually be created. +/// +/// Notably, because path_provider needs to manually register +/// path_provider_windows, anything with a transitive dependency on +/// path_provider will also depend on path_provider_windows, not just at the +/// pubspec level but the code level. +class PathProviderWindows extends PathProviderPlatform { + /// Errors on attempted instantiation of the stub. It exists only to satisfy + /// compile-time dependencies, and should never actually be created. + PathProviderWindows() { + assert(false); + } + + /// Stub; see comment on VersionInfoQuerier. + VersionInfoQuerier versionInfoQuerier; +} + +/// Stub to satisfy the analyzer, which doesn't seem to handle conditional +/// exports correctly. +class VersionInfoQuerier {} diff --git a/packages/path_provider/path_provider_windows/pubspec.yaml b/packages/path_provider/path_provider_windows/pubspec.yaml index 998f4e2c616b..38f6316abef8 100644 --- a/packages/path_provider/path_provider_windows/pubspec.yaml +++ b/packages/path_provider/path_provider_windows/pubspec.yaml @@ -1,7 +1,7 @@ name: path_provider_windows description: Windows implementation of the path_provider plugin homepage: https://github.com/flutter/plugins/tree/master/packages/path_provider/path_provider_windows -version: 0.0.3 +version: 0.0.4 flutter: plugin: From 0d7a605df7f5319a81a193b52ec68d482ae78907 Mon Sep 17 00:00:00 2001 From: Maurice Parrish Date: Mon, 21 Sep 2020 13:54:29 -0700 Subject: [PATCH 109/233] [webview_flutter] Add new entrypoint that uses hybrid composition on Android (#2883) --- packages/webview_flutter/CHANGELOG.md | 24 ++++++ .../webview_flutter/example/lib/main.dart | 7 ++ .../test_driver/webview_flutter_e2e.dart | 78 +++++++++++++++++++ .../webview_flutter/lib/webview_flutter.dart | 67 +++++++++++++++- packages/webview_flutter/pubspec.yaml | 2 +- 5 files changed, 174 insertions(+), 4 deletions(-) diff --git a/packages/webview_flutter/CHANGELOG.md b/packages/webview_flutter/CHANGELOG.md index e1f4c3c2d1c8..2b5bb7e45152 100644 --- a/packages/webview_flutter/CHANGELOG.md +++ b/packages/webview_flutter/CHANGELOG.md @@ -1,3 +1,27 @@ +## 0.3.24 + +* Add support for building `WebView` widget with Android hybrid views. To use this feature, set + `WebView.platform` to an instance of `SurfaceAndroidWebView`. For example: + +```dart +import 'dart:io'; + +class WebViewExample extends StatefulWidget { + @override + void initState() { + super.initState(); + if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView(); + } + + @override + Widget build(BuildContext context) { + return WebView( + initialUrl: 'https://flutter.dev', + ); + } +} +``` + ## 0.3.23 * Handle WebView multi-window support. diff --git a/packages/webview_flutter/example/lib/main.dart b/packages/webview_flutter/example/lib/main.dart index 59c87a25dedf..ff25e8a16c9b 100644 --- a/packages/webview_flutter/example/lib/main.dart +++ b/packages/webview_flutter/example/lib/main.dart @@ -6,6 +6,7 @@ import 'dart:async'; import 'dart:convert'; +import 'dart:io'; import 'package:flutter/material.dart'; import 'package:webview_flutter/webview_flutter.dart'; @@ -35,6 +36,12 @@ class _WebViewExampleState extends State { final Completer _controller = Completer(); + @override + void initState() { + super.initState(); + if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView(); + } + @override Widget build(BuildContext context) { return Scaffold( diff --git a/packages/webview_flutter/example/test_driver/webview_flutter_e2e.dart b/packages/webview_flutter/example/test_driver/webview_flutter_e2e.dart index 53fc991c48f2..2a17c53a4c3f 100644 --- a/packages/webview_flutter/example/test_driver/webview_flutter_e2e.dart +++ b/packages/webview_flutter/example/test_driver/webview_flutter_e2e.dart @@ -608,6 +608,84 @@ void main() { }); }); + group('$SurfaceAndroidWebView', () { + setUpAll(() { + WebView.platform = SurfaceAndroidWebView(); + }); + + tearDownAll(() { + WebView.platform = null; + }); + + testWidgets('setAndGetScrollPosition', (WidgetTester tester) async { + final String scrollTestPage = ''' + + + + + + +

+ + + '''; + + final String scrollTestPageBase64 = + base64Encode(const Utf8Encoder().convert(scrollTestPage)); + + final Completer pageLoaded = Completer(); + final Completer controllerCompleter = + Completer(); + + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: WebView( + initialUrl: + 'data:text/html;charset=utf-8;base64,$scrollTestPageBase64', + onWebViewCreated: (WebViewController controller) { + controllerCompleter.complete(controller); + }, + onPageFinished: (String url) { + pageLoaded.complete(null); + }, + ), + ), + ); + + final WebViewController controller = await controllerCompleter.future; + await pageLoaded.future; + + await tester.pumpAndSettle(Duration(seconds: 3)); + + // Check scrollTo() + const int X_SCROLL = 123; + const int Y_SCROLL = 321; + + await controller.scrollTo(X_SCROLL, Y_SCROLL); + int scrollPosX = await controller.getScrollX(); + int scrollPosY = await controller.getScrollY(); + expect(X_SCROLL, scrollPosX); + expect(Y_SCROLL, scrollPosY); + + // Check scrollBy() (on top of scrollTo()) + await controller.scrollBy(X_SCROLL, Y_SCROLL); + scrollPosX = await controller.getScrollX(); + scrollPosY = await controller.getScrollY(); + expect(X_SCROLL * 2, scrollPosX); + expect(Y_SCROLL * 2, scrollPosY); + }); + }, skip: !Platform.isAndroid); + group('NavigationDelegate', () { final String blankPage = ""; final String blankPageEncoded = 'data:text/html;charset=utf-8;base64,' + diff --git a/packages/webview_flutter/lib/webview_flutter.dart b/packages/webview_flutter/lib/webview_flutter.dart index 2635b0446fa2..5e2bffd6539d 100644 --- a/packages/webview_flutter/lib/webview_flutter.dart +++ b/packages/webview_flutter/lib/webview_flutter.dart @@ -6,11 +6,14 @@ import 'dart:async'; import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; +import 'package:flutter/rendering.dart'; +import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'platform_interface.dart'; import 'src/webview_android.dart'; import 'src/webview_cupertino.dart'; +import 'src/webview_method_channel.dart'; /// Optional callback invoked when a web view is first created. [controller] is /// the [WebViewController] for the created web view. @@ -64,6 +67,66 @@ enum NavigationDecision { navigate, } +/// Android [WebViewPlatform] that uses [AndroidViewSurface] to build the [WebView] widget. +/// +/// To use this, set [WebView.platform] to an instance of this class. +/// +/// This implementation uses hybrid composition to render the [WebView] on +/// Android. It solves multiple issues related to accessibility and interaction +/// with the [WebView] at the cost of some performance on Android versions below +/// 10. See https://github.com/flutter/flutter/wiki/Hybrid-Composition for more +/// information. +class SurfaceAndroidWebView extends AndroidWebView { + @override + Widget build({ + BuildContext context, + CreationParams creationParams, + WebViewPlatformCreatedCallback onWebViewPlatformCreated, + Set> gestureRecognizers, + @required WebViewPlatformCallbacksHandler webViewPlatformCallbacksHandler, + }) { + assert(webViewPlatformCallbacksHandler != null); + return PlatformViewLink( + viewType: 'plugins.flutter.io/webview', + surfaceFactory: ( + BuildContext context, + PlatformViewController controller, + ) { + return AndroidViewSurface( + controller: controller, + gestureRecognizers: gestureRecognizers ?? + const >{}, + hitTestBehavior: PlatformViewHitTestBehavior.opaque, + ); + }, + onCreatePlatformView: (PlatformViewCreationParams params) { + return PlatformViewsService.initSurfaceAndroidView( + id: params.id, + viewType: 'plugins.flutter.io/webview', + // WebView content is not affected by the Android view's layout direction, + // we explicitly set it here so that the widget doesn't require an ambient + // directionality. + layoutDirection: TextDirection.rtl, + creationParams: MethodChannelWebViewPlatform.creationParamsToMap( + creationParams, + ), + creationParamsCodec: const StandardMessageCodec(), + ) + ..addOnPlatformViewCreatedListener(params.onPlatformViewCreated) + ..addOnPlatformViewCreatedListener((int id) { + if (onWebViewPlatformCreated == null) { + return; + } + onWebViewPlatformCreated( + MethodChannelWebViewPlatform(id, webViewPlatformCallbacksHandler), + ); + }) + ..create(); + }, + ); + } +} + /// Decides how to handle a specific navigation request. /// /// The returned [NavigationDecision] determines how the navigation described by @@ -445,9 +508,7 @@ WebSettings _clearUnchangedWebSettings( Set _extractChannelNames(Set channels) { final Set channelNames = channels == null - // TODO(iskakaushik): Remove this when collection literals makes it to stable. - // ignore: prefer_collection_literals - ? Set() + ? {} : channels.map((JavascriptChannel channel) => channel.name).toSet(); return channelNames; } diff --git a/packages/webview_flutter/pubspec.yaml b/packages/webview_flutter/pubspec.yaml index 8a4a62ea76a6..2212ef6c4059 100644 --- a/packages/webview_flutter/pubspec.yaml +++ b/packages/webview_flutter/pubspec.yaml @@ -1,6 +1,6 @@ name: webview_flutter description: A Flutter plugin that provides a WebView widget on Android and iOS. -version: 0.3.23 +version: 0.3.24 homepage: https://github.com/flutter/plugins/tree/master/packages/webview_flutter environment: From fdbae3faf8318f9da18769080a0a2ee99c73d99c Mon Sep 17 00:00:00 2001 From: Maurice Parrish Date: Mon, 21 Sep 2020 14:01:14 -0700 Subject: [PATCH 110/233] Revert "[webview_flutter] Add new entrypoint that uses hybrid composition on Android (#2883)" (#3066) This reverts commit 0d7a605df7f5319a81a193b52ec68d482ae78907. --- packages/webview_flutter/CHANGELOG.md | 24 ------ .../webview_flutter/example/lib/main.dart | 7 -- .../test_driver/webview_flutter_e2e.dart | 78 ------------------- .../webview_flutter/lib/webview_flutter.dart | 67 +--------------- packages/webview_flutter/pubspec.yaml | 2 +- 5 files changed, 4 insertions(+), 174 deletions(-) diff --git a/packages/webview_flutter/CHANGELOG.md b/packages/webview_flutter/CHANGELOG.md index 2b5bb7e45152..e1f4c3c2d1c8 100644 --- a/packages/webview_flutter/CHANGELOG.md +++ b/packages/webview_flutter/CHANGELOG.md @@ -1,27 +1,3 @@ -## 0.3.24 - -* Add support for building `WebView` widget with Android hybrid views. To use this feature, set - `WebView.platform` to an instance of `SurfaceAndroidWebView`. For example: - -```dart -import 'dart:io'; - -class WebViewExample extends StatefulWidget { - @override - void initState() { - super.initState(); - if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView(); - } - - @override - Widget build(BuildContext context) { - return WebView( - initialUrl: 'https://flutter.dev', - ); - } -} -``` - ## 0.3.23 * Handle WebView multi-window support. diff --git a/packages/webview_flutter/example/lib/main.dart b/packages/webview_flutter/example/lib/main.dart index ff25e8a16c9b..59c87a25dedf 100644 --- a/packages/webview_flutter/example/lib/main.dart +++ b/packages/webview_flutter/example/lib/main.dart @@ -6,7 +6,6 @@ import 'dart:async'; import 'dart:convert'; -import 'dart:io'; import 'package:flutter/material.dart'; import 'package:webview_flutter/webview_flutter.dart'; @@ -36,12 +35,6 @@ class _WebViewExampleState extends State { final Completer _controller = Completer(); - @override - void initState() { - super.initState(); - if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView(); - } - @override Widget build(BuildContext context) { return Scaffold( diff --git a/packages/webview_flutter/example/test_driver/webview_flutter_e2e.dart b/packages/webview_flutter/example/test_driver/webview_flutter_e2e.dart index 2a17c53a4c3f..53fc991c48f2 100644 --- a/packages/webview_flutter/example/test_driver/webview_flutter_e2e.dart +++ b/packages/webview_flutter/example/test_driver/webview_flutter_e2e.dart @@ -608,84 +608,6 @@ void main() { }); }); - group('$SurfaceAndroidWebView', () { - setUpAll(() { - WebView.platform = SurfaceAndroidWebView(); - }); - - tearDownAll(() { - WebView.platform = null; - }); - - testWidgets('setAndGetScrollPosition', (WidgetTester tester) async { - final String scrollTestPage = ''' - - - - - - -
- - - '''; - - final String scrollTestPageBase64 = - base64Encode(const Utf8Encoder().convert(scrollTestPage)); - - final Completer pageLoaded = Completer(); - final Completer controllerCompleter = - Completer(); - - await tester.pumpWidget( - Directionality( - textDirection: TextDirection.ltr, - child: WebView( - initialUrl: - 'data:text/html;charset=utf-8;base64,$scrollTestPageBase64', - onWebViewCreated: (WebViewController controller) { - controllerCompleter.complete(controller); - }, - onPageFinished: (String url) { - pageLoaded.complete(null); - }, - ), - ), - ); - - final WebViewController controller = await controllerCompleter.future; - await pageLoaded.future; - - await tester.pumpAndSettle(Duration(seconds: 3)); - - // Check scrollTo() - const int X_SCROLL = 123; - const int Y_SCROLL = 321; - - await controller.scrollTo(X_SCROLL, Y_SCROLL); - int scrollPosX = await controller.getScrollX(); - int scrollPosY = await controller.getScrollY(); - expect(X_SCROLL, scrollPosX); - expect(Y_SCROLL, scrollPosY); - - // Check scrollBy() (on top of scrollTo()) - await controller.scrollBy(X_SCROLL, Y_SCROLL); - scrollPosX = await controller.getScrollX(); - scrollPosY = await controller.getScrollY(); - expect(X_SCROLL * 2, scrollPosX); - expect(Y_SCROLL * 2, scrollPosY); - }); - }, skip: !Platform.isAndroid); - group('NavigationDelegate', () { final String blankPage = ""; final String blankPageEncoded = 'data:text/html;charset=utf-8;base64,' + diff --git a/packages/webview_flutter/lib/webview_flutter.dart b/packages/webview_flutter/lib/webview_flutter.dart index 5e2bffd6539d..2635b0446fa2 100644 --- a/packages/webview_flutter/lib/webview_flutter.dart +++ b/packages/webview_flutter/lib/webview_flutter.dart @@ -6,14 +6,11 @@ import 'dart:async'; import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; -import 'package:flutter/rendering.dart'; -import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'platform_interface.dart'; import 'src/webview_android.dart'; import 'src/webview_cupertino.dart'; -import 'src/webview_method_channel.dart'; /// Optional callback invoked when a web view is first created. [controller] is /// the [WebViewController] for the created web view. @@ -67,66 +64,6 @@ enum NavigationDecision { navigate, } -/// Android [WebViewPlatform] that uses [AndroidViewSurface] to build the [WebView] widget. -/// -/// To use this, set [WebView.platform] to an instance of this class. -/// -/// This implementation uses hybrid composition to render the [WebView] on -/// Android. It solves multiple issues related to accessibility and interaction -/// with the [WebView] at the cost of some performance on Android versions below -/// 10. See https://github.com/flutter/flutter/wiki/Hybrid-Composition for more -/// information. -class SurfaceAndroidWebView extends AndroidWebView { - @override - Widget build({ - BuildContext context, - CreationParams creationParams, - WebViewPlatformCreatedCallback onWebViewPlatformCreated, - Set> gestureRecognizers, - @required WebViewPlatformCallbacksHandler webViewPlatformCallbacksHandler, - }) { - assert(webViewPlatformCallbacksHandler != null); - return PlatformViewLink( - viewType: 'plugins.flutter.io/webview', - surfaceFactory: ( - BuildContext context, - PlatformViewController controller, - ) { - return AndroidViewSurface( - controller: controller, - gestureRecognizers: gestureRecognizers ?? - const >{}, - hitTestBehavior: PlatformViewHitTestBehavior.opaque, - ); - }, - onCreatePlatformView: (PlatformViewCreationParams params) { - return PlatformViewsService.initSurfaceAndroidView( - id: params.id, - viewType: 'plugins.flutter.io/webview', - // WebView content is not affected by the Android view's layout direction, - // we explicitly set it here so that the widget doesn't require an ambient - // directionality. - layoutDirection: TextDirection.rtl, - creationParams: MethodChannelWebViewPlatform.creationParamsToMap( - creationParams, - ), - creationParamsCodec: const StandardMessageCodec(), - ) - ..addOnPlatformViewCreatedListener(params.onPlatformViewCreated) - ..addOnPlatformViewCreatedListener((int id) { - if (onWebViewPlatformCreated == null) { - return; - } - onWebViewPlatformCreated( - MethodChannelWebViewPlatform(id, webViewPlatformCallbacksHandler), - ); - }) - ..create(); - }, - ); - } -} - /// Decides how to handle a specific navigation request. /// /// The returned [NavigationDecision] determines how the navigation described by @@ -508,7 +445,9 @@ WebSettings _clearUnchangedWebSettings( Set _extractChannelNames(Set channels) { final Set channelNames = channels == null - ? {} + // TODO(iskakaushik): Remove this when collection literals makes it to stable. + // ignore: prefer_collection_literals + ? Set() : channels.map((JavascriptChannel channel) => channel.name).toSet(); return channelNames; } diff --git a/packages/webview_flutter/pubspec.yaml b/packages/webview_flutter/pubspec.yaml index 2212ef6c4059..8a4a62ea76a6 100644 --- a/packages/webview_flutter/pubspec.yaml +++ b/packages/webview_flutter/pubspec.yaml @@ -1,6 +1,6 @@ name: webview_flutter description: A Flutter plugin that provides a WebView widget on Android and iOS. -version: 0.3.24 +version: 0.3.23 homepage: https://github.com/flutter/plugins/tree/master/packages/webview_flutter environment: From 861eae99b1a76e93e4b7008d135ee144b95f1ecc Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Mon, 21 Sep 2020 21:26:28 -0400 Subject: [PATCH 111/233] [path_provider_windows] Add missing method to fake (#3068) The fake didn't have getFolder, so if a test of something using path_provider_windows (such as shared_preferences_windows) had a fake that overrode getFolder, the analyzer would complain about overriding a non-existent method. This adds it to avoid that analyzer warning. It also fixes a minor issue introduced in the previous change, where folder.dart was accidentally made internal rather than public. --- packages/path_provider/path_provider_windows/CHANGELOG.md | 7 +++++++ .../path_provider_windows/lib/path_provider_windows.dart | 1 + .../path_provider_windows/lib/src/folders_stub.dart | 6 ++++++ .../lib/src/path_provider_windows_stub.dart | 4 ++++ packages/path_provider/path_provider_windows/pubspec.yaml | 2 +- 5 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 packages/path_provider/path_provider_windows/lib/src/folders_stub.dart diff --git a/packages/path_provider/path_provider_windows/CHANGELOG.md b/packages/path_provider/path_provider_windows/CHANGELOG.md index a7cfe1dbb283..b7bc07e82bc7 100644 --- a/packages/path_provider/path_provider_windows/CHANGELOG.md +++ b/packages/path_provider/path_provider_windows/CHANGELOG.md @@ -1,3 +1,10 @@ +## 0.0.4+1 + +* Add getPath to the stub, so that the analyzer won't complain about + fakes that override it. +* export 'folders.dart' rather than importing it, since it's intended to be + public. + ## 0.0.4 * Move the actual implementation behind a conditional import, exporting diff --git a/packages/path_provider/path_provider_windows/lib/path_provider_windows.dart b/packages/path_provider/path_provider_windows/lib/path_provider_windows.dart index ed96698c9589..b7aeb7a6d5f6 100644 --- a/packages/path_provider/path_provider_windows/lib/path_provider_windows.dart +++ b/packages/path_provider/path_provider_windows/lib/path_provider_windows.dart @@ -5,5 +5,6 @@ // path_provider_windows is implemented using FFI; export a stub for platforms // that don't support FFI (e.g., web) to avoid having transitive dependencies // break web compilation. +export 'src/folders_stub.dart' if (dart.library.ffi) 'src/folders.dart'; export 'src/path_provider_windows_stub.dart' if (dart.library.ffi) 'src/path_provider_windows_real.dart'; diff --git a/packages/path_provider/path_provider_windows/lib/src/folders_stub.dart b/packages/path_provider/path_provider_windows/lib/src/folders_stub.dart new file mode 100644 index 000000000000..d19103602cdc --- /dev/null +++ b/packages/path_provider/path_provider_windows/lib/src/folders_stub.dart @@ -0,0 +1,6 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/// Stub version of the actual class. +class WindowsKnownFolder {} diff --git a/packages/path_provider/path_provider_windows/lib/src/path_provider_windows_stub.dart b/packages/path_provider/path_provider_windows/lib/src/path_provider_windows_stub.dart index fedb53735fb1..11a946542f26 100644 --- a/packages/path_provider/path_provider_windows/lib/src/path_provider_windows_stub.dart +++ b/packages/path_provider/path_provider_windows/lib/src/path_provider_windows_stub.dart @@ -20,6 +20,10 @@ class PathProviderWindows extends PathProviderPlatform { /// Stub; see comment on VersionInfoQuerier. VersionInfoQuerier versionInfoQuerier; + + /// Match PathProviderWindows so that the analyzer won't report invalid + /// overrides if tests provide fake PathProviderWindows implementations. + Future getPath(String folderID) async => ''; } /// Stub to satisfy the analyzer, which doesn't seem to handle conditional diff --git a/packages/path_provider/path_provider_windows/pubspec.yaml b/packages/path_provider/path_provider_windows/pubspec.yaml index 38f6316abef8..a04366cf0962 100644 --- a/packages/path_provider/path_provider_windows/pubspec.yaml +++ b/packages/path_provider/path_provider_windows/pubspec.yaml @@ -1,7 +1,7 @@ name: path_provider_windows description: Windows implementation of the path_provider plugin homepage: https://github.com/flutter/plugins/tree/master/packages/path_provider/path_provider_windows -version: 0.0.4 +version: 0.0.4+1 flutter: plugin: From eb4af2e90b74f79b46ba20b21865e36bd7ba717e Mon Sep 17 00:00:00 2001 From: Jia Hao Date: Tue, 22 Sep 2020 14:20:18 +0800 Subject: [PATCH 112/233] [integration_test] Test drivers should end with `_test.dart` (#3063) This makes globbing by tooling easier. Also fix the documentation for running them natively with the Android and iOS tool. --- .cirrus.yml | 2 +- packages/integration_test/README.md | 23 +++++++++++-------- packages/integration_test/example/README.md | 4 ++-- ...er.dart => extended_integration_test.dart} | 0 .../failure.dart} | 6 +++++ ..._failure_driver.dart => failure_test.dart} | 3 +++ ...test_driver.dart => integration_test.dart} | 0 7 files changed, 25 insertions(+), 13 deletions(-) rename packages/integration_test/example/test_driver/{integration_test_extended_driver.dart => extended_integration_test.dart} (100%) rename packages/integration_test/example/{integration_test/failure_test.dart => test_driver/failure.dart} (77%) rename packages/integration_test/example/test_driver/{integration_test_failure_driver.dart => failure_test.dart} (77%) rename packages/integration_test/example/test_driver/{integration_test_driver.dart => integration_test.dart} (100%) diff --git a/.cirrus.yml b/.cirrus.yml index 25396ea3faf4..872cfc2316fa 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -59,7 +59,7 @@ task: - ./chromedriver/chromedriver --port=4444 & test_script: - cd $INTEGRATION_TEST_PATH/example/ - - flutter drive -v --driver=test_driver/integration_test_driver.dart --target=integration_test/example_test.dart -d web-server --release --browser-name=chrome + - flutter drive -v --driver=test_driver/integration_test.dart --target=integration_test/example_test.dart -d web-server --release --browser-name=chrome - name: build-apks+java-test+firebase-test-lab env: matrix: diff --git a/packages/integration_test/README.md b/packages/integration_test/README.md index a6b1726475e2..be08a722bc75 100644 --- a/packages/integration_test/README.md +++ b/packages/integration_test/README.md @@ -30,8 +30,8 @@ void main() { ### Driver Entrypoint An accompanying driver script will be needed that can be shared across all -integration tests. Create a `integration_test_driver.dart` in the `test_driver/` -directory with the following contents: +integration tests. Create a file named `integration_test.dart` in the +`test_driver/` directory with the following contents: ```dart import 'package:integration_test/integration_test_driver.dart'; @@ -57,7 +57,7 @@ integration_test/ test/ # Other unit tests go here. test_driver/ - integration_test_driver.dart + integration_test.dart ``` [Example](https://github.com/flutter/plugins/tree/master/packages/integration_test/example) @@ -67,11 +67,11 @@ test_driver/ These tests can be launched with the `flutter drive` command. To run the `integration_test/foo_test.dart` test with the -`test_driver/integration_test_driver.dart` driver, use the following command: +`test_driver/integration_test.dart` driver, use the following command: ```sh flutter drive \ - --driver=test_driver/integration_test_driver.dart \ + --driver=test_driver/integration_test.dart \ --target=integration_test/foo_test.dart ``` @@ -85,7 +85,7 @@ Use following command to execute the tests: ```sh flutter drive \ - --driver=test_driver/integration_test_driver.dart \ + --driver=test_driver/integration_test.dart \ --target=integration_test/foo_test.dart \ -d web-server ``` @@ -134,10 +134,11 @@ dependencies { } ``` -To run a test on a local Android device (emulated or physical): +To run `integration_test/foo_test.dart` on a local Android device (emulated or +physical): ```sh -./gradlew app:connectedAndroidTest -Ptarget=`pwd`/../test_driver/_integration_test.dart +./gradlew app:connectedAndroidTest -Ptarget=`pwd`/../integration_test/foo_test.dart ``` ## Firebase Test Lab @@ -189,10 +190,12 @@ target 'Runner' do end ``` -To run a test on your iOS device (simulator or real), rebuild your iOS targets with Flutter tool. +To run `integration_test/foo_test.dart` on your iOS device, rebuild your iOS +targets with Flutter tool. ```sh -flutter build ios -t test_driver/_integration_test.dart (--simulator) +# Pass --simulator if building for the simulator. +flutter build ios integration_test/foo_test.dart ``` Open Xcode project (by default, it's `ios/Runner.xcodeproj`). Create a test target diff --git a/packages/integration_test/example/README.md b/packages/integration_test/example/README.md index 7e6317fcf96f..b5cc5d77e46f 100644 --- a/packages/integration_test/example/README.md +++ b/packages/integration_test/example/README.md @@ -8,7 +8,7 @@ Android / iOS: ```sh flutter drive \ - --driver=test_driver/integration_test_driver.dart \ + --driver=test_driver/integration_test.dart \ --target=integration_test/example_test.dart ``` @@ -16,7 +16,7 @@ Web: ```sh flutter drive \ - --driver=test_driver/integration_test_driver.dart \ + --driver=test_driver/integration_test.dart \ --target=integration_test/example_test.dart \ -d web-server ``` diff --git a/packages/integration_test/example/test_driver/integration_test_extended_driver.dart b/packages/integration_test/example/test_driver/extended_integration_test.dart similarity index 100% rename from packages/integration_test/example/test_driver/integration_test_extended_driver.dart rename to packages/integration_test/example/test_driver/extended_integration_test.dart diff --git a/packages/integration_test/example/integration_test/failure_test.dart b/packages/integration_test/example/test_driver/failure.dart similarity index 77% rename from packages/integration_test/example/integration_test/failure_test.dart rename to packages/integration_test/example/test_driver/failure.dart index ffb569f75fbb..02fc55e94a53 100644 --- a/packages/integration_test/example/integration_test/failure_test.dart +++ b/packages/integration_test/example/test_driver/failure.dart @@ -8,6 +8,12 @@ import 'package:integration_test/integration_test.dart'; import 'package:integration_test_example/main.dart' as app; +/// This file is placed in `test_driver/` instead of `integration_test/`, so +/// that the CI tooling of flutter/plugins only uses this together with +/// `failure_test.dart` as the driver. It is only used for testing of +/// `package:integration_test` – do not follow the conventions here if you are a +/// user of `package:integration_test`. + // Tests the failure behavior of the IntegrationTestWidgetsFlutterBinding // // This test fails intentionally! It should be run using a test runner that diff --git a/packages/integration_test/example/test_driver/integration_test_failure_driver.dart b/packages/integration_test/example/test_driver/failure_test.dart similarity index 77% rename from packages/integration_test/example/test_driver/integration_test_failure_driver.dart rename to packages/integration_test/example/test_driver/failure_test.dart index 0b60e471d711..fce6adc42c92 100644 --- a/packages/integration_test/example/test_driver/integration_test_failure_driver.dart +++ b/packages/integration_test/example/test_driver/failure_test.dart @@ -2,6 +2,9 @@ import 'package:flutter_driver/flutter_driver.dart'; import 'package:integration_test/common.dart' as common; import 'package:test/test.dart'; +/// This file is only used for testing of `package:integration_test` – do not +/// follow the conventions here if you are a user of `package:integration_test`. + Future main() async { test('fails gracefully', () async { final FlutterDriver driver = await FlutterDriver.connect(); diff --git a/packages/integration_test/example/test_driver/integration_test_driver.dart b/packages/integration_test/example/test_driver/integration_test.dart similarity index 100% rename from packages/integration_test/example/test_driver/integration_test_driver.dart rename to packages/integration_test/example/test_driver/integration_test.dart From 85abce5f30bdebc5e4ae6ce48029e96f24a5e149 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Tue, 22 Sep 2020 06:23:05 -0400 Subject: [PATCH 113/233] [path_provider] Update endorsed Windows version (#3065) path_provider_windows 0.0.2 causes issues both for web projects and for projects built with Flutter 1.17 or earlier. This requires 0.0.4+ to ensure fixes for both issues are included. --- packages/path_provider/path_provider/CHANGELOG.md | 5 +++++ packages/path_provider/path_provider/pubspec.yaml | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/path_provider/path_provider/CHANGELOG.md b/packages/path_provider/path_provider/CHANGELOG.md index 62cc4d777dd9..abcb0f2d051c 100644 --- a/packages/path_provider/path_provider/CHANGELOG.md +++ b/packages/path_provider/path_provider/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.6.17 + +* Update Windows endorsement verison again, to pick up the fix for + web compilation in projects that include path_provider. + ## 1.6.16 * Update Windows endorsement verison diff --git a/packages/path_provider/path_provider/pubspec.yaml b/packages/path_provider/path_provider/pubspec.yaml index 4f574e9bebc9..ada80e10931b 100644 --- a/packages/path_provider/path_provider/pubspec.yaml +++ b/packages/path_provider/path_provider/pubspec.yaml @@ -1,7 +1,7 @@ name: path_provider description: Flutter plugin for getting commonly used locations on host platform file systems, such as the temp and app data directories. homepage: https://github.com/flutter/plugins/tree/master/packages/path_provider/path_provider -version: 1.6.16 +version: 1.6.17 flutter: plugin: @@ -24,7 +24,7 @@ dependencies: path_provider_platform_interface: ^1.0.1 path_provider_macos: ^0.0.4 path_provider_linux: ^0.0.1 - path_provider_windows: ^0.0.2 + path_provider_windows: ^0.0.4 dev_dependencies: integration_test: From fce1eeee4ac3c97e3e1983a0ef1d08372088cbfc Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Tue, 22 Sep 2020 06:27:53 -0400 Subject: [PATCH 114/233] [shared_preferences] Endorse Windows (#3059) Adds endorsement, and manual registration, of shared_preferences_windows. Fixes flutter/flutter#41719 --- .../shared_preferences/shared_preferences/CHANGELOG.md | 4 ++++ .../shared_preferences/lib/shared_preferences.dart | 8 ++++++-- .../shared_preferences/shared_preferences/pubspec.yaml | 3 ++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/shared_preferences/shared_preferences/CHANGELOG.md b/packages/shared_preferences/shared_preferences/CHANGELOG.md index 3f4edca10dc2..5a6a030a35ee 100644 --- a/packages/shared_preferences/shared_preferences/CHANGELOG.md +++ b/packages/shared_preferences/shared_preferences/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.5.11 + +* Support Windows by default. + ## 0.5.10 * Update package:e2e -> package:integration_test diff --git a/packages/shared_preferences/shared_preferences/lib/shared_preferences.dart b/packages/shared_preferences/shared_preferences/lib/shared_preferences.dart index b8d3452a0a0e..c4c8710769df 100644 --- a/packages/shared_preferences/shared_preferences/lib/shared_preferences.dart +++ b/packages/shared_preferences/shared_preferences/lib/shared_preferences.dart @@ -11,6 +11,7 @@ import 'package:meta/meta.dart'; import 'package:shared_preferences_linux/shared_preferences_linux.dart'; import 'package:shared_preferences_platform_interface/shared_preferences_platform_interface.dart'; import 'package:shared_preferences_platform_interface/method_channel_shared_preferences.dart'; +import 'package:shared_preferences_windows/shared_preferences_windows.dart'; /// Wraps NSUserDefaults (on iOS) and SharedPreferences (on Android), providing /// a persistent store for simple data. @@ -31,10 +32,13 @@ class SharedPreferences { // Only do the initial registration if it hasn't already been overridden // with a non-default instance. if (!kIsWeb && - Platform.isLinux && SharedPreferencesStorePlatform.instance is MethodChannelSharedPreferencesStore) { - SharedPreferencesStorePlatform.instance = SharedPreferencesLinux(); + if (Platform.isLinux) { + SharedPreferencesStorePlatform.instance = SharedPreferencesLinux(); + } else if (Platform.isWindows) { + SharedPreferencesStorePlatform.instance = SharedPreferencesWindows(); + } } _manualDartRegistrationNeeded = false; } diff --git a/packages/shared_preferences/shared_preferences/pubspec.yaml b/packages/shared_preferences/shared_preferences/pubspec.yaml index 04b7813a2a99..a27fce29f202 100644 --- a/packages/shared_preferences/shared_preferences/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences/pubspec.yaml @@ -5,7 +5,7 @@ homepage: https://github.com/flutter/plugins/tree/master/packages/shared_prefere # 0.5.y+z is compatible with 1.0.0, if you land a breaking change bump # the version to 2.0.0. # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0 -version: 0.5.10 +version: 0.5.11 flutter: plugin: @@ -35,6 +35,7 @@ dependencies: shared_preferences_linux: ^0.0.2 shared_preferences_macos: ^0.0.1 shared_preferences_web: ^0.1.2 + shared_preferences_windows: ^0.0.1 dev_dependencies: flutter_test: From 5a183ac54a515be096d01f3a35546c5d89a30dca Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Tue, 22 Sep 2020 13:11:01 -0700 Subject: [PATCH 115/233] [flutter_plugin_android_lifecycle] update to android 29 (#3050) --- packages/flutter_plugin_android_lifecycle/CHANGELOG.md | 4 ++++ .../flutter_plugin_android_lifecycle/android/build.gradle | 2 +- .../example/android/app/build.gradle | 2 +- packages/flutter_plugin_android_lifecycle/pubspec.yaml | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/flutter_plugin_android_lifecycle/CHANGELOG.md b/packages/flutter_plugin_android_lifecycle/CHANGELOG.md index cf37870e2a14..1b6388a0433d 100644 --- a/packages/flutter_plugin_android_lifecycle/CHANGELOG.md +++ b/packages/flutter_plugin_android_lifecycle/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.10 + +* Update android compileSdkVersion to 29. + ## 1.0.9 * Let the no-op plugin implement the `FlutterPlugin` interface. diff --git a/packages/flutter_plugin_android_lifecycle/android/build.gradle b/packages/flutter_plugin_android_lifecycle/android/build.gradle index 77c8415cd69d..ac042bf144ab 100644 --- a/packages/flutter_plugin_android_lifecycle/android/build.gradle +++ b/packages/flutter_plugin_android_lifecycle/android/build.gradle @@ -22,7 +22,7 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { - compileSdkVersion 28 + compileSdkVersion 29 defaultConfig { minSdkVersion 16 diff --git a/packages/flutter_plugin_android_lifecycle/example/android/app/build.gradle b/packages/flutter_plugin_android_lifecycle/example/android/app/build.gradle index b2f6139734bd..da10d611c704 100644 --- a/packages/flutter_plugin_android_lifecycle/example/android/app/build.gradle +++ b/packages/flutter_plugin_android_lifecycle/example/android/app/build.gradle @@ -25,7 +25,7 @@ apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 28 + compileSdkVersion 29 lintOptions { disable 'InvalidPackage' diff --git a/packages/flutter_plugin_android_lifecycle/pubspec.yaml b/packages/flutter_plugin_android_lifecycle/pubspec.yaml index ec3aa9812ebf..416b484a54b6 100644 --- a/packages/flutter_plugin_android_lifecycle/pubspec.yaml +++ b/packages/flutter_plugin_android_lifecycle/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_plugin_android_lifecycle description: Flutter plugin for accessing an Android Lifecycle within other plugins. -version: 1.0.9 +version: 1.0.10 homepage: https://github.com/flutter/plugins/tree/master/packages/flutter_plugin_android_lifecycle environment: From 0e27dc2bf87de057af2285737768bdaeb4a87b72 Mon Sep 17 00:00:00 2001 From: xster Date: Wed, 23 Sep 2020 00:51:25 -0700 Subject: [PATCH 116/233] Add deprecation suppression for plugins marked with -Werror (#3072) --- packages/android_alarm_manager/CHANGELOG.md | 4 ++++ .../androidalarmmanager/AlarmService.java | 12 +++++----- .../AndroidAlarmManagerPlugin.java | 12 +++++----- .../FlutterBackgroundExecutor.java | 22 +++++++++++-------- .../Application.java | 9 ++++---- .../EmbeddingV1Activity.java | 4 ++-- packages/android_alarm_manager/pubspec.yaml | 2 +- packages/android_intent/CHANGELOG.md | 10 ++++++--- .../androidintent/AndroidIntentPlugin.java | 4 ++-- .../EmbeddingV1Activity.java | 4 ++-- packages/android_intent/pubspec.yaml | 2 +- packages/battery/battery/CHANGELOG.md | 4 ++++ .../plugins/battery/BatteryPlugin.java | 4 ++-- packages/battery/battery/pubspec.yaml | 2 +- packages/camera/CHANGELOG.md | 4 ++++ .../plugins/camera/CameraPermissions.java | 9 ++++---- .../flutter/plugins/camera/CameraPlugin.java | 8 +++---- .../EmbeddingV1ActivityTest.java | 1 + .../cameraexample/EmbeddingV1Activity.java | 4 ++-- packages/camera/pubspec.yaml | 2 +- .../connectivity/connectivity/CHANGELOG.md | 4 ++++ .../connectivity/ConnectivityPlugin.java | 4 ++-- .../EmbeddingV1Activity.java | 4 ++-- .../EmbeddingV1ActivityTest.java | 1 + .../connectivity/connectivity/pubspec.yaml | 2 +- packages/device_info/device_info/CHANGELOG.md | 4 ++++ .../plugins/deviceinfo/DeviceInfoPlugin.java | 4 ++-- .../EmbeddingV1Activity.java | 4 ++-- .../EmbeddingV1ActivityTest.java | 1 + packages/device_info/device_info/pubspec.yaml | 2 +- packages/espresso/CHANGELOG.md | 4 ++++ .../com/example/espresso/EspressoPlugin.java | 4 ++-- packages/espresso/pubspec.yaml | 2 +- .../CHANGELOG.md | 4 ++++ .../FlutterAndroidLifecyclePlugin.java | 4 ++-- .../EmbeddingV1ActivityTest.java | 1 + .../EmbeddingV1Activity.java | 4 ++-- .../pubspec.yaml | 2 +- .../google_maps_flutter/CHANGELOG.md | 4 ++++ .../plugins/googlemaps/GoogleMapsPlugin.java | 4 ++-- .../googlemaps/EmbeddingV1ActivityTest.java | 1 + .../EmbeddingV1Activity.java | 4 ++-- .../google_maps_flutter/pubspec.yaml | 2 +- .../EmbeddingV1Activity.java | 4 ++-- .../EmbeddingV1ActivityTest.java | 1 + .../google_sign_in/CHANGELOG.md | 4 ++++ .../googlesignin/GoogleSignInPlugin.java | 3 ++- .../EmbeddingV1Activity.java | 4 ++-- .../EmbeddingV1ActivityTest.java | 1 + .../google_sign_in/pubspec.yaml | 2 +- .../image_picker/image_picker/CHANGELOG.md | 4 ++++ .../imagepicker/ImagePickerPlugin.java | 3 ++- .../EmbeddingV1Activity.java | 4 ++-- .../EmbeddingV1ActivityTest.java | 1 + .../imagepicker/ImagePickerPluginTest.java | 6 +++-- .../image_picker/image_picker/pubspec.yaml | 2 +- packages/in_app_purchase/CHANGELOG.md | 6 +++++ .../inapppurchase/InAppPurchasePlugin.java | 4 ++-- .../EmbeddingV1Activity.java | 4 ++-- .../EmbeddingV1ActivityTest.java | 1 + packages/in_app_purchase/pubspec.yaml | 2 +- packages/integration_test/CHANGELOG.md | 4 ++++ .../IntegrationTestPlugin.java | 4 ++-- packages/integration_test/pubspec.yaml | 2 +- packages/local_auth/CHANGELOG.md | 4 ++++ .../plugins/localauth/LocalAuthPlugin.java | 4 ++-- .../localauth/EmbeddingV1ActivityTest.java | 1 + .../localauthexample/EmbeddingV1Activity.java | 1 + packages/local_auth/pubspec.yaml | 2 +- .../packageinfo/PackageInfoPlugin.java | 4 ++-- .../path_provider/path_provider/CHANGELOG.md | 4 ++++ .../pathprovider/PathProviderPlugin.java | 4 ++-- .../java/EmbeddingV1ActivityTest.java | 1 + .../EmbeddingV1Activity.java | 4 ++-- .../path_provider/path_provider/pubspec.yaml | 2 +- packages/quick_actions/CHANGELOG.md | 4 ++++ .../quickactions/QuickActionsPlugin.java | 4 ++-- .../EmbeddingV1Activity.java | 4 ++-- .../EmbeddingV1ActivityTest.java | 1 + packages/quick_actions/pubspec.yaml | 2 +- packages/sensors/CHANGELOG.md | 4 ++++ .../plugins/sensors/SensorsPlugin.java | 4 ++-- .../sensorsexample/EmbeddingV1Activity.java | 4 ++-- .../EmbeddingV1ActivityTest.java | 1 + packages/sensors/pubspec.yaml | 2 +- packages/share/CHANGELOG.md | 4 ++++ .../io/flutter/plugins/share/SharePlugin.java | 4 ++-- .../shareexample/EmbeddingV1Activity.java | 4 ++-- .../shareexample/EmbeddingV1ActivityTest.java | 1 + packages/share/pubspec.yaml | 2 +- .../shared_preferences/CHANGELOG.md | 4 ++++ .../SharedPreferencesPlugin.java | 4 ++-- .../EmbeddingV1Activity.java | 4 ++-- .../EmbeddingV1ActivityTest.java | 1 + .../shared_preferences/pubspec.yaml | 2 +- .../url_launcher/url_launcher/CHANGELOG.md | 4 ++++ .../urllauncher/UrlLauncherPlugin.java | 4 ++-- .../EmbeddingV1ActivityTest.java | 1 + .../EmbeddingV1Activity.java | 4 ++-- .../url_launcher/url_launcher/pubspec.yaml | 2 +- .../video_player/video_player/CHANGELOG.md | 4 ++++ .../videoplayer/VideoPlayerPlugin.java | 15 ++++++++----- .../EmbeddingV1Activity.java | 4 ++-- .../video_player/video_player/pubspec.yaml | 2 +- packages/webview_flutter/CHANGELOG.md | 4 ++++ .../webviewflutter/WebViewFlutterPlugin.java | 4 ++-- .../EmbeddingV1ActivityTest.java | 1 + .../EmbeddingV1Activity.java | 4 ++-- packages/webview_flutter/pubspec.yaml | 2 +- 109 files changed, 264 insertions(+), 141 deletions(-) diff --git a/packages/android_alarm_manager/CHANGELOG.md b/packages/android_alarm_manager/CHANGELOG.md index 22c3d822ec04..aff0e4a30982 100644 --- a/packages/android_alarm_manager/CHANGELOG.md +++ b/packages/android_alarm_manager/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.4.5+14 + +* Keep handling deprecated Android v1 classes for backward compatibility. + ## 0.4.5+13 * Android Code Inspection and Clean up. diff --git a/packages/android_alarm_manager/android/src/main/java/io/flutter/plugins/androidalarmmanager/AlarmService.java b/packages/android_alarm_manager/android/src/main/java/io/flutter/plugins/androidalarmmanager/AlarmService.java index 107d76738fe3..3287789f6c3d 100644 --- a/packages/android_alarm_manager/android/src/main/java/io/flutter/plugins/androidalarmmanager/AlarmService.java +++ b/packages/android_alarm_manager/android/src/main/java/io/flutter/plugins/androidalarmmanager/AlarmService.java @@ -13,7 +13,6 @@ import android.util.Log; import androidx.core.app.AlarmManagerCompat; import androidx.core.app.JobIntentService; -import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; @@ -91,15 +90,18 @@ public static void setCallbackDispatcher(Context context, long callbackHandle) { } /** - * Sets the {@link PluginRegistrantCallback} used to register the plugins used by an application - * with the newly spawned background isolate. + * Sets the {@link io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback} used to + * register the plugins used by an application with the newly spawned background isolate. * *

This should be invoked in {@link Application.onCreate} with {@link * GeneratedPluginRegistrant} in applications using the V1 embedding API in order to use other * plugins in the background isolate. For applications using the V2 embedding API, it is not - * necessary to set a {@link PluginRegistrantCallback} as plugins are registered automatically. + * necessary to set a {@link io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback} as + * plugins are registered automatically. */ - public static void setPluginRegistrant(PluginRegistrantCallback callback) { + @SuppressWarnings("deprecation") + public static void setPluginRegistrant( + io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback callback) { // Indirectly set in FlutterBackgroundExecutor for backwards compatibility. FlutterBackgroundExecutor.setPluginRegistrant(callback); } diff --git a/packages/android_alarm_manager/android/src/main/java/io/flutter/plugins/androidalarmmanager/AndroidAlarmManagerPlugin.java b/packages/android_alarm_manager/android/src/main/java/io/flutter/plugins/androidalarmmanager/AndroidAlarmManagerPlugin.java index 5a135f95e631..557913a626d5 100644 --- a/packages/android_alarm_manager/android/src/main/java/io/flutter/plugins/androidalarmmanager/AndroidAlarmManagerPlugin.java +++ b/packages/android_alarm_manager/android/src/main/java/io/flutter/plugins/androidalarmmanager/AndroidAlarmManagerPlugin.java @@ -6,6 +6,7 @@ import android.content.Context; import android.util.Log; +import io.flutter.embedding.engine.FlutterEngine; import io.flutter.embedding.engine.plugins.FlutterPlugin; import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugin.common.JSONMethodCodec; @@ -13,8 +14,6 @@ import io.flutter.plugin.common.MethodChannel; import io.flutter.plugin.common.MethodChannel.MethodCallHandler; import io.flutter.plugin.common.MethodChannel.Result; -import io.flutter.plugin.common.PluginRegistry.Registrar; -import io.flutter.view.FlutterNativeView; import org.json.JSONArray; import org.json.JSONException; @@ -28,8 +27,8 @@ *

  • The Dart side of this plugin sends the Android side a "AlarmService.start" message, along * with a Dart callback handle for a Dart callback that should be immediately invoked by a * background Dart isolate. - *
  • The Android side of this plugin spins up a background {@link FlutterNativeView}, which - * includes a background Dart isolate. + *
  • The Android side of this plugin spins up a background {@link FlutterEngine}, which includes + * a background Dart isolate. *
  • The Android side of this plugin instructs the new background Dart isolate to execute the * callback that was received in the "AlarmService.start" message. *
  • The Dart side of this plugin, running within the new background isolate, executes the @@ -49,12 +48,13 @@ public class AndroidAlarmManagerPlugin implements FlutterPlugin, MethodCallHandl /** * Registers this plugin with an associated Flutter execution context, represented by the given - * {@link Registrar}. + * {@link io.flutter.plugin.common.PluginRegistry.Registrar}. * *

    Once this method is executed, an instance of {@code AndroidAlarmManagerPlugin} will be * connected to, and running against, the associated Flutter execution context. */ - public static void registerWith(Registrar registrar) { + @SuppressWarnings("deprecation") + public static void registerWith(io.flutter.plugin.common.PluginRegistry.Registrar registrar) { if (instance == null) { instance = new AndroidAlarmManagerPlugin(); } diff --git a/packages/android_alarm_manager/android/src/main/java/io/flutter/plugins/androidalarmmanager/FlutterBackgroundExecutor.java b/packages/android_alarm_manager/android/src/main/java/io/flutter/plugins/androidalarmmanager/FlutterBackgroundExecutor.java index 8d5290842e14..86010ff3f089 100644 --- a/packages/android_alarm_manager/android/src/main/java/io/flutter/plugins/androidalarmmanager/FlutterBackgroundExecutor.java +++ b/packages/android_alarm_manager/android/src/main/java/io/flutter/plugins/androidalarmmanager/FlutterBackgroundExecutor.java @@ -19,9 +19,7 @@ import io.flutter.plugin.common.MethodChannel; import io.flutter.plugin.common.MethodChannel.MethodCallHandler; import io.flutter.plugin.common.MethodChannel.Result; -import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback; import io.flutter.view.FlutterCallbackInformation; -import io.flutter.view.FlutterMain; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicBoolean; @@ -32,7 +30,10 @@ public class FlutterBackgroundExecutor implements MethodCallHandler { private static final String TAG = "FlutterBackgroundExecutor"; private static final String CALLBACK_HANDLE_KEY = "callback_handle"; - private static PluginRegistrantCallback pluginRegistrantCallback; + + @SuppressWarnings("deprecation") + private static io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback + pluginRegistrantCallback; /** * The {@link MethodChannel} that connects the Android side of this plugin with the background @@ -45,14 +46,16 @@ public class FlutterBackgroundExecutor implements MethodCallHandler { private AtomicBoolean isCallbackDispatcherReady = new AtomicBoolean(false); /** - * Sets the {@code PluginRegistrantCallback} used to register plugins with the newly spawned - * isolate. + * Sets the {@code io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback} used to + * register plugins with the newly spawned isolate. * *

    Note: this is only necessary for applications using the V1 engine embedding API as plugins * are automatically registered via reflection in the V2 engine embedding API. If not set, alarm * callbacks will not be able to utilize functionality from other plugins. */ - public static void setPluginRegistrant(PluginRegistrantCallback callback) { + @SuppressWarnings("deprecation") + public static void setPluginRegistrant( + io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback callback) { pluginRegistrantCallback = callback; } @@ -101,7 +104,7 @@ public void onMethodCall(MethodCall call, Result result) { *

    The isolate is configured as follows: * *