From d1f1f0fdaf49124be7ab65fef795a1a213801e13 Mon Sep 17 00:00:00 2001 From: Ravi Singh Lodhi <37270954+foxtrotravi@users.noreply.github.com> Date: Tue, 13 Feb 2024 01:16:51 +0530 Subject: [PATCH 01/40] [cupertino_icons] Add example to cupertino icons (#5312) ## Description of PR: Adding an example app to showcase the usage of `cupertino_icons`. This addition will also increase the pub points of the package and will be helpful for other developers to quickly find relevant examples. Fixes https://github.com/flutter/flutter/issues/137682 --- .../packages/cupertino_icons/CHANGELOG.md | 3 +- .../cupertino_icons/example/example.md | 14 ++++++++ .../packages/cupertino_icons/pubspec.yaml | 8 ++++- .../test/cupertino_icons_test.dart | 35 +++++++++++++++++++ 4 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 third_party/packages/cupertino_icons/example/example.md create mode 100644 third_party/packages/cupertino_icons/test/cupertino_icons_test.dart diff --git a/third_party/packages/cupertino_icons/CHANGELOG.md b/third_party/packages/cupertino_icons/CHANGELOG.md index b069e04f97d6..636e9af1b794 100644 --- a/third_party/packages/cupertino_icons/CHANGELOG.md +++ b/third_party/packages/cupertino_icons/CHANGELOG.md @@ -1,5 +1,6 @@ -## NEXT +## 1.0.7 +* Adds example.md file to display usage. * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. ## 1.0.6 diff --git a/third_party/packages/cupertino_icons/example/example.md b/third_party/packages/cupertino_icons/example/example.md new file mode 100644 index 000000000000..1b6bc0ac27b5 --- /dev/null +++ b/third_party/packages/cupertino_icons/example/example.md @@ -0,0 +1,14 @@ + + +This package is used via [`CupertinoIcons`](https://api.flutter.dev/flutter/cupertino/CupertinoIcons-class.html): + + +```dart +const Icon icon = Icon( + CupertinoIcons.heart_fill, + color: Colors.pink, + size: 24.0, +); +``` + +For a list of all icons, see [`CupertinoIcons`](https://api.flutter.dev/flutter/cupertino/CupertinoIcons-class.html#constants) [class documentation constants](https://api.flutter.dev/flutter/cupertino/CupertinoIcons-class.html#constants). diff --git a/third_party/packages/cupertino_icons/pubspec.yaml b/third_party/packages/cupertino_icons/pubspec.yaml index 1e0b09766d76..322124cf4e7b 100644 --- a/third_party/packages/cupertino_icons/pubspec.yaml +++ b/third_party/packages/cupertino_icons/pubspec.yaml @@ -3,11 +3,17 @@ name: cupertino_icons description: Default icons asset for Cupertino widgets based on Apple styled icons repository: https://github.com/flutter/packages/tree/main/third_party/packages/cupertino_icons issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+cupertino_icons%22 -version: 1.0.6 +version: 1.0.7 environment: sdk: ">=3.0.0 <4.0.0" +dev_dependencies: + flutter: + sdk: flutter + flutter_test: + sdk: flutter + flutter: fonts: - family: CupertinoIcons diff --git a/third_party/packages/cupertino_icons/test/cupertino_icons_test.dart b/third_party/packages/cupertino_icons/test/cupertino_icons_test.dart new file mode 100644 index 000000000000..bb61b92c5099 --- /dev/null +++ b/third_party/packages/cupertino_icons/test/cupertino_icons_test.dart @@ -0,0 +1,35 @@ +// 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. + +/// This test file is primarily here to serve as a source for code excerpts. +library; + +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + testWidgets( + 'Cupertino Icon Test', + (WidgetTester tester) async { + // #docregion CupertinoIcon + const Icon icon = Icon( + CupertinoIcons.heart_fill, + color: Colors.pink, + size: 24.0, + ); + // #enddocregion CupertinoIcon + + await tester.pumpWidget( + const MaterialApp( + home: Scaffold( + body: icon, + ), + ), + ); + + expect(find.byType(Icon), findsOne); + }, + ); +} From 6828aaaf488b2882be3eec7f367eabdebfda4aea Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Mon, 12 Feb 2024 12:08:24 -0800 Subject: [PATCH 02/40] [webview_flutter] Update compileSdk to 34 (#6106) Makes this plugin's compile SDK consistent with the rest of the repository. --- packages/webview_flutter/webview_flutter_android/CHANGELOG.md | 4 ++++ .../webview_flutter_android/android/build.gradle | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/webview_flutter/webview_flutter_android/CHANGELOG.md b/packages/webview_flutter/webview_flutter_android/CHANGELOG.md index 56d9f95af446..be9ac8adff10 100644 --- a/packages/webview_flutter/webview_flutter_android/CHANGELOG.md +++ b/packages/webview_flutter/webview_flutter_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates compileSdk to 34. + ## 3.15.0 * Adds support for `setOnScrollPositionChange` method to the `AndroidWebViewController`. diff --git a/packages/webview_flutter/webview_flutter_android/android/build.gradle b/packages/webview_flutter/webview_flutter_android/android/build.gradle index 76b56e0d2a66..1f6e33e5af68 100644 --- a/packages/webview_flutter/webview_flutter_android/android/build.gradle +++ b/packages/webview_flutter/webview_flutter_android/android/build.gradle @@ -26,7 +26,7 @@ android { if (project.android.hasProperty("namespace")) { namespace 'io.flutter.plugins.webviewflutter' } - compileSdk 33 + compileSdk 34 defaultConfig { minSdkVersion 19 From 41a00788d65efcc526db0c43cfb0913244743c5d Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Mon, 12 Feb 2024 15:26:02 -0500 Subject: [PATCH 03/40] [in_app_purchase] Add alternative billing apis for android (#6056) - Update the emulator versions and expose cipd. (#6025 - Enable alternitive billing only available check, add test and code to handle service unavilable in getBillingConfig - Enable alternative billing only during client creation and tests covering fallback path - ShowAlternativeBillingDialog android native method added - Add tests for null activity behavior - Remove not needed lines of code - Add showAlternativeBillingOnlyInformationDialog and isAlternativeBillingOnlyAvailable to android platform addition and billing client wrapper. - test showAlternativeBillingOnlyInformationDialog and isAlternativeBillingOnlyAvailable in platfrom addition and billing_client Fixes flutter/flutter/issues/142618 Still left TODO: * [x] incorporate new apis into example app * [x] expose alternative billing only [dart api](https://github.com/flutter/packages/pull/6056/files/d4c445422f2cd3f0627f575d85b59b559e0e9f69#r1480455450) * [x] Expose alternative billing reporting details * [ ] Configure end to end working example with playstore --- .../in_app_purchase_android/CHANGELOG.md | 4 + .../android/build.gradle | 2 +- .../inapppurchase/BillingClientFactory.java | 5 +- .../BillingClientFactoryImpl.java | 8 +- .../inapppurchase/MethodCallHandlerImpl.java | 93 ++++++- .../plugins/inapppurchase/Translator.java | 13 + .../inapppurchase/MethodCallHandlerTest.java | 231 +++++++++++++++++- .../example/android/.gitignore | 2 + .../example/android/app/build.gradle | 4 +- .../android/app/src/main/AndroidManifest.xml | 1 + .../android/keystore.example.properties | 3 +- .../example/lib/main.dart | 159 +++++++++++- .../lib/billing_client_wrappers.dart | 1 + ...illing_only_reporting_details_wrapper.dart | 79 ++++++ ...ling_only_reporting_details_wrapper.g.dart | 17 ++ .../billing_client_manager.dart | 21 +- .../billing_client_wrapper.dart | 102 +++++++- .../billing_client_wrapper.g.dart | 5 + ...pp_purchase_android_platform_addition.dart | 47 ++++ .../in_app_purchase_android/pubspec.yaml | 2 +- .../billing_client_manager_test.dart | 30 +++ .../billing_client_wrapper_test.dart | 118 ++++++++- ...rchase_android_platform_addition_test.dart | 94 ++++++- 23 files changed, 996 insertions(+), 45 deletions(-) create mode 100644 packages/in_app_purchase/in_app_purchase_android/example/android/.gitignore create mode 100644 packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/alternative_billing_only_reporting_details_wrapper.dart create mode 100644 packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/alternative_billing_only_reporting_details_wrapper.g.dart diff --git a/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md b/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md index 72b8bb36ff3d..d495ff40c555 100644 --- a/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md +++ b/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.3.1 + +* Adds alternative-billing-only APIs to InAppPurchaseAndroidPlatformAddition. + ## 0.3.0+18 * Adds new getCountryCode() method to InAppPurchaseAndroidPlatformAddition to get a customer's country code. diff --git a/packages/in_app_purchase/in_app_purchase_android/android/build.gradle b/packages/in_app_purchase/in_app_purchase_android/android/build.gradle index 726fdaba29d8..24d9fe296442 100644 --- a/packages/in_app_purchase/in_app_purchase_android/android/build.gradle +++ b/packages/in_app_purchase/in_app_purchase_android/android/build.gradle @@ -66,6 +66,6 @@ dependencies { testImplementation 'junit:junit:4.13.2' testImplementation 'org.json:json:20231013' testImplementation 'org.mockito:mockito-core:5.4.0' - androidTestImplementation 'androidx.test:runner:1.4.0' + androidTestImplementation 'androidx.test:runner:1.5.2' androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' } diff --git a/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/BillingClientFactory.java b/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/BillingClientFactory.java index 81fdf27be88e..9324c9367ee8 100644 --- a/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/BillingClientFactory.java +++ b/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/BillingClientFactory.java @@ -17,7 +17,10 @@ interface BillingClientFactory { * * @param context The context used to create the {@link BillingClient}. * @param channel The method channel used to create the {@link BillingClient}. + * @param billingChoiceMode Enables the ability to offer alternative billing or Google Play + * billing. * @return The {@link BillingClient} object that is created. */ - BillingClient createBillingClient(@NonNull Context context, @NonNull MethodChannel channel); + BillingClient createBillingClient( + @NonNull Context context, @NonNull MethodChannel channel, int billingChoiceMode); } diff --git a/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/BillingClientFactoryImpl.java b/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/BillingClientFactoryImpl.java index 201d57c7fa25..c6911f8314a3 100644 --- a/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/BillingClientFactoryImpl.java +++ b/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/BillingClientFactoryImpl.java @@ -8,15 +8,19 @@ import androidx.annotation.NonNull; import com.android.billingclient.api.BillingClient; import io.flutter.plugin.common.MethodChannel; +import io.flutter.plugins.inapppurchase.MethodCallHandlerImpl.BillingChoiceMode; /** The implementation for {@link BillingClientFactory} for the plugin. */ final class BillingClientFactoryImpl implements BillingClientFactory { @Override public BillingClient createBillingClient( - @NonNull Context context, @NonNull MethodChannel channel) { + @NonNull Context context, @NonNull MethodChannel channel, int billingChoiceMode) { BillingClient.Builder builder = BillingClient.newBuilder(context).enablePendingPurchases(); - + if (billingChoiceMode == BillingChoiceMode.ALTERNATIVE_BILLING_ONLY) { + // https://developer.android.com/google/play/billing/alternative/alternative-billing-without-user-choice-in-app + builder.enableAlternativeBillingOnly(); + } return builder.setListener(new PluginPurchaseListener(channel)).build(); } } diff --git a/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/MethodCallHandlerImpl.java b/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/MethodCallHandlerImpl.java index 247e037d3202..ecf88747779a 100644 --- a/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/MethodCallHandlerImpl.java +++ b/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/MethodCallHandlerImpl.java @@ -4,6 +4,7 @@ package io.flutter.plugins.inapppurchase; +import static io.flutter.plugins.inapppurchase.Translator.fromAlternativeBillingOnlyReportingDetails; import static io.flutter.plugins.inapppurchase.Translator.fromBillingConfig; import static io.flutter.plugins.inapppurchase.Translator.fromBillingResult; import static io.flutter.plugins.inapppurchase.Translator.fromProductDetailsList; @@ -65,10 +66,36 @@ static final class MethodNames { static final String IS_FEATURE_SUPPORTED = "BillingClient#isFeatureSupported(String)"; static final String GET_CONNECTION_STATE = "BillingClient#getConnectionState()"; static final String GET_BILLING_CONFIG = "BillingClient#getBillingConfig()"; + static final String IS_ALTERNATIVE_BILLING_ONLY_AVAILABLE = + "BillingClient#isAlternativeBillingOnlyAvailable()"; + static final String CREATE_ALTERNATIVE_BILLING_ONLY_REPORTING_DETAILS = + "BillingClient#createAlternativeBillingOnlyReportingDetails()"; + static final String SHOW_ALTERNATIVE_BILLING_ONLY_INFORMATION_DIALOG = + "BillingClient#showAlternativeBillingOnlyInformationDialog()"; private MethodNames() {} } + @VisibleForTesting + static final class MethodArgs { + + // Key for an int argument passed into startConnection + static final String HANDLE = "handle"; + // Key for a boolean argument passed into startConnection. + static final String BILLING_CHOICE_MODE = "billingChoiceMode"; + + private MethodArgs() {} + } + + /** + * Values here must match values used in + * in_app_purchase_android/lib/src/billing_client_wrappers/billing_client_wrapper.dart + */ + static final class BillingChoiceMode { + static final int PLAY_BILLING_ONLY = 0; + static final int ALTERNATIVE_BILLING_ONLY = 1; + } + // TODO(gmackall): Replace uses of deprecated ProrationMode enum values with new // ReplacementMode enum values. // https://github.com/flutter/flutter/issues/128957. @@ -80,6 +107,7 @@ private MethodNames() {} private static final String TAG = "InAppPurchasePlugin"; private static final String LOAD_PRODUCT_DOC_URL = "https://github.com/flutter/packages/blob/main/packages/in_app_purchase/in_app_purchase/README.md#loading-products-for-sale"; + @VisibleForTesting static final String ACTIVITY_UNAVAILABLE = "ACTIVITY_UNAVAILABLE"; @Nullable private BillingClient billingClient; private final BillingClientFactory billingClientFactory; @@ -147,7 +175,12 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull MethodChannel.Result isReady(result); break; case MethodNames.START_CONNECTION: - startConnection((int) call.argument("handle"), result); + final int handle = (int) call.argument(MethodArgs.HANDLE); + int billingChoiceMode = BillingChoiceMode.PLAY_BILLING_ONLY; + if (call.hasArgument(MethodArgs.BILLING_CHOICE_MODE)) { + billingChoiceMode = call.argument(MethodArgs.BILLING_CHOICE_MODE); + } + startConnection(handle, result, billingChoiceMode); break; case MethodNames.END_CONNECTION: endConnection(result); @@ -190,12 +223,61 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull MethodChannel.Result case MethodNames.GET_BILLING_CONFIG: getBillingConfig(result); break; + case MethodNames.IS_ALTERNATIVE_BILLING_ONLY_AVAILABLE: + isAlternativeBillingOnlyAvailable(result); + break; + case MethodNames.CREATE_ALTERNATIVE_BILLING_ONLY_REPORTING_DETAILS: + createAlternativeBillingOnlyReportingDetails(result); + break; + case MethodNames.SHOW_ALTERNATIVE_BILLING_ONLY_INFORMATION_DIALOG: + showAlternativeBillingOnlyInformationDialog(result); + break; default: result.notImplemented(); } } + private void showAlternativeBillingOnlyInformationDialog(final MethodChannel.Result result) { + if (billingClientError(result)) { + return; + } + if (activity == null) { + result.error(ACTIVITY_UNAVAILABLE, "Not attempting to show dialog", null); + return; + } + billingClient.showAlternativeBillingOnlyInformationDialog( + activity, + billingResult -> { + result.success(fromBillingResult(billingResult)); + }); + } + + private void createAlternativeBillingOnlyReportingDetails(final MethodChannel.Result result) { + if (billingClientError(result)) { + return; + } + billingClient.createAlternativeBillingOnlyReportingDetailsAsync( + ((billingResult, alternativeBillingOnlyReportingDetails) -> { + result.success( + fromAlternativeBillingOnlyReportingDetails( + billingResult, alternativeBillingOnlyReportingDetails)); + })); + } + + private void isAlternativeBillingOnlyAvailable(final MethodChannel.Result result) { + if (billingClientError(result)) { + return; + } + billingClient.isAlternativeBillingOnlyAvailableAsync( + billingResult -> { + result.success(fromBillingResult(billingResult)); + }); + } + private void getBillingConfig(final MethodChannel.Result result) { + if (billingClientError(result)) { + return; + } billingClient.getBillingConfigAsync( GetBillingConfigParams.newBuilder().build(), (billingResult, billingConfig) -> { @@ -313,7 +395,7 @@ private void launchBillingFlow( if (activity == null) { result.error( - "ACTIVITY_UNAVAILABLE", + ACTIVITY_UNAVAILABLE, "Details for product " + product + " are not available. This method must be run with the app in foreground.", @@ -422,9 +504,12 @@ private void getConnectionState(final MethodChannel.Result result) { result.success(serialized); } - private void startConnection(final int handle, final MethodChannel.Result result) { + private void startConnection( + final int handle, final MethodChannel.Result result, int billingChoiceMode) { if (billingClient == null) { - billingClient = billingClientFactory.createBillingClient(applicationContext, methodChannel); + billingClient = + billingClientFactory.createBillingClient( + applicationContext, methodChannel, billingChoiceMode); } billingClient.startConnection( diff --git a/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/Translator.java b/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/Translator.java index 95976d1a8afc..8c80b1797eda 100644 --- a/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/Translator.java +++ b/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/Translator.java @@ -7,6 +7,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.android.billingclient.api.AccountIdentifiers; +import com.android.billingclient.api.AlternativeBillingOnlyReportingDetails; import com.android.billingclient.api.BillingConfig; import com.android.billingclient.api.BillingResult; import com.android.billingclient.api.ProductDetails; @@ -240,6 +241,18 @@ static HashMap fromBillingConfig( return info; } + /** + * Converter from {@link BillingResult} and {@link AlternativeBillingOnlyReportingDetails} to map. + */ + static HashMap fromAlternativeBillingOnlyReportingDetails( + BillingResult result, AlternativeBillingOnlyReportingDetails details) { + HashMap info = fromBillingResult(result); + if (details != null) { + info.put("externalTransactionToken", details.getExternalTransactionToken()); + } + return info; + } + /** * Gets the symbol of for the given currency code for the default {@link Locale.Category#DISPLAY * DISPLAY} locale. For example, for the US Dollar, the symbol is "$" if the default locale is the diff --git a/packages/in_app_purchase/in_app_purchase_android/android/src/test/java/io/flutter/plugins/inapppurchase/MethodCallHandlerTest.java b/packages/in_app_purchase/in_app_purchase_android/android/src/test/java/io/flutter/plugins/inapppurchase/MethodCallHandlerTest.java index 2a826150a649..bfdf928ca511 100644 --- a/packages/in_app_purchase/in_app_purchase_android/android/src/test/java/io/flutter/plugins/inapppurchase/MethodCallHandlerTest.java +++ b/packages/in_app_purchase/in_app_purchase_android/android/src/test/java/io/flutter/plugins/inapppurchase/MethodCallHandlerTest.java @@ -4,10 +4,13 @@ package io.flutter.plugins.inapppurchase; +import static io.flutter.plugins.inapppurchase.MethodCallHandlerImpl.ACTIVITY_UNAVAILABLE; import static io.flutter.plugins.inapppurchase.MethodCallHandlerImpl.MethodNames.ACKNOWLEDGE_PURCHASE; import static io.flutter.plugins.inapppurchase.MethodCallHandlerImpl.MethodNames.CONSUME_PURCHASE_ASYNC; +import static io.flutter.plugins.inapppurchase.MethodCallHandlerImpl.MethodNames.CREATE_ALTERNATIVE_BILLING_ONLY_REPORTING_DETAILS; import static io.flutter.plugins.inapppurchase.MethodCallHandlerImpl.MethodNames.END_CONNECTION; import static io.flutter.plugins.inapppurchase.MethodCallHandlerImpl.MethodNames.GET_BILLING_CONFIG; +import static io.flutter.plugins.inapppurchase.MethodCallHandlerImpl.MethodNames.IS_ALTERNATIVE_BILLING_ONLY_AVAILABLE; import static io.flutter.plugins.inapppurchase.MethodCallHandlerImpl.MethodNames.IS_FEATURE_SUPPORTED; import static io.flutter.plugins.inapppurchase.MethodCallHandlerImpl.MethodNames.IS_READY; import static io.flutter.plugins.inapppurchase.MethodCallHandlerImpl.MethodNames.LAUNCH_BILLING_FLOW; @@ -15,8 +18,10 @@ import static io.flutter.plugins.inapppurchase.MethodCallHandlerImpl.MethodNames.QUERY_PRODUCT_DETAILS; import static io.flutter.plugins.inapppurchase.MethodCallHandlerImpl.MethodNames.QUERY_PURCHASES_ASYNC; import static io.flutter.plugins.inapppurchase.MethodCallHandlerImpl.MethodNames.QUERY_PURCHASE_HISTORY_ASYNC; +import static io.flutter.plugins.inapppurchase.MethodCallHandlerImpl.MethodNames.SHOW_ALTERNATIVE_BILLING_ONLY_INFORMATION_DIALOG; import static io.flutter.plugins.inapppurchase.MethodCallHandlerImpl.MethodNames.START_CONNECTION; import static io.flutter.plugins.inapppurchase.PluginPurchaseListener.ON_PURCHASES_UPDATED; +import static io.flutter.plugins.inapppurchase.Translator.fromAlternativeBillingOnlyReportingDetails; import static io.flutter.plugins.inapppurchase.Translator.fromBillingConfig; import static io.flutter.plugins.inapppurchase.Translator.fromBillingResult; import static io.flutter.plugins.inapppurchase.Translator.fromProductDetailsList; @@ -42,11 +47,15 @@ import android.app.Activity; import android.content.Context; -import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.android.billingclient.api.AcknowledgePurchaseParams; import com.android.billingclient.api.AcknowledgePurchaseResponseListener; +import com.android.billingclient.api.AlternativeBillingOnlyAvailabilityListener; +import com.android.billingclient.api.AlternativeBillingOnlyInformationDialogListener; +import com.android.billingclient.api.AlternativeBillingOnlyReportingDetails; +import com.android.billingclient.api.AlternativeBillingOnlyReportingDetailsListener; import com.android.billingclient.api.BillingClient; +import com.android.billingclient.api.BillingClient.BillingResponseCode; import com.android.billingclient.api.BillingClientStateListener; import com.android.billingclient.api.BillingConfig; import com.android.billingclient.api.BillingConfigResponseListener; @@ -68,6 +77,8 @@ import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodChannel; import io.flutter.plugin.common.MethodChannel.Result; +import io.flutter.plugins.inapppurchase.MethodCallHandlerImpl.BillingChoiceMode; +import io.flutter.plugins.inapppurchase.MethodCallHandlerImpl.MethodArgs; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; @@ -87,7 +98,7 @@ public class MethodCallHandlerTest { private MethodCallHandlerImpl methodChannelHandler; - private BillingClientFactory factory; + @Mock BillingClientFactory factory; @Mock BillingClient mockBillingClient; @Mock MethodChannel mockMethodChannel; @Spy Result result; @@ -95,12 +106,17 @@ public class MethodCallHandlerTest { @Mock Context context; @Mock ActivityPluginBinding mockActivityPluginBinding; @Captor ArgumentCaptor> resultCaptor; - @Mock BillingConfig mockBillingConfig; @Before public void setUp() { MockitoAnnotations.openMocks(this); - factory = (@NonNull Context context, @NonNull MethodChannel channel) -> mockBillingClient; + // Use the same client no matter if alternative billing is enabled or not. + when(factory.createBillingClient( + context, mockMethodChannel, BillingChoiceMode.PLAY_BILLING_ONLY)) + .thenReturn(mockBillingClient); + when(factory.createBillingClient( + context, mockMethodChannel, BillingChoiceMode.ALTERNATIVE_BILLING_ONLY)) + .thenReturn(mockBillingClient); methodChannelHandler = new MethodCallHandlerImpl(activity, context, mockMethodChannel, factory); when(mockActivityPluginBinding.getActivity()).thenReturn(activity); } @@ -144,8 +160,57 @@ public void isReady_clientDisconnected() { @Test public void startConnection() { - ArgumentCaptor captor = mockStartConnection(); + ArgumentCaptor captor = + mockStartConnection(BillingChoiceMode.PLAY_BILLING_ONLY); + verify(result, never()).success(any()); + verify(factory, times(1)) + .createBillingClient(context, mockMethodChannel, BillingChoiceMode.PLAY_BILLING_ONLY); + + BillingResult billingResult = + BillingResult.newBuilder() + .setResponseCode(100) + .setDebugMessage("dummy debug message") + .build(); + captor.getValue().onBillingSetupFinished(billingResult); + + verify(result, times(1)).success(fromBillingResult(billingResult)); + } + + @Test + public void startConnectionAlternativeBillingOnly() { + ArgumentCaptor captor = + mockStartConnection(BillingChoiceMode.ALTERNATIVE_BILLING_ONLY); verify(result, never()).success(any()); + verify(factory, times(1)) + .createBillingClient( + context, mockMethodChannel, BillingChoiceMode.ALTERNATIVE_BILLING_ONLY); + + BillingResult billingResult = + BillingResult.newBuilder() + .setResponseCode(100) + .setDebugMessage("dummy debug message") + .build(); + captor.getValue().onBillingSetupFinished(billingResult); + + verify(result, times(1)).success(fromBillingResult(billingResult)); + } + + @Test + public void startConnectionAlternativeBillingUnset() { + // Logic is identical to mockStartConnection but does not set a value for + // ENABLE_ALTERNATIVE_BILLING to verify fallback behavior. + Map arguments = new HashMap<>(); + arguments.put(MethodArgs.HANDLE, 1); + MethodCall call = new MethodCall(START_CONNECTION, arguments); + ArgumentCaptor captor = + ArgumentCaptor.forClass(BillingClientStateListener.class); + doNothing().when(mockBillingClient).startConnection(captor.capture()); + + methodChannelHandler.onMethodCall(call, result); + verify(result, never()).success(any()); + verify(factory, times(1)) + .createBillingClient(context, mockMethodChannel, BillingChoiceMode.PLAY_BILLING_ONLY); + BillingResult billingResult = BillingResult.newBuilder() .setResponseCode(100) @@ -199,25 +264,150 @@ public void getBillingConfigSuccess() { ArgumentCaptor listenerCaptor = ArgumentCaptor.forClass(BillingConfigResponseListener.class); MethodCall billingCall = new MethodCall(GET_BILLING_CONFIG, null); - methodChannelHandler.onMethodCall(billingCall, mock(Result.class)); BillingResult billingResult = BillingResult.newBuilder() .setResponseCode(100) .setDebugMessage("dummy debug message") .build(); final String expectedCountryCode = "US"; - final HashMap expectedResult = fromBillingResult(billingResult); - expectedResult.put("countryCode", expectedCountryCode); + final BillingConfig expectedConfig = mock(BillingConfig.class); + when(expectedConfig.getCountryCode()).thenReturn(expectedCountryCode); - when(mockBillingConfig.getCountryCode()).thenReturn(expectedCountryCode); doNothing() .when(mockBillingClient) .getBillingConfigAsync(paramsCaptor.capture(), listenerCaptor.capture()); methodChannelHandler.onMethodCall(billingCall, result); - listenerCaptor.getValue().onBillingConfigResponse(billingResult, mockBillingConfig); + listenerCaptor.getValue().onBillingConfigResponse(billingResult, expectedConfig); + + verify(result, times(1)).success(fromBillingConfig(billingResult, expectedConfig)); + } + + @Test + public void getBillingConfig_serviceDisconnected() { + MethodCall billingCall = new MethodCall(GET_BILLING_CONFIG, null); + methodChannelHandler.onMethodCall(billingCall, mock(Result.class)); + + methodChannelHandler.onMethodCall(billingCall, result); - verify(result, times(1)).success(fromBillingConfig(billingResult, mockBillingConfig)); + verify(result).error(contains("UNAVAILABLE"), contains("BillingClient"), any()); + } + + @Test + public void createAlternativeBillingOnlyReportingDetailsSuccess() { + mockStartConnection(); + ArgumentCaptor listenerCaptor = + ArgumentCaptor.forClass(AlternativeBillingOnlyReportingDetailsListener.class); + MethodCall createABOReportingDetailsCall = + new MethodCall(CREATE_ALTERNATIVE_BILLING_ONLY_REPORTING_DETAILS, null); + BillingResult billingResult = + BillingResult.newBuilder() + .setResponseCode(BillingResponseCode.OK) + .setDebugMessage("dummy debug message") + .build(); + final AlternativeBillingOnlyReportingDetails expectedDetails = + mock(AlternativeBillingOnlyReportingDetails.class); + final String expectedExternalTransactionToken = "abc123youandme"; + + when(expectedDetails.getExternalTransactionToken()) + .thenReturn(expectedExternalTransactionToken); + doNothing() + .when(mockBillingClient) + .createAlternativeBillingOnlyReportingDetailsAsync(listenerCaptor.capture()); + + methodChannelHandler.onMethodCall(createABOReportingDetailsCall, result); + listenerCaptor.getValue().onAlternativeBillingOnlyTokenResponse(billingResult, expectedDetails); + + verify(result, times(1)) + .success(fromAlternativeBillingOnlyReportingDetails(billingResult, expectedDetails)); + } + + @Test + public void createAlternativeBillingOnlyReportingDetails_serviceDisconnected() { + MethodCall createCall = new MethodCall(CREATE_ALTERNATIVE_BILLING_ONLY_REPORTING_DETAILS, null); + methodChannelHandler.onMethodCall(createCall, mock(Result.class)); + + methodChannelHandler.onMethodCall(createCall, result); + + verify(result).error(contains("UNAVAILABLE"), contains("BillingClient"), any()); + } + + @Test + public void isAlternativeBillingOnlyAvailableSuccess() { + mockStartConnection(); + ArgumentCaptor listenerCaptor = + ArgumentCaptor.forClass(AlternativeBillingOnlyAvailabilityListener.class); + MethodCall billingCall = new MethodCall(IS_ALTERNATIVE_BILLING_ONLY_AVAILABLE, null); + BillingResult billingResult = + BillingResult.newBuilder() + .setResponseCode(BillingClient.BillingResponseCode.OK) + .setDebugMessage("dummy debug message") + .build(); + final HashMap expectedResult = fromBillingResult(billingResult); + + doNothing() + .when(mockBillingClient) + .isAlternativeBillingOnlyAvailableAsync(listenerCaptor.capture()); + + methodChannelHandler.onMethodCall(billingCall, result); + listenerCaptor.getValue().onAlternativeBillingOnlyAvailabilityResponse(billingResult); + + verify(result, times(1)).success(fromBillingResult(billingResult)); + } + + @Test + public void isAlternativeBillingOnlyAvailable_serviceDisconnected() { + MethodCall billingCall = new MethodCall(IS_ALTERNATIVE_BILLING_ONLY_AVAILABLE, null); + methodChannelHandler.onMethodCall(billingCall, mock(Result.class)); + + methodChannelHandler.onMethodCall(billingCall, result); + + verify(result).error(contains("UNAVAILABLE"), contains("BillingClient"), any()); + } + + @Test + public void showAlternativeBillingOnlyInformationDialogSuccess() { + mockStartConnection(); + ArgumentCaptor listenerCaptor = + ArgumentCaptor.forClass(AlternativeBillingOnlyInformationDialogListener.class); + MethodCall showDialogCall = + new MethodCall(SHOW_ALTERNATIVE_BILLING_ONLY_INFORMATION_DIALOG, null); + BillingResult billingResult = + BillingResult.newBuilder() + .setResponseCode(BillingResponseCode.OK) + .setDebugMessage("dummy debug message") + .build(); + + when(mockBillingClient.showAlternativeBillingOnlyInformationDialog( + eq(activity), listenerCaptor.capture())) + .thenReturn(billingResult); + + methodChannelHandler.onMethodCall(showDialogCall, result); + listenerCaptor.getValue().onAlternativeBillingOnlyInformationDialogResponse(billingResult); + + verify(result, times(1)).success(fromBillingResult(billingResult)); + } + + @Test + public void showAlternativeBillingOnlyInformationDialog_serviceDisconnected() { + MethodCall billingCall = new MethodCall(SHOW_ALTERNATIVE_BILLING_ONLY_INFORMATION_DIALOG, null); + + methodChannelHandler.onMethodCall(billingCall, result); + + verify(result).error(contains("UNAVAILABLE"), contains("BillingClient"), any()); + } + + @Test + public void showAlternativeBillingOnlyInformationDialog_NullActivity() { + mockStartConnection(); + MethodCall showDialogCall = + new MethodCall(SHOW_ALTERNATIVE_BILLING_ONLY_INFORMATION_DIALOG, null); + + methodChannelHandler.setActivity(null); + methodChannelHandler.onMethodCall(showDialogCall, result); + + verify(result) + .error(contains(ACTIVITY_UNAVAILABLE), contains("Not attempting to show dialog"), any()); } @Test @@ -865,9 +1055,24 @@ public void isFutureSupported_false() { verify(result).success(false); } + /** + * Call {@link MethodCallHandlerImpl.START_CONNECTION] with startup params. + * + * Defaults to play billing only which is the default. + */ private ArgumentCaptor mockStartConnection() { + return mockStartConnection(BillingChoiceMode.PLAY_BILLING_ONLY); + } + + /** + * Call {@link MethodCallHandlerImpl.START_CONNECTION] with startup params. + * + *{@link billingChoiceMode} is one of the int value used from {@link BillingChoiceMode}. + */ + private ArgumentCaptor mockStartConnection(int billingChoiceMode) { Map arguments = new HashMap<>(); - arguments.put("handle", 1); + arguments.put(MethodArgs.HANDLE, 1); + arguments.put(MethodArgs.BILLING_CHOICE_MODE, billingChoiceMode); MethodCall call = new MethodCall(START_CONNECTION, arguments); ArgumentCaptor captor = ArgumentCaptor.forClass(BillingClientStateListener.class); @@ -881,7 +1086,7 @@ private void establishConnectedBillingClient( @Nullable Map arguments, @Nullable Result result) { if (arguments == null) { arguments = new HashMap<>(); - arguments.put("handle", 1); + arguments.put(MethodArgs.HANDLE, 1); } if (result == null) { result = mock(Result.class); diff --git a/packages/in_app_purchase/in_app_purchase_android/example/android/.gitignore b/packages/in_app_purchase/in_app_purchase_android/example/android/.gitignore new file mode 100644 index 000000000000..de72ca0c8080 --- /dev/null +++ b/packages/in_app_purchase/in_app_purchase_android/example/android/.gitignore @@ -0,0 +1,2 @@ +# Keystore files +*.jks diff --git a/packages/in_app_purchase/in_app_purchase_android/example/android/app/build.gradle b/packages/in_app_purchase/in_app_purchase_android/example/android/app/build.gradle index 1cffa7dfb764..dfccaac37d6e 100644 --- a/packages/in_app_purchase/in_app_purchase_android/example/android/app/build.gradle +++ b/packages/in_app_purchase/in_app_purchase_android/example/android/app/build.gradle @@ -70,7 +70,7 @@ android { defaultConfig { applicationId project.APP_ID minSdkVersion flutter.minSdkVersion - targetSdkVersion 30 + targetSdkVersion 34 versionCode project.VERSION_CODE versionName project.VERSION_NAME testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -107,7 +107,7 @@ flutter { } dependencies { - implementation 'com.android.billingclient:billing:5.0.0' + implementation 'com.android.billingclient:billing:6.1.0' testImplementation 'junit:junit:4.13.2' testImplementation 'org.mockito:mockito-core:5.1.1' testImplementation 'org.json:json:20231013' diff --git a/packages/in_app_purchase/in_app_purchase_android/example/android/app/src/main/AndroidManifest.xml b/packages/in_app_purchase/in_app_purchase_android/example/android/app/src/main/AndroidManifest.xml index 1185a05b3530..43a74d844ca3 100644 --- a/packages/in_app_purchase/in_app_purchase_android/example/android/app/src/main/AndroidManifest.xml +++ b/packages/in_app_purchase/in_app_purchase_android/example/android/app/src/main/AndroidManifest.xml @@ -14,6 +14,7 @@ android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density" android:hardwareAccelerated="true" + android:exported="true" android:windowSoftInputMode="adjustResize"> diff --git a/packages/in_app_purchase/in_app_purchase_android/example/android/keystore.example.properties b/packages/in_app_purchase/in_app_purchase_android/example/android/keystore.example.properties index ccbbb3653569..8357b4beb609 100644 --- a/packages/in_app_purchase/in_app_purchase_android/example/android/keystore.example.properties +++ b/packages/in_app_purchase/in_app_purchase_android/example/android/keystore.example.properties @@ -1,7 +1,8 @@ +# https://developer.android.com/studio/publish/app-signing#generate-key storePassword=??? keyPassword=??? keyAlias=??? storeFile=??? appId=io.flutter.plugins.inapppurchaseexample.DEFAULT_DO_NOT_USE versionCode=1 -versionName=0.0.1 \ No newline at end of file +versionName=0.0.1 diff --git a/packages/in_app_purchase/in_app_purchase_android/example/lib/main.dart b/packages/in_app_purchase/in_app_purchase_android/example/lib/main.dart index d3eafa8d7152..fbae24a5dcfd 100644 --- a/packages/in_app_purchase/in_app_purchase_android/example/lib/main.dart +++ b/packages/in_app_purchase/in_app_purchase_android/example/lib/main.dart @@ -49,6 +49,9 @@ class _MyAppState extends State<_MyApp> { List _purchases = []; List _consumables = []; String _countryCode = ''; + String _isAlternativeBillingOnlyAvailableResponseCode = ''; + String _showAlternativeBillingOnlyDialogResponseCode = ''; + String _alternativeBillingOnlyReportingDetailsToken = ''; bool _isAvailable = false; bool _purchasePending = false; bool _loading = true; @@ -145,6 +148,7 @@ class _MyAppState extends State<_MyApp> { _buildProductList(), _buildConsumableBox(), const _FeatureCard(), + _buildFetchButtons(), ], ), ); @@ -209,6 +213,119 @@ class _MyAppState extends State<_MyApp> { return Card(child: Column(children: children)); } + Card _buildFetchButtons() { + const ListTile header = ListTile(title: Text('AlternativeBilling Info')); + final List entries = []; + entries.add(ListTile( + title: Text('User Country Code', + style: TextStyle(color: ThemeData.light().colorScheme.primary)), + subtitle: Text(_countryCode))); + entries.add(ListTile( + title: Text('isAlternativeBillingOnlyAvailable response code', + style: TextStyle(color: ThemeData.light().colorScheme.primary)), + subtitle: Text(_isAlternativeBillingOnlyAvailableResponseCode))); + entries.add(ListTile( + title: Text('showAlternativeBillingOnlyDialog response code', + style: TextStyle(color: ThemeData.light().colorScheme.primary)), + subtitle: Text(_showAlternativeBillingOnlyDialogResponseCode))); + entries.add(ListTile( + title: Text('createAlternativeBillingOnlyReportingDetails contents', + style: TextStyle(color: ThemeData.light().colorScheme.primary)), + subtitle: Text(_alternativeBillingOnlyReportingDetailsToken))); + + final List buttons = []; + buttons.add(ListTile( + title: TextButton( + style: TextButton.styleFrom( + backgroundColor: Colors.green[800], + foregroundColor: Colors.white, + ), + onPressed: () { + final InAppPurchaseAndroidPlatformAddition addition = + InAppPurchasePlatformAddition.instance! + as InAppPurchaseAndroidPlatformAddition; + unawaited(deliverCountryCode(addition.getCountryCode())); + }, + child: const Text('Fetch Country Code'), + ), + )); + buttons.add(ListTile( + title: TextButton( + style: TextButton.styleFrom( + backgroundColor: Colors.green[800], + foregroundColor: Colors.white, + ), + onPressed: () { + final InAppPurchaseAndroidPlatformAddition addition = + InAppPurchasePlatformAddition.instance! + as InAppPurchaseAndroidPlatformAddition; + unawaited(deliverIsAlternativeBillingOnlyAvailable( + addition.isAlternativeBillingOnlyAvailable())); + }, + child: const Text('isAlternativeBillingOnlyAvailable'), + ), + )); + buttons.add(ListTile( + title: TextButton( + style: TextButton.styleFrom( + backgroundColor: Colors.green[800], + foregroundColor: Colors.white, + ), + onPressed: () { + final InAppPurchaseAndroidPlatformAddition addition = + InAppPurchasePlatformAddition.instance! + as InAppPurchaseAndroidPlatformAddition; + unawaited(deliverShowAlternativeBillingOnlyInformationDialogResult( + addition.showAlternativeBillingOnlyInformationDialog())); + }, + child: const Text('showAlternativeBillingOnlyInformationDialog'), + ), + )); + buttons.add(ListTile( + title: TextButton( + style: TextButton.styleFrom( + backgroundColor: Colors.green[800], + foregroundColor: Colors.white, + ), + onPressed: () { + final InAppPurchaseAndroidPlatformAddition addition = + InAppPurchasePlatformAddition.instance! + as InAppPurchaseAndroidPlatformAddition; + unawaited(addition + .setBillingChoice(BillingChoiceMode.alternativeBillingOnly)); + }, + child: const Text('setBillingChoice alternativeBillingOnly'), + ), + )); + buttons.add(ListTile( + title: TextButton( + style: TextButton.styleFrom( + backgroundColor: Colors.green[800], + foregroundColor: Colors.white, + ), + onPressed: () { + final InAppPurchaseAndroidPlatformAddition addition = + InAppPurchasePlatformAddition.instance! + as InAppPurchaseAndroidPlatformAddition; + unawaited(deliverCreateAlternativeBillingOnlyReportingDetails( + addition.createAlternativeBillingOnlyReportingDetails())); + }, + child: const Text('createAlternativeBillingOnlyReportingDetails'), + ), + )); + return Card( + child: Column( + children: [ + header, + const Divider(), + ...entries, + const Divider(), + ...buttons, + ], + ), + ); + } + Card _buildProductList() { if (_loading) { return const Card( @@ -229,11 +346,6 @@ class _MyAppState extends State<_MyApp> { 'This app needs special configuration to run. Please see example/README.md for instructions.'))); } - productList.add(ListTile( - title: Text('User Country Code', - style: TextStyle(color: ThemeData.light().colorScheme.error)), - subtitle: Text(_countryCode))); - // This loading previous purchases code is just a demo. Please do not use this as it is. // In your app you should always verify the purchase data using the `verificationData` inside the [PurchaseDetails] object before trusting it. // We recommend that you use your own server to verify the purchase data. @@ -352,12 +464,46 @@ class _MyAppState extends State<_MyApp> { }); } - Future deliverCountryCode(String countryCode) async { + Future deliverCountryCode(Future countryCodeFuture) async { + final String countryCode = await countryCodeFuture; setState(() { _countryCode = countryCode; }); } + Future deliverIsAlternativeBillingOnlyAvailable( + Future billingOnly) async { + final BillingResultWrapper wrapper = await billingOnly; + setState(() { + _isAlternativeBillingOnlyAvailableResponseCode = + wrapper.responseCode.name; + }); + } + + Future deliverShowAlternativeBillingOnlyInformationDialogResult( + Future billingResult) async { + final BillingResultWrapper wrapper = await billingResult; + setState(() { + _showAlternativeBillingOnlyDialogResponseCode = wrapper.responseCode.name; + }); + } + + Future deliverCreateAlternativeBillingOnlyReportingDetails( + Future + futureWrapper) async { + final AlternativeBillingOnlyReportingDetailsWrapper wrapper = + await futureWrapper; + setState(() { + if (wrapper.responseCode == BillingResponse.ok) { + _alternativeBillingOnlyReportingDetailsToken = + wrapper.externalTransactionToken; + } else { + _alternativeBillingOnlyReportingDetailsToken = + wrapper.responseCode.name; + } + }); + } + Future deliverProduct(PurchaseDetails purchaseDetails) async { // IMPORTANT!! Always verify purchase details before delivering the product. if (purchaseDetails.productID == _kConsumableId) { @@ -400,7 +546,6 @@ class _MyAppState extends State<_MyApp> { final InAppPurchaseAndroidPlatformAddition addition = InAppPurchasePlatformAddition.instance! as InAppPurchaseAndroidPlatformAddition; - unawaited(deliverCountryCode(await addition.getCountryCode())); if (purchaseDetails.status == PurchaseStatus.error) { handleError(purchaseDetails.error!); } else if (purchaseDetails.status == PurchaseStatus.purchased || diff --git a/packages/in_app_purchase/in_app_purchase_android/lib/billing_client_wrappers.dart b/packages/in_app_purchase/in_app_purchase_android/lib/billing_client_wrappers.dart index 31133424afb6..8a53b95e9a7e 100644 --- a/packages/in_app_purchase/in_app_purchase_android/lib/billing_client_wrappers.dart +++ b/packages/in_app_purchase/in_app_purchase_android/lib/billing_client_wrappers.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. +export 'src/billing_client_wrappers/alternative_billing_only_reporting_details_wrapper.dart'; export 'src/billing_client_wrappers/billing_client_manager.dart'; export 'src/billing_client_wrappers/billing_client_wrapper.dart'; export 'src/billing_client_wrappers/billing_response_wrapper.dart'; diff --git a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/alternative_billing_only_reporting_details_wrapper.dart b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/alternative_billing_only_reporting_details_wrapper.dart new file mode 100644 index 000000000000..6e6dee97fb82 --- /dev/null +++ b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/alternative_billing_only_reporting_details_wrapper.dart @@ -0,0 +1,79 @@ +// 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'; +import 'package:json_annotation/json_annotation.dart'; + +import '../../billing_client_wrappers.dart'; + +// WARNING: Changes to `@JsonSerializable` classes need to be reflected in the +// below generated file. Run `flutter packages pub run build_runner watch` to +// rebuild and watch for further changes. +part 'alternative_billing_only_reporting_details_wrapper.g.dart'; + +/// The error message shown when the map representing details is invalid from method channel. +/// +/// This usually indicates a serious underlying code issue in the plugin. +@visibleForTesting +const String kInvalidAlternativeBillingReportingDetailsErrorMessage = + 'Invalid AlternativeBillingReportingDetails map from method channel.'; + +/// Params containing the response code and the debug message from the Play Billing API response. +@JsonSerializable() +@BillingResponseConverter() +@immutable +class AlternativeBillingOnlyReportingDetailsWrapper + implements HasBillingResponse { + /// Constructs the object with [responseCode] and [debugMessage]. + const AlternativeBillingOnlyReportingDetailsWrapper( + {required this.responseCode, + this.debugMessage, + this.externalTransactionToken = ''}); + + /// Constructs an instance of this from a key value map of data. + /// + /// The map needs to have named string keys with values matching the names and + /// types of all of the members on this class. + factory AlternativeBillingOnlyReportingDetailsWrapper.fromJson( + Map? map) { + if (map == null || map.isEmpty) { + return const AlternativeBillingOnlyReportingDetailsWrapper( + responseCode: BillingResponse.error, + debugMessage: kInvalidAlternativeBillingReportingDetailsErrorMessage, + ); + } + return _$AlternativeBillingOnlyReportingDetailsWrapperFromJson(map); + } + + /// Response code returned in the Play Billing API calls. + @override + final BillingResponse responseCode; + + /// Debug message returned in the Play Billing API calls. + /// + /// Defaults to `null`. + /// This message uses an en-US locale and should not be shown to users. + @JsonKey(defaultValue: '') + final String? debugMessage; + + /// https://developer.android.com/reference/com/android/billingclient/api/AlternativeBillingOnlyReportingDetails#getExternalTransactionToken() + @JsonKey(defaultValue: '') + final String externalTransactionToken; + + @override + bool operator ==(Object other) { + if (other.runtimeType != runtimeType) { + return false; + } + + return other is AlternativeBillingOnlyReportingDetailsWrapper && + other.responseCode == responseCode && + other.debugMessage == debugMessage && + other.externalTransactionToken == externalTransactionToken; + } + + @override + int get hashCode => + Object.hash(responseCode, debugMessage, externalTransactionToken); +} diff --git a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/alternative_billing_only_reporting_details_wrapper.g.dart b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/alternative_billing_only_reporting_details_wrapper.g.dart new file mode 100644 index 000000000000..46b82645de0f --- /dev/null +++ b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/alternative_billing_only_reporting_details_wrapper.g.dart @@ -0,0 +1,17 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'alternative_billing_only_reporting_details_wrapper.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AlternativeBillingOnlyReportingDetailsWrapper + _$AlternativeBillingOnlyReportingDetailsWrapperFromJson(Map json) => + AlternativeBillingOnlyReportingDetailsWrapper( + responseCode: const BillingResponseConverter() + .fromJson(json['responseCode'] as int?), + debugMessage: json['debugMessage'] as String? ?? '', + externalTransactionToken: + json['externalTransactionToken'] as String? ?? '', + ); diff --git a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_client_manager.dart b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_client_manager.dart index 0eca29606a5c..789ba5e01cc3 100644 --- a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_client_manager.dart +++ b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_client_manager.dart @@ -32,7 +32,8 @@ class BillingClientManager { /// Creates the [BillingClientManager]. /// /// Immediately initializes connection to the underlying [BillingClient]. - BillingClientManager() { + BillingClientManager() + : _billingChoiceMode = BillingChoiceMode.playBillingOnly { _connect(); } @@ -53,6 +54,7 @@ class BillingClientManager { final StreamController _purchasesUpdatedController = StreamController.broadcast(); + BillingChoiceMode _billingChoiceMode; bool _isConnecting = false; bool _isDisposed = false; @@ -119,6 +121,19 @@ class BillingClientManager { _purchasesUpdatedController.close(); } + /// Ends connection to [BillingClient] and reconnects with [billingChoiceMode]. + /// + /// Callers need to check if [BillingChoiceMode.alternativeBillingOnly] is + /// available by calling [BillingClientWrapper.isAlternativeBillingOnlyAvailable] + /// first. + Future reconnectWithBillingChoiceMode( + BillingChoiceMode billingChoiceMode) async { + _billingChoiceMode = billingChoiceMode; + // Ends connection and triggers OnBillingServiceDisconnected, which causes reconnect. + await client.endConnection(); + await _connect(); + } + // If disposed, does nothing. // If currently connecting, waits for it to complete. // Otherwise, starts a new connection. @@ -131,7 +146,9 @@ class BillingClientManager { } _isConnecting = true; _readyFuture = Future.sync(() async { - await client.startConnection(onBillingServiceDisconnected: _connect); + await client.startConnection( + onBillingServiceDisconnected: _connect, + billingChoiceMode: _billingChoiceMode); _isConnecting = false; }); return _readyFuture; diff --git a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_client_wrapper.dart b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_client_wrapper.dart index c54fc54e91b0..15dc4217fe69 100644 --- a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_client_wrapper.dart +++ b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_client_wrapper.dart @@ -109,8 +109,9 @@ class BillingClient { /// This triggers the creation of a new `BillingClient` instance in Java if /// one doesn't already exist. Future startConnection( - {required OnBillingServiceDisconnected - onBillingServiceDisconnected}) async { + {required OnBillingServiceDisconnected onBillingServiceDisconnected, + BillingChoiceMode billingChoiceMode = + BillingChoiceMode.playBillingOnly}) async { final List disconnectCallbacks = _callbacks[_kOnBillingServiceDisconnected] ??= []; disconnectCallbacks.add(onBillingServiceDisconnected); @@ -119,6 +120,8 @@ class BillingClient { 'BillingClient#startConnection(BillingClientStateListener)', { 'handle': disconnectCallbacks.length - 1, + 'billingChoiceMode': + const BillingChoiceModeConverter().toJson(billingChoiceMode), })) ?? {}); } @@ -330,7 +333,7 @@ class BillingClient { // Must match the value of GET_BILLING_CONFIG in // ../../../android/src/main/java/io/flutter/plugins/inapppurchase/MethodCallHandlerImpl.java @visibleForTesting - final String getBillingConfigMethodString = + static const String getBillingConfigMethodString = 'BillingClient#getBillingConfig()'; /// Fetches billing config info into a [BillingConfigWrapper] object. @@ -340,6 +343,57 @@ class BillingClient { {}); } + /// isAlternativeBillingOnlyAvailable method channel string identifier. + // + // Must match the value of IS_ALTERNATIVE_BILLING_ONLY_AVAILABLE in + // ../../../android/src/main/java/io/flutter/plugins/inapppurchase/MethodCallHandlerImpl.java + @visibleForTesting + static const String isAlternativeBillingOnlyAvailableMethodString = + 'BillingClient#isAlternativeBillingOnlyAvailable()'; + + /// Checks if "AlterntitiveBillingOnly" feature is available. + Future isAlternativeBillingOnlyAvailable() async { + return BillingResultWrapper.fromJson( + (await channel.invokeMapMethod( + isAlternativeBillingOnlyAvailableMethodString)) ?? + {}); + } + + /// showAlternativeBillingOnlyInformationDialog method channel string identifier. + // + // Must match the value of SHOW_ALTERNATIVE_BILLING_ONLY_INFORMATION_DIALOG in + // ../../../android/src/main/java/io/flutter/plugins/inapppurchase/MethodCallHandlerImpl.java + @visibleForTesting + static const String showAlternativeBillingOnlyInformationDialogMethodString = + 'BillingClient#showAlternativeBillingOnlyInformationDialog()'; + + /// Shows the alternative billing only information dialog on top of the calling app. + Future + showAlternativeBillingOnlyInformationDialog() async { + return BillingResultWrapper.fromJson( + (await channel.invokeMapMethod( + showAlternativeBillingOnlyInformationDialogMethodString)) ?? + {}); + } + + /// createAlternativeBillingOnlyReportingDetails method channel string identifier. + // + // Must match the value of CREATE_ALTERNATIVE_BILLING_ONLY_REPORTING_DETAILS in + // ../../../android/src/main/java/io/flutter/plugins/inapppurchase/MethodCallHandlerImpl.java + @visibleForTesting + static const String createAlternativeBillingOnlyReportingDetailsMethodString = + 'BillingClient#createAlternativeBillingOnlyReportingDetails()'; + + /// The details used to report transactions made via alternative billing + /// without user choice to use Google Play billing. + Future + createAlternativeBillingOnlyReportingDetails() async { + return AlternativeBillingOnlyReportingDetailsWrapper.fromJson( + (await channel.invokeMapMethod( + createAlternativeBillingOnlyReportingDetailsMethodString)) ?? + {}); + } + /// The method call handler for [channel]. @visibleForTesting Future callHandler(MethodCall call) async { @@ -434,6 +488,48 @@ enum BillingResponse { networkError, } +/// Plugin concept to cover billing modes. +/// +/// [playBillingOnly] (google play billing only). +/// [alternativeBillingOnly] (app provided billing with reporting to play). +@JsonEnum(alwaysCreate: true) +enum BillingChoiceMode { + // WARNING: Changes to this class need to be reflected in our generated code. + // Run `flutter packages pub run build_runner watch` to rebuild and watch for + // further changes. + // Values must match what is used in + // in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/MethodCallHandlerImpl.java + + /// Billing through google play. Default state. + @JsonValue(0) + playBillingOnly, + + /// Billing through app provided flow. + @JsonValue(1) + alternativeBillingOnly, +} + +/// Serializer for [BillingChoiceMode]. +/// +/// Use these in `@JsonSerializable()` classes by annotating them with +/// `@BillingChoiceModeConverter()`. +class BillingChoiceModeConverter + implements JsonConverter { + /// Default const constructor. + const BillingChoiceModeConverter(); + + @override + BillingChoiceMode fromJson(int? json) { + if (json == null) { + return BillingChoiceMode.playBillingOnly; + } + return $enumDecode(_$BillingChoiceModeEnumMap, json); + } + + @override + int toJson(BillingChoiceMode object) => _$BillingChoiceModeEnumMap[object]!; +} + /// Serializer for [BillingResponse]. /// /// Use these in `@JsonSerializable()` classes by annotating them with diff --git a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_client_wrapper.g.dart b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_client_wrapper.g.dart index f0f99ee55255..eb7b41afce14 100644 --- a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_client_wrapper.g.dart +++ b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_client_wrapper.g.dart @@ -22,6 +22,11 @@ const _$BillingResponseEnumMap = { BillingResponse.networkError: 12, }; +const _$BillingChoiceModeEnumMap = { + BillingChoiceMode.playBillingOnly: 0, + BillingChoiceMode.alternativeBillingOnly: 1, +}; + const _$ProductTypeEnumMap = { ProductType.inapp: 'inapp', ProductType.subs: 'subs', diff --git a/packages/in_app_purchase/in_app_purchase_android/lib/src/in_app_purchase_android_platform_addition.dart b/packages/in_app_purchase/in_app_purchase_android/lib/src/in_app_purchase_android_platform_addition.dart index aa660192ee39..732840802d28 100644 --- a/packages/in_app_purchase/in_app_purchase_android/lib/src/in_app_purchase_android_platform_addition.dart +++ b/packages/in_app_purchase/in_app_purchase_android/lib/src/in_app_purchase_android_platform_addition.dart @@ -157,4 +157,51 @@ class InAppPurchaseAndroidPlatformAddition .runWithClient((BillingClient client) => client.getBillingConfig()); return billingConfig.countryCode; } + + /// Returns if the caller can use alternative billing only without giving the + /// user a choice to use Play billing. + /// + /// See: https://developer.android.com/reference/com/android/billingclient/api/BillingClient#isAlternativeBillingOnlyAvailableAsync(com.android.billingclient.api.AlternativeBillingOnlyAvailabilityListener) + Future isAlternativeBillingOnlyAvailable() async { + final BillingResultWrapper wrapper = + await _billingClientManager.runWithClient((BillingClient client) => + client.isAlternativeBillingOnlyAvailable()); + return wrapper; + } + + /// Shows the alternative billing only information dialog on top of the calling app. + /// + /// See: https://developer.android.com/reference/com/android/billingclient/api/BillingClient#showAlternativeBillingOnlyInformationDialog(android.app.Activity,%20com.android.billingclient.api.AlternativeBillingOnlyInformationDialogListener) + Future + showAlternativeBillingOnlyInformationDialog() async { + final BillingResultWrapper wrapper = + await _billingClientManager.runWithClient((BillingClient client) => + client.showAlternativeBillingOnlyInformationDialog()); + return wrapper; + } + + /// The details used to report transactions made via alternative billing + /// without user choice to use Google Play billing. + /// + /// See: https://developer.android.com/reference/com/android/billingclient/api/AlternativeBillingOnlyReportingDetails + Future + createAlternativeBillingOnlyReportingDetails() async { + final AlternativeBillingOnlyReportingDetailsWrapper wrapper = + await _billingClientManager.runWithClient((BillingClient client) => + client.createAlternativeBillingOnlyReportingDetails()); + return wrapper; + } + + /// Disconnects, sets AlternativeBillingOnly to true, and reconnects to + /// the [BillingClient]. + /// + /// [BillingChoiceMode.playBillingOnly] is the default state used. + /// [BillingChoiceMode.alternativeBillingOnly] will enable alternative billing only. + /// + /// Play apis have requirements for when this method can be called. + /// See: https://developer.android.com/google/play/billing/alternative/alternative-billing-without-user-choice-in-app + Future setBillingChoice(BillingChoiceMode billingChoiceMode) { + return _billingClientManager + .reconnectWithBillingChoiceMode(billingChoiceMode); + } } diff --git a/packages/in_app_purchase/in_app_purchase_android/pubspec.yaml b/packages/in_app_purchase/in_app_purchase_android/pubspec.yaml index d97518aa751e..08f34f113fbc 100644 --- a/packages/in_app_purchase/in_app_purchase_android/pubspec.yaml +++ b/packages/in_app_purchase/in_app_purchase_android/pubspec.yaml @@ -2,7 +2,7 @@ name: in_app_purchase_android description: An implementation for the Android platform of the Flutter `in_app_purchase` plugin. This uses the Android BillingClient APIs. repository: https://github.com/flutter/packages/tree/main/packages/in_app_purchase/in_app_purchase_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22 -version: 0.3.0+18 +version: 0.3.1 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/in_app_purchase/in_app_purchase_android/test/billing_client_wrappers/billing_client_manager_test.dart b/packages/in_app_purchase/in_app_purchase_android/test/billing_client_wrappers/billing_client_manager_test.dart index 85af3aa15d9d..b53bb5c96c3f 100644 --- a/packages/in_app_purchase/in_app_purchase_android/test/billing_client_wrappers/billing_client_manager_test.dart +++ b/packages/in_app_purchase/in_app_purchase_android/test/billing_client_wrappers/billing_client_manager_test.dart @@ -81,6 +81,36 @@ void main() { expect(stubPlatform.countPreviousCalls(startConnectionCall), equals(2)); }); + test('re-connects when host calls reconnectWithBillingChoiceMode', + () async { + connectedCompleter.complete(); + // Ensures all asynchronous connected code finishes. + await manager.runWithClientNonRetryable((_) async {}); + + await manager.reconnectWithBillingChoiceMode( + BillingChoiceMode.alternativeBillingOnly); + // Verify that connection was ended. + expect(stubPlatform.countPreviousCalls(endConnectionCall), equals(1)); + + stubPlatform.reset(); + + late Map arguments; + stubPlatform.addResponse( + name: startConnectionCall, + additionalStepBeforeReturn: (dynamic value) => + arguments = value as Map, + ); + + /// Fake the disconnect that we would expect from a endConnectionCall. + await manager.client.callHandler( + const MethodCall(onBillingServiceDisconnectedCallback, + {'handle': 0}), + ); + // Verify that after connection ended reconnect was called. + expect(stubPlatform.countPreviousCalls(startConnectionCall), equals(1)); + expect(arguments['billingChoiceMode'], 1); + }); + test( 're-connects when operation returns BillingResponse.serviceDisconnected', () async { diff --git a/packages/in_app_purchase/in_app_purchase_android/test/billing_client_wrappers/billing_client_wrapper_test.dart b/packages/in_app_purchase/in_app_purchase_android/test/billing_client_wrappers/billing_client_wrapper_test.dart index df1c6278a1c3..3ffcd8d5d08e 100644 --- a/packages/in_app_purchase/in_app_purchase_android/test/billing_client_wrappers/billing_client_wrapper_test.dart +++ b/packages/in_app_purchase/in_app_purchase_android/test/billing_client_wrappers/billing_client_wrapper_test.dart @@ -106,7 +106,34 @@ void main() { ); await billingClient.startConnection(onBillingServiceDisconnected: () {}); final MethodCall call = stubPlatform.previousCallMatching(methodName); - expect(call.arguments, equals({'handle': 0})); + expect( + call.arguments, + equals({ + 'handle': 0, + 'billingChoiceMode': 0, + })); + }); + + test('passes billingChoiceMode when set', () async { + const String debugMessage = 'dummy message'; + const BillingResponse responseCode = BillingResponse.developerError; + stubPlatform.addResponse( + name: methodName, + value: { + 'responseCode': const BillingResponseConverter().toJson(responseCode), + 'debugMessage': debugMessage, + }, + ); + await billingClient.startConnection( + onBillingServiceDisconnected: () {}, + billingChoiceMode: BillingChoiceMode.alternativeBillingOnly); + final MethodCall call = stubPlatform.previousCallMatching(methodName); + expect( + call.arguments, + equals({ + 'handle': 0, + 'billingChoiceMode': 1, + })); }); test('handles method channel returning null', () async { @@ -644,14 +671,13 @@ void main() { }); group('billingConfig', () { - const String billingConfigMethodName = 'BillingClient#getBillingConfig()'; test('billingConfig returns object', () async { const BillingConfigWrapper expected = BillingConfigWrapper( countryCode: 'US', responseCode: BillingResponse.ok, debugMessage: ''); stubPlatform.addResponse( - name: billingConfigMethodName, + name: BillingClient.getBillingConfigMethodString, value: buildBillingConfigMap(expected), ); final BillingConfigWrapper result = @@ -662,7 +688,7 @@ void main() { test('handles method channel returning null', () async { stubPlatform.addResponse( - name: billingConfigMethodName, + name: BillingClient.getBillingConfigMethodString, ); final BillingConfigWrapper result = await billingClient.getBillingConfig(); @@ -674,6 +700,79 @@ void main() { ))); }); }); + + group('isAlternativeBillingOnlyAvailable', () { + test('returns object', () async { + const BillingResultWrapper expected = + BillingResultWrapper(responseCode: BillingResponse.ok); + stubPlatform.addResponse( + name: BillingClient.isAlternativeBillingOnlyAvailableMethodString, + value: buildBillingResultMap(expected)); + final BillingResultWrapper result = + await billingClient.isAlternativeBillingOnlyAvailable(); + expect(result, expected); + }); + + test('handles method channel returning null', () async { + stubPlatform.addResponse( + name: BillingClient.isAlternativeBillingOnlyAvailableMethodString, + ); + final BillingResultWrapper result = + await billingClient.isAlternativeBillingOnlyAvailable(); + expect(result.responseCode, BillingResponse.error); + }); + }); + + group('createAlternativeBillingOnlyReportingDetails', () { + test('returns object', () async { + const AlternativeBillingOnlyReportingDetailsWrapper expected = + AlternativeBillingOnlyReportingDetailsWrapper( + responseCode: BillingResponse.ok, + debugMessage: 'debug', + externalTransactionToken: 'abc123youandme'); + stubPlatform.addResponse( + name: BillingClient + .createAlternativeBillingOnlyReportingDetailsMethodString, + value: buildAlternativeBillingOnlyReportingDetailsMap(expected)); + final AlternativeBillingOnlyReportingDetailsWrapper result = + await billingClient.createAlternativeBillingOnlyReportingDetails(); + expect(result, equals(expected)); + }); + + test('handles method channel returning null', () async { + stubPlatform.addResponse( + name: BillingClient + .createAlternativeBillingOnlyReportingDetailsMethodString, + ); + final AlternativeBillingOnlyReportingDetailsWrapper result = + await billingClient.createAlternativeBillingOnlyReportingDetails(); + expect(result.responseCode, BillingResponse.error); + }); + }); + + group('showAlternativeBillingOnlyInformationDialog', () { + test('returns object', () async { + const BillingResultWrapper expected = + BillingResultWrapper(responseCode: BillingResponse.ok); + stubPlatform.addResponse( + name: BillingClient + .showAlternativeBillingOnlyInformationDialogMethodString, + value: buildBillingResultMap(expected)); + final BillingResultWrapper result = + await billingClient.showAlternativeBillingOnlyInformationDialog(); + expect(result, expected); + }); + + test('handles method channel returning null', () async { + stubPlatform.addResponse( + name: BillingClient + .showAlternativeBillingOnlyInformationDialogMethodString, + ); + final BillingResultWrapper result = + await billingClient.showAlternativeBillingOnlyInformationDialog(); + expect(result.responseCode, BillingResponse.error); + }); + }); } Map buildBillingConfigMap(BillingConfigWrapper original) { @@ -684,3 +783,14 @@ Map buildBillingConfigMap(BillingConfigWrapper original) { 'countryCode': original.countryCode, }; } + +Map buildAlternativeBillingOnlyReportingDetailsMap( + AlternativeBillingOnlyReportingDetailsWrapper original) { + return { + 'responseCode': + const BillingResponseConverter().toJson(original.responseCode), + 'debugMessage': original.debugMessage, + // from: io/flutter/plugins/inapppurchase/Translator.java + 'externalTransactionToken': original.externalTransactionToken, + }; +} diff --git a/packages/in_app_purchase/in_app_purchase_android/test/in_app_purchase_android_platform_addition_test.dart b/packages/in_app_purchase/in_app_purchase_android/test/in_app_purchase_android_platform_addition_test.dart index 4a97a43df5e9..718bd3cdde1c 100644 --- a/packages/in_app_purchase/in_app_purchase_android/test/in_app_purchase_android_platform_addition_test.dart +++ b/packages/in_app_purchase/in_app_purchase_android/test/in_app_purchase_android_platform_addition_test.dart @@ -22,6 +22,9 @@ void main() { const String startConnectionCall = 'BillingClient#startConnection(BillingClientStateListener)'; const String endConnectionCall = 'BillingClient#endConnection()'; + const String onBillingServiceDisconnectedCallback = + 'BillingClientStateListener#onBillingServiceDisconnected()'; + late BillingClientManager manager; setUpAll(() { TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger @@ -39,8 +42,8 @@ void main() { name: startConnectionCall, value: buildBillingResultMap(expectedBillingResult)); stubPlatform.addResponse(name: endConnectionCall); - iapAndroidPlatformAddition = - InAppPurchaseAndroidPlatformAddition(BillingClientManager()); + manager = BillingClientManager(); + iapAndroidPlatformAddition = InAppPurchaseAndroidPlatformAddition(manager); }); group('consume purchases', () { @@ -64,7 +67,6 @@ void main() { }); group('billingConfig', () { - const String billingConfigMethodName = 'BillingClient#getBillingConfig()'; test('getCountryCode success', () async { const String expectedCountryCode = 'US'; const BillingConfigWrapper expected = BillingConfigWrapper( @@ -73,7 +75,7 @@ void main() { debugMessage: 'dummy message'); stubPlatform.addResponse( - name: billingConfigMethodName, + name: BillingClient.getBillingConfigMethodString, value: buildBillingConfigMap(expected), ); final String countryCode = @@ -83,6 +85,90 @@ void main() { }); }); + group('setBillingChoice', () { + late Map arguments; + test('setAlternativeBillingOnlyState', () async { + stubPlatform.reset(); + stubPlatform.addResponse( + name: startConnectionCall, + additionalStepBeforeReturn: (dynamic value) => + arguments = value as Map, + ); + stubPlatform.addResponse(name: endConnectionCall); + await iapAndroidPlatformAddition + .setBillingChoice(BillingChoiceMode.alternativeBillingOnly); + + // Fake the disconnect that we would expect from a endConnectionCall. + await manager.client.callHandler( + const MethodCall(onBillingServiceDisconnectedCallback, + {'handle': 0}), + ); + // Verify that after connection ended reconnect was called. + expect(stubPlatform.countPreviousCalls(startConnectionCall), equals(2)); + expect( + arguments['billingChoiceMode'], + const BillingChoiceModeConverter() + .toJson(BillingChoiceMode.alternativeBillingOnly)); + }); + + test('setPlayBillingState', () async { + stubPlatform.reset(); + stubPlatform.addResponse( + name: startConnectionCall, + additionalStepBeforeReturn: (dynamic value) => + arguments = value as Map, + ); + stubPlatform.addResponse(name: endConnectionCall); + await iapAndroidPlatformAddition + .setBillingChoice(BillingChoiceMode.playBillingOnly); + + // Fake the disconnect that we would expect from a endConnectionCall. + await manager.client.callHandler( + const MethodCall(onBillingServiceDisconnectedCallback, + {'handle': 0}), + ); + // Verify that after connection ended reconnect was called. + expect(stubPlatform.countPreviousCalls(startConnectionCall), equals(2)); + expect( + arguments['billingChoiceMode'], + const BillingChoiceModeConverter() + .toJson(BillingChoiceMode.playBillingOnly)); + }); + }); + + group('isAlternativeBillingOnlyAvailable', () { + test('isAlternativeBillingOnlyAvailable success', () async { + const BillingResultWrapper expected = BillingResultWrapper( + responseCode: BillingResponse.ok, debugMessage: 'dummy message'); + + stubPlatform.addResponse( + name: BillingClient.isAlternativeBillingOnlyAvailableMethodString, + value: buildBillingResultMap(expected), + ); + final BillingResultWrapper result = + await iapAndroidPlatformAddition.isAlternativeBillingOnlyAvailable(); + + expect(result, equals(expected)); + }); + }); + + group('showAlternativeBillingOnlyInformationDialog', () { + test('showAlternativeBillingOnlyInformationDialog success', () async { + const BillingResultWrapper expected = BillingResultWrapper( + responseCode: BillingResponse.ok, debugMessage: 'dummy message'); + + stubPlatform.addResponse( + name: BillingClient + .showAlternativeBillingOnlyInformationDialogMethodString, + value: buildBillingResultMap(expected), + ); + final BillingResultWrapper result = + await iapAndroidPlatformAddition.isAlternativeBillingOnlyAvailable(); + + expect(result, equals(expected)); + }); + }); + group('queryPastPurchase', () { group('queryPurchaseDetails', () { const String queryMethodName = From 2424147b0a6e28ed06585a47cb85ba8aabaf332b Mon Sep 17 00:00:00 2001 From: Jakub Walusiak Date: Mon, 12 Feb 2024 22:21:55 +0100 Subject: [PATCH 04/40] [video_player_android] Handle BehindLiveWindowException (#5869) This PR adds error handling for BehindLiveWindowException when playing video streams as recommended in [ExoPlayer docs](https://developer.android.com/media/media3/exoplayer/live-streaming#behindlivewindowexception-and) Fixes https://github.com/flutter/flutter/issues/100478 --- .../video_player_android/CHANGELOG.md | 3 +- .../plugins/videoplayer/VideoPlayer.java | 6 +++- .../plugins/videoplayer/VideoPlayerTest.java | 33 +++++++++++++++++-- .../video_player_android/pubspec.yaml | 2 +- 4 files changed, 38 insertions(+), 6 deletions(-) diff --git a/packages/video_player/video_player_android/CHANGELOG.md b/packages/video_player/video_player_android/CHANGELOG.md index 8faafadf36b8..1606316b5540 100644 --- a/packages/video_player/video_player_android/CHANGELOG.md +++ b/packages/video_player/video_player_android/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 2.4.12 * Updates compileSdk version to 34. +* Adds error handling for `BehindLiveWindowException`, which may occur upon live-video playback failure. ## 2.4.11 diff --git a/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java b/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java index 57fc1037cc7b..b8b781912308 100644 --- a/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java +++ b/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java @@ -227,7 +227,11 @@ public void onPlaybackStateChanged(final int playbackState) { @Override public void onPlayerError(@NonNull final PlaybackException error) { setBuffering(false); - if (eventSink != null) { + if (error.errorCode == PlaybackException.ERROR_CODE_BEHIND_LIVE_WINDOW) { + // See https://exoplayer.dev/live-streaming.html#behindlivewindowexception-and-error_code_behind_live_window + exoPlayer.seekToDefaultPosition(); + exoPlayer.prepare(); + } else if (eventSink != null) { eventSink.error("VideoError", "Video player had error " + error, null); } } diff --git a/packages/video_player/video_player_android/android/src/test/java/io/flutter/plugins/videoplayer/VideoPlayerTest.java b/packages/video_player/video_player_android/android/src/test/java/io/flutter/plugins/videoplayer/VideoPlayerTest.java index 2ba6ee053885..85c1715dd6c6 100644 --- a/packages/video_player/video_player_android/android/src/test/java/io/flutter/plugins/videoplayer/VideoPlayerTest.java +++ b/packages/video_player/video_player_android/android/src/test/java/io/flutter/plugins/videoplayer/VideoPlayerTest.java @@ -5,22 +5,25 @@ package io.flutter.plugins.videoplayer; import static org.junit.Assert.assertEquals; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyBoolean; +import static org.mockito.Mockito.*; import static org.mockito.Mockito.any; import static org.mockito.Mockito.doAnswer; -import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; import com.google.android.exoplayer2.ExoPlayer; import com.google.android.exoplayer2.Format; +import com.google.android.exoplayer2.PlaybackException; +import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.upstream.DefaultHttpDataSource; import io.flutter.plugin.common.EventChannel; import io.flutter.view.TextureRegistry; import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; import java.util.Map; import org.junit.Before; import org.junit.Test; @@ -278,4 +281,28 @@ public void onIsPlayingChangedSendsExpectedEvent() { assertEquals(event2.get("event"), "isPlayingStateUpdate"); assertEquals(event2.get("isPlaying"), false); } + + @Test + public void behindLiveWindowErrorResetsPlayerToDefaultPosition() { + List listeners = new LinkedList<>(); + doAnswer(invocation -> listeners.add(invocation.getArgument(0))) + .when(fakeExoPlayer) + .addListener(any()); + + VideoPlayer unused = + new VideoPlayer( + fakeExoPlayer, + fakeEventChannel, + fakeSurfaceTextureEntry, + fakeVideoPlayerOptions, + fakeEventSink, + httpDataSourceFactorySpy); + + PlaybackException exception = + new PlaybackException(null, null, PlaybackException.ERROR_CODE_BEHIND_LIVE_WINDOW); + listeners.forEach(listener -> listener.onPlayerError(exception)); + + verify(fakeExoPlayer).seekToDefaultPosition(); + verify(fakeExoPlayer).prepare(); + } } diff --git a/packages/video_player/video_player_android/pubspec.yaml b/packages/video_player/video_player_android/pubspec.yaml index 5f488dde7467..3a8bbb0aceda 100644 --- a/packages/video_player/video_player_android/pubspec.yaml +++ b/packages/video_player/video_player_android/pubspec.yaml @@ -2,7 +2,7 @@ name: video_player_android description: Android implementation of the video_player plugin. repository: https://github.com/flutter/packages/tree/main/packages/video_player/video_player_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22 -version: 2.4.11 +version: 2.4.12 environment: sdk: ">=3.0.0 <4.0.0" From 70d4feeb1a03d37fec46cf52cbdcf17cd7e6d3ab Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Mon, 12 Feb 2024 15:46:18 -0800 Subject: [PATCH 05/40] [local_auth] Rename iOS classes (#6108) When we renamed `local_auth_ios` to `local_auth_darwin` I forgot that we needed to rename all of the classes. Not doing so would make it a breaking change for us to switch endorsement, since anyone who depends directly on `local_auth_ios` (anyone setting custom strings, most commonly) would then have both copies. It's an immediate runtime failure on launch since it tries to register the same plugin class twice, but even if we fixed just that it would be picking an implementation of each class and random and we could have strange runtime behavior as they diverge over time. This renames the plugin class to use the newer `FLA` prefix, and renames all of the internal classes already using `FLA` to `FLAD` to make them distinct. (This is slightly ugly, but we're only stuck with it until we convert this plugin to Swift.) --- .../local_auth/local_auth_darwin/CHANGELOG.md | 5 + ...LocalAuthPlugin.h => FLALocalAuthPlugin.h} | 2 +- ...LocalAuthPlugin.m => FLALocalAuthPlugin.m} | 93 +++++------ ...lugin_Test.h => FLALocalAuthPlugin_Test.h} | 6 +- .../darwin/Classes/messages.g.h | 76 ++++----- .../darwin/Classes/messages.g.m | 156 +++++++++--------- ...luginTests.m => FLALocalAuthPluginTests.m} | 156 +++++++++--------- .../ios/Runner.xcodeproj/project.pbxproj | 10 +- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- .../local_auth_darwin/pigeons/messages.dart | 2 +- .../local_auth/local_auth_darwin/pubspec.yaml | 4 +- 11 files changed, 259 insertions(+), 253 deletions(-) rename packages/local_auth/local_auth_darwin/darwin/Classes/{FLTLocalAuthPlugin.h => FLALocalAuthPlugin.h} (74%) rename packages/local_auth/local_auth_darwin/darwin/Classes/{FLTLocalAuthPlugin.m => FLALocalAuthPlugin.m} (72%) rename packages/local_auth/local_auth_darwin/darwin/Classes/{FLTLocalAuthPlugin_Test.h => FLALocalAuthPlugin_Test.h} (76%) rename packages/local_auth/local_auth_darwin/darwin/Tests/{FLTLocalAuthPluginTests.m => FLALocalAuthPluginTests.m} (82%) diff --git a/packages/local_auth/local_auth_darwin/CHANGELOG.md b/packages/local_auth/local_auth_darwin/CHANGELOG.md index 7c816d348e89..e5367d705efc 100644 --- a/packages/local_auth/local_auth_darwin/CHANGELOG.md +++ b/packages/local_auth/local_auth_darwin/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.2.1 + +* Renames the Objective-C plugin classes to avoid runtime conflicts with + `local_auth_ios` in apps that have transitive dependencies on both. + ## 1.2.0 * Renames the package previously published as [`local_auth_ios`](https://pub.dev/packages/local_auth_ios) diff --git a/packages/local_auth/local_auth_darwin/darwin/Classes/FLTLocalAuthPlugin.h b/packages/local_auth/local_auth_darwin/darwin/Classes/FLALocalAuthPlugin.h similarity index 74% rename from packages/local_auth/local_auth_darwin/darwin/Classes/FLTLocalAuthPlugin.h rename to packages/local_auth/local_auth_darwin/darwin/Classes/FLALocalAuthPlugin.h index d023ba3ed140..7168f350fe04 100644 --- a/packages/local_auth/local_auth_darwin/darwin/Classes/FLTLocalAuthPlugin.h +++ b/packages/local_auth/local_auth_darwin/darwin/Classes/FLALocalAuthPlugin.h @@ -6,5 +6,5 @@ #import "messages.g.h" -@interface FLTLocalAuthPlugin : NSObject +@interface FLALocalAuthPlugin : NSObject @end diff --git a/packages/local_auth/local_auth_darwin/darwin/Classes/FLTLocalAuthPlugin.m b/packages/local_auth/local_auth_darwin/darwin/Classes/FLALocalAuthPlugin.m similarity index 72% rename from packages/local_auth/local_auth_darwin/darwin/Classes/FLTLocalAuthPlugin.m rename to packages/local_auth/local_auth_darwin/darwin/Classes/FLALocalAuthPlugin.m index 3ac8ebe29cc7..6b9ef39f6e2d 100644 --- a/packages/local_auth/local_auth_darwin/darwin/Classes/FLTLocalAuthPlugin.m +++ b/packages/local_auth/local_auth_darwin/darwin/Classes/FLALocalAuthPlugin.m @@ -1,17 +1,17 @@ // 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 "FLTLocalAuthPlugin.h" -#import "FLTLocalAuthPlugin_Test.h" +#import "FLALocalAuthPlugin.h" +#import "FLALocalAuthPlugin_Test.h" #import -typedef void (^FLAAuthCompletion)(FLAAuthResultDetails *_Nullable, FlutterError *_Nullable); +typedef void (^FLADAuthCompletion)(FLADAuthResultDetails *_Nullable, FlutterError *_Nullable); /** * A default context factory that wraps standard LAContext allocation. */ -@interface FLADefaultAuthContextFactory : NSObject +@interface FLADefaultAuthContextFactory : NSObject @end @implementation FLADefaultAuthContextFactory @@ -26,18 +26,18 @@ - (LAContext *)createAuthContext { * A data container for sticky auth state. */ @interface FLAStickyAuthState : NSObject -@property(nonatomic, strong, nonnull) FLAAuthOptions *options; -@property(nonatomic, strong, nonnull) FLAAuthStrings *strings; -@property(nonatomic, copy, nonnull) FLAAuthCompletion resultHandler; -- (instancetype)initWithOptions:(nonnull FLAAuthOptions *)options - strings:(nonnull FLAAuthStrings *)strings - resultHandler:(nonnull FLAAuthCompletion)resultHandler; +@property(nonatomic, strong, nonnull) FLADAuthOptions *options; +@property(nonatomic, strong, nonnull) FLADAuthStrings *strings; +@property(nonatomic, copy, nonnull) FLADAuthCompletion resultHandler; +- (instancetype)initWithOptions:(nonnull FLADAuthOptions *)options + strings:(nonnull FLADAuthStrings *)strings + resultHandler:(nonnull FLADAuthCompletion)resultHandler; @end @implementation FLAStickyAuthState -- (instancetype)initWithOptions:(nonnull FLAAuthOptions *)options - strings:(nonnull FLAAuthStrings *)strings - resultHandler:(nonnull FLAAuthCompletion)resultHandler { +- (instancetype)initWithOptions:(nonnull FLADAuthOptions *)options + strings:(nonnull FLADAuthStrings *)strings + resultHandler:(nonnull FLADAuthCompletion)resultHandler { self = [super init]; if (self) { _options = options; @@ -50,24 +50,24 @@ - (instancetype)initWithOptions:(nonnull FLAAuthOptions *)options #pragma mark - -@interface FLTLocalAuthPlugin () +@interface FLALocalAuthPlugin () @property(nonatomic, strong, nullable) FLAStickyAuthState *lastCallState; -@property(nonatomic, strong) NSObject *authContextFactory; +@property(nonatomic, strong) NSObject *authContextFactory; @end -@implementation FLTLocalAuthPlugin +@implementation FLALocalAuthPlugin + (void)registerWithRegistrar:(NSObject *)registrar { - FLTLocalAuthPlugin *instance = [[FLTLocalAuthPlugin alloc] init]; + FLALocalAuthPlugin *instance = [[FLALocalAuthPlugin alloc] init]; [registrar addApplicationDelegate:instance]; - SetUpFLALocalAuthApi([registrar messenger], instance); + SetUpFLADLocalAuthApi([registrar messenger], instance); } - (instancetype)init { return [self initWithContextFactory:[[FLADefaultAuthContextFactory alloc] init]]; } -- (instancetype)initWithContextFactory:(NSObject *)factory { +- (instancetype)initWithContextFactory:(NSObject *)factory { self = [super init]; if (self) { _authContextFactory = factory; @@ -75,11 +75,11 @@ - (instancetype)initWithContextFactory:(NSObject *)factor return self; } -#pragma mark FLALocalAuthApi +#pragma mark FLADLocalAuthApi -- (void)authenticateWithOptions:(nonnull FLAAuthOptions *)options - strings:(nonnull FLAAuthStrings *)strings - completion:(nonnull void (^)(FLAAuthResultDetails *_Nullable, +- (void)authenticateWithOptions:(nonnull FLADAuthOptions *)options + strings:(nonnull FLADAuthStrings *)strings + completion:(nonnull void (^)(FLADAuthResultDetails *_Nullable, FlutterError *_Nullable))completion { LAContext *context = [self.authContextFactory createAuthContext]; NSError *authError = nil; @@ -126,18 +126,19 @@ - (nullable NSNumber *)deviceCanSupportBiometricsWithError: return @NO; } -- (nullable NSArray *)getEnrolledBiometricsWithError: +- (nullable NSArray *)getEnrolledBiometricsWithError: (FlutterError *_Nullable __autoreleasing *_Nonnull)error { LAContext *context = [self.authContextFactory createAuthContext]; NSError *authError = nil; - NSMutableArray *biometrics = [[NSMutableArray alloc] init]; + NSMutableArray *biometrics = [[NSMutableArray alloc] init]; if ([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&authError]) { if (authError == nil) { if (context.biometryType == LABiometryTypeFaceID) { - [biometrics addObject:[FLAAuthBiometricWrapper makeWithValue:FLAAuthBiometricFace]]; + [biometrics addObject:[FLADAuthBiometricWrapper makeWithValue:FLADAuthBiometricFace]]; } else if (context.biometryType == LABiometryTypeTouchID) { - [biometrics addObject:[FLAAuthBiometricWrapper makeWithValue:FLAAuthBiometricFingerprint]]; + [biometrics + addObject:[FLADAuthBiometricWrapper makeWithValue:FLADAuthBiometricFingerprint]]; } } } @@ -155,7 +156,7 @@ - (nullable NSNumber *)isDeviceSupportedWithError: - (void)showAlertWithMessage:(NSString *)message dismissButtonTitle:(NSString *)dismissButtonTitle openSettingsButtonTitle:(NSString *)openSettingsButtonTitle - completion:(FLAAuthCompletion)completion { + completion:(FLADAuthCompletion)completion { UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"" message:message @@ -189,9 +190,9 @@ - (void)showAlertWithMessage:(NSString *)message - (void)handleAuthReplyWithSuccess:(BOOL)success error:(NSError *)error - options:(FLAAuthOptions *)options - strings:(FLAAuthStrings *)strings - completion:(nonnull FLAAuthCompletion)completion { + options:(FLADAuthOptions *)options + strings:(FLADAuthStrings *)strings + completion:(nonnull FLADAuthCompletion)completion { NSAssert([NSThread isMainThread], @"Response handling must be done on the main thread."); if (success) { [self handleSucceeded:YES withCompletion:completion]; @@ -219,19 +220,19 @@ - (void)handleAuthReplyWithSuccess:(BOOL)success } } -- (void)handleSucceeded:(BOOL)succeeded withCompletion:(nonnull FLAAuthCompletion)completion { - completion( - [FLAAuthResultDetails makeWithResult:(succeeded ? FLAAuthResultSuccess : FLAAuthResultFailure) - errorMessage:nil - errorDetails:nil], - nil); +- (void)handleSucceeded:(BOOL)succeeded withCompletion:(nonnull FLADAuthCompletion)completion { + completion([FLADAuthResultDetails + makeWithResult:(succeeded ? FLADAuthResultSuccess : FLADAuthResultFailure) + errorMessage:nil + errorDetails:nil], + nil); } - (void)handleError:(NSError *)authError - withOptions:(FLAAuthOptions *)options - strings:(FLAAuthStrings *)strings - completion:(nonnull FLAAuthCompletion)completion { - FLAAuthResult result = FLAAuthResultErrorNotAvailable; + withOptions:(FLADAuthOptions *)options + strings:(FLADAuthStrings *)strings + completion:(nonnull FLADAuthCompletion)completion { + FLADAuthResult result = FLADAuthResultErrorNotAvailable; switch (authError.code) { case LAErrorPasscodeNotSet: case LAErrorBiometryNotEnrolled: @@ -242,8 +243,8 @@ - (void)handleError:(NSError *)authError completion:completion]; return; } - result = authError.code == LAErrorPasscodeNotSet ? FLAAuthResultErrorPasscodeNotSet - : FLAAuthResultErrorNotEnrolled; + result = authError.code == LAErrorPasscodeNotSet ? FLADAuthResultErrorPasscodeNotSet + : FLADAuthResultErrorNotEnrolled; break; case LAErrorBiometryLockout: [self showAlertWithMessage:strings.lockOut @@ -252,9 +253,9 @@ - (void)handleError:(NSError *)authError completion:completion]; return; } - completion([FLAAuthResultDetails makeWithResult:result - errorMessage:authError.localizedDescription - errorDetails:authError.domain], + completion([FLADAuthResultDetails makeWithResult:result + errorMessage:authError.localizedDescription + errorDetails:authError.domain], nil); } diff --git a/packages/local_auth/local_auth_darwin/darwin/Classes/FLTLocalAuthPlugin_Test.h b/packages/local_auth/local_auth_darwin/darwin/Classes/FLALocalAuthPlugin_Test.h similarity index 76% rename from packages/local_auth/local_auth_darwin/darwin/Classes/FLTLocalAuthPlugin_Test.h rename to packages/local_auth/local_auth_darwin/darwin/Classes/FLALocalAuthPlugin_Test.h index c35322033f99..79ac48ec8cbc 100644 --- a/packages/local_auth/local_auth_darwin/darwin/Classes/FLTLocalAuthPlugin_Test.h +++ b/packages/local_auth/local_auth_darwin/darwin/Classes/FLALocalAuthPlugin_Test.h @@ -8,14 +8,14 @@ /** * Protocol for a source of LAContext instances. Used to allow context injection in unit tests. */ -@protocol FLAAuthContextFactory +@protocol FLADAuthContextFactory - (LAContext *)createAuthContext; @end -@interface FLTLocalAuthPlugin () +@interface FLALocalAuthPlugin () /** * Returns an instance that uses the given factory to create LAContexts. */ -- (instancetype)initWithContextFactory:(NSObject *)factory +- (instancetype)initWithContextFactory:(NSObject *)factory NS_DESIGNATED_INITIALIZER; @end diff --git a/packages/local_auth/local_auth_darwin/darwin/Classes/messages.g.h b/packages/local_auth/local_auth_darwin/darwin/Classes/messages.g.h index 712216c7599f..e15d520472a8 100644 --- a/packages/local_auth/local_auth_darwin/darwin/Classes/messages.g.h +++ b/packages/local_auth/local_auth_darwin/darwin/Classes/messages.g.h @@ -14,46 +14,46 @@ NS_ASSUME_NONNULL_BEGIN /// Possible outcomes of an authentication attempt. -typedef NS_ENUM(NSUInteger, FLAAuthResult) { +typedef NS_ENUM(NSUInteger, FLADAuthResult) { /// The user authenticated successfully. - FLAAuthResultSuccess = 0, + FLADAuthResultSuccess = 0, /// The user failed to successfully authenticate. - FLAAuthResultFailure = 1, + FLADAuthResultFailure = 1, /// The authentication system was not available. - FLAAuthResultErrorNotAvailable = 2, + FLADAuthResultErrorNotAvailable = 2, /// No biometrics are enrolled. - FLAAuthResultErrorNotEnrolled = 3, + FLADAuthResultErrorNotEnrolled = 3, /// No passcode is set. - FLAAuthResultErrorPasscodeNotSet = 4, + FLADAuthResultErrorPasscodeNotSet = 4, }; -/// Wrapper for FLAAuthResult to allow for nullability. -@interface FLAAuthResultBox : NSObject -@property(nonatomic, assign) FLAAuthResult value; -- (instancetype)initWithValue:(FLAAuthResult)value; +/// Wrapper for FLADAuthResult to allow for nullability. +@interface FLADAuthResultBox : NSObject +@property(nonatomic, assign) FLADAuthResult value; +- (instancetype)initWithValue:(FLADAuthResult)value; @end /// Pigeon equivalent of the subset of BiometricType used by iOS. -typedef NS_ENUM(NSUInteger, FLAAuthBiometric) { - FLAAuthBiometricFace = 0, - FLAAuthBiometricFingerprint = 1, +typedef NS_ENUM(NSUInteger, FLADAuthBiometric) { + FLADAuthBiometricFace = 0, + FLADAuthBiometricFingerprint = 1, }; -/// Wrapper for FLAAuthBiometric to allow for nullability. -@interface FLAAuthBiometricBox : NSObject -@property(nonatomic, assign) FLAAuthBiometric value; -- (instancetype)initWithValue:(FLAAuthBiometric)value; +/// Wrapper for FLADAuthBiometric to allow for nullability. +@interface FLADAuthBiometricBox : NSObject +@property(nonatomic, assign) FLADAuthBiometric value; +- (instancetype)initWithValue:(FLADAuthBiometric)value; @end -@class FLAAuthStrings; -@class FLAAuthOptions; -@class FLAAuthResultDetails; -@class FLAAuthBiometricWrapper; +@class FLADAuthStrings; +@class FLADAuthOptions; +@class FLADAuthResultDetails; +@class FLADAuthBiometricWrapper; /// Pigeon version of IOSAuthMessages, plus the authorization reason. /// /// See auth_messages_ios.dart for details. -@interface FLAAuthStrings : NSObject +@interface FLADAuthStrings : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithReason:(NSString *)reason @@ -70,7 +70,7 @@ typedef NS_ENUM(NSUInteger, FLAAuthBiometric) { @property(nonatomic, copy, nullable) NSString *localizedFallbackTitle; @end -@interface FLAAuthOptions : NSObject +@interface FLADAuthOptions : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithBiometricOnly:(BOOL)biometricOnly @@ -81,31 +81,31 @@ typedef NS_ENUM(NSUInteger, FLAAuthBiometric) { @property(nonatomic, assign) BOOL useErrorDialogs; @end -@interface FLAAuthResultDetails : NSObject +@interface FLADAuthResultDetails : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithResult:(FLAAuthResult)result ++ (instancetype)makeWithResult:(FLADAuthResult)result errorMessage:(nullable NSString *)errorMessage errorDetails:(nullable NSString *)errorDetails; /// The result of authenticating. -@property(nonatomic, assign) FLAAuthResult result; +@property(nonatomic, assign) FLADAuthResult result; /// A system-provided error message, if any. @property(nonatomic, copy, nullable) NSString *errorMessage; /// System-provided error details, if any. @property(nonatomic, copy, nullable) NSString *errorDetails; @end -@interface FLAAuthBiometricWrapper : NSObject +@interface FLADAuthBiometricWrapper : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithValue:(FLAAuthBiometric)value; -@property(nonatomic, assign) FLAAuthBiometric value; ++ (instancetype)makeWithValue:(FLADAuthBiometric)value; +@property(nonatomic, assign) FLADAuthBiometric value; @end -/// The codec used by FLALocalAuthApi. -NSObject *FLALocalAuthApiGetCodec(void); +/// The codec used by FLADLocalAuthApi. +NSObject *FLADLocalAuthApiGetCodec(void); -@protocol FLALocalAuthApi +@protocol FLADLocalAuthApi /// Returns true if this device supports authentication. /// /// @return `nil` only when `error != nil`. @@ -119,17 +119,17 @@ NSObject *FLALocalAuthApiGetCodec(void); /// without additional setup. /// /// @return `nil` only when `error != nil`. -- (nullable NSArray *)getEnrolledBiometricsWithError: +- (nullable NSArray *)getEnrolledBiometricsWithError: (FlutterError *_Nullable *_Nonnull)error; /// Attempts to authenticate the user with the provided [options], and using /// [strings] for any UI. -- (void)authenticateWithOptions:(FLAAuthOptions *)options - strings:(FLAAuthStrings *)strings - completion:(void (^)(FLAAuthResultDetails *_Nullable, +- (void)authenticateWithOptions:(FLADAuthOptions *)options + strings:(FLADAuthStrings *)strings + completion:(void (^)(FLADAuthResultDetails *_Nullable, FlutterError *_Nullable))completion; @end -extern void SetUpFLALocalAuthApi(id binaryMessenger, - NSObject *_Nullable api); +extern void SetUpFLADLocalAuthApi(id binaryMessenger, + NSObject *_Nullable api); NS_ASSUME_NONNULL_END diff --git a/packages/local_auth/local_auth_darwin/darwin/Classes/messages.g.m b/packages/local_auth/local_auth_darwin/darwin/Classes/messages.g.m index 6f0ef07d4c9e..421b31e94244 100644 --- a/packages/local_auth/local_auth_darwin/darwin/Classes/messages.g.m +++ b/packages/local_auth/local_auth_darwin/darwin/Classes/messages.g.m @@ -31,8 +31,8 @@ static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { } /// Possible outcomes of an authentication attempt. -@implementation FLAAuthResultBox -- (instancetype)initWithValue:(FLAAuthResult)value { +@implementation FLADAuthResultBox +- (instancetype)initWithValue:(FLADAuthResult)value { self = [super init]; if (self) { _value = value; @@ -42,8 +42,8 @@ - (instancetype)initWithValue:(FLAAuthResult)value { @end /// Pigeon equivalent of the subset of BiometricType used by iOS. -@implementation FLAAuthBiometricBox -- (instancetype)initWithValue:(FLAAuthBiometric)value { +@implementation FLADAuthBiometricBox +- (instancetype)initWithValue:(FLADAuthBiometric)value { self = [super init]; if (self) { _value = value; @@ -52,38 +52,38 @@ - (instancetype)initWithValue:(FLAAuthBiometric)value { } @end -@interface FLAAuthStrings () -+ (FLAAuthStrings *)fromList:(NSArray *)list; -+ (nullable FLAAuthStrings *)nullableFromList:(NSArray *)list; +@interface FLADAuthStrings () ++ (FLADAuthStrings *)fromList:(NSArray *)list; ++ (nullable FLADAuthStrings *)nullableFromList:(NSArray *)list; - (NSArray *)toList; @end -@interface FLAAuthOptions () -+ (FLAAuthOptions *)fromList:(NSArray *)list; -+ (nullable FLAAuthOptions *)nullableFromList:(NSArray *)list; +@interface FLADAuthOptions () ++ (FLADAuthOptions *)fromList:(NSArray *)list; ++ (nullable FLADAuthOptions *)nullableFromList:(NSArray *)list; - (NSArray *)toList; @end -@interface FLAAuthResultDetails () -+ (FLAAuthResultDetails *)fromList:(NSArray *)list; -+ (nullable FLAAuthResultDetails *)nullableFromList:(NSArray *)list; +@interface FLADAuthResultDetails () ++ (FLADAuthResultDetails *)fromList:(NSArray *)list; ++ (nullable FLADAuthResultDetails *)nullableFromList:(NSArray *)list; - (NSArray *)toList; @end -@interface FLAAuthBiometricWrapper () -+ (FLAAuthBiometricWrapper *)fromList:(NSArray *)list; -+ (nullable FLAAuthBiometricWrapper *)nullableFromList:(NSArray *)list; +@interface FLADAuthBiometricWrapper () ++ (FLADAuthBiometricWrapper *)fromList:(NSArray *)list; ++ (nullable FLADAuthBiometricWrapper *)nullableFromList:(NSArray *)list; - (NSArray *)toList; @end -@implementation FLAAuthStrings +@implementation FLADAuthStrings + (instancetype)makeWithReason:(NSString *)reason lockOut:(NSString *)lockOut goToSettingsButton:(NSString *)goToSettingsButton goToSettingsDescription:(NSString *)goToSettingsDescription cancelButton:(NSString *)cancelButton localizedFallbackTitle:(nullable NSString *)localizedFallbackTitle { - FLAAuthStrings *pigeonResult = [[FLAAuthStrings alloc] init]; + FLADAuthStrings *pigeonResult = [[FLADAuthStrings alloc] init]; pigeonResult.reason = reason; pigeonResult.lockOut = lockOut; pigeonResult.goToSettingsButton = goToSettingsButton; @@ -92,8 +92,8 @@ + (instancetype)makeWithReason:(NSString *)reason pigeonResult.localizedFallbackTitle = localizedFallbackTitle; return pigeonResult; } -+ (FLAAuthStrings *)fromList:(NSArray *)list { - FLAAuthStrings *pigeonResult = [[FLAAuthStrings alloc] init]; ++ (FLADAuthStrings *)fromList:(NSArray *)list { + FLADAuthStrings *pigeonResult = [[FLADAuthStrings alloc] init]; pigeonResult.reason = GetNullableObjectAtIndex(list, 0); pigeonResult.lockOut = GetNullableObjectAtIndex(list, 1); pigeonResult.goToSettingsButton = GetNullableObjectAtIndex(list, 2); @@ -102,8 +102,8 @@ + (FLAAuthStrings *)fromList:(NSArray *)list { pigeonResult.localizedFallbackTitle = GetNullableObjectAtIndex(list, 5); return pigeonResult; } -+ (nullable FLAAuthStrings *)nullableFromList:(NSArray *)list { - return (list) ? [FLAAuthStrings fromList:list] : nil; ++ (nullable FLADAuthStrings *)nullableFromList:(NSArray *)list { + return (list) ? [FLADAuthStrings fromList:list] : nil; } - (NSArray *)toList { return @[ @@ -117,25 +117,25 @@ - (NSArray *)toList { } @end -@implementation FLAAuthOptions +@implementation FLADAuthOptions + (instancetype)makeWithBiometricOnly:(BOOL)biometricOnly sticky:(BOOL)sticky useErrorDialogs:(BOOL)useErrorDialogs { - FLAAuthOptions *pigeonResult = [[FLAAuthOptions alloc] init]; + FLADAuthOptions *pigeonResult = [[FLADAuthOptions alloc] init]; pigeonResult.biometricOnly = biometricOnly; pigeonResult.sticky = sticky; pigeonResult.useErrorDialogs = useErrorDialogs; return pigeonResult; } -+ (FLAAuthOptions *)fromList:(NSArray *)list { - FLAAuthOptions *pigeonResult = [[FLAAuthOptions alloc] init]; ++ (FLADAuthOptions *)fromList:(NSArray *)list { + FLADAuthOptions *pigeonResult = [[FLADAuthOptions alloc] init]; pigeonResult.biometricOnly = [GetNullableObjectAtIndex(list, 0) boolValue]; pigeonResult.sticky = [GetNullableObjectAtIndex(list, 1) boolValue]; pigeonResult.useErrorDialogs = [GetNullableObjectAtIndex(list, 2) boolValue]; return pigeonResult; } -+ (nullable FLAAuthOptions *)nullableFromList:(NSArray *)list { - return (list) ? [FLAAuthOptions fromList:list] : nil; ++ (nullable FLADAuthOptions *)nullableFromList:(NSArray *)list { + return (list) ? [FLADAuthOptions fromList:list] : nil; } - (NSArray *)toList { return @[ @@ -146,25 +146,25 @@ - (NSArray *)toList { } @end -@implementation FLAAuthResultDetails -+ (instancetype)makeWithResult:(FLAAuthResult)result +@implementation FLADAuthResultDetails ++ (instancetype)makeWithResult:(FLADAuthResult)result errorMessage:(nullable NSString *)errorMessage errorDetails:(nullable NSString *)errorDetails { - FLAAuthResultDetails *pigeonResult = [[FLAAuthResultDetails alloc] init]; + FLADAuthResultDetails *pigeonResult = [[FLADAuthResultDetails alloc] init]; pigeonResult.result = result; pigeonResult.errorMessage = errorMessage; pigeonResult.errorDetails = errorDetails; return pigeonResult; } -+ (FLAAuthResultDetails *)fromList:(NSArray *)list { - FLAAuthResultDetails *pigeonResult = [[FLAAuthResultDetails alloc] init]; ++ (FLADAuthResultDetails *)fromList:(NSArray *)list { + FLADAuthResultDetails *pigeonResult = [[FLADAuthResultDetails alloc] init]; pigeonResult.result = [GetNullableObjectAtIndex(list, 0) integerValue]; pigeonResult.errorMessage = GetNullableObjectAtIndex(list, 1); pigeonResult.errorDetails = GetNullableObjectAtIndex(list, 2); return pigeonResult; } -+ (nullable FLAAuthResultDetails *)nullableFromList:(NSArray *)list { - return (list) ? [FLAAuthResultDetails fromList:list] : nil; ++ (nullable FLADAuthResultDetails *)nullableFromList:(NSArray *)list { + return (list) ? [FLADAuthResultDetails fromList:list] : nil; } - (NSArray *)toList { return @[ @@ -175,19 +175,19 @@ - (NSArray *)toList { } @end -@implementation FLAAuthBiometricWrapper -+ (instancetype)makeWithValue:(FLAAuthBiometric)value { - FLAAuthBiometricWrapper *pigeonResult = [[FLAAuthBiometricWrapper alloc] init]; +@implementation FLADAuthBiometricWrapper ++ (instancetype)makeWithValue:(FLADAuthBiometric)value { + FLADAuthBiometricWrapper *pigeonResult = [[FLADAuthBiometricWrapper alloc] init]; pigeonResult.value = value; return pigeonResult; } -+ (FLAAuthBiometricWrapper *)fromList:(NSArray *)list { - FLAAuthBiometricWrapper *pigeonResult = [[FLAAuthBiometricWrapper alloc] init]; ++ (FLADAuthBiometricWrapper *)fromList:(NSArray *)list { + FLADAuthBiometricWrapper *pigeonResult = [[FLADAuthBiometricWrapper alloc] init]; pigeonResult.value = [GetNullableObjectAtIndex(list, 0) integerValue]; return pigeonResult; } -+ (nullable FLAAuthBiometricWrapper *)nullableFromList:(NSArray *)list { - return (list) ? [FLAAuthBiometricWrapper fromList:list] : nil; ++ (nullable FLADAuthBiometricWrapper *)nullableFromList:(NSArray *)list { + return (list) ? [FLADAuthBiometricWrapper fromList:list] : nil; } - (NSArray *)toList { return @[ @@ -196,39 +196,39 @@ - (NSArray *)toList { } @end -@interface FLALocalAuthApiCodecReader : FlutterStandardReader +@interface FLADLocalAuthApiCodecReader : FlutterStandardReader @end -@implementation FLALocalAuthApiCodecReader +@implementation FLADLocalAuthApiCodecReader - (nullable id)readValueOfType:(UInt8)type { switch (type) { case 128: - return [FLAAuthBiometricWrapper fromList:[self readValue]]; + return [FLADAuthBiometricWrapper fromList:[self readValue]]; case 129: - return [FLAAuthOptions fromList:[self readValue]]; + return [FLADAuthOptions fromList:[self readValue]]; case 130: - return [FLAAuthResultDetails fromList:[self readValue]]; + return [FLADAuthResultDetails fromList:[self readValue]]; case 131: - return [FLAAuthStrings fromList:[self readValue]]; + return [FLADAuthStrings fromList:[self readValue]]; default: return [super readValueOfType:type]; } } @end -@interface FLALocalAuthApiCodecWriter : FlutterStandardWriter +@interface FLADLocalAuthApiCodecWriter : FlutterStandardWriter @end -@implementation FLALocalAuthApiCodecWriter +@implementation FLADLocalAuthApiCodecWriter - (void)writeValue:(id)value { - if ([value isKindOfClass:[FLAAuthBiometricWrapper class]]) { + if ([value isKindOfClass:[FLADAuthBiometricWrapper class]]) { [self writeByte:128]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FLAAuthOptions class]]) { + } else if ([value isKindOfClass:[FLADAuthOptions class]]) { [self writeByte:129]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FLAAuthResultDetails class]]) { + } else if ([value isKindOfClass:[FLADAuthResultDetails class]]) { [self writeByte:130]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FLAAuthStrings class]]) { + } else if ([value isKindOfClass:[FLADAuthStrings class]]) { [self writeByte:131]; [self writeValue:[value toList]]; } else { @@ -237,40 +237,40 @@ - (void)writeValue:(id)value { } @end -@interface FLALocalAuthApiCodecReaderWriter : FlutterStandardReaderWriter +@interface FLADLocalAuthApiCodecReaderWriter : FlutterStandardReaderWriter @end -@implementation FLALocalAuthApiCodecReaderWriter +@implementation FLADLocalAuthApiCodecReaderWriter - (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[FLALocalAuthApiCodecWriter alloc] initWithData:data]; + return [[FLADLocalAuthApiCodecWriter alloc] initWithData:data]; } - (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[FLALocalAuthApiCodecReader alloc] initWithData:data]; + return [[FLADLocalAuthApiCodecReader alloc] initWithData:data]; } @end -NSObject *FLALocalAuthApiGetCodec(void) { +NSObject *FLADLocalAuthApiGetCodec(void) { static FlutterStandardMessageCodec *sSharedObject = nil; static dispatch_once_t sPred = 0; dispatch_once(&sPred, ^{ - FLALocalAuthApiCodecReaderWriter *readerWriter = - [[FLALocalAuthApiCodecReaderWriter alloc] init]; + FLADLocalAuthApiCodecReaderWriter *readerWriter = + [[FLADLocalAuthApiCodecReaderWriter alloc] init]; sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; }); return sSharedObject; } -void SetUpFLALocalAuthApi(id binaryMessenger, - NSObject *api) { +void SetUpFLADLocalAuthApi(id binaryMessenger, + NSObject *api) { /// Returns true if this device supports authentication. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:@"dev.flutter.pigeon.local_auth_darwin.LocalAuthApi.isDeviceSupported" binaryMessenger:binaryMessenger - codec:FLALocalAuthApiGetCodec()]; + codec:FLADLocalAuthApiGetCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(isDeviceSupportedWithError:)], - @"FLALocalAuthApi api (%@) doesn't respond to @selector(isDeviceSupportedWithError:)", + @"FLADLocalAuthApi api (%@) doesn't respond to @selector(isDeviceSupportedWithError:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; @@ -288,10 +288,10 @@ void SetUpFLALocalAuthApi(id binaryMessenger, initWithName: @"dev.flutter.pigeon.local_auth_darwin.LocalAuthApi.deviceCanSupportBiometrics" binaryMessenger:binaryMessenger - codec:FLALocalAuthApiGetCodec()]; + codec:FLADLocalAuthApiGetCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(deviceCanSupportBiometricsWithError:)], - @"FLALocalAuthApi api (%@) doesn't respond to " + @"FLADLocalAuthApi api (%@) doesn't respond to " @"@selector(deviceCanSupportBiometricsWithError:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { @@ -309,15 +309,15 @@ void SetUpFLALocalAuthApi(id binaryMessenger, FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:@"dev.flutter.pigeon.local_auth_darwin.LocalAuthApi.getEnrolledBiometrics" binaryMessenger:binaryMessenger - codec:FLALocalAuthApiGetCodec()]; + codec:FLADLocalAuthApiGetCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(getEnrolledBiometricsWithError:)], - @"FLALocalAuthApi api (%@) doesn't respond to @selector(getEnrolledBiometricsWithError:)", - api); + NSCAssert([api respondsToSelector:@selector(getEnrolledBiometricsWithError:)], + @"FLADLocalAuthApi api (%@) doesn't respond to " + @"@selector(getEnrolledBiometricsWithError:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; - NSArray *output = [api getEnrolledBiometricsWithError:&error]; + NSArray *output = [api getEnrolledBiometricsWithError:&error]; callback(wrapResult(output, error)); }]; } else { @@ -330,19 +330,19 @@ void SetUpFLALocalAuthApi(id binaryMessenger, FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:@"dev.flutter.pigeon.local_auth_darwin.LocalAuthApi.authenticate" binaryMessenger:binaryMessenger - codec:FLALocalAuthApiGetCodec()]; + codec:FLADLocalAuthApiGetCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(authenticateWithOptions:strings:completion:)], - @"FLALocalAuthApi api (%@) doesn't respond to " + @"FLADLocalAuthApi api (%@) doesn't respond to " @"@selector(authenticateWithOptions:strings:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FLAAuthOptions *arg_options = GetNullableObjectAtIndex(args, 0); - FLAAuthStrings *arg_strings = GetNullableObjectAtIndex(args, 1); + FLADAuthOptions *arg_options = GetNullableObjectAtIndex(args, 0); + FLADAuthStrings *arg_strings = GetNullableObjectAtIndex(args, 1); [api authenticateWithOptions:arg_options strings:arg_strings - completion:^(FLAAuthResultDetails *_Nullable output, + completion:^(FLADAuthResultDetails *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; diff --git a/packages/local_auth/local_auth_darwin/darwin/Tests/FLTLocalAuthPluginTests.m b/packages/local_auth/local_auth_darwin/darwin/Tests/FLALocalAuthPluginTests.m similarity index 82% rename from packages/local_auth/local_auth_darwin/darwin/Tests/FLTLocalAuthPluginTests.m rename to packages/local_auth/local_auth_darwin/darwin/Tests/FLALocalAuthPluginTests.m index 1e6f2d0e8dd4..786316835d78 100644 --- a/packages/local_auth/local_auth_darwin/darwin/Tests/FLTLocalAuthPluginTests.m +++ b/packages/local_auth/local_auth_darwin/darwin/Tests/FLALocalAuthPluginTests.m @@ -14,7 +14,7 @@ /** * A context factory that returns preset contexts. */ -@interface StubAuthContextFactory : NSObject +@interface StubAuthContextFactory : NSObject @property(copy, nonatomic) NSMutableArray *contexts; - (instancetype)initWithContexts:(NSArray *)contexts; @end @@ -40,10 +40,10 @@ - (LAContext *)createAuthContext { #pragma mark - -@interface FLTLocalAuthPluginTests : XCTestCase +@interface FLALocalAuthPluginTests : XCTestCase @end -@implementation FLTLocalAuthPluginTests +@implementation FLALocalAuthPluginTests - (void)setUp { self.continueAfterFailure = NO; @@ -51,12 +51,12 @@ - (void)setUp { - (void)testSuccessfullAuthWithBiometrics { id mockAuthContext = OCMClassMock([LAContext class]); - FLTLocalAuthPlugin *plugin = [[FLTLocalAuthPlugin alloc] + FLALocalAuthPlugin *plugin = [[FLALocalAuthPlugin alloc] initWithContextFactory:[[StubAuthContextFactory alloc] initWithContexts:@[ mockAuthContext ]]]; const LAPolicy policy = LAPolicyDeviceOwnerAuthenticationWithBiometrics; - FLAAuthStrings *strings = [self createAuthStrings]; + FLADAuthStrings *strings = [self createAuthStrings]; OCMStub([mockAuthContext canEvaluatePolicy:policy error:[OCMArg setTo:nil]]).andReturn(YES); // evaluatePolicy:localizedReason:reply: calls back on an internal queue, which is not @@ -73,14 +73,14 @@ - (void)testSuccessfullAuthWithBiometrics { .andDo(backgroundThreadReplyCaller); XCTestExpectation *expectation = [self expectationWithDescription:@"Result is called"]; - [plugin authenticateWithOptions:[FLAAuthOptions makeWithBiometricOnly:YES - sticky:NO - useErrorDialogs:NO] + [plugin authenticateWithOptions:[FLADAuthOptions makeWithBiometricOnly:YES + sticky:NO + useErrorDialogs:NO] strings:strings - completion:^(FLAAuthResultDetails *_Nullable resultDetails, + completion:^(FLADAuthResultDetails *_Nullable resultDetails, FlutterError *_Nullable error) { XCTAssertTrue([NSThread isMainThread]); - XCTAssertEqual(resultDetails.result, FLAAuthResultSuccess); + XCTAssertEqual(resultDetails.result, FLADAuthResultSuccess); XCTAssertNil(error); [expectation fulfill]; }]; @@ -89,12 +89,12 @@ - (void)testSuccessfullAuthWithBiometrics { - (void)testSuccessfullAuthWithoutBiometrics { id mockAuthContext = OCMClassMock([LAContext class]); - FLTLocalAuthPlugin *plugin = [[FLTLocalAuthPlugin alloc] + FLALocalAuthPlugin *plugin = [[FLALocalAuthPlugin alloc] initWithContextFactory:[[StubAuthContextFactory alloc] initWithContexts:@[ mockAuthContext ]]]; const LAPolicy policy = LAPolicyDeviceOwnerAuthentication; - FLAAuthStrings *strings = [self createAuthStrings]; + FLADAuthStrings *strings = [self createAuthStrings]; OCMStub([mockAuthContext canEvaluatePolicy:policy error:[OCMArg setTo:nil]]).andReturn(YES); // evaluatePolicy:localizedReason:reply: calls back on an internal queue, which is not @@ -111,14 +111,14 @@ - (void)testSuccessfullAuthWithoutBiometrics { .andDo(backgroundThreadReplyCaller); XCTestExpectation *expectation = [self expectationWithDescription:@"Result is called"]; - [plugin authenticateWithOptions:[FLAAuthOptions makeWithBiometricOnly:NO - sticky:NO - useErrorDialogs:NO] + [plugin authenticateWithOptions:[FLADAuthOptions makeWithBiometricOnly:NO + sticky:NO + useErrorDialogs:NO] strings:strings - completion:^(FLAAuthResultDetails *_Nullable resultDetails, + completion:^(FLADAuthResultDetails *_Nullable resultDetails, FlutterError *_Nullable error) { XCTAssertTrue([NSThread isMainThread]); - XCTAssertEqual(resultDetails.result, FLAAuthResultSuccess); + XCTAssertEqual(resultDetails.result, FLADAuthResultSuccess); XCTAssertNil(error); [expectation fulfill]; }]; @@ -127,12 +127,12 @@ - (void)testSuccessfullAuthWithoutBiometrics { - (void)testFailedAuthWithBiometrics { id mockAuthContext = OCMClassMock([LAContext class]); - FLTLocalAuthPlugin *plugin = [[FLTLocalAuthPlugin alloc] + FLALocalAuthPlugin *plugin = [[FLALocalAuthPlugin alloc] initWithContextFactory:[[StubAuthContextFactory alloc] initWithContexts:@[ mockAuthContext ]]]; const LAPolicy policy = LAPolicyDeviceOwnerAuthenticationWithBiometrics; - FLAAuthStrings *strings = [self createAuthStrings]; + FLADAuthStrings *strings = [self createAuthStrings]; OCMStub([mockAuthContext canEvaluatePolicy:policy error:[OCMArg setTo:nil]]).andReturn(YES); // evaluatePolicy:localizedReason:reply: calls back on an internal queue, which is not @@ -149,18 +149,18 @@ - (void)testFailedAuthWithBiometrics { .andDo(backgroundThreadReplyCaller); XCTestExpectation *expectation = [self expectationWithDescription:@"Result is called"]; - [plugin authenticateWithOptions:[FLAAuthOptions makeWithBiometricOnly:YES - sticky:NO - useErrorDialogs:NO] + [plugin authenticateWithOptions:[FLADAuthOptions makeWithBiometricOnly:YES + sticky:NO + useErrorDialogs:NO] strings:strings - completion:^(FLAAuthResultDetails *_Nullable resultDetails, + completion:^(FLADAuthResultDetails *_Nullable resultDetails, FlutterError *_Nullable error) { XCTAssertTrue([NSThread isMainThread]); // TODO(stuartmorgan): Fix this; this was the pre-Pigeon-migration // behavior, so is preserved as part of the migration, but a failed // authentication should return failure, not an error that results in a // PlatformException. - XCTAssertEqual(resultDetails.result, FLAAuthResultErrorNotAvailable); + XCTAssertEqual(resultDetails.result, FLADAuthResultErrorNotAvailable); XCTAssertNil(error); [expectation fulfill]; }]; @@ -169,12 +169,12 @@ - (void)testFailedAuthWithBiometrics { - (void)testFailedWithUnknownErrorCode { id mockAuthContext = OCMClassMock([LAContext class]); - FLTLocalAuthPlugin *plugin = [[FLTLocalAuthPlugin alloc] + FLALocalAuthPlugin *plugin = [[FLALocalAuthPlugin alloc] initWithContextFactory:[[StubAuthContextFactory alloc] initWithContexts:@[ mockAuthContext ]]]; const LAPolicy policy = LAPolicyDeviceOwnerAuthentication; - FLAAuthStrings *strings = [self createAuthStrings]; + FLADAuthStrings *strings = [self createAuthStrings]; OCMStub([mockAuthContext canEvaluatePolicy:policy error:[OCMArg setTo:nil]]).andReturn(YES); // evaluatePolicy:localizedReason:reply: calls back on an internal queue, which is not @@ -191,14 +191,14 @@ - (void)testFailedWithUnknownErrorCode { .andDo(backgroundThreadReplyCaller); XCTestExpectation *expectation = [self expectationWithDescription:@"Result is called"]; - [plugin authenticateWithOptions:[FLAAuthOptions makeWithBiometricOnly:NO - sticky:NO - useErrorDialogs:NO] + [plugin authenticateWithOptions:[FLADAuthOptions makeWithBiometricOnly:NO + sticky:NO + useErrorDialogs:NO] strings:strings - completion:^(FLAAuthResultDetails *_Nullable resultDetails, + completion:^(FLADAuthResultDetails *_Nullable resultDetails, FlutterError *_Nullable error) { XCTAssertTrue([NSThread isMainThread]); - XCTAssertEqual(resultDetails.result, FLAAuthResultErrorNotAvailable); + XCTAssertEqual(resultDetails.result, FLADAuthResultErrorNotAvailable); XCTAssertNil(error); [expectation fulfill]; }]; @@ -207,12 +207,12 @@ - (void)testFailedWithUnknownErrorCode { - (void)testSystemCancelledWithoutStickyAuth { id mockAuthContext = OCMClassMock([LAContext class]); - FLTLocalAuthPlugin *plugin = [[FLTLocalAuthPlugin alloc] + FLALocalAuthPlugin *plugin = [[FLALocalAuthPlugin alloc] initWithContextFactory:[[StubAuthContextFactory alloc] initWithContexts:@[ mockAuthContext ]]]; const LAPolicy policy = LAPolicyDeviceOwnerAuthentication; - FLAAuthStrings *strings = [self createAuthStrings]; + FLADAuthStrings *strings = [self createAuthStrings]; OCMStub([mockAuthContext canEvaluatePolicy:policy error:[OCMArg setTo:nil]]).andReturn(YES); // evaluatePolicy:localizedReason:reply: calls back on an internal queue, which is not @@ -229,14 +229,14 @@ - (void)testSystemCancelledWithoutStickyAuth { .andDo(backgroundThreadReplyCaller); XCTestExpectation *expectation = [self expectationWithDescription:@"Result is called"]; - [plugin authenticateWithOptions:[FLAAuthOptions makeWithBiometricOnly:NO - sticky:NO - useErrorDialogs:NO] + [plugin authenticateWithOptions:[FLADAuthOptions makeWithBiometricOnly:NO + sticky:NO + useErrorDialogs:NO] strings:strings - completion:^(FLAAuthResultDetails *_Nullable resultDetails, + completion:^(FLADAuthResultDetails *_Nullable resultDetails, FlutterError *_Nullable error) { XCTAssertTrue([NSThread isMainThread]); - XCTAssertEqual(resultDetails.result, FLAAuthResultFailure); + XCTAssertEqual(resultDetails.result, FLADAuthResultFailure); XCTAssertNil(error); [expectation fulfill]; }]; @@ -245,12 +245,12 @@ - (void)testSystemCancelledWithoutStickyAuth { - (void)testFailedAuthWithoutBiometrics { id mockAuthContext = OCMClassMock([LAContext class]); - FLTLocalAuthPlugin *plugin = [[FLTLocalAuthPlugin alloc] + FLALocalAuthPlugin *plugin = [[FLALocalAuthPlugin alloc] initWithContextFactory:[[StubAuthContextFactory alloc] initWithContexts:@[ mockAuthContext ]]]; const LAPolicy policy = LAPolicyDeviceOwnerAuthentication; - FLAAuthStrings *strings = [self createAuthStrings]; + FLADAuthStrings *strings = [self createAuthStrings]; OCMStub([mockAuthContext canEvaluatePolicy:policy error:[OCMArg setTo:nil]]).andReturn(YES); // evaluatePolicy:localizedReason:reply: calls back on an internal queue, which is not @@ -267,18 +267,18 @@ - (void)testFailedAuthWithoutBiometrics { .andDo(backgroundThreadReplyCaller); XCTestExpectation *expectation = [self expectationWithDescription:@"Result is called"]; - [plugin authenticateWithOptions:[FLAAuthOptions makeWithBiometricOnly:NO - sticky:NO - useErrorDialogs:NO] + [plugin authenticateWithOptions:[FLADAuthOptions makeWithBiometricOnly:NO + sticky:NO + useErrorDialogs:NO] strings:strings - completion:^(FLAAuthResultDetails *_Nullable resultDetails, + completion:^(FLADAuthResultDetails *_Nullable resultDetails, FlutterError *_Nullable error) { XCTAssertTrue([NSThread isMainThread]); // TODO(stuartmorgan): Fix this; this was the pre-Pigeon-migration // behavior, so is preserved as part of the migration, but a failed // authentication should return failure, not an error that results in a // PlatformException. - XCTAssertEqual(resultDetails.result, FLAAuthResultErrorNotAvailable); + XCTAssertEqual(resultDetails.result, FLADAuthResultErrorNotAvailable); XCTAssertNil(error); [expectation fulfill]; }]; @@ -287,12 +287,12 @@ - (void)testFailedAuthWithoutBiometrics { - (void)testLocalizedFallbackTitle { id mockAuthContext = OCMClassMock([LAContext class]); - FLTLocalAuthPlugin *plugin = [[FLTLocalAuthPlugin alloc] + FLALocalAuthPlugin *plugin = [[FLALocalAuthPlugin alloc] initWithContextFactory:[[StubAuthContextFactory alloc] initWithContexts:@[ mockAuthContext ]]]; const LAPolicy policy = LAPolicyDeviceOwnerAuthentication; - FLAAuthStrings *strings = [self createAuthStrings]; + FLADAuthStrings *strings = [self createAuthStrings]; strings.localizedFallbackTitle = @"a title"; OCMStub([mockAuthContext canEvaluatePolicy:policy error:[OCMArg setTo:nil]]).andReturn(YES); @@ -310,11 +310,11 @@ - (void)testLocalizedFallbackTitle { .andDo(backgroundThreadReplyCaller); XCTestExpectation *expectation = [self expectationWithDescription:@"Result is called"]; - [plugin authenticateWithOptions:[FLAAuthOptions makeWithBiometricOnly:NO - sticky:NO - useErrorDialogs:NO] + [plugin authenticateWithOptions:[FLADAuthOptions makeWithBiometricOnly:NO + sticky:NO + useErrorDialogs:NO] strings:strings - completion:^(FLAAuthResultDetails *_Nullable resultDetails, + completion:^(FLADAuthResultDetails *_Nullable resultDetails, FlutterError *_Nullable error) { OCMVerify([mockAuthContext setLocalizedFallbackTitle:strings.localizedFallbackTitle]); @@ -325,12 +325,12 @@ - (void)testLocalizedFallbackTitle { - (void)testSkippedLocalizedFallbackTitle { id mockAuthContext = OCMClassMock([LAContext class]); - FLTLocalAuthPlugin *plugin = [[FLTLocalAuthPlugin alloc] + FLALocalAuthPlugin *plugin = [[FLALocalAuthPlugin alloc] initWithContextFactory:[[StubAuthContextFactory alloc] initWithContexts:@[ mockAuthContext ]]]; const LAPolicy policy = LAPolicyDeviceOwnerAuthentication; - FLAAuthStrings *strings = [self createAuthStrings]; + FLADAuthStrings *strings = [self createAuthStrings]; strings.localizedFallbackTitle = nil; OCMStub([mockAuthContext canEvaluatePolicy:policy error:[OCMArg setTo:nil]]).andReturn(YES); @@ -348,11 +348,11 @@ - (void)testSkippedLocalizedFallbackTitle { .andDo(backgroundThreadReplyCaller); XCTestExpectation *expectation = [self expectationWithDescription:@"Result is called"]; - [plugin authenticateWithOptions:[FLAAuthOptions makeWithBiometricOnly:NO - sticky:NO - useErrorDialogs:NO] + [plugin authenticateWithOptions:[FLADAuthOptions makeWithBiometricOnly:NO + sticky:NO + useErrorDialogs:NO] strings:strings - completion:^(FLAAuthResultDetails *_Nullable resultDetails, + completion:^(FLADAuthResultDetails *_Nullable resultDetails, FlutterError *_Nullable error) { OCMVerify([mockAuthContext setLocalizedFallbackTitle:nil]); [expectation fulfill]; @@ -362,7 +362,7 @@ - (void)testSkippedLocalizedFallbackTitle { - (void)testDeviceSupportsBiometrics_withEnrolledHardware { id mockAuthContext = OCMClassMock([LAContext class]); - FLTLocalAuthPlugin *plugin = [[FLTLocalAuthPlugin alloc] + FLALocalAuthPlugin *plugin = [[FLALocalAuthPlugin alloc] initWithContextFactory:[[StubAuthContextFactory alloc] initWithContexts:@[ mockAuthContext ]]]; @@ -377,7 +377,7 @@ - (void)testDeviceSupportsBiometrics_withEnrolledHardware { - (void)testDeviceSupportsBiometrics_withNonEnrolledHardware { id mockAuthContext = OCMClassMock([LAContext class]); - FLTLocalAuthPlugin *plugin = [[FLTLocalAuthPlugin alloc] + FLALocalAuthPlugin *plugin = [[FLALocalAuthPlugin alloc] initWithContextFactory:[[StubAuthContextFactory alloc] initWithContexts:@[ mockAuthContext ]]]; @@ -404,7 +404,7 @@ - (void)testDeviceSupportsBiometrics_withNonEnrolledHardware { - (void)testDeviceSupportsBiometrics_withNoBiometricHardware { id mockAuthContext = OCMClassMock([LAContext class]); - FLTLocalAuthPlugin *plugin = [[FLTLocalAuthPlugin alloc] + FLALocalAuthPlugin *plugin = [[FLALocalAuthPlugin alloc] initWithContextFactory:[[StubAuthContextFactory alloc] initWithContexts:@[ mockAuthContext ]]]; @@ -431,7 +431,7 @@ - (void)testDeviceSupportsBiometrics_withNoBiometricHardware { - (void)testGetEnrolledBiometricsWithFaceID { id mockAuthContext = OCMClassMock([LAContext class]); - FLTLocalAuthPlugin *plugin = [[FLTLocalAuthPlugin alloc] + FLALocalAuthPlugin *plugin = [[FLALocalAuthPlugin alloc] initWithContextFactory:[[StubAuthContextFactory alloc] initWithContexts:@[ mockAuthContext ]]]; @@ -440,15 +440,15 @@ - (void)testGetEnrolledBiometricsWithFaceID { OCMStub([mockAuthContext biometryType]).andReturn(LABiometryTypeFaceID); FlutterError *error; - NSArray *result = [plugin getEnrolledBiometricsWithError:&error]; + NSArray *result = [plugin getEnrolledBiometricsWithError:&error]; XCTAssertEqual([result count], 1); - XCTAssertEqual(result[0].value, FLAAuthBiometricFace); + XCTAssertEqual(result[0].value, FLADAuthBiometricFace); XCTAssertNil(error); } - (void)testGetEnrolledBiometricsWithTouchID { id mockAuthContext = OCMClassMock([LAContext class]); - FLTLocalAuthPlugin *plugin = [[FLTLocalAuthPlugin alloc] + FLALocalAuthPlugin *plugin = [[FLALocalAuthPlugin alloc] initWithContextFactory:[[StubAuthContextFactory alloc] initWithContexts:@[ mockAuthContext ]]]; @@ -457,15 +457,15 @@ - (void)testGetEnrolledBiometricsWithTouchID { OCMStub([mockAuthContext biometryType]).andReturn(LABiometryTypeTouchID); FlutterError *error; - NSArray *result = [plugin getEnrolledBiometricsWithError:&error]; + NSArray *result = [plugin getEnrolledBiometricsWithError:&error]; XCTAssertEqual([result count], 1); - XCTAssertEqual(result[0].value, FLAAuthBiometricFingerprint); + XCTAssertEqual(result[0].value, FLADAuthBiometricFingerprint); XCTAssertNil(error); } - (void)testGetEnrolledBiometricsWithoutEnrolledHardware { id mockAuthContext = OCMClassMock([LAContext class]); - FLTLocalAuthPlugin *plugin = [[FLTLocalAuthPlugin alloc] + FLALocalAuthPlugin *plugin = [[FLALocalAuthPlugin alloc] initWithContextFactory:[[StubAuthContextFactory alloc] initWithContexts:@[ mockAuthContext ]]]; @@ -485,7 +485,7 @@ - (void)testGetEnrolledBiometricsWithoutEnrolledHardware { .andDo(canEvaluatePolicyHandler); FlutterError *error; - NSArray *result = [plugin getEnrolledBiometricsWithError:&error]; + NSArray *result = [plugin getEnrolledBiometricsWithError:&error]; XCTAssertEqual([result count], 0); XCTAssertNil(error); } @@ -495,7 +495,7 @@ - (void)testIsDeviceSupportedHandlesSupported { OCMStub([mockAuthContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthentication error:[OCMArg setTo:nil]]) .andReturn(YES); - FLTLocalAuthPlugin *plugin = [[FLTLocalAuthPlugin alloc] + FLALocalAuthPlugin *plugin = [[FLALocalAuthPlugin alloc] initWithContextFactory:[[StubAuthContextFactory alloc] initWithContexts:@[ mockAuthContext ]]]; @@ -510,7 +510,7 @@ - (void)testIsDeviceSupportedHandlesUnsupported { OCMStub([mockAuthContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthentication error:[OCMArg setTo:nil]]) .andReturn(NO); - FLTLocalAuthPlugin *plugin = [[FLTLocalAuthPlugin alloc] + FLALocalAuthPlugin *plugin = [[FLALocalAuthPlugin alloc] initWithContextFactory:[[StubAuthContextFactory alloc] initWithContexts:@[ mockAuthContext ]]]; @@ -520,13 +520,13 @@ - (void)testIsDeviceSupportedHandlesUnsupported { XCTAssertNil(error); } -// Creates an FLAAuthStrings with placeholder values. -- (FLAAuthStrings *)createAuthStrings { - return [FLAAuthStrings makeWithReason:@"a reason" - lockOut:@"locked out" - goToSettingsButton:@"Go To Settings" - goToSettingsDescription:@"Settings" - cancelButton:@"Cancel" - localizedFallbackTitle:nil]; +// Creates an FLADAuthStrings with placeholder values. +- (FLADAuthStrings *)createAuthStrings { + return [FLADAuthStrings makeWithReason:@"a reason" + lockOut:@"locked out" + goToSettingsButton:@"Go To Settings" + goToSettingsDescription:@"Settings" + cancelButton:@"Cancel" + localizedFallbackTitle:nil]; } @end diff --git a/packages/local_auth/local_auth_darwin/example/ios/Runner.xcodeproj/project.pbxproj b/packages/local_auth/local_auth_darwin/example/ios/Runner.xcodeproj/project.pbxproj index 8ee93b590997..8ef2595364c7 100644 --- a/packages/local_auth/local_auth_darwin/example/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/local_auth/local_auth_darwin/example/ios/Runner.xcodeproj/project.pbxproj @@ -9,7 +9,7 @@ /* Begin PBXBuildFile section */ 0CCCD07A2CE24E13C9C1EEA4 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9D274A3F79473B1549B2BBD5 /* libPods-Runner.a */; }; 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 3398D2E426164AD8005A052F /* FLTLocalAuthPluginTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3398D2E326164AD8005A052F /* FLTLocalAuthPluginTests.m */; }; + 3398D2E426164AD8005A052F /* FLALocalAuthPluginTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3398D2E326164AD8005A052F /* FLALocalAuthPluginTests.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 691CB38B382734AF80FBCA4C /* libPods-RunnerTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADBFA21B380E07A3A585383D /* libPods-RunnerTests.a */; }; 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; @@ -49,7 +49,7 @@ 3398D2D126163948005A052F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 3398D2DC261649CD005A052F /* liblocal_auth.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = liblocal_auth.a; sourceTree = BUILT_PRODUCTS_DIR; }; 3398D2DF26164A03005A052F /* liblocal_auth.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = liblocal_auth.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 3398D2E326164AD8005A052F /* FLTLocalAuthPluginTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FLTLocalAuthPluginTests.m; path = ../../darwin/Tests/FLTLocalAuthPluginTests.m; sourceTree = SOURCE_ROOT; }; + 3398D2E326164AD8005A052F /* FLALocalAuthPluginTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FLALocalAuthPluginTests.m; path = ../../darwin/Tests/FLALocalAuthPluginTests.m; sourceTree = SOURCE_ROOT; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 658CDD04B21E4EA92F8EF229 /* 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 = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; @@ -93,7 +93,7 @@ 33BF11D226680B2E002967F3 /* RunnerTests */ = { isa = PBXGroup; children = ( - 3398D2E326164AD8005A052F /* FLTLocalAuthPluginTests.m */, + 3398D2E326164AD8005A052F /* FLALocalAuthPluginTests.m */, 3398D2D126163948005A052F /* Info.plist */, ); path = RunnerTests; @@ -227,7 +227,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1430; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = "The Flutter Authors"; TargetAttributes = { 3398D2CC26163948005A052F = { @@ -377,7 +377,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 3398D2E426164AD8005A052F /* FLTLocalAuthPluginTests.m in Sources */, + 3398D2E426164AD8005A052F /* FLALocalAuthPluginTests.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/packages/local_auth/local_auth_darwin/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/local_auth/local_auth_darwin/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index b17d9a05d491..7585dfca24d0 100644 --- a/packages/local_auth/local_auth_darwin/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/packages/local_auth/local_auth_darwin/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ Date: Tue, 13 Feb 2024 00:49:10 +0000 Subject: [PATCH 06/40] [in_app_pur]: Bump org.json:json from 20231013 to 20240205 in /packages/in_app_purchase/in_app_purchase/example/android/app (#6096) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [org.json:json](https://github.com/douglascrockford/JSON-java) from 20231013 to 20240205.
Release notes

Sourced from org.json:json's releases.

20240205

Pull Request Description
#855 Fix JSONArrayTest testRecursiveDepthArrayFor1000Levels()ร‚ย 
#846 Cleanup warnings and merge new unit tests
#845 improved annotation search performance
#835 Delete redundant .toString() call in README
#832 Add a config flag to disable whitespace trimming
#831 Refactor NumberConversionUtil and toString() of CookieList & XML Classes
#830 Upgrade json-path's version to 2.4.0 to avoid dependency conflict
#828 Fixed flaky tests in XMLTest.java
#824 Ignore tests that fail due to resource differences
#823 JSON parsing self reference object and array
#820 Close XML tag explicitly for empty tags with configuration
#815 Ensure java 6 compatableร‚ย 
#814 Refactor duplicate code for stringToNumber() in JSONObject, JSONArray, and XML
#812 docs: use syntax highlighting
#808 Fix compiler warnings
#806 Add new deployment pipeline
#803 ci: test with Java 21ร‚ย 
#801 Updates the pipeline to validate that packaging a jar works properly
#798 fix: flakiness in org.json.junit.XMLTest#testIndentComplicatedJsonObjectWithArrayAndWithConfig
#794 XML optLong/getLong equivalent updates for string to number conversion.
Changelog

Sourced from org.json:json's changelog.

20240205 Recent commits.

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=org.json:json&package-manager=gradle&previous-version=20231013&new-version=20240205)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- .../in_app_purchase/example/android/app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/in_app_purchase/in_app_purchase/example/android/app/build.gradle b/packages/in_app_purchase/in_app_purchase/example/android/app/build.gradle index d1e8ea9832f2..9e1388cb73bb 100644 --- a/packages/in_app_purchase/in_app_purchase/example/android/app/build.gradle +++ b/packages/in_app_purchase/in_app_purchase/example/android/app/build.gradle @@ -110,7 +110,7 @@ dependencies { implementation 'com.android.billingclient:billing:3.0.2' testImplementation 'junit:junit:4.13.2' testImplementation 'org.mockito:mockito-core:5.0.0' - testImplementation 'org.json:json:20231013' + testImplementation 'org.json:json:20240205' androidTestImplementation 'androidx.test:runner:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' } From 9385bbb3cf469b1204d55c0c04b6167de89bfa64 Mon Sep 17 00:00:00 2001 From: LouiseHsu Date: Mon, 12 Feb 2024 18:34:43 -0800 Subject: [PATCH 07/40] Convert startProductRequest(), finishTransaction(), restoreTransactions(), presentCodeRedemptionSheet() to pigeon (#6032) Part 2 of https://github.com/flutter/flutter/issues/117910 This PR converts startProductRequest(), finishTransaction(), restoreTransactions(), presentCodeRedemptionSheet() to pigeon, as well as add all remaining converts to and from pigeons for SK objects. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] All existing and new tests are passing. --- .../in_app_purchase_storekit/CHANGELOG.md | 4 + .../darwin/Classes/FIAObjectTranslator.h | 17 +- .../darwin/Classes/FIAObjectTranslator.m | 136 ++++++- .../darwin/Classes/InAppPurchasePlugin.m | 91 ++--- .../darwin/Classes/messages.g.h | 130 +++++++ .../darwin/Classes/messages.g.m | 362 ++++++++++++++++- .../RunnerTests/InAppPurchasePluginTests.m | 39 +- .../shared/RunnerTests/TranslatorTests.m | 37 ++ .../lib/src/messages.g.dart | 364 +++++++++++++++++- .../sk_payment_queue_wrapper.dart | 12 +- .../sk_product_wrapper.dart | 231 ++++++++++- .../store_kit_wrappers/sk_request_maker.dart | 17 +- .../pigeons/messages.dart | 123 +++++- .../in_app_purchase_storekit/pubspec.yaml | 2 +- .../test/fakes/fake_storekit_platform.dart | 144 +++---- .../pigeon_converter_test.dart | 98 +++++ .../sk_methodchannel_apis_test.dart | 43 ++- .../sk_test_stub_objects.dart | 40 ++ .../test/test_api.g.dart | 155 +++++++- 19 files changed, 1822 insertions(+), 223 deletions(-) create mode 100644 packages/in_app_purchase/in_app_purchase_storekit/test/store_kit_wrappers/pigeon_converter_test.dart diff --git a/packages/in_app_purchase/in_app_purchase_storekit/CHANGELOG.md b/packages/in_app_purchase/in_app_purchase_storekit/CHANGELOG.md index 044a1fef4fc5..67ff21186e7b 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/CHANGELOG.md +++ b/packages/in_app_purchase/in_app_purchase_storekit/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.3.10 + +* Converts `startProductRequest()`, `finishTransaction()`, `restoreTransactions()`, `presentCodeRedemptionSheet()` to pigeon. + ## 0.3.9 * Converts `storefront()`, `transactions()`, `addPayment()`, `canMakePayment` to pigeon. diff --git a/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/FIAObjectTranslator.h b/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/FIAObjectTranslator.h index bf32cc128fc1..ffb0f1fe9588 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/FIAObjectTranslator.h +++ b/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/FIAObjectTranslator.h @@ -69,7 +69,22 @@ NS_ASSUME_NONNULL_BEGIN + (nullable SKPaymentMessage *)convertPaymentToPigeon:(nullable SKPayment *)payment API_AVAILABLE(ios(12.2)); -+ (nullable SKErrorMessage *)convertSKErrorToPigeon:(NSError *)error; ++ (nullable SKErrorMessage *)convertSKErrorToPigeon:(nullable NSError *)error; + ++ (nullable SKProductsResponseMessage *)convertProductsResponseToPigeon: + (nullable SKProductsResponse *)payment; + ++ (nullable SKProductMessage *)convertProductToPigeon:(nullable SKProduct *)product + API_AVAILABLE(ios(12.2)); + ++ (nullable SKProductDiscountMessage *)convertProductDiscountToPigeon: + (nullable SKProductDiscount *)productDiscount API_AVAILABLE(ios(12.2)); + ++ (nullable SKPriceLocaleMessage *)convertNSLocaleToPigeon:(nullable NSLocale *)locale + API_AVAILABLE(ios(12.2)); + ++ (nullable SKProductSubscriptionPeriodMessage *)convertSKProductSubscriptionPeriodToPigeon: + (nullable SKProductSubscriptionPeriod *)period API_AVAILABLE(ios(12.2)); @end NS_ASSUME_NONNULL_END diff --git a/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/FIAObjectTranslator.m b/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/FIAObjectTranslator.m index bfc5542af5ec..b8c6a269b8ce 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/FIAObjectTranslator.m +++ b/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/FIAObjectTranslator.m @@ -306,7 +306,11 @@ + (nullable SKPaymentTransactionMessage *)convertTransactionToPigeon: return msg; } -+ (nullable SKErrorMessage *)convertSKErrorToPigeon:(NSError *)error { ++ (nullable SKErrorMessage *)convertSKErrorToPigeon:(nullable NSError *)error { + if (!error) { + return nil; + } + NSMutableDictionary *userInfo = [NSMutableDictionary new]; for (NSErrorUserInfoKey key in error.userInfo) { id value = error.userInfo[key]; @@ -376,4 +380,134 @@ + (nullable SKStorefrontMessage *)convertStorefrontToPigeon:(nullable SKStorefro return msg; } ++ (nullable SKProductSubscriptionPeriodMessage *)convertSKProductSubscriptionPeriodToPigeon: + (nullable SKProductSubscriptionPeriod *)period API_AVAILABLE(ios(12.2)) { + if (!period) { + return nil; + } + + SKSubscriptionPeriodUnitMessage unit; + switch (period.unit) { + case SKProductPeriodUnitDay: + unit = SKSubscriptionPeriodUnitMessageDay; + break; + case SKProductPeriodUnitWeek: + unit = SKSubscriptionPeriodUnitMessageWeek; + break; + case SKProductPeriodUnitMonth: + unit = SKSubscriptionPeriodUnitMessageMonth; + break; + case SKProductPeriodUnitYear: + unit = SKSubscriptionPeriodUnitMessageYear; + break; + } + + SKProductSubscriptionPeriodMessage *msg = + [SKProductSubscriptionPeriodMessage makeWithNumberOfUnits:period.numberOfUnits unit:unit]; + + return msg; +} + ++ (nullable SKProductDiscountMessage *)convertProductDiscountToPigeon: + (nullable SKProductDiscount *)productDiscount API_AVAILABLE(ios(12.2)) { + if (!productDiscount) { + return nil; + } + + SKProductDiscountPaymentModeMessage paymentMode; + switch (productDiscount.paymentMode) { + case SKProductDiscountPaymentModeFreeTrial: + paymentMode = SKProductDiscountPaymentModeMessageFreeTrial; + break; + case SKProductDiscountPaymentModePayAsYouGo: + paymentMode = SKProductDiscountPaymentModeMessagePayAsYouGo; + break; + case SKProductDiscountPaymentModePayUpFront: + paymentMode = SKProductDiscountPaymentModeMessagePayUpFront; + break; + } + + SKProductDiscountTypeMessage type; + switch (productDiscount.type) { + case SKProductDiscountTypeIntroductory: + type = SKProductDiscountTypeMessageIntroductory; + break; + case SKProductDiscountTypeSubscription: + type = SKProductDiscountTypeMessageSubscription; + break; + } + + SKProductDiscountMessage *msg = [SKProductDiscountMessage + makeWithPrice:productDiscount.price.description + priceLocale:[self convertNSLocaleToPigeon:productDiscount.priceLocale] + numberOfPeriods:productDiscount.numberOfPeriods + paymentMode:paymentMode + subscriptionPeriod:[self convertSKProductSubscriptionPeriodToPigeon:productDiscount + .subscriptionPeriod] + identifier:productDiscount.identifier + type:type]; + + return msg; +} + ++ (nullable SKPriceLocaleMessage *)convertNSLocaleToPigeon:(nullable NSLocale *)locale + API_AVAILABLE(ios(12.2)) { + if (!locale) { + return nil; + } + SKPriceLocaleMessage *msg = [SKPriceLocaleMessage makeWithCurrencySymbol:locale.currencySymbol + currencyCode:locale.currencyCode + countryCode:locale.countryCode]; + + return msg; +} + ++ (nullable SKProductMessage *)convertProductToPigeon:(nullable SKProduct *)product + API_AVAILABLE(ios(12.2)) { + if (!product) { + return nil; + } + + NSArray *skProductDiscounts = product.discounts; + NSMutableArray *pigeonProductDiscounts = + [NSMutableArray arrayWithCapacity:skProductDiscounts.count]; + + for (SKProductDiscount *productDiscount in skProductDiscounts) { + [pigeonProductDiscounts addObject:[self convertProductDiscountToPigeon:productDiscount]]; + }; + + SKProductMessage *msg = [SKProductMessage + makeWithProductIdentifier:product.productIdentifier + localizedTitle:product.localizedTitle + localizedDescription:product.localizedDescription + priceLocale:[self convertNSLocaleToPigeon:product.priceLocale] + subscriptionGroupIdentifier:product.subscriptionGroupIdentifier + price:product.price.description + subscriptionPeriod: + [self convertSKProductSubscriptionPeriodToPigeon:product.subscriptionPeriod] + introductoryPrice:[self convertProductDiscountToPigeon:product.introductoryPrice] + discounts:pigeonProductDiscounts]; + + return msg; +} + ++ (nullable SKProductsResponseMessage *)convertProductsResponseToPigeon: + (nullable SKProductsResponse *)productsResponse API_AVAILABLE(ios(12.2)) { + if (!productsResponse) { + return nil; + } + NSArray *skProducts = productsResponse.products; + NSMutableArray *pigeonProducts = + [NSMutableArray arrayWithCapacity:skProducts.count]; + + for (SKProduct *product in skProducts) { + [pigeonProducts addObject:[self convertProductToPigeon:product]]; + }; + + SKProductsResponseMessage *msg = + [SKProductsResponseMessage makeWithProducts:pigeonProducts + invalidProductIdentifiers:productsResponse.invalidProductIdentifiers]; + return msg; +} + @end diff --git a/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/InAppPurchasePlugin.m b/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/InAppPurchasePlugin.m index 88cc4e8a5d03..82366537404b 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/InAppPurchasePlugin.m +++ b/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/InAppPurchasePlugin.m @@ -88,18 +88,7 @@ - (instancetype)initWithRegistrar:(NSObject *)registrar } - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result { - if ([@"-[InAppPurchasePlugin startProductRequest:result:]" isEqualToString:call.method]) { - [self handleProductRequestMethodCall:call result:result]; - } else if ([@"-[InAppPurchasePlugin finishTransaction:result:]" isEqualToString:call.method]) { - [self finishTransaction:call result:result]; - } else if ([@"-[InAppPurchasePlugin restoreTransactions:result:]" isEqualToString:call.method]) { - [self restoreTransactions:call result:result]; -#if TARGET_OS_IOS - } else if ([@"-[InAppPurchasePlugin presentCodeRedemptionSheet:result:]" - isEqualToString:call.method]) { - [self presentCodeRedemptionSheet:call result:result]; -#endif - } else if ([@"-[InAppPurchasePlugin retrieveReceiptData:result:]" isEqualToString:call.method]) { + if ([@"-[InAppPurchasePlugin retrieveReceiptData:result:]" isEqualToString:call.method]) { [self retrieveReceiptData:call result:result]; } else if ([@"-[InAppPurchasePlugin refreshReceipt:result:]" isEqualToString:call.method]) { [self refreshReceipt:call result:result]; @@ -147,38 +136,38 @@ - (nullable SKStorefrontMessage *)storefrontWithError:(FlutterError *_Nullable * return [FIAObjectTranslator convertStorefrontToPigeon:storefront]; } -- (void)handleProductRequestMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result { - if (![call.arguments isKindOfClass:[NSArray class]]) { - result([FlutterError errorWithCode:@"storekit_invalid_argument" - message:@"Argument type of startRequest is not array" - details:call.arguments]); - return; - } - NSArray *productIdentifiers = (NSArray *)call.arguments; +- (void)startProductRequestProductIdentifiers:(NSArray *)productIdentifiers + completion:(void (^)(SKProductsResponseMessage *_Nullable, + FlutterError *_Nullable))completion { SKProductsRequest *request = [self getProductRequestWithIdentifiers:[NSSet setWithArray:productIdentifiers]]; FIAPRequestHandler *handler = [[FIAPRequestHandler alloc] initWithRequest:request]; [self.requestHandlers addObject:handler]; __weak typeof(self) weakSelf = self; + [handler startProductRequestWithCompletionHandler:^(SKProductsResponse *_Nullable response, - NSError *_Nullable error) { - if (error) { - result([FlutterError errorWithCode:@"storekit_getproductrequest_platform_error" - message:error.localizedDescription - details:error.description]); + NSError *_Nullable startProductRequestError) { + FlutterError *error = nil; + if (startProductRequestError != nil) { + error = [FlutterError errorWithCode:@"storekit_getproductrequest_platform_error" + message:startProductRequestError.localizedDescription + details:startProductRequestError.description]; + completion(nil, error); return; } if (!response) { - result([FlutterError errorWithCode:@"storekit_platform_no_response" - message:@"Failed to get SKProductResponse in startRequest " - @"call. Error occured on iOS platform" - details:call.arguments]); + error = [FlutterError errorWithCode:@"storekit_platform_no_response" + message:@"Failed to get SKProductResponse in startRequest " + @"call. Error occured on iOS platform" + details:productIdentifiers]; + completion(nil, error); return; } for (SKProduct *product in response.products) { [self.productsCache setObject:product forKey:product.productIdentifier]; } - result([FIAObjectTranslator getMapFromSKProductsResponse:response]); + + completion([FIAObjectTranslator convertProductsResponseToPigeon:response], error); [weakSelf.requestHandlers removeObject:handler]; }]; } @@ -240,16 +229,10 @@ - (void)addPaymentPaymentMap:(nonnull NSDictionary *)paymentMap } } -- (void)finishTransaction:(FlutterMethodCall *)call result:(FlutterResult)result { - if (![call.arguments isKindOfClass:[NSDictionary class]]) { - result([FlutterError errorWithCode:@"storekit_invalid_argument" - message:@"Argument type of finishTransaction is not a Dictionary" - details:call.arguments]); - return; - } - NSDictionary *paymentMap = (NSDictionary *)call.arguments; - NSString *transactionIdentifier = [paymentMap objectForKey:@"transactionIdentifier"]; - NSString *productIdentifier = [paymentMap objectForKey:@"productIdentifier"]; +- (void)finishTransactionFinishMap:(nonnull NSDictionary *)finishMap + error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { + NSString *transactionIdentifier = [finishMap objectForKey:@"transactionIdentifier"]; + NSString *productIdentifier = [finishMap objectForKey:@"productIdentifier"]; NSArray *pendingTransactions = [self.paymentQueueHandler getUnfinishedTransactions]; @@ -265,35 +248,27 @@ - (void)finishTransaction:(FlutterMethodCall *)call result:(FlutterResult)result @try { [self.paymentQueueHandler finishTransaction:transaction]; } @catch (NSException *e) { - result([FlutterError errorWithCode:@"storekit_finish_transaction_exception" - message:e.name - details:e.description]); + *error = [FlutterError errorWithCode:@"storekit_finish_transaction_exception" + message:e.name + details:e.description]; return; } } } - - result(nil); } -- (void)restoreTransactions:(FlutterMethodCall *)call result:(FlutterResult)result { - if (call.arguments && ![call.arguments isKindOfClass:[NSString class]]) { - result([FlutterError - errorWithCode:@"storekit_invalid_argument" - message:@"Argument is not nil and the type of finishTransaction is not a string." - details:call.arguments]); - return; - } - [self.paymentQueueHandler restoreTransactions:call.arguments]; - result(nil); +- (void)restoreTransactionsApplicationUserName:(nullable NSString *)applicationUserName + error:(FlutterError *_Nullable __autoreleasing *_Nonnull) + error { + [self.paymentQueueHandler restoreTransactions:applicationUserName]; } +- (void)presentCodeRedemptionSheetWithError: + (FlutterError *_Nullable __autoreleasing *_Nonnull)error { #if TARGET_OS_IOS -- (void)presentCodeRedemptionSheet:(FlutterMethodCall *)call result:(FlutterResult)result { [self.paymentQueueHandler presentCodeRedemptionSheet]; - result(nil); -} #endif +} - (void)retrieveReceiptData:(FlutterMethodCall *)call result:(FlutterResult)result { FlutterError *error = nil; diff --git a/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/messages.g.h b/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/messages.g.h index 3874b7b20a88..87a197212504 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/messages.g.h +++ b/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/messages.g.h @@ -52,11 +52,60 @@ typedef NS_ENUM(NSUInteger, SKPaymentTransactionStateMessage) { - (instancetype)initWithValue:(SKPaymentTransactionStateMessage)value; @end +typedef NS_ENUM(NSUInteger, SKProductDiscountTypeMessage) { + /// A constant indicating the discount type is an introductory offer. + SKProductDiscountTypeMessageIntroductory = 0, + /// A constant indicating the discount type is a promotional offer. + SKProductDiscountTypeMessageSubscription = 1, +}; + +/// Wrapper for SKProductDiscountTypeMessage to allow for nullability. +@interface SKProductDiscountTypeMessageBox : NSObject +@property(nonatomic, assign) SKProductDiscountTypeMessage value; +- (instancetype)initWithValue:(SKProductDiscountTypeMessage)value; +@end + +typedef NS_ENUM(NSUInteger, SKProductDiscountPaymentModeMessage) { + /// Allows user to pay the discounted price at each payment period. + SKProductDiscountPaymentModeMessagePayAsYouGo = 0, + /// Allows user to pay the discounted price upfront and receive the product for the rest of time + /// that was paid for. + SKProductDiscountPaymentModeMessagePayUpFront = 1, + /// User pays nothing during the discounted period. + SKProductDiscountPaymentModeMessageFreeTrial = 2, + /// Unspecified mode. + SKProductDiscountPaymentModeMessageUnspecified = 3, +}; + +/// Wrapper for SKProductDiscountPaymentModeMessage to allow for nullability. +@interface SKProductDiscountPaymentModeMessageBox : NSObject +@property(nonatomic, assign) SKProductDiscountPaymentModeMessage value; +- (instancetype)initWithValue:(SKProductDiscountPaymentModeMessage)value; +@end + +typedef NS_ENUM(NSUInteger, SKSubscriptionPeriodUnitMessage) { + SKSubscriptionPeriodUnitMessageDay = 0, + SKSubscriptionPeriodUnitMessageWeek = 1, + SKSubscriptionPeriodUnitMessageMonth = 2, + SKSubscriptionPeriodUnitMessageYear = 3, +}; + +/// Wrapper for SKSubscriptionPeriodUnitMessage to allow for nullability. +@interface SKSubscriptionPeriodUnitMessageBox : NSObject +@property(nonatomic, assign) SKSubscriptionPeriodUnitMessage value; +- (instancetype)initWithValue:(SKSubscriptionPeriodUnitMessage)value; +@end + @class SKPaymentTransactionMessage; @class SKPaymentMessage; @class SKErrorMessage; @class SKPaymentDiscountMessage; @class SKStorefrontMessage; +@class SKProductsResponseMessage; +@class SKProductMessage; +@class SKPriceLocaleMessage; +@class SKProductDiscountMessage; +@class SKProductSubscriptionPeriodMessage; @interface SKPaymentTransactionMessage : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. @@ -126,6 +175,79 @@ typedef NS_ENUM(NSUInteger, SKPaymentTransactionStateMessage) { @property(nonatomic, copy) NSString *identifier; @end +@interface SKProductsResponseMessage : NSObject ++ (instancetype)makeWithProducts:(nullable NSArray *)products + invalidProductIdentifiers:(nullable NSArray *)invalidProductIdentifiers; +@property(nonatomic, copy, nullable) NSArray *products; +@property(nonatomic, copy, nullable) NSArray *invalidProductIdentifiers; +@end + +@interface SKProductMessage : NSObject +/// `init` unavailable to enforce nonnull fields, see the `make` class method. +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)makeWithProductIdentifier:(NSString *)productIdentifier + localizedTitle:(NSString *)localizedTitle + localizedDescription:(NSString *)localizedDescription + priceLocale:(SKPriceLocaleMessage *)priceLocale + subscriptionGroupIdentifier:(nullable NSString *)subscriptionGroupIdentifier + price:(NSString *)price + subscriptionPeriod: + (nullable SKProductSubscriptionPeriodMessage *)subscriptionPeriod + introductoryPrice:(nullable SKProductDiscountMessage *)introductoryPrice + discounts:(nullable NSArray *)discounts; +@property(nonatomic, copy) NSString *productIdentifier; +@property(nonatomic, copy) NSString *localizedTitle; +@property(nonatomic, copy) NSString *localizedDescription; +@property(nonatomic, strong) SKPriceLocaleMessage *priceLocale; +@property(nonatomic, copy, nullable) NSString *subscriptionGroupIdentifier; +@property(nonatomic, copy) NSString *price; +@property(nonatomic, strong, nullable) SKProductSubscriptionPeriodMessage *subscriptionPeriod; +@property(nonatomic, strong, nullable) SKProductDiscountMessage *introductoryPrice; +@property(nonatomic, copy, nullable) NSArray *discounts; +@end + +@interface SKPriceLocaleMessage : NSObject +/// `init` unavailable to enforce nonnull fields, see the `make` class method. +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)makeWithCurrencySymbol:(NSString *)currencySymbol + currencyCode:(NSString *)currencyCode + countryCode:(NSString *)countryCode; +/// The currency symbol for the locale, e.g. $ for US locale. +@property(nonatomic, copy) NSString *currencySymbol; +/// The currency code for the locale, e.g. USD for US locale. +@property(nonatomic, copy) NSString *currencyCode; +/// The country code for the locale, e.g. US for US locale. +@property(nonatomic, copy) NSString *countryCode; +@end + +@interface SKProductDiscountMessage : NSObject +/// `init` unavailable to enforce nonnull fields, see the `make` class method. +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)makeWithPrice:(NSString *)price + priceLocale:(SKPriceLocaleMessage *)priceLocale + numberOfPeriods:(NSInteger)numberOfPeriods + paymentMode:(SKProductDiscountPaymentModeMessage)paymentMode + subscriptionPeriod:(SKProductSubscriptionPeriodMessage *)subscriptionPeriod + identifier:(nullable NSString *)identifier + type:(SKProductDiscountTypeMessage)type; +@property(nonatomic, copy) NSString *price; +@property(nonatomic, strong) SKPriceLocaleMessage *priceLocale; +@property(nonatomic, assign) NSInteger numberOfPeriods; +@property(nonatomic, assign) SKProductDiscountPaymentModeMessage paymentMode; +@property(nonatomic, strong) SKProductSubscriptionPeriodMessage *subscriptionPeriod; +@property(nonatomic, copy, nullable) NSString *identifier; +@property(nonatomic, assign) SKProductDiscountTypeMessage type; +@end + +@interface SKProductSubscriptionPeriodMessage : NSObject +/// `init` unavailable to enforce nonnull fields, see the `make` class method. +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)makeWithNumberOfUnits:(NSInteger)numberOfUnits + unit:(SKSubscriptionPeriodUnitMessage)unit; +@property(nonatomic, assign) NSInteger numberOfUnits; +@property(nonatomic, assign) SKSubscriptionPeriodUnitMessage unit; +@end + /// The codec used by InAppPurchaseAPI. NSObject *InAppPurchaseAPIGetCodec(void); @@ -141,6 +263,14 @@ NSObject *InAppPurchaseAPIGetCodec(void); - (nullable SKStorefrontMessage *)storefrontWithError:(FlutterError *_Nullable *_Nonnull)error; - (void)addPaymentPaymentMap:(NSDictionary *)paymentMap error:(FlutterError *_Nullable *_Nonnull)error; +- (void)startProductRequestProductIdentifiers:(NSArray *)productIdentifiers + completion:(void (^)(SKProductsResponseMessage *_Nullable, + FlutterError *_Nullable))completion; +- (void)finishTransactionFinishMap:(NSDictionary *)finishMap + error:(FlutterError *_Nullable *_Nonnull)error; +- (void)restoreTransactionsApplicationUserName:(nullable NSString *)applicationUserName + error:(FlutterError *_Nullable *_Nonnull)error; +- (void)presentCodeRedemptionSheetWithError:(FlutterError *_Nullable *_Nonnull)error; @end extern void SetUpInAppPurchaseAPI(id binaryMessenger, diff --git a/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/messages.g.m b/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/messages.g.m index 6608b7a0002b..79599d932e0e 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/messages.g.m +++ b/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/messages.g.m @@ -1,6 +1,7 @@ // 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. + // Autogenerated from Pigeon (v16.0.4), do not edit directly. // See also: https://pub.dev/packages/pigeon @@ -40,6 +41,36 @@ - (instancetype)initWithValue:(SKPaymentTransactionStateMessage)value { } @end +@implementation SKProductDiscountTypeMessageBox +- (instancetype)initWithValue:(SKProductDiscountTypeMessage)value { + self = [super init]; + if (self) { + _value = value; + } + return self; +} +@end + +@implementation SKProductDiscountPaymentModeMessageBox +- (instancetype)initWithValue:(SKProductDiscountPaymentModeMessage)value { + self = [super init]; + if (self) { + _value = value; + } + return self; +} +@end + +@implementation SKSubscriptionPeriodUnitMessageBox +- (instancetype)initWithValue:(SKSubscriptionPeriodUnitMessage)value { + self = [super init]; + if (self) { + _value = value; + } + return self; +} +@end + @interface SKPaymentTransactionMessage () + (SKPaymentTransactionMessage *)fromList:(NSArray *)list; + (nullable SKPaymentTransactionMessage *)nullableFromList:(NSArray *)list; @@ -70,6 +101,36 @@ + (nullable SKStorefrontMessage *)nullableFromList:(NSArray *)list; - (NSArray *)toList; @end +@interface SKProductsResponseMessage () ++ (SKProductsResponseMessage *)fromList:(NSArray *)list; ++ (nullable SKProductsResponseMessage *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; +@end + +@interface SKProductMessage () ++ (SKProductMessage *)fromList:(NSArray *)list; ++ (nullable SKProductMessage *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; +@end + +@interface SKPriceLocaleMessage () ++ (SKPriceLocaleMessage *)fromList:(NSArray *)list; ++ (nullable SKPriceLocaleMessage *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; +@end + +@interface SKProductDiscountMessage () ++ (SKProductDiscountMessage *)fromList:(NSArray *)list; ++ (nullable SKProductDiscountMessage *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; +@end + +@interface SKProductSubscriptionPeriodMessage () ++ (SKProductSubscriptionPeriodMessage *)fromList:(NSArray *)list; ++ (nullable SKProductSubscriptionPeriodMessage *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; +@end + @implementation SKPaymentTransactionMessage + (instancetype)makeWithPayment:(SKPaymentMessage *)payment transactionState:(SKPaymentTransactionStateMessage)transactionState @@ -244,6 +305,191 @@ - (NSArray *)toList { } @end +@implementation SKProductsResponseMessage ++ (instancetype)makeWithProducts:(nullable NSArray *)products + invalidProductIdentifiers:(nullable NSArray *)invalidProductIdentifiers { + SKProductsResponseMessage *pigeonResult = [[SKProductsResponseMessage alloc] init]; + pigeonResult.products = products; + pigeonResult.invalidProductIdentifiers = invalidProductIdentifiers; + return pigeonResult; +} ++ (SKProductsResponseMessage *)fromList:(NSArray *)list { + SKProductsResponseMessage *pigeonResult = [[SKProductsResponseMessage alloc] init]; + pigeonResult.products = GetNullableObjectAtIndex(list, 0); + pigeonResult.invalidProductIdentifiers = GetNullableObjectAtIndex(list, 1); + return pigeonResult; +} ++ (nullable SKProductsResponseMessage *)nullableFromList:(NSArray *)list { + return (list) ? [SKProductsResponseMessage fromList:list] : nil; +} +- (NSArray *)toList { + return @[ + self.products ?: [NSNull null], + self.invalidProductIdentifiers ?: [NSNull null], + ]; +} +@end + +@implementation SKProductMessage ++ (instancetype) + makeWithProductIdentifier:(NSString *)productIdentifier + localizedTitle:(NSString *)localizedTitle + localizedDescription:(NSString *)localizedDescription + priceLocale:(SKPriceLocaleMessage *)priceLocale + subscriptionGroupIdentifier:(nullable NSString *)subscriptionGroupIdentifier + price:(NSString *)price + subscriptionPeriod:(nullable SKProductSubscriptionPeriodMessage *)subscriptionPeriod + introductoryPrice:(nullable SKProductDiscountMessage *)introductoryPrice + discounts:(nullable NSArray *)discounts { + SKProductMessage *pigeonResult = [[SKProductMessage alloc] init]; + pigeonResult.productIdentifier = productIdentifier; + pigeonResult.localizedTitle = localizedTitle; + pigeonResult.localizedDescription = localizedDescription; + pigeonResult.priceLocale = priceLocale; + pigeonResult.subscriptionGroupIdentifier = subscriptionGroupIdentifier; + pigeonResult.price = price; + pigeonResult.subscriptionPeriod = subscriptionPeriod; + pigeonResult.introductoryPrice = introductoryPrice; + pigeonResult.discounts = discounts; + return pigeonResult; +} ++ (SKProductMessage *)fromList:(NSArray *)list { + SKProductMessage *pigeonResult = [[SKProductMessage alloc] init]; + pigeonResult.productIdentifier = GetNullableObjectAtIndex(list, 0); + pigeonResult.localizedTitle = GetNullableObjectAtIndex(list, 1); + pigeonResult.localizedDescription = GetNullableObjectAtIndex(list, 2); + pigeonResult.priceLocale = + [SKPriceLocaleMessage nullableFromList:(GetNullableObjectAtIndex(list, 3))]; + pigeonResult.subscriptionGroupIdentifier = GetNullableObjectAtIndex(list, 4); + pigeonResult.price = GetNullableObjectAtIndex(list, 5); + pigeonResult.subscriptionPeriod = + [SKProductSubscriptionPeriodMessage nullableFromList:(GetNullableObjectAtIndex(list, 6))]; + pigeonResult.introductoryPrice = + [SKProductDiscountMessage nullableFromList:(GetNullableObjectAtIndex(list, 7))]; + pigeonResult.discounts = GetNullableObjectAtIndex(list, 8); + return pigeonResult; +} ++ (nullable SKProductMessage *)nullableFromList:(NSArray *)list { + return (list) ? [SKProductMessage fromList:list] : nil; +} +- (NSArray *)toList { + return @[ + self.productIdentifier ?: [NSNull null], + self.localizedTitle ?: [NSNull null], + self.localizedDescription ?: [NSNull null], + (self.priceLocale ? [self.priceLocale toList] : [NSNull null]), + self.subscriptionGroupIdentifier ?: [NSNull null], + self.price ?: [NSNull null], + (self.subscriptionPeriod ? [self.subscriptionPeriod toList] : [NSNull null]), + (self.introductoryPrice ? [self.introductoryPrice toList] : [NSNull null]), + self.discounts ?: [NSNull null], + ]; +} +@end + +@implementation SKPriceLocaleMessage ++ (instancetype)makeWithCurrencySymbol:(NSString *)currencySymbol + currencyCode:(NSString *)currencyCode + countryCode:(NSString *)countryCode { + SKPriceLocaleMessage *pigeonResult = [[SKPriceLocaleMessage alloc] init]; + pigeonResult.currencySymbol = currencySymbol; + pigeonResult.currencyCode = currencyCode; + pigeonResult.countryCode = countryCode; + return pigeonResult; +} ++ (SKPriceLocaleMessage *)fromList:(NSArray *)list { + SKPriceLocaleMessage *pigeonResult = [[SKPriceLocaleMessage alloc] init]; + pigeonResult.currencySymbol = GetNullableObjectAtIndex(list, 0); + pigeonResult.currencyCode = GetNullableObjectAtIndex(list, 1); + pigeonResult.countryCode = GetNullableObjectAtIndex(list, 2); + return pigeonResult; +} ++ (nullable SKPriceLocaleMessage *)nullableFromList:(NSArray *)list { + return (list) ? [SKPriceLocaleMessage fromList:list] : nil; +} +- (NSArray *)toList { + return @[ + self.currencySymbol ?: [NSNull null], + self.currencyCode ?: [NSNull null], + self.countryCode ?: [NSNull null], + ]; +} +@end + +@implementation SKProductDiscountMessage ++ (instancetype)makeWithPrice:(NSString *)price + priceLocale:(SKPriceLocaleMessage *)priceLocale + numberOfPeriods:(NSInteger)numberOfPeriods + paymentMode:(SKProductDiscountPaymentModeMessage)paymentMode + subscriptionPeriod:(SKProductSubscriptionPeriodMessage *)subscriptionPeriod + identifier:(nullable NSString *)identifier + type:(SKProductDiscountTypeMessage)type { + SKProductDiscountMessage *pigeonResult = [[SKProductDiscountMessage alloc] init]; + pigeonResult.price = price; + pigeonResult.priceLocale = priceLocale; + pigeonResult.numberOfPeriods = numberOfPeriods; + pigeonResult.paymentMode = paymentMode; + pigeonResult.subscriptionPeriod = subscriptionPeriod; + pigeonResult.identifier = identifier; + pigeonResult.type = type; + return pigeonResult; +} ++ (SKProductDiscountMessage *)fromList:(NSArray *)list { + SKProductDiscountMessage *pigeonResult = [[SKProductDiscountMessage alloc] init]; + pigeonResult.price = GetNullableObjectAtIndex(list, 0); + pigeonResult.priceLocale = + [SKPriceLocaleMessage nullableFromList:(GetNullableObjectAtIndex(list, 1))]; + pigeonResult.numberOfPeriods = [GetNullableObjectAtIndex(list, 2) integerValue]; + pigeonResult.paymentMode = [GetNullableObjectAtIndex(list, 3) integerValue]; + pigeonResult.subscriptionPeriod = + [SKProductSubscriptionPeriodMessage nullableFromList:(GetNullableObjectAtIndex(list, 4))]; + pigeonResult.identifier = GetNullableObjectAtIndex(list, 5); + pigeonResult.type = [GetNullableObjectAtIndex(list, 6) integerValue]; + return pigeonResult; +} ++ (nullable SKProductDiscountMessage *)nullableFromList:(NSArray *)list { + return (list) ? [SKProductDiscountMessage fromList:list] : nil; +} +- (NSArray *)toList { + return @[ + self.price ?: [NSNull null], + (self.priceLocale ? [self.priceLocale toList] : [NSNull null]), + @(self.numberOfPeriods), + @(self.paymentMode), + (self.subscriptionPeriod ? [self.subscriptionPeriod toList] : [NSNull null]), + self.identifier ?: [NSNull null], + @(self.type), + ]; +} +@end + +@implementation SKProductSubscriptionPeriodMessage ++ (instancetype)makeWithNumberOfUnits:(NSInteger)numberOfUnits + unit:(SKSubscriptionPeriodUnitMessage)unit { + SKProductSubscriptionPeriodMessage *pigeonResult = + [[SKProductSubscriptionPeriodMessage alloc] init]; + pigeonResult.numberOfUnits = numberOfUnits; + pigeonResult.unit = unit; + return pigeonResult; +} ++ (SKProductSubscriptionPeriodMessage *)fromList:(NSArray *)list { + SKProductSubscriptionPeriodMessage *pigeonResult = + [[SKProductSubscriptionPeriodMessage alloc] init]; + pigeonResult.numberOfUnits = [GetNullableObjectAtIndex(list, 0) integerValue]; + pigeonResult.unit = [GetNullableObjectAtIndex(list, 1) integerValue]; + return pigeonResult; +} ++ (nullable SKProductSubscriptionPeriodMessage *)nullableFromList:(NSArray *)list { + return (list) ? [SKProductSubscriptionPeriodMessage fromList:list] : nil; +} +- (NSArray *)toList { + return @[ + @(self.numberOfUnits), + @(self.unit), + ]; +} +@end + @interface InAppPurchaseAPICodecReader : FlutterStandardReader @end @implementation InAppPurchaseAPICodecReader @@ -258,6 +504,16 @@ - (nullable id)readValueOfType:(UInt8)type { case 131: return [SKPaymentTransactionMessage fromList:[self readValue]]; case 132: + return [SKPriceLocaleMessage fromList:[self readValue]]; + case 133: + return [SKProductDiscountMessage fromList:[self readValue]]; + case 134: + return [SKProductMessage fromList:[self readValue]]; + case 135: + return [SKProductSubscriptionPeriodMessage fromList:[self readValue]]; + case 136: + return [SKProductsResponseMessage fromList:[self readValue]]; + case 137: return [SKStorefrontMessage fromList:[self readValue]]; default: return [super readValueOfType:type]; @@ -281,9 +537,24 @@ - (void)writeValue:(id)value { } else if ([value isKindOfClass:[SKPaymentTransactionMessage class]]) { [self writeByte:131]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[SKStorefrontMessage class]]) { + } else if ([value isKindOfClass:[SKPriceLocaleMessage class]]) { [self writeByte:132]; [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[SKProductDiscountMessage class]]) { + [self writeByte:133]; + [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[SKProductMessage class]]) { + [self writeByte:134]; + [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[SKProductSubscriptionPeriodMessage class]]) { + [self writeByte:135]; + [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[SKProductsResponseMessage class]]) { + [self writeByte:136]; + [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[SKStorefrontMessage class]]) { + [self writeByte:137]; + [self writeValue:[value toList]]; } else { [super writeValue:value]; } @@ -392,4 +663,93 @@ void SetUpInAppPurchaseAPI(id binaryMessenger, [channel setMessageHandler:nil]; } } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + @"dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.startProductRequest" + binaryMessenger:binaryMessenger + codec:InAppPurchaseAPIGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(startProductRequestProductIdentifiers: + completion:)], + @"InAppPurchaseAPI api (%@) doesn't respond to " + @"@selector(startProductRequestProductIdentifiers:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSArray *arg_productIdentifiers = GetNullableObjectAtIndex(args, 0); + [api startProductRequestProductIdentifiers:arg_productIdentifiers + completion:^(SKProductsResponseMessage *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + @"dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.finishTransaction" + binaryMessenger:binaryMessenger + codec:InAppPurchaseAPIGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(finishTransactionFinishMap:error:)], + @"InAppPurchaseAPI api (%@) doesn't respond to " + @"@selector(finishTransactionFinishMap:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_finishMap = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + [api finishTransactionFinishMap:arg_finishMap error:&error]; + callback(wrapResult(nil, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + @"dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.restoreTransactions" + binaryMessenger:binaryMessenger + codec:InAppPurchaseAPIGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(restoreTransactionsApplicationUserName:error:)], + @"InAppPurchaseAPI api (%@) doesn't respond to " + @"@selector(restoreTransactionsApplicationUserName:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSString *arg_applicationUserName = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + [api restoreTransactionsApplicationUserName:arg_applicationUserName error:&error]; + callback(wrapResult(nil, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI." + @"presentCodeRedemptionSheet" + binaryMessenger:binaryMessenger + codec:InAppPurchaseAPIGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(presentCodeRedemptionSheetWithError:)], + @"InAppPurchaseAPI api (%@) doesn't respond to " + @"@selector(presentCodeRedemptionSheetWithError:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + FlutterError *error; + [api presentCodeRedemptionSheetWithError:&error]; + callback(wrapResult(nil, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } } diff --git a/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/InAppPurchasePluginTests.m b/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/InAppPurchasePluginTests.m index 3b855991b8f7..d53301e54c39 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/InAppPurchasePluginTests.m +++ b/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/InAppPurchasePluginTests.m @@ -105,22 +105,21 @@ - (void)testPaymentQueueStorefrontReturnsNil { } - (void)testGetProductResponse { + NSArray *argument = @[ @"123" ]; XCTestExpectation *expectation = - [self expectationWithDescription:@"expect response contains 1 item"]; - FlutterMethodCall *call = [FlutterMethodCall - methodCallWithMethodName:@"-[InAppPurchasePlugin startProductRequest:result:]" - arguments:@[ @"123" ]]; - __block id result; - [self.plugin handleMethodCall:call - result:^(id r) { - [expectation fulfill]; - result = r; - }]; + [self expectationWithDescription:@"completion handler successfully called"]; + [self.plugin + startProductRequestProductIdentifiers:argument + completion:^(SKProductsResponseMessage *_Nullable response, + FlutterError *_Nullable startProductRequestError) { + XCTAssert( + [response isKindOfClass:[SKProductsResponseMessage class]]); + XCTAssertEqual(response.products.count, 1); + XCTAssertEqual(response.invalidProductIdentifiers.count, 0); + XCTAssertEqual(response.products[0].productIdentifier, @"123"); + [expectation fulfill]; + }]; [self waitForExpectations:@[ expectation ] timeout:5]; - XCTAssert([result isKindOfClass:[NSDictionary class]]); - NSArray *resultArray = [result objectForKey:@"products"]; - XCTAssertEqual(resultArray.count, 1); - XCTAssertTrue([resultArray.firstObject[@"productIdentifier"] isEqualToString:@"123"]); } - (void)testAddPaymentShouldReturnFlutterErrorWhenPaymentFails { @@ -273,11 +272,10 @@ - (void)testAddPaymentWithNullSandboxArgument { - (void)testRestoreTransactions { XCTestExpectation *expectation = [self expectationWithDescription:@"result successfully restore transactions"]; - FlutterMethodCall *call = [FlutterMethodCall - methodCallWithMethodName:@"-[InAppPurchasePlugin restoreTransactions:result:]" - arguments:nil]; + SKPaymentQueueStub *queue = [SKPaymentQueueStub new]; queue.testState = SKPaymentTransactionStatePurchased; + __block BOOL callbackInvoked = NO; self.plugin.paymentQueueHandler = [[FIAPaymentQueueHandler alloc] initWithQueue:queue transactionsUpdated:^(NSArray *_Nonnull transactions) { @@ -292,9 +290,10 @@ - (void)testRestoreTransactions { updatedDownloads:nil transactionCache:OCMClassMock(FIATransactionCache.class)]; [queue addTransactionObserver:self.plugin.paymentQueueHandler]; - [self.plugin handleMethodCall:call - result:^(id r){ - }]; + + FlutterError *error; + [self.plugin restoreTransactionsApplicationUserName:nil error:&error]; + [self waitForExpectations:@[ expectation ] timeout:5]; XCTAssertTrue(callbackInvoked); } diff --git a/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/TranslatorTests.m b/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/TranslatorTests.m index 23597321de9a..0060051dad6a 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/TranslatorTests.m +++ b/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/TranslatorTests.m @@ -458,4 +458,41 @@ - (void)testSKPaymentTransactionConvertToPigeon { XCTAssertEqual(paymentTransaction.transactionIdentifier, msg.transactionIdentifier); } +- (void)testSKProductResponseCovertToPigeon { + SKProductsResponseStub *response = + [[SKProductsResponseStub alloc] initWithMap:self.productResponseMap]; + SKProductsResponseMessage *responseMsg = + [FIAObjectTranslator convertProductsResponseToPigeon:response]; + + XCTAssertEqual(responseMsg.products.count, 1); + XCTAssertEqual(responseMsg.invalidProductIdentifiers.count, 0); + + SKProductMessage *productMsg = responseMsg.products[0]; + + // These values are being set in productResponseMap in setUp() + XCTAssertEqualObjects(productMsg.price, @"1"); + XCTAssertEqualObjects(productMsg.productIdentifier, @"123"); + XCTAssertEqualObjects(productMsg.localizedTitle, @"title"); + XCTAssertEqualObjects(productMsg.localizedDescription, @"des"); + XCTAssertEqualObjects(productMsg.subscriptionGroupIdentifier, @"com.group"); + + SKPriceLocaleMessage *localeMsg = productMsg.priceLocale; + SKProductSubscriptionPeriodMessage *subPeriod = productMsg.subscriptionPeriod; + SKProductDiscountMessage *introDiscount = productMsg.introductoryPrice; + NSArray *discounts = productMsg.discounts; + + XCTAssertEqualObjects(localeMsg.countryCode, nil); + XCTAssertEqualObjects(localeMsg.currencyCode, nil); + XCTAssertEqualObjects(localeMsg.currencySymbol, @"\u00a4"); + + XCTAssertEqual(subPeriod.unit, SKSubscriptionPeriodUnitMessageDay); + XCTAssertEqual(subPeriod.numberOfUnits, 0); + + XCTAssertEqualObjects(introDiscount.price, @"1"); + XCTAssertEqual(introDiscount.numberOfPeriods, 1); + XCTAssertEqual(introDiscount.paymentMode, SKProductDiscountPaymentModeMessagePayUpFront); + + XCTAssertEqual(discounts.count, 1); +} + @end diff --git a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/messages.g.dart b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/messages.g.dart index ba454380fbc9..bfbd447de677 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/messages.g.dart +++ b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/messages.g.dart @@ -63,6 +63,35 @@ enum SKPaymentTransactionStateMessage { unspecified, } +enum SKProductDiscountTypeMessage { + /// A constant indicating the discount type is an introductory offer. + introductory, + + /// A constant indicating the discount type is a promotional offer. + subscription, +} + +enum SKProductDiscountPaymentModeMessage { + /// Allows user to pay the discounted price at each payment period. + payAsYouGo, + + /// Allows user to pay the discounted price upfront and receive the product for the rest of time that was paid for. + payUpFront, + + /// User pays nothing during the discounted period. + freeTrial, + + /// Unspecified mode. + unspecified, +} + +enum SKSubscriptionPeriodUnitMessage { + day, + week, + month, + year, +} + class SKPaymentTransactionMessage { SKPaymentTransactionMessage({ required this.payment, @@ -260,6 +289,212 @@ class SKStorefrontMessage { } } +class SKProductsResponseMessage { + SKProductsResponseMessage({ + this.products, + this.invalidProductIdentifiers, + }); + + List? products; + + List? invalidProductIdentifiers; + + Object encode() { + return [ + products, + invalidProductIdentifiers, + ]; + } + + static SKProductsResponseMessage decode(Object result) { + result as List; + return SKProductsResponseMessage( + products: (result[0] as List?)?.cast(), + invalidProductIdentifiers: (result[1] as List?)?.cast(), + ); + } +} + +class SKProductMessage { + SKProductMessage({ + required this.productIdentifier, + required this.localizedTitle, + required this.localizedDescription, + required this.priceLocale, + this.subscriptionGroupIdentifier, + required this.price, + this.subscriptionPeriod, + this.introductoryPrice, + this.discounts, + }); + + String productIdentifier; + + String localizedTitle; + + String localizedDescription; + + SKPriceLocaleMessage priceLocale; + + String? subscriptionGroupIdentifier; + + String price; + + SKProductSubscriptionPeriodMessage? subscriptionPeriod; + + SKProductDiscountMessage? introductoryPrice; + + List? discounts; + + Object encode() { + return [ + productIdentifier, + localizedTitle, + localizedDescription, + priceLocale.encode(), + subscriptionGroupIdentifier, + price, + subscriptionPeriod?.encode(), + introductoryPrice?.encode(), + discounts, + ]; + } + + static SKProductMessage decode(Object result) { + result as List; + return SKProductMessage( + productIdentifier: result[0]! as String, + localizedTitle: result[1]! as String, + localizedDescription: result[2]! as String, + priceLocale: SKPriceLocaleMessage.decode(result[3]! as List), + subscriptionGroupIdentifier: result[4] as String?, + price: result[5]! as String, + subscriptionPeriod: result[6] != null + ? SKProductSubscriptionPeriodMessage.decode( + result[6]! as List) + : null, + introductoryPrice: result[7] != null + ? SKProductDiscountMessage.decode(result[7]! as List) + : null, + discounts: + (result[8] as List?)?.cast(), + ); + } +} + +class SKPriceLocaleMessage { + SKPriceLocaleMessage({ + required this.currencySymbol, + required this.currencyCode, + required this.countryCode, + }); + + ///The currency symbol for the locale, e.g. $ for US locale. + String currencySymbol; + + ///The currency code for the locale, e.g. USD for US locale. + String currencyCode; + + ///The country code for the locale, e.g. US for US locale. + String countryCode; + + Object encode() { + return [ + currencySymbol, + currencyCode, + countryCode, + ]; + } + + static SKPriceLocaleMessage decode(Object result) { + result as List; + return SKPriceLocaleMessage( + currencySymbol: result[0]! as String, + currencyCode: result[1]! as String, + countryCode: result[2]! as String, + ); + } +} + +class SKProductDiscountMessage { + SKProductDiscountMessage({ + required this.price, + required this.priceLocale, + required this.numberOfPeriods, + required this.paymentMode, + required this.subscriptionPeriod, + this.identifier, + required this.type, + }); + + String price; + + SKPriceLocaleMessage priceLocale; + + int numberOfPeriods; + + SKProductDiscountPaymentModeMessage paymentMode; + + SKProductSubscriptionPeriodMessage subscriptionPeriod; + + String? identifier; + + SKProductDiscountTypeMessage type; + + Object encode() { + return [ + price, + priceLocale.encode(), + numberOfPeriods, + paymentMode.index, + subscriptionPeriod.encode(), + identifier, + type.index, + ]; + } + + static SKProductDiscountMessage decode(Object result) { + result as List; + return SKProductDiscountMessage( + price: result[0]! as String, + priceLocale: SKPriceLocaleMessage.decode(result[1]! as List), + numberOfPeriods: result[2]! as int, + paymentMode: + SKProductDiscountPaymentModeMessage.values[result[3]! as int], + subscriptionPeriod: SKProductSubscriptionPeriodMessage.decode( + result[4]! as List), + identifier: result[5] as String?, + type: SKProductDiscountTypeMessage.values[result[6]! as int], + ); + } +} + +class SKProductSubscriptionPeriodMessage { + SKProductSubscriptionPeriodMessage({ + required this.numberOfUnits, + required this.unit, + }); + + int numberOfUnits; + + SKSubscriptionPeriodUnitMessage unit; + + Object encode() { + return [ + numberOfUnits, + unit.index, + ]; + } + + static SKProductSubscriptionPeriodMessage decode(Object result) { + result as List; + return SKProductSubscriptionPeriodMessage( + numberOfUnits: result[0]! as int, + unit: SKSubscriptionPeriodUnitMessage.values[result[1]! as int], + ); + } +} + class _InAppPurchaseAPICodec extends StandardMessageCodec { const _InAppPurchaseAPICodec(); @override @@ -276,9 +511,24 @@ class _InAppPurchaseAPICodec extends StandardMessageCodec { } else if (value is SKPaymentTransactionMessage) { buffer.putUint8(131); writeValue(buffer, value.encode()); - } else if (value is SKStorefrontMessage) { + } else if (value is SKPriceLocaleMessage) { buffer.putUint8(132); writeValue(buffer, value.encode()); + } else if (value is SKProductDiscountMessage) { + buffer.putUint8(133); + writeValue(buffer, value.encode()); + } else if (value is SKProductMessage) { + buffer.putUint8(134); + writeValue(buffer, value.encode()); + } else if (value is SKProductSubscriptionPeriodMessage) { + buffer.putUint8(135); + writeValue(buffer, value.encode()); + } else if (value is SKProductsResponseMessage) { + buffer.putUint8(136); + writeValue(buffer, value.encode()); + } else if (value is SKStorefrontMessage) { + buffer.putUint8(137); + writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); } @@ -296,6 +546,16 @@ class _InAppPurchaseAPICodec extends StandardMessageCodec { case 131: return SKPaymentTransactionMessage.decode(readValue(buffer)!); case 132: + return SKPriceLocaleMessage.decode(readValue(buffer)!); + case 133: + return SKProductDiscountMessage.decode(readValue(buffer)!); + case 134: + return SKProductMessage.decode(readValue(buffer)!); + case 135: + return SKProductSubscriptionPeriodMessage.decode(readValue(buffer)!); + case 136: + return SKProductsResponseMessage.decode(readValue(buffer)!); + case 137: return SKStorefrontMessage.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -426,4 +686,106 @@ class InAppPurchaseAPI { return; } } + + Future startProductRequest( + List productIdentifiers) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.startProductRequest'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([productIdentifiers]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { + throw PlatformException( + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], + ); + } else if (__pigeon_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (__pigeon_replyList[0] as SKProductsResponseMessage?)!; + } + } + + Future finishTransaction(Map finishMap) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.finishTransaction'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = + await __pigeon_channel.send([finishMap]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { + throw PlatformException( + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], + ); + } else { + return; + } + } + + Future restoreTransactions(String? applicationUserName) async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.restoreTransactions'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([applicationUserName]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { + throw PlatformException( + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], + ); + } else { + return; + } + } + + Future presentCodeRedemptionSheet() async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.presentCodeRedemptionSheet'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = + await __pigeon_channel.send(null) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { + throw PlatformException( + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], + ); + } else { + return; + } + } } diff --git a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart index 5c2e3c395a35..f8fd85fcc6b0 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart +++ b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart @@ -161,10 +161,7 @@ class SKPaymentQueueWrapper { Future finishTransaction( SKPaymentTransactionWrapper transaction) async { final Map requestMap = transaction.toFinishMap(); - await channel.invokeMethod( - '-[InAppPurchasePlugin finishTransaction:result:]', - requestMap, - ); + await _hostApi.finishTransaction(requestMap); } /// Restore previously purchased transactions. @@ -188,9 +185,7 @@ class SKPaymentQueueWrapper { /// or [`-[SKPayment restoreCompletedTransactionsWithApplicationUsername:]`](https://developer.apple.com/documentation/storekit/skpaymentqueue/1505992-restorecompletedtransactionswith?language=objc) /// depending on whether the `applicationUserName` is set. Future restoreTransactions({String? applicationUserName}) async { - await channel.invokeMethod( - '-[InAppPurchasePlugin restoreTransactions:result:]', - applicationUserName); + await _hostApi.restoreTransactions(applicationUserName); } /// Present Code Redemption Sheet @@ -200,8 +195,7 @@ class SKPaymentQueueWrapper { /// This method triggers [`-[SKPayment /// presentCodeRedemptionSheet]`](https://developer.apple.com/documentation/storekit/skpaymentqueue/3566726-presentcoderedemptionsheet?language=objc) Future presentCodeRedemptionSheet() async { - await channel.invokeMethod( - '-[InAppPurchasePlugin presentCodeRedemptionSheet:result:]'); + await _hostApi.presentCodeRedemptionSheet(); } /// Shows the price consent sheet if the user has not yet responded to a diff --git a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_product_wrapper.dart b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_product_wrapper.dart index 5eace6fda69e..dfd8c3083fac 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_product_wrapper.dart +++ b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_product_wrapper.dart @@ -5,6 +5,8 @@ import 'package:collection/collection.dart'; import 'package:flutter/foundation.dart'; import 'package:json_annotation/json_annotation.dart'; + +import '../messages.g.dart'; import 'enum_converters.dart'; // WARNING: Changes to `@JsonSerializable` classes need to be reflected in the @@ -64,6 +66,31 @@ class SkProductResponseWrapper { @override int get hashCode => Object.hash(products, invalidProductIdentifiers); + + /// Convert from [SkProductResponseMessage] to [SkProductResponseWrapper] + static SkProductResponseWrapper convertFromPigeon( + SKProductsResponseMessage msg) { + return SkProductResponseWrapper( + products: msg.products! + .map((SKProductMessage? e) => SKProductWrapper.convertFromPigeon(e!)) + .toList(), + invalidProductIdentifiers: msg.invalidProductIdentifiers != null + ? msg.invalidProductIdentifiers!.cast() + : [], + ); + } + + /// Convert from [SkProductResponseWrapper] to [SkProductResponseWrapper] + @visibleForTesting + static SKProductsResponseMessage convertToPigeon( + SkProductResponseWrapper wrapper) { + return SKProductsResponseMessage( + products: wrapper.products + .map((SKProductWrapper? e) => SKProductWrapper.convertToPigeon(e!)) + .toList(), + invalidProductIdentifiers: + wrapper.invalidProductIdentifiers.cast()); + } } /// Dart wrapper around StoreKit's [SKProductPeriodUnit](https://developer.apple.com/documentation/storekit/skproductperiodunit?language=objc). @@ -88,7 +115,38 @@ enum SKSubscriptionPeriodUnit { /// An interval lasting one year. @JsonValue(3) - year, + year; + + /// Convert from [SKSubscriptionPeriodUnitMessage] to [SKSubscriptionPeriodUnit] + static SKSubscriptionPeriodUnit convertFromPigeon( + SKSubscriptionPeriodUnitMessage msg) { + switch (msg) { + case SKSubscriptionPeriodUnitMessage.day: + return SKSubscriptionPeriodUnit.day; + case SKSubscriptionPeriodUnitMessage.week: + return SKSubscriptionPeriodUnit.week; + case SKSubscriptionPeriodUnitMessage.month: + return SKSubscriptionPeriodUnit.month; + case SKSubscriptionPeriodUnitMessage.year: + return SKSubscriptionPeriodUnit.year; + } + } + + /// Convert from [SKSubscriptionPeriodUnit] to [SKSubscriptionPeriodUnitMessage] + @visibleForTesting + static SKSubscriptionPeriodUnitMessage convertToPigeon( + SKSubscriptionPeriodUnit msg) { + switch (msg) { + case SKSubscriptionPeriodUnit.day: + return SKSubscriptionPeriodUnitMessage.day; + case SKSubscriptionPeriodUnit.week: + return SKSubscriptionPeriodUnitMessage.week; + case SKSubscriptionPeriodUnit.month: + return SKSubscriptionPeriodUnitMessage.month; + case SKSubscriptionPeriodUnit.year: + return SKSubscriptionPeriodUnitMessage.year; + } + } } /// Dart wrapper around StoreKit's [SKProductSubscriptionPeriod](https://developer.apple.com/documentation/storekit/skproductsubscriptionperiod?language=objc). @@ -142,6 +200,23 @@ class SKProductSubscriptionPeriodWrapper { @override int get hashCode => Object.hash(numberOfUnits, unit); + + /// Convert from [SKProductSubscriptionPeriodMessage] to [SKProductSubscriptionPeriodWrapper] + static SKProductSubscriptionPeriodWrapper convertFromPigeon( + SKProductSubscriptionPeriodMessage msg) { + return SKProductSubscriptionPeriodWrapper( + numberOfUnits: msg.numberOfUnits, + unit: SKSubscriptionPeriodUnit.convertFromPigeon(msg.unit)); + } + + /// Convert from [SKProductSubscriptionPeriodWrapper] to [SKProductSubscriptionPeriodMessage] + @visibleForTesting + static SKProductSubscriptionPeriodMessage convertToPigeon( + SKProductSubscriptionPeriodWrapper wrapper) { + return SKProductSubscriptionPeriodMessage( + numberOfUnits: wrapper.numberOfUnits, + unit: SKSubscriptionPeriodUnit.convertToPigeon(wrapper.unit)); + } } /// Dart wrapper around StoreKit's [SKProductDiscountPaymentMode](https://developer.apple.com/documentation/storekit/skproductdiscountpaymentmode?language=objc). @@ -164,7 +239,38 @@ enum SKProductDiscountPaymentMode { /// Unspecified mode. @JsonValue(-1) - unspecified, + unspecified; + + /// Convert from [SKProductDiscountPaymentModeMessage] to [SKProductDiscountPaymentModeWrapper] + static SKProductDiscountPaymentMode convertFromPigeon( + SKProductDiscountPaymentModeMessage msg) { + switch (msg) { + case SKProductDiscountPaymentModeMessage.payAsYouGo: + return SKProductDiscountPaymentMode.payAsYouGo; + case SKProductDiscountPaymentModeMessage.payUpFront: + return SKProductDiscountPaymentMode.payUpFront; + case SKProductDiscountPaymentModeMessage.freeTrial: + return SKProductDiscountPaymentMode.freeTrail; + case SKProductDiscountPaymentModeMessage.unspecified: + return SKProductDiscountPaymentMode.unspecified; + } + } + + /// Convert from [SKProductDiscountPaymentModeMessage] to [SKProductDiscountPaymentMode] + @visibleForTesting + static SKProductDiscountPaymentModeMessage convertToPigeon( + SKProductDiscountPaymentMode wrapper) { + switch (wrapper) { + case SKProductDiscountPaymentMode.payAsYouGo: + return SKProductDiscountPaymentModeMessage.payAsYouGo; + case SKProductDiscountPaymentMode.payUpFront: + return SKProductDiscountPaymentModeMessage.payUpFront; + case SKProductDiscountPaymentMode.freeTrail: + return SKProductDiscountPaymentModeMessage.freeTrial; + case SKProductDiscountPaymentMode.unspecified: + return SKProductDiscountPaymentModeMessage.unspecified; + } + } } /// Dart wrapper around StoreKit's [SKProductDiscountType] @@ -182,7 +288,30 @@ enum SKProductDiscountType { /// A constant indicating the discount type is a promotional offer. @JsonValue(1) - subscription, + subscription; + + /// Convert from [SKProductDiscountTypeMessage] to [SKProductDiscountType] + static SKProductDiscountType convertFromPigeon( + SKProductDiscountTypeMessage msg) { + switch (msg) { + case SKProductDiscountTypeMessage.introductory: + return SKProductDiscountType.introductory; + case SKProductDiscountTypeMessage.subscription: + return SKProductDiscountType.subscription; + } + } + + /// Convert from [SKProductDiscountType] to [SKProductDiscountTypeMessage] + @visibleForTesting + static SKProductDiscountTypeMessage convertToPigeon( + SKProductDiscountType wrapper) { + switch (wrapper) { + case SKProductDiscountType.introductory: + return SKProductDiscountTypeMessage.introductory; + case SKProductDiscountType.subscription: + return SKProductDiscountTypeMessage.subscription; + } + } } /// Dart wrapper around StoreKit's [SKProductDiscount](https://developer.apple.com/documentation/storekit/skproductdiscount?language=objc). @@ -265,6 +394,38 @@ class SKProductDiscountWrapper { @override int get hashCode => Object.hash(price, priceLocale, numberOfPeriods, paymentMode, subscriptionPeriod, identifier, type); + + /// Convert from [SKProductDiscountMessage] to [SKProductDiscountWrapper] + static SKProductDiscountWrapper convertFromPigeon( + SKProductDiscountMessage msg) { + return SKProductDiscountWrapper( + price: msg.price, + priceLocale: SKPriceLocaleWrapper.convertFromPigeon(msg.priceLocale), + numberOfPeriods: msg.numberOfPeriods, + paymentMode: + SKProductDiscountPaymentMode.convertFromPigeon(msg.paymentMode), + subscriptionPeriod: + SKProductSubscriptionPeriodWrapper.convertFromPigeon( + msg.subscriptionPeriod), + identifier: msg.identifier, + type: SKProductDiscountType.convertFromPigeon(msg.type)); + } + + /// Convert from [SKProductDiscountWrapper] to [SKProductDiscountMessage] + @visibleForTesting + static SKProductDiscountMessage convertToPigeon( + SKProductDiscountWrapper wrapper) { + return SKProductDiscountMessage( + price: wrapper.price, + priceLocale: SKPriceLocaleWrapper.convertToPigeon(wrapper.priceLocale), + numberOfPeriods: wrapper.numberOfPeriods, + paymentMode: + SKProductDiscountPaymentMode.convertToPigeon(wrapper.paymentMode), + subscriptionPeriod: SKProductSubscriptionPeriodWrapper.convertToPigeon( + wrapper.subscriptionPeriod), + identifier: wrapper.identifier, + type: SKProductDiscountType.convertToPigeon(wrapper.type)); + } } /// Dart wrapper around StoreKit's [SKProduct](https://developer.apple.com/documentation/storekit/skproduct?language=objc). @@ -383,6 +544,53 @@ class SKProductWrapper { subscriptionPeriod, introductoryPrice, discounts); + + /// Convert from [SKProductMessage] to [SKProductWrapper] + static SKProductWrapper convertFromPigeon(SKProductMessage msg) { + return SKProductWrapper( + productIdentifier: msg.productIdentifier, + localizedTitle: msg.localizedTitle, + localizedDescription: msg.localizedDescription, + priceLocale: SKPriceLocaleWrapper.convertFromPigeon(msg.priceLocale), + price: msg.price, + subscriptionGroupIdentifier: msg.subscriptionGroupIdentifier, + subscriptionPeriod: msg.subscriptionPeriod != null + ? SKProductSubscriptionPeriodWrapper.convertFromPigeon( + msg.subscriptionPeriod!) + : null, + introductoryPrice: msg.introductoryPrice != null + ? SKProductDiscountWrapper.convertFromPigeon(msg.introductoryPrice!) + : null, + discounts: msg.discounts != null + ? msg.discounts! + .map((SKProductDiscountMessage? e) => + SKProductDiscountWrapper.convertFromPigeon(e!)) + .toList() + : []); + } + + /// Convert from [SKProductWrapper] to [SKProductMessage] + static SKProductMessage convertToPigeon(SKProductWrapper wrapper) { + return SKProductMessage( + productIdentifier: wrapper.productIdentifier, + localizedTitle: wrapper.localizedTitle, + localizedDescription: wrapper.localizedDescription, + priceLocale: SKPriceLocaleWrapper.convertToPigeon(wrapper.priceLocale), + price: wrapper.price, + subscriptionGroupIdentifier: wrapper.subscriptionGroupIdentifier, + subscriptionPeriod: wrapper.subscriptionPeriod != null + ? SKProductSubscriptionPeriodWrapper.convertToPigeon( + wrapper.subscriptionPeriod!) + : null, + introductoryPrice: wrapper.introductoryPrice != null + ? SKProductDiscountWrapper.convertToPigeon( + wrapper.introductoryPrice!) + : null, + discounts: wrapper.discounts + .map((SKProductDiscountWrapper? e) => + SKProductDiscountWrapper.convertToPigeon(e!)) + .toList()); + } } /// Object that indicates the locale of the price @@ -442,4 +650,21 @@ class SKPriceLocaleWrapper { @override int get hashCode => Object.hash(currencySymbol, currencyCode); + + /// Convert from [SKPriceLocaleMessage] to [SKPriceLocaleWrapper] + static SKPriceLocaleWrapper convertFromPigeon(SKPriceLocaleMessage msg) { + return SKPriceLocaleWrapper( + currencySymbol: msg.currencySymbol, + currencyCode: msg.currencyCode, + countryCode: msg.countryCode); + } + + /// Convert from [SKPriceLocaleWrapper] to [SKPriceLocaleMessage] + @visibleForTesting + static SKPriceLocaleMessage convertToPigeon(SKPriceLocaleWrapper msg) { + return SKPriceLocaleMessage( + currencySymbol: msg.currencySymbol, + currencyCode: msg.currencyCode, + countryCode: msg.countryCode); + } } diff --git a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_request_maker.dart b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_request_maker.dart index d59f66fce2c9..2dc2ad7baef2 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_request_maker.dart +++ b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_request_maker.dart @@ -7,8 +7,11 @@ import 'dart:async'; import 'package:flutter/services.dart'; import '../channel.dart'; +import '../messages.g.dart'; import 'sk_product_wrapper.dart'; +InAppPurchaseAPI _hostApi = InAppPurchaseAPI(); + /// A request maker that handles all the requests made by SKRequest subclasses. /// /// There are multiple [SKRequest](https://developer.apple.com/documentation/storekit/skrequest?language=objc) subclasses handling different requests in the `StoreKit` with multiple delegate methods, @@ -26,18 +29,18 @@ class SKRequestMaker { /// A [PlatformException] is thrown if the platform code making the request fails. Future startProductRequest( List productIdentifiers) async { - final Map? productResponseMap = - await channel.invokeMapMethod( - '-[InAppPurchasePlugin startProductRequest:result:]', - productIdentifiers, - ); - if (productResponseMap == null) { + final SKProductsResponseMessage productResponsePigeon = + await _hostApi.startProductRequest(productIdentifiers); + + // should products be null or [] ? + if (productResponsePigeon.products == null) { throw PlatformException( code: 'storekit_no_response', message: 'StoreKit: Failed to get response from platform.', ); } - return SkProductResponseWrapper.fromJson(productResponseMap); + + return SkProductResponseWrapper.convertFromPigeon(productResponsePigeon); } /// Uses [SKReceiptRefreshRequest](https://developer.apple.com/documentation/storekit/skreceiptrefreshrequest?language=objc) to request a new receipt. diff --git a/packages/in_app_purchase/in_app_purchase_storekit/pigeons/messages.dart b/packages/in_app_purchase/in_app_purchase_storekit/pigeons/messages.dart index d9d43cd7eff2..9ada32ed2e0d 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/pigeons/messages.dart +++ b/packages/in_app_purchase/in_app_purchase_storekit/pigeons/messages.dart @@ -22,15 +22,10 @@ class SKPaymentTransactionMessage { }); final SKPaymentMessage payment; - final SKPaymentTransactionStateMessage transactionState; - final SKPaymentTransactionMessage? originalTransaction; - final double? transactionTimeStamp; - final String? transactionIdentifier; - final SKErrorMessage? error; } @@ -83,15 +78,10 @@ class SKPaymentMessage { }); final String productIdentifier; - final String? applicationUsername; - final String? requestData; - final int quantity; - final bool simulatesAskToBuyInSandbox; - final SKPaymentDiscountMessage? paymentDiscount; } @@ -130,6 +120,109 @@ class SKStorefrontMessage { final String identifier; } +class SKProductsResponseMessage { + const SKProductsResponseMessage( + {required this.products, required this.invalidProductIdentifiers}); + final List? products; + final List? invalidProductIdentifiers; +} + +class SKProductMessage { + const SKProductMessage( + {required this.productIdentifier, + required this.localizedTitle, + required this.localizedDescription, + required this.priceLocale, + required this.price, + this.subscriptionGroupIdentifier, + this.subscriptionPeriod, + this.introductoryPrice, + this.discounts}); + + final String productIdentifier; + final String localizedTitle; + final String localizedDescription; + final SKPriceLocaleMessage priceLocale; + final String? subscriptionGroupIdentifier; + final String price; + final SKProductSubscriptionPeriodMessage? subscriptionPeriod; + final SKProductDiscountMessage? introductoryPrice; + final List? discounts; +} + +class SKPriceLocaleMessage { + SKPriceLocaleMessage({ + required this.currencySymbol, + required this.currencyCode, + required this.countryCode, + }); + + ///The currency symbol for the locale, e.g. $ for US locale. + final String currencySymbol; + + ///The currency code for the locale, e.g. USD for US locale. + final String currencyCode; + + ///The country code for the locale, e.g. US for US locale. + final String countryCode; +} + +class SKProductDiscountMessage { + const SKProductDiscountMessage( + {required this.price, + required this.priceLocale, + required this.numberOfPeriods, + required this.paymentMode, + required this.subscriptionPeriod, + required this.identifier, + required this.type}); + + final String price; + final SKPriceLocaleMessage priceLocale; + final int numberOfPeriods; + final SKProductDiscountPaymentModeMessage paymentMode; + final SKProductSubscriptionPeriodMessage subscriptionPeriod; + final String? identifier; + final SKProductDiscountTypeMessage type; +} + +enum SKProductDiscountTypeMessage { + /// A constant indicating the discount type is an introductory offer. + introductory, + + /// A constant indicating the discount type is a promotional offer. + subscription, +} + +enum SKProductDiscountPaymentModeMessage { + /// Allows user to pay the discounted price at each payment period. + payAsYouGo, + + /// Allows user to pay the discounted price upfront and receive the product for the rest of time that was paid for. + payUpFront, + + /// User pays nothing during the discounted period. + freeTrial, + + /// Unspecified mode. + unspecified, +} + +class SKProductSubscriptionPeriodMessage { + SKProductSubscriptionPeriodMessage( + {required this.numberOfUnits, required this.unit}); + + final int numberOfUnits; + final SKSubscriptionPeriodUnitMessage unit; +} + +enum SKSubscriptionPeriodUnitMessage { + day, + week, + month, + year, +} + @HostApi(dartHostTestHandler: 'TestInAppPurchaseApi') abstract class InAppPurchaseAPI { /// Returns if the current device is able to make payments @@ -140,4 +233,14 @@ abstract class InAppPurchaseAPI { SKStorefrontMessage storefront(); void addPayment(Map paymentMap); + + @async + SKProductsResponseMessage startProductRequest( + List productIdentifiers); + + void finishTransaction(Map finishMap); + + void restoreTransactions(String? applicationUserName); + + void presentCodeRedemptionSheet(); } diff --git a/packages/in_app_purchase/in_app_purchase_storekit/pubspec.yaml b/packages/in_app_purchase/in_app_purchase_storekit/pubspec.yaml index fc7fde8d6220..97fa1dbd1869 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/pubspec.yaml +++ b/packages/in_app_purchase/in_app_purchase_storekit/pubspec.yaml @@ -2,7 +2,7 @@ name: in_app_purchase_storekit description: An implementation for the iOS and macOS platforms of the Flutter `in_app_purchase` plugin. This uses the StoreKit Framework. repository: https://github.com/flutter/packages/tree/main/packages/in_app_purchase/in_app_purchase_storekit issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22 -version: 0.3.9 +version: 0.3.10 environment: sdk: ^3.2.3 diff --git a/packages/in_app_purchase/in_app_purchase_storekit/test/fakes/fake_storekit_platform.dart b/packages/in_app_purchase/in_app_purchase_storekit/test/fakes/fake_storekit_platform.dart index d26840ad8c07..48db0847bf30 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/test/fakes/fake_storekit_platform.dart +++ b/packages/in_app_purchase/in_app_purchase_storekit/test/fakes/fake_storekit_platform.dart @@ -2,8 +2,6 @@ // 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/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:in_app_purchase_storekit/in_app_purchase_storekit.dart'; @@ -124,42 +122,6 @@ class FakeStoreKitPlatform implements TestInAppPurchaseApi { Future onMethodCall(MethodCall call) { switch (call.method) { - case '-[InAppPurchasePlugin startProductRequest:result:]': - if (queryProductException != null) { - throw queryProductException!; - } - final List productIDS = - List.castFrom(call.arguments as List); - final List invalidFound = []; - final List products = []; - for (final String productID in productIDS) { - if (!validProductIDs.contains(productID)) { - invalidFound.add(productID); - } else { - products.add(validProducts[productID]!); - } - } - final SkProductResponseWrapper response = SkProductResponseWrapper( - products: products, invalidProductIdentifiers: invalidFound); - return Future>.value( - buildProductResponseMap(response)); - case '-[InAppPurchasePlugin restoreTransactions:result:]': - if (restoreException != null) { - throw restoreException!; - } - if (testRestoredError != null) { - InAppPurchaseStoreKitPlatform.observer - .restoreCompletedTransactionsFailed(error: testRestoredError!); - return Future.sync(() {}); - } - if (!testRestoredTransactionsNull) { - InAppPurchaseStoreKitPlatform.observer - .updatedTransactions(transactions: transactionList); - } - InAppPurchaseStoreKitPlatform.observer - .paymentQueueRestoreCompletedTransactionsFinished(); - - return Future.sync(() {}); case '-[InAppPurchasePlugin retrieveReceiptData:result:]': if (receiptData != null) { return Future.value(receiptData!); @@ -169,53 +131,6 @@ class FakeStoreKitPlatform implements TestInAppPurchaseApi { case '-[InAppPurchasePlugin refreshReceipt:result:]': receiptData = 'refreshed receipt data'; return Future.sync(() {}); - case '-[InAppPurchasePlugin addPayment:result:]': - final Map arguments = _getArgumentDictionary(call); - final String id = arguments['productIdentifier']! as String; - final int quantity = arguments['quantity']! as int; - - // Keep the received paymentDiscount parameter when testing payment with discount. - if (arguments['applicationUsername']! == 'userWithDiscount') { - final Map? discountArgument = - arguments['paymentDiscount'] as Map?; - if (discountArgument != null) { - discountReceived = discountArgument.cast(); - } else { - discountReceived = {}; - } - } - - final SKPaymentTransactionWrapper transaction = - createPendingTransaction(id, quantity: quantity); - transactionList.add(transaction); - InAppPurchaseStoreKitPlatform.observer.updatedTransactions( - transactions: [transaction]); - sleep(const Duration(milliseconds: 30)); - if (testTransactionFail) { - final SKPaymentTransactionWrapper transactionFailed = - createFailedTransaction(id, quantity: quantity); - InAppPurchaseStoreKitPlatform.observer.updatedTransactions( - transactions: [transactionFailed]); - } else if (testTransactionCancel > 0) { - final SKPaymentTransactionWrapper transactionCanceled = - createCanceledTransaction(id, testTransactionCancel, - quantity: quantity); - InAppPurchaseStoreKitPlatform.observer.updatedTransactions( - transactions: [transactionCanceled]); - } else { - final SKPaymentTransactionWrapper transactionFinished = - createPurchasedTransaction( - id, transaction.transactionIdentifier ?? '', - quantity: quantity); - InAppPurchaseStoreKitPlatform.observer.updatedTransactions( - transactions: [transactionFinished]); - } - case '-[InAppPurchasePlugin finishTransaction:result:]': - final Map arguments = _getArgumentDictionary(call); - finishedTransactions.add(createPurchasedTransaction( - arguments['productIdentifier']! as String, - arguments['transactionIdentifier']! as String, - quantity: transactionList.first.payment.quantity)); case '-[SKPaymentQueue startObservingTransactionQueue]': queueIsActive = true; case '-[SKPaymentQueue stopObservingTransactionQueue]': @@ -224,14 +139,6 @@ class FakeStoreKitPlatform implements TestInAppPurchaseApi { return Future.sync(() {}); } - /// Returns the arguments of [call] as typed string-keyed Map. - /// - /// This does not do any type validation, so is only safe to call if the - /// arguments are known to be a map. - Map _getArgumentDictionary(MethodCall call) { - return (call.arguments as Map).cast(); - } - @override bool canMakePayments() { return true; @@ -288,4 +195,55 @@ class FakeStoreKitPlatform implements TestInAppPurchaseApi { List transactions() { throw UnimplementedError(); } + + @override + void finishTransaction(Map finishMap) { + finishedTransactions.add(createPurchasedTransaction( + finishMap['productIdentifier']!, finishMap['transactionIdentifier']!, + quantity: transactionList.first.payment.quantity)); + } + + @override + void presentCodeRedemptionSheet() {} + + @override + void restoreTransactions(String? applicationUserName) { + if (restoreException != null) { + throw restoreException!; + } + if (testRestoredError != null) { + InAppPurchaseStoreKitPlatform.observer + .restoreCompletedTransactionsFailed(error: testRestoredError!); + return; + } + if (!testRestoredTransactionsNull) { + InAppPurchaseStoreKitPlatform.observer + .updatedTransactions(transactions: transactionList); + } + InAppPurchaseStoreKitPlatform.observer + .paymentQueueRestoreCompletedTransactionsFinished(); + } + + @override + Future startProductRequest( + List productIdentifiers) { + if (queryProductException != null) { + throw queryProductException!; + } + final List productIDS = productIdentifiers; + final List invalidFound = []; + final List products = []; + for (final String? productID in productIDS) { + if (!validProductIDs.contains(productID)) { + invalidFound.add(productID!); + } else { + products.add(validProducts[productID]!); + } + } + final SkProductResponseWrapper response = SkProductResponseWrapper( + products: products, invalidProductIdentifiers: invalidFound); + + return Future.value( + SkProductResponseWrapper.convertToPigeon(response)); + } } diff --git a/packages/in_app_purchase/in_app_purchase_storekit/test/store_kit_wrappers/pigeon_converter_test.dart b/packages/in_app_purchase/in_app_purchase_storekit/test/store_kit_wrappers/pigeon_converter_test.dart new file mode 100644 index 000000000000..36881eb07986 --- /dev/null +++ b/packages/in_app_purchase/in_app_purchase_storekit/test/store_kit_wrappers/pigeon_converter_test.dart @@ -0,0 +1,98 @@ +// 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_test/flutter_test.dart'; +import 'package:in_app_purchase_storekit/src/messages.g.dart'; +import 'package:in_app_purchase_storekit/store_kit_wrappers.dart'; + +void main() { + final SKPriceLocaleWrapper locale = SKPriceLocaleWrapper( + currencySymbol: r'$', currencyCode: 'USD', countryCode: 'USA'); + + final SKProductSubscriptionPeriodWrapper subPeriod = + SKProductSubscriptionPeriodWrapper( + numberOfUnits: 1, unit: SKSubscriptionPeriodUnit.month); + + final SKProductDiscountWrapper discount = SKProductDiscountWrapper( + price: '0.99', + priceLocale: locale, + numberOfPeriods: 1, + paymentMode: SKProductDiscountPaymentMode.payUpFront, + subscriptionPeriod: subPeriod, + identifier: 'discount', + type: SKProductDiscountType.subscription); + + final SKProductWrapper product = SKProductWrapper( + productIdentifier: 'fake_product', + localizedTitle: 'title', + localizedDescription: 'description', + priceLocale: locale, + price: '3.99', + subscriptionGroupIdentifier: 'sub_group', + discounts: [discount]); + + final SkProductResponseWrapper productResponse = SkProductResponseWrapper( + products: [product], + invalidProductIdentifiers: const ['invalid_identifier']); + + test('test SKPriceLocale pigeon converters', () { + final SKPriceLocaleMessage msg = + SKPriceLocaleWrapper.convertToPigeon(locale); + expect(msg.currencySymbol, r'$'); + expect(msg.currencyCode, 'USD'); + expect(msg.countryCode, 'USA'); + + final SKPriceLocaleWrapper convertedWrapper = + SKPriceLocaleWrapper.convertFromPigeon(msg); + expect(convertedWrapper, locale); + }); + + test('test SKProductSubscription pigeon converters', () { + final SKProductSubscriptionPeriodMessage msg = + SKProductSubscriptionPeriodWrapper.convertToPigeon(subPeriod); + expect(msg.unit, SKSubscriptionPeriodUnitMessage.month); + expect(msg.numberOfUnits, 1); + final SKProductSubscriptionPeriodWrapper convertedWrapper = + SKProductSubscriptionPeriodWrapper.convertFromPigeon(msg); + expect(convertedWrapper, subPeriod); + }); + + test('test SKProductDiscount pigeon converters', () { + final SKProductDiscountMessage msg = + SKProductDiscountWrapper.convertToPigeon(discount); + expect(msg.price, '0.99'); + expect(msg.numberOfPeriods, 1); + expect(msg.paymentMode, SKProductDiscountPaymentModeMessage.payUpFront); + expect(msg.identifier, 'discount'); + expect(msg.type, SKProductDiscountTypeMessage.subscription); + + final SKProductDiscountWrapper convertedWrapper = + SKProductDiscountWrapper.convertFromPigeon(msg); + expect(convertedWrapper, discount); + }); + + test('test SKProduct pigeon converters', () { + final SKProductMessage msg = SKProductWrapper.convertToPigeon(product); + expect(msg.productIdentifier, 'fake_product'); + expect(msg.localizedTitle, 'title'); + expect(msg.localizedDescription, 'description'); + expect(msg.price, '3.99'); + expect(msg.discounts?.length, 1); + + final SKProductWrapper convertedWrapper = + SKProductWrapper.convertFromPigeon(msg); + expect(convertedWrapper, product); + }); + + test('test SKProductResponse pigeon converters', () { + final SKProductsResponseMessage msg = + SkProductResponseWrapper.convertToPigeon(productResponse); + expect(msg.products?.length, 1); + expect(msg.invalidProductIdentifiers, ['invalid_identifier']); + + final SkProductResponseWrapper convertedWrapper = + SkProductResponseWrapper.convertFromPigeon(msg); + expect(convertedWrapper, productResponse); + }); +} diff --git a/packages/in_app_purchase/in_app_purchase_storekit/test/store_kit_wrappers/sk_methodchannel_apis_test.dart b/packages/in_app_purchase/in_app_purchase_storekit/test/store_kit_wrappers/sk_methodchannel_apis_test.dart index 44228ebb523b..704be83c8e25 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/test/store_kit_wrappers/sk_methodchannel_apis_test.dart +++ b/packages/in_app_purchase/in_app_purchase_storekit/test/store_kit_wrappers/sk_methodchannel_apis_test.dart @@ -228,13 +228,6 @@ class FakeStoreKitPlatform implements TestInAppPurchaseApi { Future onMethodCall(MethodCall call) { switch (call.method) { // request makers - case '-[InAppPurchasePlugin startProductRequest:result:]': - startProductRequestParam = call.arguments as List; - if (getProductRequestFailTest) { - return Future.value(); - } - return Future>.value( - buildProductResponseMap(dummyProductResponseWrapper)); case '-[InAppPurchasePlugin refreshReceipt:result:]': refreshReceipt++; refreshReceiptParam = Map.castFrom( @@ -246,16 +239,6 @@ class FakeStoreKitPlatform implements TestInAppPurchaseApi { throw Exception('some arbitrary error'); } return Future.value('receipt data'); - case '-[InAppPurchasePlugin finishTransaction:result:]': - transactionsFinished.add( - Map.from(call.arguments as Map)); - return Future.sync(() {}); - case '-[InAppPurchasePlugin restoreTransactions:result:]': - applicationNameHasTransactionRestored = call.arguments as String; - return Future.sync(() {}); - case '-[InAppPurchasePlugin presentCodeRedemptionSheet:result:]': - presentCodeRedemption = true; - return Future.sync(() {}); case '-[SKPaymentQueue startObservingTransactionQueue]': queueIsActive = true; return Future.sync(() {}); @@ -295,6 +278,32 @@ class FakeStoreKitPlatform implements TestInAppPurchaseApi { @override List transactions() => [dummyTransactionMessage]; + + @override + void finishTransaction(Map finishMap) { + transactionsFinished.add(Map.from(finishMap)); + } + + @override + void presentCodeRedemptionSheet() { + presentCodeRedemption = true; + } + + @override + void restoreTransactions(String? applicationUserName) { + applicationNameHasTransactionRestored = applicationUserName!; + } + + @override + Future startProductRequest( + List productIdentifiers) { + startProductRequestParam = productIdentifiers; + if (getProductRequestFailTest) { + return Future.value( + SKProductsResponseMessage()); + } + return Future.value(dummyProductResponseMessage); + } } class TestPaymentQueueDelegate extends SKPaymentQueueDelegateWrapper {} diff --git a/packages/in_app_purchase/in_app_purchase_storekit/test/store_kit_wrappers/sk_test_stub_objects.dart b/packages/in_app_purchase/in_app_purchase_storekit/test/store_kit_wrappers/sk_test_stub_objects.dart index ad32a0a5c14a..59022aa2fd24 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/test/store_kit_wrappers/sk_test_stub_objects.dart +++ b/packages/in_app_purchase/in_app_purchase_storekit/test/store_kit_wrappers/sk_test_stub_objects.dart @@ -62,6 +62,12 @@ final SKPriceLocaleWrapper dollarLocale = SKPriceLocaleWrapper( countryCode: 'US', ); +final SKPriceLocaleMessage dollarLocaleMessage = SKPriceLocaleMessage( + currencySymbol: r'$', + currencyCode: 'USD', + countryCode: 'US', +); + final SKPriceLocaleWrapper noSymbolLocale = SKPriceLocaleWrapper( currencySymbol: '', currencyCode: 'EUR', @@ -74,6 +80,12 @@ final SKProductSubscriptionPeriodWrapper dummySubscription = unit: SKSubscriptionPeriodUnit.month, ); +final SKProductSubscriptionPeriodMessage dummySubscriptionMessage = + SKProductSubscriptionPeriodMessage( + numberOfUnits: 1, + unit: SKSubscriptionPeriodUnitMessage.month, +); + final SKProductDiscountWrapper dummyDiscount = SKProductDiscountWrapper( price: '1.0', priceLocale: dollarLocale, @@ -84,6 +96,16 @@ final SKProductDiscountWrapper dummyDiscount = SKProductDiscountWrapper( type: SKProductDiscountType.subscription, ); +final SKProductDiscountMessage dummyDiscountMessage = SKProductDiscountMessage( + price: '1.0', + priceLocale: dollarLocaleMessage, + numberOfPeriods: 1, + paymentMode: SKProductDiscountPaymentModeMessage.payUpFront, + subscriptionPeriod: dummySubscriptionMessage, + identifier: 'id', + type: SKProductDiscountTypeMessage.subscription, +); + final SKProductDiscountWrapper dummyDiscountMissingIdentifierAndType = SKProductDiscountWrapper( price: '1.0', @@ -107,12 +129,30 @@ final SKProductWrapper dummyProductWrapper = SKProductWrapper( discounts: [dummyDiscount], ); +final SKProductMessage dummyProductMessage = SKProductMessage( + productIdentifier: 'id', + localizedTitle: 'title', + localizedDescription: 'description', + priceLocale: dollarLocaleMessage, + subscriptionGroupIdentifier: 'com.group', + price: '1.0', + subscriptionPeriod: dummySubscriptionMessage, + introductoryPrice: dummyDiscountMessage, + discounts: [dummyDiscountMessage], +); + final SkProductResponseWrapper dummyProductResponseWrapper = SkProductResponseWrapper( products: [dummyProductWrapper], invalidProductIdentifiers: const ['123'], ); +final SKProductsResponseMessage dummyProductResponseMessage = + SKProductsResponseMessage( + products: [dummyProductMessage], + invalidProductIdentifiers: const ['123'], +); + Map buildLocaleMap(SKPriceLocaleWrapper local) { return { 'currencySymbol': local.currencySymbol, diff --git a/packages/in_app_purchase/in_app_purchase_storekit/test/test_api.g.dart b/packages/in_app_purchase/in_app_purchase_storekit/test/test_api.g.dart index a640a188c43c..80debcebb79d 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/test/test_api.g.dart +++ b/packages/in_app_purchase/in_app_purchase_storekit/test/test_api.g.dart @@ -26,9 +26,24 @@ class _TestInAppPurchaseApiCodec extends StandardMessageCodec { } else if (value is SKPaymentTransactionMessage) { buffer.putUint8(131); writeValue(buffer, value.encode()); - } else if (value is SKStorefrontMessage) { + } else if (value is SKPriceLocaleMessage) { buffer.putUint8(132); writeValue(buffer, value.encode()); + } else if (value is SKProductDiscountMessage) { + buffer.putUint8(133); + writeValue(buffer, value.encode()); + } else if (value is SKProductMessage) { + buffer.putUint8(134); + writeValue(buffer, value.encode()); + } else if (value is SKProductSubscriptionPeriodMessage) { + buffer.putUint8(135); + writeValue(buffer, value.encode()); + } else if (value is SKProductsResponseMessage) { + buffer.putUint8(136); + writeValue(buffer, value.encode()); + } else if (value is SKStorefrontMessage) { + buffer.putUint8(137); + writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); } @@ -46,6 +61,16 @@ class _TestInAppPurchaseApiCodec extends StandardMessageCodec { case 131: return SKPaymentTransactionMessage.decode(readValue(buffer)!); case 132: + return SKPriceLocaleMessage.decode(readValue(buffer)!); + case 133: + return SKProductDiscountMessage.decode(readValue(buffer)!); + case 134: + return SKProductMessage.decode(readValue(buffer)!); + case 135: + return SKProductSubscriptionPeriodMessage.decode(readValue(buffer)!); + case 136: + return SKProductsResponseMessage.decode(readValue(buffer)!); + case 137: return SKStorefrontMessage.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -68,6 +93,15 @@ abstract class TestInAppPurchaseApi { void addPayment(Map paymentMap); + Future startProductRequest( + List productIdentifiers); + + void finishTransaction(Map finishMap); + + void restoreTransactions(String? applicationUserName); + + void presentCodeRedemptionSheet(); + static void setup(TestInAppPurchaseApi? api, {BinaryMessenger? binaryMessenger}) { { @@ -178,5 +212,124 @@ abstract class TestInAppPurchaseApi { }); } } + { + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.startProductRequest', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); + } else { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.startProductRequest was null.'); + final List args = (message as List?)!; + final List? arg_productIdentifiers = + (args[0] as List?)?.cast(); + assert(arg_productIdentifiers != null, + 'Argument for dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.startProductRequest was null, expected non-null List.'); + try { + final SKProductsResponseMessage output = + await api.startProductRequest(arg_productIdentifiers!); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.finishTransaction', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); + } else { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.finishTransaction was null.'); + final List args = (message as List?)!; + final Map? arg_finishMap = + (args[0] as Map?)?.cast(); + assert(arg_finishMap != null, + 'Argument for dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.finishTransaction was null, expected non-null Map.'); + try { + api.finishTransaction(arg_finishMap!); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.restoreTransactions', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); + } else { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.restoreTransactions was null.'); + final List args = (message as List?)!; + final String? arg_applicationUserName = (args[0] as String?); + try { + api.restoreTransactions(arg_applicationUserName); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.presentCodeRedemptionSheet', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); + } else { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { + try { + api.presentCodeRedemptionSheet(); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } } } From 8d1a5c9062e91f0616dd3c81a746d918fea52116 Mon Sep 17 00:00:00 2001 From: GavrielRosendorn74 <97943118+GavrielRosendorn74@users.noreply.github.com> Date: Tue, 13 Feb 2024 19:28:01 +0100 Subject: [PATCH 08/40] [google_maps_flutter][iOS 17] takeSnapshot FIX (#5823) I have fixed the function takeSnapShot for IOS17. Here you got some screenshots of before now : Before : ![289014755-4e6787c3-c7c0-454a-9c3f-89730a846302](https://github.com/flutter/packages/assets/97943118/e812f71e-3d31-49d5-975f-74bc28aaaad1) Now : ![289014438-4bc5a965-08e0-4520-984d-e5c054c1f370](https://github.com/flutter/packages/assets/97943118/16e71558-2d18-4eda-91d8-f639365b88e3) This issue was fixed by this PR :[ #139733 ](https://github.com/flutter/flutter/issues/139733) --- .../google_maps_flutter_ios/CHANGELOG.md | 4 ++++ .../example/ios12/integration_test/google_maps_test.dart | 4 +--- .../ios/Classes/GoogleMapController.m | 9 ++++----- .../google_maps_flutter_ios/pubspec.yaml | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md index fc4289fad7c0..4eae3cfc1f0f 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.4.2 + +* Fixes a bug in "takeSnapshot" function that incorrectly returns a blank image on iOS 17. + ## 2.4.1 * Restores the workaround to exclude arm64 simulator builds, as it is still necessary for applications targeting iOS 12. diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios12/integration_test/google_maps_test.dart b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios12/integration_test/google_maps_test.dart index 9902456444d6..ba8ba957edfb 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios12/integration_test/google_maps_test.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios12/integration_test/google_maps_test.dart @@ -849,9 +849,7 @@ void main() { await controllerCompleter.future; final Uint8List? bytes = await controller.takeSnapshot(); expect(bytes?.isNotEmpty, true); - }, - // TODO(stuartmorgan): Re-enable; see https://github.com/flutter/flutter/issues/139825 - skip: true); + }); testWidgets( 'set tileOverlay correctly', diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/GoogleMapController.m b/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/GoogleMapController.m index 8619d8908fba..06e7838d9f4d 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/GoogleMapController.m +++ b/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/GoogleMapController.m @@ -250,13 +250,12 @@ - (void)onMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result { result(nil); } else if ([call.method isEqualToString:@"map#takeSnapshot"]) { if (self.mapView != nil) { - UIGraphicsImageRendererFormat *format = [UIGraphicsImageRendererFormat defaultFormat]; - format.scale = [[UIScreen mainScreen] scale]; UIGraphicsImageRenderer *renderer = - [[UIGraphicsImageRenderer alloc] initWithSize:self.mapView.frame.size format:format]; - + [[UIGraphicsImageRenderer alloc] initWithSize:self.mapView.bounds.size]; + // For some unknown reason mapView.layer::renderInContext API returns a blank image on iOS 17. + // So we have to use drawViewHierarchyInRect API. UIImage *image = [renderer imageWithActions:^(UIGraphicsImageRendererContext *context) { - [self.mapView.layer renderInContext:context.CGContext]; + [self.mapView drawViewHierarchyInRect:self.mapView.bounds afterScreenUpdates:YES]; }]; result([FlutterStandardTypedData typedDataWithBytes:UIImagePNGRepresentation(image)]); } else { diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml index d540d40e26ff..502db892ac53 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml @@ -2,7 +2,7 @@ name: google_maps_flutter_ios description: iOS implementation of the google_maps_flutter plugin. repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_ios issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 -version: 2.4.1 +version: 2.4.2 environment: sdk: ^3.2.3 From 49e3f1cc021b1e0c832c432e0fbbeaa3f137f538 Mon Sep 17 00:00:00 2001 From: leiatfly <16229121+leiatfly@users.noreply.github.com> Date: Tue, 13 Feb 2024 11:09:21 -0800 Subject: [PATCH 09/40] [flutter_markdown] Use Text.rich to replace RichText in Flutter Markdown (#6062) With this PR, a client can use SelectionArea to handle selected text in Markdown. When setting `selectable` to false, the Markdown widget renders Text, which can be wrapped in SelectionArea for client-defined behavior (i.e., the Markdown widget no longer consumes the selection event). When setting `selectable` to true, the Markdown widget handles the selection behavior, as before this change. This fixes issue #107073 and is related to issue #113530. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [relevant style guides] and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use `dart format`.) - [x] I signed the [CLA]. - [x] The title of the PR starts with the name of the package surrounded by square brackets, e.g. `[shared_preferences]` - [x] I [linked to at least one issue that this PR fixes] in the description above. - [x] I updated `pubspec.yaml` with an appropriate new version according to the [pub versioning philosophy], or this PR is [exempt from version changes]. - [x] I updated `CHANGELOG.md` to add a description of the change, [following repository CHANGELOG style]. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. [Contributor Guide]: https://github.com/flutter/packages/blob/main/CONTRIBUTING.md [Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene [relevant style guides]: https://github.com/flutter/packages/blob/main/CONTRIBUTING.md#style [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/wiki/Chat [linked to at least one issue that this PR fixes]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview [pub versioning philosophy]: https://dart.dev/tools/pub/versioning [exempt from version changes]: https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#version-and-changelog-updates [following repository CHANGELOG style]: https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changelog-style [test-exempt]: https://github.com/flutter/flutter/wiki/Tree-hygiene#tests --------- Co-authored-by: leiatcornell <16229121+leiatcornell@users.noreply.github.com> --- packages/flutter_markdown/CHANGELOG.md | 4 + .../flutter_markdown/lib/src/builder.dart | 24 +- packages/flutter_markdown/pubspec.yaml | 2 +- packages/flutter_markdown/test/all.dart | 2 + .../test/blockquote_test.dart | 4 +- .../test/custom_syntax_test.dart | 42 +- .../flutter_markdown/test/emphasis_test.dart | 1340 ++++++++--------- .../flutter_markdown/test/footnote_test.dart | 18 +- .../flutter_markdown/test/header_test.dart | 1 + .../test/horizontal_rule_test.dart | 2 + .../flutter_markdown/test/image_test.dart | 37 +- .../test/line_break_test.dart | 44 +- packages/flutter_markdown/test/link_test.dart | 229 ++- .../test/markdown_body_shrink_wrap_test.dart | 5 +- .../selection_area_compatibility_test.dart | 76 + .../test/style_sheet_test.dart | 5 +- .../flutter_markdown/test/table_test.dart | 82 +- .../test/text_alignment_test.dart | 2 + packages/flutter_markdown/test/text_test.dart | 11 +- packages/flutter_markdown/test/utils.dart | 30 +- 20 files changed, 963 insertions(+), 997 deletions(-) create mode 100644 packages/flutter_markdown/test/selection_area_compatibility_test.dart diff --git a/packages/flutter_markdown/CHANGELOG.md b/packages/flutter_markdown/CHANGELOG.md index 5cb6371421fd..d6b2a3c32318 100644 --- a/packages/flutter_markdown/CHANGELOG.md +++ b/packages/flutter_markdown/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.6.19 + +* Replaces `RichText` with `Text.rich` so the widget can work with `SelectionArea` when `selectable` is set to false. + ## 0.6.18+3 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. diff --git a/packages/flutter_markdown/lib/src/builder.dart b/packages/flutter_markdown/lib/src/builder.dart index e89a6620c060..0c4a6d875e8a 100644 --- a/packages/flutter_markdown/lib/src/builder.dart +++ b/packages/flutter_markdown/lib/src/builder.dart @@ -56,13 +56,13 @@ class _TableElement { /// A collection of widgets that should be placed adjacent to (inline with) /// other inline elements in the same parent block. /// -/// Inline elements can be textual (a/em/strong) represented by [RichText] +/// Inline elements can be textual (a/em/strong) represented by [Text.rich] /// widgets or images (img) represented by [Image.network] widgets. /// /// Inline elements can be nested within other inline elements, inheriting their /// parent's style along with the style of the block they are in. /// -/// When laying out inline widgets, first, any adjacent RichText widgets are +/// When laying out inline widgets, first, any adjacent Text.rich widgets are /// merged, then, all inline widgets are enclosed in a parent [Wrap] widget. class _InlineElement { _InlineElement(this.tag, {this.style}); @@ -517,8 +517,8 @@ class MarkdownBuilder implements md.NodeVisitor { } else if (tag == 'sup') { final Widget c = current.children.last; TextSpan? textSpan; - if (c is RichText && c.text is TextSpan) { - textSpan = c.text as TextSpan; + if (c is Text && c.textSpan is TextSpan) { + textSpan = c.textSpan! as TextSpan; } else if (c is SelectableText && c.textSpan is TextSpan) { textSpan = c.textSpan; } @@ -717,11 +717,9 @@ class MarkdownBuilder implements md.NodeVisitor { ) { final List mergedTexts = []; for (final Widget child in children) { - if (mergedTexts.isNotEmpty && - mergedTexts.last is RichText && - child is RichText) { - final RichText previous = mergedTexts.removeLast() as RichText; - final TextSpan previousTextSpan = previous.text as TextSpan; + if (mergedTexts.isNotEmpty && mergedTexts.last is Text && child is Text) { + final Text previous = mergedTexts.removeLast() as Text; + final TextSpan previousTextSpan = previous.textSpan! as TextSpan; final List children = previousTextSpan.children != null ? previousTextSpan.children! .map((InlineSpan span) => span is! TextSpan @@ -729,7 +727,7 @@ class MarkdownBuilder implements md.NodeVisitor { : span) .toList() : [previousTextSpan]; - children.add(child.text as TextSpan); + children.add(child.textSpan! as TextSpan); final TextSpan? mergedSpan = _mergeSimilarTextSpans(children); mergedTexts.add(_buildRichText( mergedSpan, @@ -876,10 +874,10 @@ class MarkdownBuilder implements md.NodeVisitor { key: k, ); } else { - return RichText( - text: text!, + return Text.rich( + text!, // ignore: deprecated_member_use - textScaleFactor: styleSheet.textScaleFactor!, + textScaleFactor: styleSheet.textScaleFactor, textAlign: textAlign ?? TextAlign.start, key: k, ); diff --git a/packages/flutter_markdown/pubspec.yaml b/packages/flutter_markdown/pubspec.yaml index eb25a03ebd01..e909e60da2d2 100644 --- a/packages/flutter_markdown/pubspec.yaml +++ b/packages/flutter_markdown/pubspec.yaml @@ -4,7 +4,7 @@ description: A Markdown renderer for Flutter. Create rich text output, formatted with simple Markdown tags. repository: https://github.com/flutter/packages/tree/main/packages/flutter_markdown issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+flutter_markdown%22 -version: 0.6.18+3 +version: 0.6.19 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/flutter_markdown/test/all.dart b/packages/flutter_markdown/test/all.dart index 1258cca75562..44387e0afe9c 100644 --- a/packages/flutter_markdown/test/all.dart +++ b/packages/flutter_markdown/test/all.dart @@ -14,6 +14,7 @@ import 'line_break_test.dart' as line_break_test; import 'link_test.dart' as link_test; import 'list_test.dart' as list_test; import 'scrollable_test.dart' as scrollable_test; +import 'selection_area_compatibility_test.dart' as selection_area_test; import 'style_sheet_test.dart' as style_sheet_test; import 'table_test.dart' as table_test; import 'text_alignment_test.dart' as text_alignment_test; @@ -34,6 +35,7 @@ void main() { link_test.defineTests(); list_test.defineTests(); scrollable_test.defineTests(); + selection_area_test.defineTests(); style_sheet_test.defineTests(); table_test.defineTests(); text_test.defineTests(); diff --git a/packages/flutter_markdown/test/blockquote_test.dart b/packages/flutter_markdown/test/blockquote_test.dart index 210554947ffe..2d1fa3e30a4c 100644 --- a/packages/flutter_markdown/test/blockquote_test.dart +++ b/packages/flutter_markdown/test/blockquote_test.dart @@ -50,9 +50,9 @@ void defineTests() { final DecoratedBox blockQuoteContainer = tester.widget( find.byType(DecoratedBox), ); - final RichText qouteText = tester.widget(find.byType(RichText)); + final Text qouteText = tester.widget(find.byType(Text)); final List styledTextParts = - (qouteText.text as TextSpan).children!.cast(); + (qouteText.textSpan! as TextSpan).children!.cast(); expectTextStrings( widgets, diff --git a/packages/flutter_markdown/test/custom_syntax_test.dart b/packages/flutter_markdown/test/custom_syntax_test.dart index fd81ba7e1fc5..1db01e3c0f9e 100644 --- a/packages/flutter_markdown/test/custom_syntax_test.dart +++ b/packages/flutter_markdown/test/custom_syntax_test.dart @@ -51,9 +51,9 @@ void defineTests() { ), ); - final RichText textWidget = tester.widget(find.byType(RichText)); + final Text textWidget = tester.widget(find.byType(Text)); final TextSpan span = - (textWidget.text as TextSpan).children![1] as TextSpan; + (textWidget.textSpan! as TextSpan).children![1] as TextSpan; expect(span.children, null); expect(span.recognizer.runtimeType, equals(TapGestureRecognizer)); @@ -61,7 +61,7 @@ void defineTests() { ); testWidgets( - 'WidgetSpan in RichText is handled correctly', + 'WidgetSpan in Text.rich is handled correctly', (WidgetTester tester) async { await tester.pumpWidget( boilerplate( @@ -76,9 +76,9 @@ void defineTests() { ), ); - final RichText textWidget = tester.widget(find.byType(RichText)); + final Text textWidget = tester.widget(find.byType(Text)); final TextSpan span = - (textWidget.text as TextSpan).children![0] as TextSpan; + (textWidget.textSpan! as TextSpan).children![0] as TextSpan; final WidgetSpan widgetSpan = span.children![0] as WidgetSpan; expect(widgetSpan.child, isInstanceOf()); }, @@ -100,8 +100,8 @@ void defineTests() { ), ); - final RichText textWidget = tester.widget(find.byType(RichText)); - final TextSpan rootSpan = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan rootSpan = textWidget.textSpan! as TextSpan; final TextSpan firstSpan = rootSpan.children![0] as TextSpan; final TextSpan secondSpan = rootSpan.children![1] as TextSpan; final TextSpan thirdSpan = rootSpan.children![2] as TextSpan; @@ -114,7 +114,7 @@ void defineTests() { }); testWidgets( - 'TextSpan and WidgetSpan as children in RichText are handled correctly', + 'TextSpan and WidgetSpan as children in Text.rich are handled correctly', (WidgetTester tester) async { await tester.pumpWidget( boilerplate( @@ -129,8 +129,8 @@ void defineTests() { ), ); - final RichText textWidget = tester.widget(find.byType(RichText)); - final TextSpan textSpan = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan textSpan = textWidget.textSpan! as TextSpan; final TextSpan start = textSpan.children![0] as TextSpan; expect(start.text, 'this test replaces a string with a '); final TextSpan end = textSpan.children![1] as TextSpan; @@ -201,7 +201,7 @@ class SubscriptBuilder extends MarkdownElementBuilder { for (int i = 0; i < textContent.length; i++) { text += _subscripts[int.parse(textContent[i])]; } - return RichText(text: TextSpan(text: text)); + return Text.rich(TextSpan(text: text)); } } @@ -225,11 +225,9 @@ class WikilinkSyntax extends md.InlineSyntax { class WikilinkBuilder extends MarkdownElementBuilder { @override Widget visitElementAfter(md.Element element, _) { - return RichText( - text: TextSpan( - text: element.textContent, - recognizer: TapGestureRecognizer()..onTap = () {}), - ); + return Text.rich(TextSpan( + text: element.textContent, + recognizer: TapGestureRecognizer()..onTap = () {})); } } @@ -250,8 +248,8 @@ class ContainerSyntax extends md.InlineSyntax { class ContainerBuilder extends MarkdownElementBuilder { @override Widget? visitElementAfter(md.Element element, _) { - return RichText( - text: TextSpan( + return Text.rich( + TextSpan( children: [ WidgetSpan( child: Container(), @@ -265,8 +263,8 @@ class ContainerBuilder extends MarkdownElementBuilder { class ContainerBuilder2 extends MarkdownElementBuilder { @override Widget? visitElementAfter(md.Element element, _) { - return RichText( - text: TextSpan( + return Text.rich( + TextSpan( children: [ const TextSpan(text: 'foo'), WidgetSpan( @@ -320,8 +318,8 @@ class InlineTextColorElementBuilder extends MarkdownElementBuilder { }; final Color? contentColor = contentColors[color]; - return RichText( - text: TextSpan( + return Text.rich( + TextSpan( text: innerText, style: parentStyle?.copyWith(color: contentColor), ), diff --git a/packages/flutter_markdown/test/emphasis_test.dart b/packages/flutter_markdown/test/emphasis_test.dart index c0891c22b6ca..14de5c8cd2ee 100644 --- a/packages/flutter_markdown/test/emphasis_test.dart +++ b/packages/flutter_markdown/test/emphasis_test.dart @@ -34,16 +34,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = + textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo bar'); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, FontStyle.italic, FontWeight.normal, ); @@ -61,17 +61,17 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = + textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -89,17 +89,17 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = + textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -121,17 +121,17 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - expect(richText, isNotNull); - final String text = richText.text.toPlainText(); + final Text textWidget = + textFinder.evaluate().first.widget as Text; + expect(textWidget, isNotNull); + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foobar'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -164,17 +164,17 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - expect(richText, isNotNull); - final String text = richText.text.toPlainText(); + final Text textWidget = + textFinder.evaluate().first.widget as Text; + expect(textWidget, isNotNull); + final String text = textWidget.textSpan!.toPlainText(); expect(text, '5678'); // There should be three spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 3, isTrue); @@ -218,16 +218,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo bar'); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, FontStyle.italic, FontWeight.normal, ); @@ -245,17 +244,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -273,17 +271,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -301,17 +298,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -329,17 +325,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -357,17 +352,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -385,17 +379,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -413,16 +406,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo-(bar)'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -457,17 +449,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -485,17 +476,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -513,16 +503,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, '*foo bar *'); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -540,17 +529,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -568,16 +556,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, '(foo)'); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, FontStyle.italic, FontWeight.normal, ); @@ -595,16 +582,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foobar'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -639,17 +625,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -667,17 +652,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -695,16 +679,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, '(foo)'); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, FontStyle.italic, FontWeight.normal, ); @@ -722,17 +705,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -750,17 +732,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -778,16 +759,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo_bar_baz'); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, FontStyle.italic, FontWeight.normal, ); @@ -805,16 +785,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, '(bar).'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -849,16 +828,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo bar'); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.bold, ); @@ -876,17 +854,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -904,17 +881,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -932,16 +908,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foobar'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -976,16 +951,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo bar'); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.bold, ); @@ -1003,17 +977,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -1031,16 +1004,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, '__ foo bar__'); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -1058,17 +1030,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -1086,17 +1057,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -1114,17 +1084,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -1142,17 +1111,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -1170,17 +1138,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo, bar, baz'); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.bold, ); @@ -1198,17 +1165,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo-(bar)'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -1243,17 +1209,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -1271,17 +1236,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -1299,17 +1263,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, '(foo)'); // There should be three spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 3, isTrue); @@ -1351,18 +1314,17 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'Gomphocarpus (Gomphocarpus physocarpus, syn. Asclepias physocarpa)'); // There should be five spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 5, isTrue); @@ -1419,17 +1381,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo "bar" foo'); // There should be three spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 3, isTrue); @@ -1470,17 +1431,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foobar'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -1515,17 +1475,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -1543,17 +1502,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -1571,16 +1529,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, '(foo)'); // There should be three spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 3, isTrue); @@ -1621,17 +1578,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -1649,17 +1605,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -1677,16 +1632,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo__bar__baz'); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.bold, ); @@ -1704,16 +1658,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, '(bar).'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -1748,16 +1701,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo bar'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -1793,16 +1745,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo bar'); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, FontStyle.italic, FontWeight.normal, ); @@ -1820,16 +1771,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo bar baz'); // There should be three spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 3, isTrue); @@ -1870,16 +1820,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo bar baz'); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, FontStyle.italic, FontWeight.normal, ); @@ -1897,16 +1846,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo bar'); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, FontStyle.italic, FontWeight.normal, ); @@ -1924,16 +1872,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo bar'); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, FontStyle.italic, FontWeight.normal, ); @@ -1951,16 +1898,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo bar baz'); // There should be three spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 3, isTrue); @@ -2001,16 +1947,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foobarbaz'); // There should be three spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 3, isTrue); @@ -2051,16 +1996,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo**bar'); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, FontStyle.italic, FontWeight.normal, ); @@ -2078,16 +2022,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo bar'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -2120,16 +2063,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo bar'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -2162,16 +2104,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foobar'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -2204,16 +2145,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foobarbaz'); // There should be three spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 3, isTrue); @@ -2254,16 +2194,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foobar***baz'); // There should be three spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 3, isTrue); @@ -2304,16 +2243,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo bar baz bim bop'); // There should be five spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length, 3); @@ -2354,16 +2292,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo bar'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -2399,17 +2336,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -2427,17 +2363,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -2457,16 +2392,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo bar'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -2502,16 +2436,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo bar'); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.bold, ); @@ -2529,16 +2462,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo bar baz'); // There should be three spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 3, isTrue); @@ -2579,16 +2511,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo bar baz'); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.bold, ); @@ -2606,16 +2537,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo bar'); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.bold, ); @@ -2633,16 +2563,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo bar'); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.bold, ); @@ -2660,16 +2589,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo bar baz'); // There should be three spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 3, isTrue); @@ -2710,16 +2638,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foobarbaz'); // There should be three spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 3, isTrue); @@ -2760,16 +2687,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo bar'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -2802,16 +2728,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo bar'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -2844,16 +2769,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo bar baz bim bop'); // There should be five spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length, 3); @@ -2894,16 +2818,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo bar'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -2939,17 +2862,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -2967,17 +2889,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -2997,17 +2918,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -3025,17 +2945,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo *'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -3068,17 +2987,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo _'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -3111,17 +3029,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -3139,17 +3056,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo *'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -3182,17 +3098,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo _'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -3225,17 +3140,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, '*foo'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -3268,17 +3182,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo*'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -3311,17 +3224,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, '*foo'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -3354,17 +3266,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, '***foo'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -3397,17 +3308,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo*'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -3440,17 +3350,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo***'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -3485,17 +3394,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -3513,17 +3421,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo _'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -3556,17 +3463,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo *'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -3599,17 +3505,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, data); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.normal, ); @@ -3627,17 +3532,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo _'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -3670,17 +3574,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo *'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -3713,17 +3616,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, '_foo'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -3756,17 +3658,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo_'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -3799,17 +3700,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, '_foo'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -3842,17 +3742,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, '___foo'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -3885,17 +3784,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo_'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -3928,17 +3826,16 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); // Expect text to be unchanged from original data string. - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo___'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -3973,16 +3870,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo'); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.bold, ); @@ -4000,16 +3896,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo'); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, FontStyle.italic, FontWeight.normal, ); @@ -4027,16 +3922,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo'); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.bold, ); @@ -4054,16 +3948,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo'); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, FontStyle.italic, FontWeight.normal, ); @@ -4081,16 +3974,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo'); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.bold, ); @@ -4108,16 +4000,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo'); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.bold, ); @@ -4135,16 +4026,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo'); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, null, FontWeight.bold, ); @@ -4166,16 +4056,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo'); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, FontStyle.italic, FontWeight.bold, ); @@ -4193,16 +4082,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo'); expectTextSpanStyle( - richText.text as TextSpan, + textWidget.textSpan! as TextSpan, FontStyle.italic, FontWeight.bold, ); @@ -4222,16 +4110,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo _bar baz_'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -4264,16 +4151,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo bar *baz bim bam'); // There should be three spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 3, isTrue); @@ -4316,16 +4202,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, '**foo bar baz'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); @@ -4358,16 +4243,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, '*foo bar baz'); // There should be two spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 2, isTrue); diff --git a/packages/flutter_markdown/test/footnote_test.dart b/packages/flutter_markdown/test/footnote_test.dart index b02b3af05256..191c2cb62002 100644 --- a/packages/flutter_markdown/test/footnote_test.dart +++ b/packages/flutter_markdown/test/footnote_test.dart @@ -170,10 +170,10 @@ void defineTests() { ); final Iterable widgets = tester.allWidgets; - final RichText richText = widgets - .firstWhere((Widget widget) => widget is RichText) as RichText; + final Text text = + widgets.firstWhere((Widget widget) => widget is Text) as Text; - final TextSpan span = richText.text as TextSpan; + final TextSpan span = text.textSpan! as TextSpan; final List? children = span.children; expect(children, isNotNull); @@ -197,10 +197,10 @@ void defineTests() { ); final Iterable widgets = tester.allWidgets; - final RichText richText = widgets - .firstWhere((Widget widget) => widget is RichText) as RichText; + final Text text = + widgets.firstWhere((Widget widget) => widget is Text) as Text; - final TextSpan span = richText.text as TextSpan; + final TextSpan span = text.textSpan! as TextSpan; final List? children = span.children; expect(children![0].style, isNotNull); @@ -227,10 +227,10 @@ void defineTests() { ); final Iterable widgets = tester.allWidgets; - final RichText richText = widgets - .firstWhere((Widget widget) => widget is RichText) as RichText; + final Text text = + widgets.firstWhere((Widget widget) => widget is Text) as Text; - final TextSpan span = richText.text as TextSpan; + final TextSpan span = text.textSpan! as TextSpan; final List gestureRecognizerTypes = []; span.visitChildren((InlineSpan inlineSpan) { diff --git a/packages/flutter_markdown/test/header_test.dart b/packages/flutter_markdown/test/header_test.dart index 22b1f4bbb318..54e9741751be 100644 --- a/packages/flutter_markdown/test/header_test.dart +++ b/packages/flutter_markdown/test/header_test.dart @@ -25,6 +25,7 @@ void defineTests() { MarkdownBody, Column, Wrap, + Text, RichText, ]); expectTextStrings(widgets, ['Header']); diff --git a/packages/flutter_markdown/test/horizontal_rule_test.dart b/packages/flutter_markdown/test/horizontal_rule_test.dart index 380cb2f04bb0..48c80d780220 100644 --- a/packages/flutter_markdown/test/horizontal_rule_test.dart +++ b/packages/flutter_markdown/test/horizontal_rule_test.dart @@ -89,10 +89,12 @@ void defineTests() { Column, Column, Wrap, + Text, RichText, SizedBox, Column, Wrap, + Text, RichText, SizedBox, Container, diff --git a/packages/flutter_markdown/test/image_test.dart b/packages/flutter_markdown/test/image_test.dart index 65d9aba71dae..25b0788a42c1 100644 --- a/packages/flutter_markdown/test/image_test.dart +++ b/packages/flutter_markdown/test/image_test.dart @@ -33,14 +33,13 @@ void defineTests() { ), ); - final Iterable texts = - tester.widgetList(find.byType(RichText)); - final RichText firstTextWidget = texts.first; - final TextSpan firstTextSpan = firstTextWidget.text as TextSpan; + final Iterable texts = tester.widgetList(find.byType(Text)); + final Text firstTextWidget = texts.first; + final TextSpan firstTextSpan = firstTextWidget.textSpan! as TextSpan; final Image image = tester.widget(find.byType(Image)); final NetworkImage networkImage = image.image as NetworkImage; - final RichText secondTextWidget = texts.last; - final TextSpan secondTextSpan = secondTextWidget.text as TextSpan; + final Text secondTextWidget = texts.last; + final TextSpan secondTextSpan = secondTextWidget.textSpan! as TextSpan; expect(firstTextSpan.text, 'textbefore '); expect(firstTextSpan.style!.fontStyle, FontStyle.italic); @@ -203,8 +202,8 @@ void defineTests() { ), ); - final RichText richText = tester.widget(find.byType(RichText)); - final TextSpan textSpan = richText.text as TextSpan; + final Text text = tester.widget(find.byType(Text)); + final TextSpan textSpan = text.textSpan! as TextSpan; expect(textSpan.text, 'Hello '); expect(textSpan.style, isNotNull); }, @@ -262,14 +261,13 @@ void defineTests() { tester.widget(find.byType(GestureDetector)); detector.onTap!(); - final Iterable texts = - tester.widgetList(find.byType(RichText)); - final RichText firstTextWidget = texts.first; - final TextSpan firstSpan = firstTextWidget.text as TextSpan; + final Iterable texts = tester.widgetList(find.byType(Text)); + final Text firstTextWidget = texts.first; + final TextSpan firstSpan = firstTextWidget.textSpan! as TextSpan; (firstSpan.recognizer as TapGestureRecognizer?)!.onTap!(); - final RichText lastTextWidget = texts.last; - final TextSpan lastSpan = lastTextWidget.text as TextSpan; + final Text lastTextWidget = texts.last; + final TextSpan lastSpan = lastTextWidget.textSpan! as TextSpan; (lastSpan.recognizer as TapGestureRecognizer?)!.onTap!(); expect(firstSpan.children, null); @@ -307,18 +305,17 @@ void defineTests() { ), ); - final Iterable texts = - tester.widgetList(find.byType(RichText)); - final RichText firstTextWidget = texts.first; - final TextSpan firstSpan = firstTextWidget.text as TextSpan; + final Iterable texts = tester.widgetList(find.byType(Text)); + final Text firstTextWidget = texts.first; + final TextSpan firstSpan = firstTextWidget.textSpan! as TextSpan; (firstSpan.recognizer as TapGestureRecognizer?)!.onTap!(); final GestureDetector detector = tester.widget(find.byType(GestureDetector)); detector.onTap!(); - final RichText lastTextWidget = texts.last; - final TextSpan lastSpan = lastTextWidget.text as TextSpan; + final Text lastTextWidget = texts.last; + final TextSpan lastSpan = lastTextWidget.textSpan! as TextSpan; (lastSpan.recognizer as TapGestureRecognizer?)!.onTap!(); expect(firstSpan.children, null); diff --git a/packages/flutter_markdown/test/line_break_test.dart b/packages/flutter_markdown/test/line_break_test.dart index 68976a3b8659..e60b2b5760b1 100644 --- a/packages/flutter_markdown/test/line_break_test.dart +++ b/packages/flutter_markdown/test/line_break_test.dart @@ -128,16 +128,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo\nbar'); // There should be three spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 3, isTrue); @@ -166,16 +165,15 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'foo\nbar'); // There should be three spans of text. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.children!.length == 3, isTrue); @@ -204,15 +202,14 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, 'code span'); - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.style, isNotNull); expect(textSpan.style!.fontFamily == 'monospace', isTrue); @@ -230,15 +227,14 @@ void defineTests() { ), ); - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); - final RichText richText = - richTextFinder.evaluate().first.widget as RichText; - final String text = richText.text.toPlainText(); + final Text textWidget = textFinder.evaluate().first.widget as Text; + final String text = textWidget.textSpan!.toPlainText(); expect(text, r'code\ span'); - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = textWidget.textSpan! as TextSpan; expect(textSpan, isNotNull); expect(textSpan.style, isNotNull); expect(textSpan.style!.fontFamily == 'monospace', isTrue); diff --git a/packages/flutter_markdown/test/link_test.dart b/packages/flutter_markdown/test/link_test.dart index bbe4c15c6d48..6e4b67c3dcb5 100644 --- a/packages/flutter_markdown/test/link_test.dart +++ b/packages/flutter_markdown/test/link_test.dart @@ -29,8 +29,8 @@ void defineTests() { ), ); - final RichText textWidget = tester.widget(find.byType(RichText)); - final TextSpan span = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan span = textWidget.textSpan! as TextSpan; final List gestureRecognizerTypes = []; span.visitChildren((InlineSpan inlineSpan) { @@ -74,9 +74,8 @@ void defineTests() { ), ); - final RichText textWidget = - tester.widgetList(find.byType(RichText)).first as RichText; - final TextSpan span = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan span = textWidget.textSpan! as TextSpan; final List gestureRecognizerTypes = []; span.visitChildren((InlineSpan inlineSpan) { @@ -127,7 +126,7 @@ void defineTests() { await tester.pumpWidget(toBePumped); //Assert - final Finder widgetFinder = find.byType(RichText); + final Finder widgetFinder = find.byType(Text); final List elements = widgetFinder.evaluate().toList(); final List widgets = elements.map((Element e) => e.widget).toList(); @@ -162,7 +161,7 @@ void defineTests() { await tester.pumpWidget(toBePumped); //Assert - final Finder widgetFinder = find.byType(RichText, skipOffstage: false); + final Finder widgetFinder = find.byType(Text, skipOffstage: false); final List elements = widgetFinder.evaluate().toList(); final List widgets = elements.map((Element e) => e.widget).toList(); @@ -938,8 +937,8 @@ void defineTests() { ), ); - final RichText textWidget = tester.widget(find.byType(RichText)); - final TextSpan span = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan span = textWidget.textSpan! as TextSpan; expect(span.children!.length, 2); expect(span.children![0], isA()); expect(span.children![0].toPlainText(), '[link '); @@ -986,8 +985,8 @@ void defineTests() { ), ); - final RichText textWidget = tester.widget(find.byType(RichText)); - final TextSpan span = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan span = textWidget.textSpan! as TextSpan; expect(span.children!.length, 5); expectTextSpanStyle( span.children![0] as TextSpan, null, FontWeight.normal); @@ -1066,8 +1065,8 @@ void defineTests() { ), ); - final RichText textWidget = tester.widget(find.byType(RichText)); - final TextSpan span = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan span = textWidget.textSpan! as TextSpan; expect(span.children!.length, 3); expect(span.children![0], isA()); expect(span.children![0].toPlainText(), '[foo '); @@ -1096,8 +1095,8 @@ void defineTests() { ), ); - final RichText textWidget = tester.widget(find.byType(RichText)); - final TextSpan span = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan span = textWidget.textSpan! as TextSpan; expect(span.children!.length, 5); expect(span.children, everyElement(isA())); @@ -1175,8 +1174,8 @@ void defineTests() { ), ); - final RichText textWidget = tester.widget(find.byType(RichText)); - final TextSpan span = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan span = textWidget.textSpan! as TextSpan; expect(span.children!.length, 2); expect(span.children![0], isA()); expect(span.children![0].toPlainText(), '*'); @@ -1220,8 +1219,8 @@ void defineTests() { ), ); - final RichText textWidget = tester.widget(find.byType(RichText)); - final TextSpan span = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan span = textWidget.textSpan! as TextSpan; expect(span.children!.length, 2); expect(span.children, everyElement(isA())); @@ -1276,8 +1275,8 @@ void defineTests() { final Finder gestureFinder = find.byType(GestureDetector); expect(gestureFinder, findsNothing); - final RichText textWidget = tester.widget(find.byType(RichText)); - final TextSpan span = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan span = textWidget.textSpan! as TextSpan; expect(span.children!.length, 2); expect(span.children, everyElement(isA())); @@ -1309,8 +1308,8 @@ void defineTests() { ), ); - final RichText textWidget = tester.widget(find.byType(RichText)); - final TextSpan span = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan span = textWidget.textSpan! as TextSpan; expect(span.children!.length, 2); expect(span.children, everyElement(isA())); @@ -1409,8 +1408,8 @@ void defineTests() { ), ); - final RichText textWidget = tester.widget(find.byType(RichText)); - final TextSpan span = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan span = textWidget.textSpan! as TextSpan; expect(span.children!.length, 5); expect(span.children, everyElement(isA())); @@ -1497,8 +1496,8 @@ void defineTests() { ), ); - final RichText textWidget = tester.widget(find.byType(RichText)); - final TextSpan span = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan span = textWidget.textSpan! as TextSpan; expect(span.children!.length, 4); expect(span.children![0], isA()); @@ -1531,8 +1530,8 @@ void defineTests() { ), ); - final RichText textWidget = tester.widget(find.byType(RichText)); - final TextSpan span = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan span = textWidget.textSpan! as TextSpan; expect(span.children!.length, 5); expect(span.children![0], isA()); @@ -1578,8 +1577,8 @@ void defineTests() { ), ); - final RichText textWidget = tester.widget(find.byType(RichText)); - final TextSpan span = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan span = textWidget.textSpan! as TextSpan; expect(span.children!.length, 2); expect(span.children![0], isA()); expect(span.children![0].toPlainText(), '*'); @@ -1607,8 +1606,8 @@ void defineTests() { ), ); - final RichText textWidget = tester.widget(find.byType(RichText)); - final TextSpan span = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan span = textWidget.textSpan! as TextSpan; expect(span.children!.length, 2); expectLinkTextSpan(span.children![0] as TextSpan, 'foo *bar'); @@ -1664,8 +1663,8 @@ void defineTests() { final Finder gestureFinder = find.byType(GestureDetector); expect(gestureFinder, findsNothing); - final RichText textWidget = tester.widget(find.byType(RichText)); - final TextSpan span = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan span = textWidget.textSpan! as TextSpan; expect(span.children!.length, 2); expect(span.children, everyElement(isA())); @@ -1697,8 +1696,8 @@ void defineTests() { ), ); - final RichText textWidget = tester.widget(find.byType(RichText)); - final TextSpan span = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan span = textWidget.textSpan! as TextSpan; expect(span.children!.length, 2); expect(span.children, everyElement(isA())); @@ -1780,8 +1779,8 @@ void defineTests() { ), ); - final RichText textWidget = tester.widget(find.byType(RichText)); - final TextSpan span = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan span = textWidget.textSpan! as TextSpan; expect(span.children!.length, 2); expectLinkTextSpan(span.children![0] as TextSpan, 'ะขะพะปะฟะพะน'); @@ -1831,8 +1830,8 @@ void defineTests() { ), ); - final RichText textWidget = tester.widget(find.byType(RichText)); - final TextSpan span = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan span = textWidget.textSpan! as TextSpan; expect(span.children!.length, 2); expect(span.children![0], isA()); @@ -1862,8 +1861,8 @@ void defineTests() { ), ); - final RichText textWidget = tester.widget(find.byType(RichText)); - final TextSpan span = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan span = textWidget.textSpan! as TextSpan; expect(span.children!.length, 2); expect(span.children![0], isA()); @@ -1973,21 +1972,21 @@ void defineTests() { ), ); - final List textWidgets = - tester.widgetList(find.byType(RichText)).toList().cast(); + final List textWidgets = + tester.widgetList(find.byType(Text)).toList().cast(); expect(textWidgets.length, 2); - expect(textWidgets[0].text, isNotNull); - expect(textWidgets[0].text, isA()); - expect(textWidgets[0].text.toPlainText(), '[foo][ref[bar]]'); + expect(textWidgets[0].textSpan, isNotNull); + expect(textWidgets[0].textSpan, isA()); + expect(textWidgets[0].textSpan!.toPlainText(), '[foo][ref[bar]]'); expectTextSpanStyle( - textWidgets[0].text as TextSpan, null, FontWeight.normal); + textWidgets[0].textSpan! as TextSpan, null, FontWeight.normal); - expect(textWidgets[1].text, isNotNull); - expect(textWidgets[1].text, isA()); - expect(textWidgets[1].text.toPlainText(), '[ref[bar]]: /uri'); + expect(textWidgets[1].textSpan, isNotNull); + expect(textWidgets[1].textSpan, isA()); + expect(textWidgets[1].textSpan!.toPlainText(), '[ref[bar]]: /uri'); expectTextSpanStyle( - textWidgets[1].text as TextSpan, null, FontWeight.normal); + textWidgets[1].textSpan! as TextSpan, null, FontWeight.normal); expect(linkTapResults, isNull); }, @@ -2009,21 +2008,21 @@ void defineTests() { ), ); - final List textWidgets = - tester.widgetList(find.byType(RichText)).toList().cast(); + final List textWidgets = + tester.widgetList(find.byType(Text)).toList().cast(); expect(textWidgets.length, 2); - expect(textWidgets[0].text, isNotNull); - expect(textWidgets[0].text, isA()); - expect(textWidgets[0].text.toPlainText(), '[[[foo]]]'); + expect(textWidgets[0].textSpan, isNotNull); + expect(textWidgets[0].textSpan, isA()); + expect(textWidgets[0].textSpan!.toPlainText(), '[[[foo]]]'); expectTextSpanStyle( - textWidgets[0].text as TextSpan, null, FontWeight.normal); + textWidgets[0].textSpan! as TextSpan, null, FontWeight.normal); - expect(textWidgets[1].text, isNotNull); - expect(textWidgets[1].text, isA()); - expect(textWidgets[1].text.toPlainText(), '[[[foo]]]: /url'); + expect(textWidgets[1].textSpan, isNotNull); + expect(textWidgets[1].textSpan, isA()); + expect(textWidgets[1].textSpan!.toPlainText(), '[[[foo]]]: /url'); expectTextSpanStyle( - textWidgets[1].text as TextSpan, null, FontWeight.normal); + textWidgets[1].textSpan! as TextSpan, null, FontWeight.normal); expect(linkTapResults, isNull); }, @@ -2090,21 +2089,21 @@ void defineTests() { ), ); - final List textWidgets = - tester.widgetList(find.byType(RichText)).toList().cast(); + final List textWidgets = + tester.widgetList(find.byType(Text)).toList().cast(); expect(textWidgets.length, 2); - expect(textWidgets[0].text, isNotNull); - expect(textWidgets[0].text, isA()); - expect(textWidgets[0].text.toPlainText(), '[]'); + expect(textWidgets[0].textSpan, isNotNull); + expect(textWidgets[0].textSpan, isA()); + expect(textWidgets[0].textSpan!.toPlainText(), '[]'); expectTextSpanStyle( - textWidgets[0].text as TextSpan, null, FontWeight.normal); + textWidgets[0].textSpan! as TextSpan, null, FontWeight.normal); - expect(textWidgets[1].text, isNotNull); - expect(textWidgets[1].text, isA()); - expect(textWidgets[1].text.toPlainText(), '[]: /uri'); + expect(textWidgets[1].textSpan, isNotNull); + expect(textWidgets[1].textSpan, isA()); + expect(textWidgets[1].textSpan!.toPlainText(), '[]: /uri'); expectTextSpanStyle( - textWidgets[1].text as TextSpan, null, FontWeight.normal); + textWidgets[1].textSpan! as TextSpan, null, FontWeight.normal); expect(linkTapResults, isNull); }, @@ -2126,21 +2125,21 @@ void defineTests() { ), ); - final List textWidgets = - tester.widgetList(find.byType(RichText)).toList().cast(); + final List textWidgets = + tester.widgetList(find.byType(Text)).toList().cast(); expect(textWidgets.length, 2); - expect(textWidgets[0].text, isNotNull); - expect(textWidgets[0].text, isA()); - expect(textWidgets[0].text.toPlainText(), '[ ]'); + expect(textWidgets[0].textSpan, isNotNull); + expect(textWidgets[0].textSpan, isA()); + expect(textWidgets[0].textSpan!.toPlainText(), '[ ]'); expectTextSpanStyle( - textWidgets[0].text as TextSpan, null, FontWeight.normal); + textWidgets[0].textSpan! as TextSpan, null, FontWeight.normal); - expect(textWidgets[1].text, isNotNull); - expect(textWidgets[1].text, isA()); - expect(textWidgets[1].text.toPlainText(), '[ ]: /uri'); + expect(textWidgets[1].textSpan, isNotNull); + expect(textWidgets[1].textSpan, isA()); + expect(textWidgets[1].textSpan!.toPlainText(), '[ ]: /uri'); expectTextSpanStyle( - textWidgets[1].text as TextSpan, null, FontWeight.normal); + textWidgets[1].textSpan! as TextSpan, null, FontWeight.normal); expect(linkTapResults, isNull); }, @@ -2184,8 +2183,8 @@ void defineTests() { ), ); - final RichText textWidget = tester.widget(find.byType(RichText)); - final TextSpan span = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan span = textWidget.textSpan! as TextSpan; expect(span.children!.length, 2); expect(span.children, everyElement(isA())); @@ -2253,25 +2252,25 @@ void defineTests() { ), ); - final List textWidgets = - tester.widgetList(find.byType(RichText)).toList().cast(); + final List textWidgets = + tester.widgetList(find.byType(Text)).toList().cast(); expect(textWidgets.length, 2); - expect(textWidgets[0].text, isNotNull); - expect(textWidgets[0].text, isA()); - expect(textWidgets[0].text.toPlainText(), 'foo'); + expect(textWidgets[0].textSpan, isNotNull); + expect(textWidgets[0].textSpan, isA()); + expect(textWidgets[0].textSpan!.toPlainText(), 'foo'); - expect(textWidgets[0].text, isNotNull); - expect(textWidgets[0].text, isA()); - expectLinkTextSpan(textWidgets[0].text as TextSpan, 'foo'); + expect(textWidgets[0].textSpan, isNotNull); + expect(textWidgets[0].textSpan, isA()); + expectLinkTextSpan(textWidgets[0].textSpan! as TextSpan, 'foo'); expectLinkTap( linkTapResults, const MarkdownLink('foo', '/url', 'title')); - expect(textWidgets[1].text, isNotNull); - expect(textWidgets[1].text, isA()); - expect(textWidgets[1].text.toPlainText(), '[]'); + expect(textWidgets[1].textSpan, isNotNull); + expect(textWidgets[1].textSpan, isA()); + expect(textWidgets[1].textSpan!.toPlainText(), '[]'); expectTextSpanStyle( - textWidgets[1].text as TextSpan, null, FontWeight.normal); + textWidgets[1].textSpan! as TextSpan, null, FontWeight.normal); }, ); @@ -2313,8 +2312,8 @@ void defineTests() { ), ); - final RichText textWidget = tester.widget(find.byType(RichText)); - final TextSpan span = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan span = textWidget.textSpan! as TextSpan; expect(span.children!.length, 2); expect(span.children, everyElement(isA())); @@ -2360,8 +2359,8 @@ void defineTests() { ), ); - final RichText textWidget = tester.widget(find.byType(RichText)); - final TextSpan span = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan span = textWidget.textSpan! as TextSpan; expect(span.children!.length, 2); expect(span.children, everyElement(isA())); @@ -2407,8 +2406,8 @@ void defineTests() { ), ); - final RichText textWidget = tester.widget(find.byType(RichText)); - final TextSpan span = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan span = textWidget.textSpan! as TextSpan; expect(span.children!.length, 2); expect(span.children![0], isA()); @@ -2459,8 +2458,8 @@ void defineTests() { ), ); - final RichText textWidget = tester.widget(find.byType(RichText)); - final TextSpan span = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan span = textWidget.textSpan! as TextSpan; expect(span.children!.length, 2); expectLinkTextSpan(span.children![0] as TextSpan, 'foo'); @@ -2511,8 +2510,8 @@ void defineTests() { ), ); - final RichText textWidget = tester.widget(find.byType(RichText)); - final TextSpan span = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan span = textWidget.textSpan! as TextSpan; expect(span.children!.length, 2); expect(span.children![0], isA()); expect(span.children![0].toPlainText(), '*'); @@ -2603,8 +2602,8 @@ void defineTests() { ), ); - final RichText textWidget = tester.widget(find.byType(RichText)); - final TextSpan span = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan span = textWidget.textSpan! as TextSpan; expect(span.children!.length, 2); expectLinkTextSpan(span.children![0] as TextSpan, 'foo'); @@ -2633,8 +2632,8 @@ void defineTests() { ), ); - final RichText textWidget = tester.widget(find.byType(RichText)); - final TextSpan span = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan span = textWidget.textSpan! as TextSpan; expect(span.children!.length, 2); expect(span.children![0], isA()); @@ -2663,8 +2662,8 @@ void defineTests() { ), ); - final RichText textWidget = tester.widget(find.byType(RichText)); - final TextSpan span = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan span = textWidget.textSpan! as TextSpan; expect(span.children!.length, 2); expectLinkTextSpan(span.children![0] as TextSpan, 'foo'); @@ -2691,8 +2690,8 @@ void defineTests() { ), ); - final RichText textWidget = tester.widget(find.byType(RichText)); - final TextSpan span = textWidget.text as TextSpan; + final Text textWidget = tester.widget(find.byType(Text)); + final TextSpan span = textWidget.textSpan! as TextSpan; expect(span.children!.length, 2); expect(span.children![0], isA()); expect(span.children![0].toPlainText(), '[foo]'); diff --git a/packages/flutter_markdown/test/markdown_body_shrink_wrap_test.dart b/packages/flutter_markdown/test/markdown_body_shrink_wrap_test.dart index a5ae86953921..a0e7937ca13a 100644 --- a/packages/flutter_markdown/test/markdown_body_shrink_wrap_test.dart +++ b/packages/flutter_markdown/test/markdown_body_shrink_wrap_test.dart @@ -30,7 +30,7 @@ void defineTests() { )); final Rect stackRect = tester.getRect(find.byType(Stack)); - final Rect textRect = tester.getRect(find.byType(Text)); + final Rect textRect = tester.getRect(find.text('shrinkWrap=true')); final Rect markdownBodyRect = tester.getRect(find.byType(MarkdownBody)); // The Text should be on the top of the Stack @@ -61,7 +61,8 @@ void defineTests() { )); final Rect stackRect = tester.getRect(find.byType(Stack)); - final Rect textRect = tester.getRect(find.byType(Text)); + final Rect textRect = + tester.getRect(find.text('shrinkWrap=false test')); final Rect markdownBodyRect = tester.getRect(find.byType(MarkdownBody)); // The Text should be on the top of the Stack diff --git a/packages/flutter_markdown/test/selection_area_compatibility_test.dart b/packages/flutter_markdown/test/selection_area_compatibility_test.dart new file mode 100644 index 000000000000..ddc54c36fccf --- /dev/null +++ b/packages/flutter_markdown/test/selection_area_compatibility_test.dart @@ -0,0 +1,76 @@ +// 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/gestures.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; +import 'package:flutter_markdown/flutter_markdown.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() => defineTests(); + +void defineTests() { + group('Compatible with SelectionArea when selectable is default to false', + () { + testWidgets( + 'Text can be selected', + (WidgetTester tester) async { + SelectedContent? content; + + const String data = 'How are you?'; + await tester.pumpWidget(MaterialApp( + home: SelectionArea( + child: const Markdown( + data: data, + ), + onSelectionChanged: (SelectedContent? selectedContent) => + content = selectedContent, + ))); + + final TestGesture gesture = await tester.startGesture( + tester.getTopLeft(find.text('How are you?')), + kind: PointerDeviceKind.mouse); + addTearDown(gesture.removePointer); + await tester.pump(); + + await gesture.moveTo(tester.getBottomRight(find.text('How are you?'))); + await gesture.up(); + await tester.pump(); + + expect(content, isNotNull); + expect(content!.plainText, 'How are you?'); + }, + ); + + testWidgets( + 'List can be selected', + (WidgetTester tester) async { + SelectedContent? content; + + const String data = '- Item 1\n- Item 2\n- Item 3'; + await tester.pumpWidget(MaterialApp( + home: SelectionArea( + child: const Markdown( + data: data, + ), + onSelectionChanged: (SelectedContent? selectedContent) => + content = selectedContent, + ))); + + final TestGesture gesture = await tester.startGesture( + tester.getTopLeft(find.byType(Markdown)), + kind: PointerDeviceKind.mouse); + addTearDown(gesture.removePointer); + await tester.pump(); + + await gesture.moveTo(tester.getBottomRight(find.byType(Markdown))); + await gesture.up(); + await tester.pump(); + + expect(content, isNotNull); + expect(content!.plainText, 'โ€ขItem 1โ€ขItem 2โ€ขItem 3'); + }, + ); + }); +} diff --git a/packages/flutter_markdown/test/style_sheet_test.dart b/packages/flutter_markdown/test/style_sheet_test.dart index 0236e439dcdf..ad8c1f0c695b 100644 --- a/packages/flutter_markdown/test/style_sheet_test.dart +++ b/packages/flutter_markdown/test/style_sheet_test.dart @@ -233,8 +233,8 @@ void defineTests() { ), ); - final RichText widget = tester.widget(find.byType(RichText)); - expect(widget.text.style!.color, CupertinoColors.link.color); + final Text widget = tester.widget(find.byType(Text)); + expect(widget.textSpan!.style!.color, CupertinoColors.link.color); }, ); @@ -326,6 +326,7 @@ void defineTests() { Column, Padding, Wrap, + Text, RichText, ]); expectTextStrings(widgets, ['Header']); diff --git a/packages/flutter_markdown/test/table_test.dart b/packages/flutter_markdown/test/table_test.dart index 324aec97b0d5..c67944ee0c3d 100644 --- a/packages/flutter_markdown/test/table_test.dart +++ b/packages/flutter_markdown/test/table_test.dart @@ -74,11 +74,11 @@ void defineTests() { ); final Iterable widgets = tester.allWidgets; - final RichText richText = widgets - .lastWhere((Widget widget) => widget is RichText) as RichText; + final Text text = + widgets.lastWhere((Widget widget) => widget is Text) as Text; expectTextStrings(widgets, ['Header', 'italic']); - expect(richText.text.style!.fontStyle, FontStyle.italic); + expect(text.textSpan!.style!.fontStyle, FontStyle.italic); }, ); @@ -201,13 +201,13 @@ void defineTests() { expectTableSize(2, 2); - expect(find.byType(RichText), findsNWidgets(4)); + expect(find.byType(Text), findsNWidgets(4)); final List cellText = find - .byType(RichText) + .byType(Text) .evaluate() .map((Element e) => e.widget) - .cast() - .map((RichText richText) => richText.text) + .cast() + .map((Text text) => text.textSpan!) .cast() .map((TextSpan e) => e.text) .toList(); @@ -243,11 +243,11 @@ void defineTests() { expect(find.byType(RichText), findsNWidgets(6)); final List cellText = find - .byType(RichText) + .byType(Text) .evaluate() .map((Element e) => e.widget) - .cast() - .map((RichText richText) => richText.text) + .cast() + .map((Text richText) => richText.textSpan!) .cast() .map((TextSpan e) => e.text) .toList(); @@ -284,13 +284,13 @@ void defineTests() { expectTableSize(2, 2); - expect(find.byType(RichText), findsNWidgets(4)); + expect(find.byType(Text), findsNWidgets(4)); final List cellText = find - .byType(RichText) + .byType(Text) .evaluate() .map((Element e) => e.widget) - .cast() - .map((RichText richText) => richText.text) + .cast() + .map((Text text) => text.textSpan!) .cast() .map((TextSpan e) => e.text) .toList(); @@ -323,13 +323,13 @@ void defineTests() { expectTableSize(2, 2); - expect(find.byType(RichText), findsNWidgets(4)); + expect(find.byType(Text), findsNWidgets(4)); final List cellText = find - .byType(RichText) + .byType(Text) .evaluate() .map((Element e) => e.widget) - .cast() - .map((RichText richText) => richText.text) + .cast() + .map((Text text) => text.textSpan!) .cast() .map((TextSpan e) => e.text) .toList(); @@ -363,13 +363,13 @@ void defineTests() { expectTableSize(1, 3); - expect(find.byType(RichText), findsNWidgets(4)); + expect(find.byType(Text), findsNWidgets(4)); final List cellText = find - .byType(RichText) + .byType(Text) .evaluate() .map((Element e) => e.widget) - .cast() - .map((RichText richText) => richText.text) + .cast() + .map((Text text) => text.textSpan!) .cast() .map((TextSpan e) => e.text) .toList(); @@ -407,13 +407,13 @@ void defineTests() { expectTableSize(2, 2); - expect(find.byType(RichText), findsNWidgets(5)); + expect(find.byType(Text), findsNWidgets(5)); final List text = find - .byType(RichText) + .byType(Text) .evaluate() .map((Element e) => e.widget) - .cast() - .map((RichText richText) => richText.text) + .cast() + .map((Text text) => text.textSpan!) .cast() .map((TextSpan e) => e.text) .toList(); @@ -451,13 +451,13 @@ void defineTests() { expectTableSize(3, 2); - expect(find.byType(RichText), findsNWidgets(7)); + expect(find.byType(Text), findsNWidgets(7)); final List text = find - .byType(RichText) + .byType(Text) .evaluate() .map((Element e) => e.widget) - .cast() - .map((RichText richText) => richText.text) + .cast() + .map((Text text) => text.textSpan!) .cast() .map((TextSpan e) => e.text) .toList(); @@ -485,11 +485,11 @@ void defineTests() { expect(find.byType(Table), findsNothing); final List text = find - .byType(RichText) + .byType(Text) .evaluate() .map((Element e) => e.widget) - .cast() - .map((RichText richText) => richText.text) + .cast() + .map((Text text) => text.textSpan!) .cast() .map((TextSpan e) => e.text) .toList(); @@ -519,13 +519,13 @@ void defineTests() { expectTableSize(3, 2); - expect(find.byType(RichText), findsNWidgets(6)); + expect(find.byType(Text), findsNWidgets(6)); final List cellText = find - .byType(RichText) + .byType(Text) .evaluate() .map((Element e) => e.widget) - .cast() - .map((RichText richText) => richText.text) + .cast() + .map((Text text) => text.textSpan!) .cast() .map((TextSpan e) => e.text) .toList(); @@ -555,13 +555,13 @@ void defineTests() { expectTableSize(1, 2); - expect(find.byType(RichText), findsNWidgets(2)); + expect(find.byType(Text), findsNWidgets(2)); final List cellText = find - .byType(RichText) + .byType(Text) .evaluate() .map((Element e) => e.widget) - .cast() - .map((RichText richText) => richText.text) + .cast() + .map((Text text) => text.textSpan!) .cast() .map((TextSpan e) => e.text) .toList(); diff --git a/packages/flutter_markdown/test/text_alignment_test.dart b/packages/flutter_markdown/test/text_alignment_test.dart index d0e777f7c7d4..b8914eee0381 100644 --- a/packages/flutter_markdown/test/text_alignment_test.dart +++ b/packages/flutter_markdown/test/text_alignment_test.dart @@ -41,10 +41,12 @@ void defineTests() { Column, Column, Wrap, + Text, RichText, SizedBox, Column, Wrap, + Text, RichText, ]); diff --git a/packages/flutter_markdown/test/text_test.dart b/packages/flutter_markdown/test/text_test.dart index b61a298d2639..cb4610c3f5cc 100644 --- a/packages/flutter_markdown/test/text_test.dart +++ b/packages/flutter_markdown/test/text_test.dart @@ -71,6 +71,7 @@ void defineTests() { MarkdownBody, Column, Wrap, + Text, RichText, ]); expectTextStrings(widgets, ['Hello']); @@ -97,6 +98,7 @@ void defineTests() { MarkdownBody, Column, Wrap, + Text, RichText, ]); expectTextStrings(widgets, ['aaa bbb']); @@ -120,7 +122,7 @@ void defineTests() { tester, ); expectWidgetTypes( - widgets, [MarkdownBody, Column, Wrap, RichText]); + widgets, [MarkdownBody, Column, Wrap, Text, RichText]); expectTextStrings(widgets, ['line 1\nline 2']); }, ); @@ -141,7 +143,7 @@ void defineTests() { tester, ); expectWidgetTypes( - widgets, [MarkdownBody, Column, Wrap, RichText]); + widgets, [MarkdownBody, Column, Wrap, Text, RichText]); expectTextStrings(widgets, ['line 1\nline 2']); }, ); @@ -164,6 +166,7 @@ void defineTests() { MarkdownBody, Column, Wrap, + Text, RichText, ]); expectTextStrings(widgets, ['line 1. line 2.']); @@ -188,6 +191,7 @@ void defineTests() { MarkdownBody, Column, Wrap, + Text, RichText, ]); expectTextStrings(widgets, ['line 1. line 2.']); @@ -212,7 +216,7 @@ void defineTests() { tester, ); expectWidgetTypes( - widgets, [MarkdownBody, Column, Wrap, RichText]); + widgets, [MarkdownBody, Column, Wrap, Text, RichText]); expectTextStrings(widgets, ['line 1.\nline 2.']); }, ); @@ -297,6 +301,7 @@ void defineTests() { MarkdownBody, Column, Wrap, + Text, RichText, ]); expectTextStrings(widgets, ['strikethrough']); diff --git a/packages/flutter_markdown/test/utils.dart b/packages/flutter_markdown/test/utils.dart index 3c9991099512..5f6ec962646e 100644 --- a/packages/flutter_markdown/test/utils.dart +++ b/packages/flutter_markdown/test/utils.dart @@ -50,7 +50,7 @@ void expectTextStrings(Iterable widgets, List strings) { String _extractTextFromTextSpan(TextSpan span) { String text = span.text ?? ''; if (span.children != null) { - for (final TextSpan child in span.children! as Iterable) { + for (final TextSpan child in span.children!.toList().cast()) { text += _extractTextFromTextSpan(child); } } @@ -111,16 +111,16 @@ class MarkdownLink { /// Verify a valid link structure has been created. This routine checks for the /// link text and the associated [TapGestureRecognizer] on the text span. void expectValidLink(String linkText) { - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); - final RichText richText = richTextFinder.evaluate().first.widget as RichText; + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); + final Text text = textFinder.evaluate().first.widget as Text; // Verify the link text. - expect(richText.text, isNotNull); - expect(richText.text, isA()); + expect(text.textSpan, isNotNull); + expect(text.textSpan, isA()); // Verify the link text is a onTap gesture recognizer. - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = text.textSpan! as TextSpan; expectLinkTextSpan(textSpan, linkText); } @@ -138,16 +138,16 @@ void expectLinkTextSpan(TextSpan textSpan, String linkText) { } void expectInvalidLink(String linkText) { - final Finder richTextFinder = find.byType(RichText); - expect(richTextFinder, findsOneWidget); - final RichText richText = richTextFinder.evaluate().first.widget as RichText; + final Finder textFinder = find.byType(Text); + expect(textFinder, findsOneWidget); + final Text text = textFinder.evaluate().first.widget as Text; - expect(richText.text, isNotNull); - expect(richText.text, isA()); - final String text = richText.text.toPlainText(); - expect(text, linkText); + expect(text.textSpan, isNotNull); + expect(text.textSpan, isA()); + final String plainText = text.textSpan!.toPlainText(); + expect(plainText, linkText); - final TextSpan textSpan = richText.text as TextSpan; + final TextSpan textSpan = text.textSpan! as TextSpan; expect(textSpan.recognizer, isNull); } From 1bc9fee8515885af81fc6840c5581ce92660c4fc Mon Sep 17 00:00:00 2001 From: Alex Usmanov <40719830+Alex-Usmanov@users.noreply.github.com> Date: Wed, 14 Feb 2024 00:17:56 +0500 Subject: [PATCH 10/40] [url_launcher] Add `InAppBrowserConfiguration` parameter in implementations (#5759) Platform implementation portion of #5166. Implements `InAppBrowserConfiguration` support on Android, as well as support for `InAppBrowserConfiguration.showTitle` parameter for hiding/showing webpage title in Android Custom Tabs. --- .../url_launcher_android/CHANGELOG.md | 4 +- .../flutter/plugins/urllauncher/Messages.java | 74 +++++++++-- .../plugins/urllauncher/UrlLauncher.java | 25 ++-- .../plugins/urllauncher/UrlLauncherTest.java | 117 ++++++++++++++++-- .../url_launcher_android/example/pubspec.yaml | 2 +- .../lib/src/messages.g.dart | 50 ++++++-- .../lib/url_launcher_android.dart | 21 ++-- .../pigeons/messages.dart | 25 +++- .../url_launcher_android/pubspec.yaml | 4 +- .../test/url_launcher_android_test.dart | 31 ++++- 10 files changed, 299 insertions(+), 54 deletions(-) diff --git a/packages/url_launcher/url_launcher_android/CHANGELOG.md b/packages/url_launcher/url_launcher_android/CHANGELOG.md index 8b7fc14b4128..67b010334979 100644 --- a/packages/url_launcher/url_launcher_android/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_android/CHANGELOG.md @@ -1,5 +1,7 @@ -## NEXT +## 6.3.0 +* Adds support for `BrowserConfiguration`. +* Implements `showTitle` functionality for Android Custom Tabs. * Updates compileSdk version to 34. ## 6.2.3 diff --git a/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/Messages.java b/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/Messages.java index f2294f048f82..ff79d6320936 100644 --- a/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/Messages.java +++ b/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/Messages.java @@ -1,7 +1,7 @@ // 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. -// Autogenerated from Pigeon (v10.1.4), do not edit directly. +// Autogenerated from Pigeon (v10.1.6), do not edit directly. // See also: https://pub.dev/packages/pigeon package io.flutter.plugins.urllauncher; @@ -156,6 +156,55 @@ ArrayList toList() { } } + /** Generated class from Pigeon that represents data sent in messages. */ + public static final class BrowserOptions { + private @NonNull Boolean showTitle; + + public @NonNull Boolean getShowTitle() { + return showTitle; + } + + public void setShowTitle(@NonNull Boolean setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"showTitle\" is null."); + } + this.showTitle = setterArg; + } + + /** Constructor is non-public to enforce null safety; use Builder. */ + BrowserOptions() {} + + public static final class Builder { + + private @Nullable Boolean showTitle; + + public @NonNull Builder setShowTitle(@NonNull Boolean setterArg) { + this.showTitle = setterArg; + return this; + } + + public @NonNull BrowserOptions build() { + BrowserOptions pigeonReturn = new BrowserOptions(); + pigeonReturn.setShowTitle(showTitle); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList(1); + toListResult.add(showTitle); + return toListResult; + } + + static @NonNull BrowserOptions fromList(@NonNull ArrayList list) { + BrowserOptions pigeonResult = new BrowserOptions(); + Object showTitle = list.get(0); + pigeonResult.setShowTitle((Boolean) showTitle); + return pigeonResult; + } + } + private static class UrlLauncherApiCodec extends StandardMessageCodec { public static final UrlLauncherApiCodec INSTANCE = new UrlLauncherApiCodec(); @@ -165,6 +214,8 @@ private UrlLauncherApiCodec() {} protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { switch (type) { case (byte) 128: + return BrowserOptions.fromList((ArrayList) readValue(buffer)); + case (byte) 129: return WebViewOptions.fromList((ArrayList) readValue(buffer)); default: return super.readValueOfType(type, buffer); @@ -173,8 +224,11 @@ protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { @Override protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { - if (value instanceof WebViewOptions) { + if (value instanceof BrowserOptions) { stream.write(128); + writeValue(stream, ((BrowserOptions) value).toList()); + } else if (value instanceof WebViewOptions) { + stream.write(129); writeValue(stream, ((WebViewOptions) value).toList()); } else { super.writeValue(stream, value); @@ -190,12 +244,13 @@ public interface UrlLauncherApi { /** Opens the URL externally, returning true if successful. */ @NonNull Boolean launchUrl(@NonNull String url, @NonNull Map headers); - /** - * Opens the URL in an in-app Custom Tab or WebView, returning true if it opens successfully. - */ + /** Opens the URL in an in-app WebView, returning true if it opens successfully. */ @NonNull Boolean openUrlInApp( - @NonNull String url, @NonNull Boolean allowCustomTab, @NonNull WebViewOptions options); + @NonNull String url, + @NonNull Boolean allowCustomTab, + @NonNull WebViewOptions webViewOptions, + @NonNull BrowserOptions browserOptions); @NonNull Boolean supportsCustomTabs(); @@ -272,9 +327,12 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable UrlLaunche ArrayList args = (ArrayList) message; String urlArg = (String) args.get(0); Boolean allowCustomTabArg = (Boolean) args.get(1); - WebViewOptions optionsArg = (WebViewOptions) args.get(2); + WebViewOptions webViewOptionsArg = (WebViewOptions) args.get(2); + BrowserOptions browserOptionsArg = (BrowserOptions) args.get(3); try { - Boolean output = api.openUrlInApp(urlArg, allowCustomTabArg, optionsArg); + Boolean output = + api.openUrlInApp( + urlArg, allowCustomTabArg, webViewOptionsArg, browserOptionsArg); wrapped.add(0, output); } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); diff --git a/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/UrlLauncher.java b/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/UrlLauncher.java index 028338c6981b..35094e799441 100644 --- a/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/UrlLauncher.java +++ b/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/UrlLauncher.java @@ -18,6 +18,7 @@ import androidx.annotation.VisibleForTesting; import androidx.browser.customtabs.CustomTabsClient; import androidx.browser.customtabs.CustomTabsIntent; +import io.flutter.plugins.urllauncher.Messages.BrowserOptions; import io.flutter.plugins.urllauncher.Messages.UrlLauncherApi; import io.flutter.plugins.urllauncher.Messages.WebViewOptions; import java.util.Collections; @@ -98,17 +99,20 @@ void setActivity(@Nullable Activity activity) { @Override public @NonNull Boolean openUrlInApp( - @NonNull String url, @NonNull Boolean allowCustomTab, @NonNull WebViewOptions options) { + @NonNull String url, + @NonNull Boolean allowCustomTab, + @NonNull WebViewOptions webViewOptions, + @NonNull BrowserOptions browserOptions) { ensureActivity(); assert activity != null; - Bundle headersBundle = extractBundle(options.getHeaders()); + Bundle headersBundle = extractBundle(webViewOptions.getHeaders()); // Try to launch using Custom Tabs if they have the necessary functionality, unless the caller // specifically requested a web view. - if (allowCustomTab && !containsRestrictedHeader(options.getHeaders())) { + if (allowCustomTab && !containsRestrictedHeader(webViewOptions.getHeaders())) { Uri uri = Uri.parse(url); - if (openCustomTab(activity, uri, headersBundle)) { + if (openCustomTab(activity, uri, headersBundle, browserOptions)) { return true; } } @@ -118,8 +122,8 @@ void setActivity(@Nullable Activity activity) { WebViewActivity.createIntent( activity, url, - options.getEnableJavaScript(), - options.getEnableDomStorage(), + webViewOptions.getEnableJavaScript(), + webViewOptions.getEnableDomStorage(), headersBundle); try { activity.startActivity(launchIntent); @@ -141,9 +145,14 @@ public void closeWebView() { } private static boolean openCustomTab( - @NonNull Context context, @NonNull Uri uri, @NonNull Bundle headersBundle) { - CustomTabsIntent customTabsIntent = new CustomTabsIntent.Builder().build(); + @NonNull Context context, + @NonNull Uri uri, + @NonNull Bundle headersBundle, + @NonNull BrowserOptions options) { + CustomTabsIntent customTabsIntent = + new CustomTabsIntent.Builder().setShowTitle(options.getShowTitle()).build(); customTabsIntent.intent.putExtra(Browser.EXTRA_HEADERS, headersBundle); + try { customTabsIntent.launchUrl(context, uri); } catch (ActivityNotFoundException ex) { diff --git a/packages/url_launcher/url_launcher_android/android/src/test/java/io/flutter/plugins/urllauncher/UrlLauncherTest.java b/packages/url_launcher/url_launcher_android/android/src/test/java/io/flutter/plugins/urllauncher/UrlLauncherTest.java index 3bffbc614f09..9a545a54b438 100644 --- a/packages/url_launcher/url_launcher_android/android/src/test/java/io/flutter/plugins/urllauncher/UrlLauncherTest.java +++ b/packages/url_launcher/url_launcher_android/android/src/test/java/io/flutter/plugins/urllauncher/UrlLauncherTest.java @@ -23,6 +23,7 @@ import android.net.Uri; import android.os.Bundle; import android.provider.Browser; +import androidx.browser.customtabs.CustomTabsIntent; import androidx.test.core.app.ApplicationProvider; import java.util.HashMap; import org.junit.Test; @@ -139,6 +140,7 @@ public void openUrlInApp_opensUrlInWebViewIfNecessary() { boolean enableDomStorage = false; HashMap headers = new HashMap<>(); headers.put("key", "value"); + boolean showTitle = false; boolean result = api.openUrlInApp( @@ -148,7 +150,8 @@ public void openUrlInApp_opensUrlInWebViewIfNecessary() { .setEnableJavaScript(enableJavaScript) .setEnableDomStorage(enableDomStorage) .setHeaders(headers) - .build()); + .build(), + new Messages.BrowserOptions.Builder().setShowTitle(showTitle).build()); final ArgumentCaptor intentCaptor = ArgumentCaptor.forClass(Intent.class); verify(activity).startActivity(intentCaptor.capture()); @@ -177,7 +180,8 @@ public void openWebView_opensUrlInWebViewIfRequested() { .setEnableJavaScript(false) .setEnableDomStorage(false) .setHeaders(new HashMap<>()) - .build()); + .build(), + new Messages.BrowserOptions.Builder().setShowTitle(true).build()); final ArgumentCaptor intentCaptor = ArgumentCaptor.forClass(Intent.class); verify(activity).startActivity(intentCaptor.capture()); @@ -200,7 +204,8 @@ public void openWebView_opensUrlInCustomTabs() { .setEnableJavaScript(false) .setEnableDomStorage(false) .setHeaders(new HashMap<>()) - .build()); + .build(), + new Messages.BrowserOptions.Builder().setShowTitle(false).build()); final ArgumentCaptor intentCaptor = ArgumentCaptor.forClass(Intent.class); verify(activity).startActivity(intentCaptor.capture(), isNull()); @@ -227,7 +232,8 @@ public void openWebView_opensUrlInCustomTabsWithCORSAllowedHeader() { .setEnableJavaScript(false) .setEnableDomStorage(false) .setHeaders(headers) - .build()); + .build(), + new Messages.BrowserOptions.Builder().setShowTitle(false).build()); final ArgumentCaptor intentCaptor = ArgumentCaptor.forClass(Intent.class); verify(activity).startActivity(intentCaptor.capture(), isNull()); @@ -239,6 +245,64 @@ public void openWebView_opensUrlInCustomTabsWithCORSAllowedHeader() { assertEquals(headers.get(headerKey), passedHeaders.getString(headerKey)); } + @Test + public void openWebView_opensUrlInCustomTabsWithShowTitle() { + Activity activity = mock(Activity.class); + UrlLauncher api = new UrlLauncher(ApplicationProvider.getApplicationContext()); + api.setActivity(activity); + String url = "https://flutter.dev"; + HashMap headers = new HashMap<>(); + + boolean result = + api.openUrlInApp( + url, + true, + new Messages.WebViewOptions.Builder() + .setEnableJavaScript(false) + .setEnableDomStorage(false) + .setHeaders(headers) + .build(), + new Messages.BrowserOptions.Builder().setShowTitle(true).build()); + + final ArgumentCaptor intentCaptor = ArgumentCaptor.forClass(Intent.class); + verify(activity).startActivity(intentCaptor.capture(), isNull()); + assertTrue(result); + assertEquals(Intent.ACTION_VIEW, intentCaptor.getValue().getAction()); + assertNull(intentCaptor.getValue().getComponent()); + assertEquals( + intentCaptor.getValue().getExtras().getInt(CustomTabsIntent.EXTRA_TITLE_VISIBILITY_STATE), + CustomTabsIntent.SHOW_PAGE_TITLE); + } + + @Test + public void openWebView_opensUrlInCustomTabsWithoutShowTitle() { + Activity activity = mock(Activity.class); + UrlLauncher api = new UrlLauncher(ApplicationProvider.getApplicationContext()); + api.setActivity(activity); + String url = "https://flutter.dev"; + HashMap headers = new HashMap<>(); + + boolean result = + api.openUrlInApp( + url, + true, + new Messages.WebViewOptions.Builder() + .setEnableJavaScript(false) + .setEnableDomStorage(false) + .setHeaders(headers) + .build(), + new Messages.BrowserOptions.Builder().setShowTitle(false).build()); + + final ArgumentCaptor intentCaptor = ArgumentCaptor.forClass(Intent.class); + verify(activity).startActivity(intentCaptor.capture(), isNull()); + assertTrue(result); + assertEquals(Intent.ACTION_VIEW, intentCaptor.getValue().getAction()); + assertNull(intentCaptor.getValue().getComponent()); + assertEquals( + intentCaptor.getValue().getExtras().getInt(CustomTabsIntent.EXTRA_TITLE_VISIBILITY_STATE), + CustomTabsIntent.NO_TITLE); + } + @Test public void openWebView_fallsBackToWebViewIfCustomTabFails() { Activity activity = mock(Activity.class); @@ -257,7 +321,8 @@ public void openWebView_fallsBackToWebViewIfCustomTabFails() { .setEnableJavaScript(false) .setEnableDomStorage(false) .setHeaders(new HashMap<>()) - .build()); + .build(), + new Messages.BrowserOptions.Builder().setShowTitle(false).build()); final ArgumentCaptor intentCaptor = ArgumentCaptor.forClass(Intent.class); verify(activity).startActivity(intentCaptor.capture()); @@ -285,7 +350,8 @@ public void openWebView_handlesEnableJavaScript() { .setEnableJavaScript(enableJavaScript) .setEnableDomStorage(false) .setHeaders(headers) - .build()); + .build(), + new Messages.BrowserOptions.Builder().setShowTitle(false).build()); final ArgumentCaptor intentCaptor = ArgumentCaptor.forClass(Intent.class); verify(activity).startActivity(intentCaptor.capture()); @@ -312,7 +378,8 @@ public void openWebView_handlesHeaders() { .setEnableJavaScript(false) .setEnableDomStorage(false) .setHeaders(headers) - .build()); + .build(), + new Messages.BrowserOptions.Builder().setShowTitle(false).build()); final ArgumentCaptor intentCaptor = ArgumentCaptor.forClass(Intent.class); verify(activity).startActivity(intentCaptor.capture()); @@ -339,7 +406,8 @@ public void openWebView_handlesEnableDomStorage() { .setEnableJavaScript(false) .setEnableDomStorage(enableDomStorage) .setHeaders(headers) - .build()); + .build(), + new Messages.BrowserOptions.Builder().setShowTitle(false).build()); final ArgumentCaptor intentCaptor = ArgumentCaptor.forClass(Intent.class); verify(activity).startActivity(intentCaptor.capture()); @@ -348,6 +416,33 @@ public void openWebView_handlesEnableDomStorage() { intentCaptor.getValue().getExtras().getBoolean(WebViewActivity.ENABLE_DOM_EXTRA)); } + @Test + public void openWebView_handlesEnableShowTitle() { + Activity activity = mock(Activity.class); + UrlLauncher api = new UrlLauncher(ApplicationProvider.getApplicationContext()); + api.setActivity(activity); + boolean enableDomStorage = true; + HashMap headers = new HashMap<>(); + boolean showTitle = true; + + api.openUrlInApp( + "https://flutter.dev", + true, + new Messages.WebViewOptions.Builder() + .setEnableJavaScript(false) + .setEnableDomStorage(enableDomStorage) + .setHeaders(headers) + .build(), + new Messages.BrowserOptions.Builder().setShowTitle(showTitle).build()); + + final ArgumentCaptor intentCaptor = ArgumentCaptor.forClass(Intent.class); + verify(activity).startActivity(intentCaptor.capture(), isNull()); + + assertEquals( + intentCaptor.getValue().getExtras().getInt(CustomTabsIntent.EXTRA_TITLE_VISIBILITY_STATE), + CustomTabsIntent.SHOW_PAGE_TITLE); + } + @Test public void openWebView_throwsForNoCurrentActivity() { UrlLauncher api = new UrlLauncher(ApplicationProvider.getApplicationContext()); @@ -364,7 +459,8 @@ public void openWebView_throwsForNoCurrentActivity() { .setEnableJavaScript(false) .setEnableDomStorage(false) .setHeaders(new HashMap<>()) - .build())); + .build(), + new Messages.BrowserOptions.Builder().setShowTitle(false).build())); assertEquals("NO_ACTIVITY", exception.code); } @@ -388,7 +484,8 @@ public void openWebView_returnsFalse() { .setEnableJavaScript(false) .setEnableDomStorage(false) .setHeaders(new HashMap<>()) - .build()); + .build(), + new Messages.BrowserOptions.Builder().setShowTitle(false).build()); assertFalse(result); } diff --git a/packages/url_launcher/url_launcher_android/example/pubspec.yaml b/packages/url_launcher/url_launcher_android/example/pubspec.yaml index e3a13c571f70..0d99e391616f 100644 --- a/packages/url_launcher/url_launcher_android/example/pubspec.yaml +++ b/packages/url_launcher/url_launcher_android/example/pubspec.yaml @@ -16,7 +16,7 @@ dependencies: # The example app is bundled with the plugin so we use a path dependency on # the parent directory to use the current plugin's version. path: ../ - url_launcher_platform_interface: ^2.2.0 + url_launcher_platform_interface: ^2.3.1 dev_dependencies: flutter_test: diff --git a/packages/url_launcher/url_launcher_android/lib/src/messages.g.dart b/packages/url_launcher/url_launcher_android/lib/src/messages.g.dart index 9d6ce26ed85b..546f969c8809 100644 --- a/packages/url_launcher/url_launcher_android/lib/src/messages.g.dart +++ b/packages/url_launcher/url_launcher_android/lib/src/messages.g.dart @@ -1,7 +1,7 @@ // 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. -// Autogenerated from Pigeon (v10.1.4), do not edit directly. +// Autogenerated from Pigeon (v10.1.6), 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, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import @@ -43,13 +43,37 @@ class WebViewOptions { } } +class BrowserOptions { + BrowserOptions({ + required this.showTitle, + }); + + bool showTitle; + + Object encode() { + return [ + showTitle, + ]; + } + + static BrowserOptions decode(Object result) { + result as List; + return BrowserOptions( + showTitle: result[0]! as bool, + ); + } +} + class _UrlLauncherApiCodec extends StandardMessageCodec { const _UrlLauncherApiCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is WebViewOptions) { + if (value is BrowserOptions) { buffer.putUint8(128); writeValue(buffer, value.encode()); + } else if (value is WebViewOptions) { + buffer.putUint8(129); + writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); } @@ -59,6 +83,8 @@ class _UrlLauncherApiCodec extends StandardMessageCodec { Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { case 128: + return BrowserOptions.decode(readValue(buffer)!); + case 129: return WebViewOptions.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -135,17 +161,23 @@ class UrlLauncherApi { } } - /// Opens the URL in an in-app Custom Tab or WebView, returning true if it - /// opens successfully. - Future openUrlInApp(String arg_url, bool arg_allowCustomTab, - WebViewOptions arg_options) async { + /// Opens the URL in an in-app WebView, returning true if it opens + /// successfully. + Future openUrlInApp( + String arg_url, + bool arg_allowCustomTab, + WebViewOptions arg_webViewOptions, + BrowserOptions arg_browserOptions) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.url_launcher_android.UrlLauncherApi.openUrlInApp', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_url, arg_allowCustomTab, arg_options]) - as List?; + final List? replyList = await channel.send([ + arg_url, + arg_allowCustomTab, + arg_webViewOptions, + arg_browserOptions + ]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', diff --git a/packages/url_launcher/url_launcher_android/lib/url_launcher_android.dart b/packages/url_launcher/url_launcher_android/lib/url_launcher_android.dart index 7955abe2a7c7..2c6d01c9b311 100644 --- a/packages/url_launcher/url_launcher_android/lib/url_launcher_android.dart +++ b/packages/url_launcher/url_launcher_android/lib/url_launcher_android.dart @@ -99,17 +99,23 @@ class UrlLauncherAndroid extends UrlLauncherPlatform { final bool succeeded; if (inApp) { succeeded = await _hostApi.openUrlInApp( - url, - // Prefer custom tabs unless a webview was specifically requested. - options.mode != PreferredLaunchMode.inAppWebView, - WebViewOptions( - enableJavaScript: options.webViewConfiguration.enableJavaScript, - enableDomStorage: options.webViewConfiguration.enableDomStorage, - headers: options.webViewConfiguration.headers)); + url, + // Prefer custom tabs unless a webview was specifically requested. + options.mode != PreferredLaunchMode.inAppWebView, + WebViewOptions( + enableJavaScript: options.webViewConfiguration.enableJavaScript, + enableDomStorage: options.webViewConfiguration.enableDomStorage, + headers: options.webViewConfiguration.headers, + ), + BrowserOptions( + showTitle: options.browserConfiguration.showTitle, + ), + ); } else { succeeded = await _hostApi.launchUrl(url, options.webViewConfiguration.headers); } + // TODO(stuartmorgan): Remove this special handling as part of a // breaking change to rework failure handling across all platform. The // current behavior is backwards compatible with the previous Java error. @@ -118,6 +124,7 @@ class UrlLauncherAndroid extends UrlLauncherPlatform { code: 'ACTIVITY_NOT_FOUND', message: 'No Activity found to handle intent { $url }'); } + return succeeded; } diff --git a/packages/url_launcher/url_launcher_android/pigeons/messages.dart b/packages/url_launcher/url_launcher_android/pigeons/messages.dart index d71844134092..6f39272c4f7f 100644 --- a/packages/url_launcher/url_launcher_android/pigeons/messages.dart +++ b/packages/url_launcher/url_launcher_android/pigeons/messages.dart @@ -13,10 +13,12 @@ import 'package:pigeon/pigeon.dart'; /// Configuration options for an in-app WebView. class WebViewOptions { - const WebViewOptions( - {required this.enableJavaScript, - required this.enableDomStorage, - this.headers = const {}}); + const WebViewOptions({ + required this.enableJavaScript, + required this.enableDomStorage, + this.headers = const {}, + }); + final bool enableJavaScript; final bool enableDomStorage; // TODO(stuartmorgan): Declare these as non-nullable generics once @@ -25,6 +27,14 @@ class WebViewOptions { final Map headers; } +/// Configuration options for in-app browser views. +class BrowserOptions { + BrowserOptions({required this.showTitle}); + + /// Whether or not to show the webpage title. + final bool showTitle; +} + @HostApi() abstract class UrlLauncherApi { /// Returns true if the URL can definitely be launched. @@ -35,7 +45,12 @@ abstract class UrlLauncherApi { /// Opens the URL in an in-app Custom Tab or WebView, returning true if it /// opens successfully. - bool openUrlInApp(String url, bool allowCustomTab, WebViewOptions options); + bool openUrlInApp( + String url, + bool allowCustomTab, + WebViewOptions webViewOptions, + BrowserOptions browserOptions, + ); bool supportsCustomTabs(); diff --git a/packages/url_launcher/url_launcher_android/pubspec.yaml b/packages/url_launcher/url_launcher_android/pubspec.yaml index 27ecdfcec8e8..111318fa6819 100644 --- a/packages/url_launcher/url_launcher_android/pubspec.yaml +++ b/packages/url_launcher/url_launcher_android/pubspec.yaml @@ -2,7 +2,7 @@ name: url_launcher_android description: Android implementation of the url_launcher plugin. repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22 -version: 6.2.3 +version: 6.3.0 environment: sdk: ">=3.0.0 <4.0.0" flutter: ">=3.10.0" @@ -19,7 +19,7 @@ flutter: dependencies: flutter: sdk: flutter - url_launcher_platform_interface: ^2.2.0 + url_launcher_platform_interface: ^2.3.1 dev_dependencies: flutter_test: diff --git a/packages/url_launcher/url_launcher_android/test/url_launcher_android_test.dart b/packages/url_launcher/url_launcher_android/test/url_launcher_android_test.dart index 2b331cbd027b..7b469246a5c1 100644 --- a/packages/url_launcher/url_launcher_android/test/url_launcher_android_test.dart +++ b/packages/url_launcher/url_launcher_android/test/url_launcher_android_test.dart @@ -64,6 +64,7 @@ void main() { universalLinksOnly: false, headers: const {}, ); + expect(launched, true); expect(api.usedWebView, false); expect(api.passedWebViewOptions?.headers, isEmpty); @@ -166,6 +167,20 @@ void main() { expect(api.passedWebViewOptions?.enableDomStorage, true); }); + test('passes showTitle to webview', () async { + final UrlLauncherAndroid launcher = UrlLauncherAndroid(api: api); + await launcher.launchUrl( + 'http://example.com/', + const LaunchOptions( + browserConfiguration: InAppBrowserConfiguration( + showTitle: true, + ), + ), + ); + + expect(api.passedBrowserOptions?.showTitle, true); + }); + test('passes through no-activity exception', () async { final UrlLauncherAndroid launcher = UrlLauncherAndroid(api: api); await expectLater( @@ -400,6 +415,7 @@ void main() { class _FakeUrlLauncherApi implements UrlLauncherApi { bool hasCustomTabSupport = true; WebViewOptions? passedWebViewOptions; + BrowserOptions? passedBrowserOptions; bool? usedWebView; bool? allowedCustomTab; bool? closed; @@ -415,7 +431,11 @@ class _FakeUrlLauncherApi implements UrlLauncherApi { @override Future launchUrl(String url, Map headers) async { passedWebViewOptions = WebViewOptions( - enableJavaScript: false, enableDomStorage: false, headers: headers); + enableJavaScript: false, + enableDomStorage: false, + headers: headers, + ); + usedWebView = false; return _launch(url); } @@ -427,8 +447,13 @@ class _FakeUrlLauncherApi implements UrlLauncherApi { @override Future openUrlInApp( - String url, bool allowCustomTab, WebViewOptions options) async { - passedWebViewOptions = options; + String url, + bool allowCustomTab, + WebViewOptions webViewOptions, + BrowserOptions browserOptions, + ) async { + passedWebViewOptions = webViewOptions; + passedBrowserOptions = browserOptions; usedWebView = true; allowedCustomTab = allowCustomTab; return _launch(url); From abb04bb89cca97e653764a60bde0ee4e816db322 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Tue, 13 Feb 2024 11:26:35 -0800 Subject: [PATCH 11/40] [ci] Allow dependencies on local_auth_ios (#6116) We aren't quite ready to switch the endorsement to `local_auth_darwin`, so allow `local_auth_ios` for now. --- script/configs/allowed_unpinned_deps.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/script/configs/allowed_unpinned_deps.yaml b/script/configs/allowed_unpinned_deps.yaml index fe4c138b0a63..7387401c5313 100644 --- a/script/configs/allowed_unpinned_deps.yaml +++ b/script/configs/allowed_unpinned_deps.yaml @@ -6,6 +6,10 @@ ## Explicit allowances +# Temporary during transition to local_auth_darwin. Can be removed once +# the default endorsement changes. +- local_auth_ios + # Owned by individual Flutter Team members. # Ideally we would not do this, since there's no clear plan for what # would happen if the individuals left the Flutter Team, and the From 8c263efd4119b18c3e012cc648af153b1fcc7971 Mon Sep 17 00:00:00 2001 From: Camille Simon <43054281+camsim99@users.noreply.github.com> Date: Tue, 13 Feb 2024 19:54:20 -0500 Subject: [PATCH 12/40] [google_maps_flutter][iOS 12] Skip `testTakeSnapshot` (#6120) Skips `testTakeSnapshot` test re-enabeld by https://github.com/flutter/packages/pull/5823, but causing failures and blocking the `flutter/packages` tree, e.g. https://ci.chromium.org/ui/p/flutter/builders/prod/Mac_arm64%20ios_platform_tests_shard_2%20master/1697/overview. --- .../example/ios12/integration_test/google_maps_test.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios12/integration_test/google_maps_test.dart b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios12/integration_test/google_maps_test.dart index ba8ba957edfb..9902456444d6 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios12/integration_test/google_maps_test.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios12/integration_test/google_maps_test.dart @@ -849,7 +849,9 @@ void main() { await controllerCompleter.future; final Uint8List? bytes = await controller.takeSnapshot(); expect(bytes?.isNotEmpty, true); - }); + }, + // TODO(stuartmorgan): Re-enable; see https://github.com/flutter/flutter/issues/139825 + skip: true); testWidgets( 'set tileOverlay correctly', From a8642544730aef7a3da61d7093ea22acc6987dd8 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Wed, 14 Feb 2024 04:19:26 -0800 Subject: [PATCH 13/40] Allow deprecated members from the Dart SDK/Flutter Framework to roll in (#6111) Namely, without breaking the tree. This is a deliberate policy decision change. See https://github.com/flutter/flutter/issues/143312. --- analysis_options.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index 69c2634ca12a..364fc12db89a 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -11,8 +11,10 @@ analyzer: strict-inference: true strict-raw-types: true errors: - # allow self-reference to deprecated members (we do this because otherwise we have - # to annotate every member in every test, assert, etc, when we deprecate something) + # allow deprecated members (we do this because otherwise we have to annotate + # every member in every test, assert, etc, when we or the Dart SDK deprecates + # something (https://github.com/flutter/flutter/issues/143312) + deprecated_member_use: ignore deprecated_member_use_from_same_package: ignore exclude: # DIFFERENT FROM FLUTTER/FLUTTER # Ignore generated files From 3c5687cc12c1b3d4e38ed1f30129f70e51fe8a7b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Feb 2024 16:45:12 +0000 Subject: [PATCH 14/40] Bump github/codeql-action from 3.24.0 to 3.24.1 (#6121) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.24.0 to 3.24.1.
Changelog

Sourced from github/codeql-action's changelog.

CodeQL Action Changelog

See the releases page for the relevant changes to the CodeQL CLI and language packs.

Note that the only difference between v2 and v3 of the CodeQL Action is the node version they support, with v3 running on node 20 while we continue to release v2 to support running on node 16. For example 3.22.11 was the first v3 release and is functionally identical to 2.22.11. This approach ensures an easy way to track exactly which features are included in different versions, indicated by the minor and patch version numbers.

[UNRELEASED]

No user facing changes.

3.24.1 - 13 Feb 2024

  • Update default CodeQL bundle version to 2.16.2. #2124
  • The CodeQL action no longer fails if it can't write to the telemetry api endpoint. #2121

3.24.0 - 02 Feb 2024

  • CodeQL Python analysis will no longer install dependencies on GitHub Enterprise Server, as is already the case for GitHub.com. See release notes for 3.23.0 for more details. #2106

3.23.2 - 26 Jan 2024

  • On Linux, the maximum possible value for the --threads option now respects the CPU count as specified in cgroup files to more accurately reflect the number of available cores when running in containers. #2083
  • Update default CodeQL bundle version to 2.16.1. #2096

3.23.1 - 17 Jan 2024

  • Update default CodeQL bundle version to 2.16.0. #2073
  • Change the retention period for uploaded debug artifacts to 7 days. Previously, this was whatever the repository default was. #2079

3.23.0 - 08 Jan 2024

  • We are rolling out a feature in January 2024 that will disable Python dependency installation by default for all users. This improves the speed of analysis while having only a very minor impact on results. You can override this behavior by setting CODEQL_ACTION_DISABLE_PYTHON_DEPENDENCY_INSTALLATION=false in your workflow, however we plan to remove this ability in future versions of the CodeQL Action. #2031
  • The CodeQL Action now requires CodeQL version 2.11.6 or later. For more information, see the corresponding changelog entry for CodeQL Action version 2.22.7. #2009

3.22.12 - 22 Dec 2023

  • Update default CodeQL bundle version to 2.15.5. #2047

3.22.11 - 13 Dec 2023

  • [v3+ only] The CodeQL Action now runs on Node.js v20. #2006

2.22.10 - 12 Dec 2023

  • Update default CodeQL bundle version to 2.15.4. #2016

2.22.9 - 07 Dec 2023

No user facing changes.

... (truncated)

Commits
  • e675ced Merge pull request #2131 from github/update-v3.24.1-c79c360e0
  • 41154da Update changelog for v3.24.1
  • c79c360 Bump the npm group with 3 updates (#2128)
  • 4075abf Merge pull request #2121 from jsoref/status-reports-are-not-critical
  • 5a6da1d Treat status reports as non-critical
  • 43a8916 Merge pull request #2124 from github/update-bundle/codeql-bundle-v2.16.2
  • b0346e4 Merge branch 'main' into update-bundle/codeql-bundle-v2.16.2
  • 3ab1d29 Stop running debug artifacts checks on MacOS (#2123)
  • 9a734da Add changelog note
  • 8fae32e Update default bundle to codeql-bundle-v2.16.2
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github/codeql-action&package-manager=github_actions&previous-version=3.24.0&new-version=3.24.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- .github/workflows/scorecards-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml index 28023c7662a7..22b29f63e70a 100644 --- a/.github/workflows/scorecards-analysis.yml +++ b/.github/workflows/scorecards-analysis.yml @@ -49,6 +49,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@e8893c57a1f3a2b659b6b55564fdfdbbd2982911 # v1.0.26 + uses: github/codeql-action/upload-sarif@e675ced7a7522a761fc9c8eb26682c8b27c42b2b # v1.0.26 with: sarif_file: results.sarif From de9654f06b79ff86c57af9a7e2585ef3561c7fc8 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Wed, 14 Feb 2024 09:33:03 -0800 Subject: [PATCH 15/40] [various] Clean up `deprecated_member_use` ignores (#6123) As of https://github.com/flutter/packages/pull/6111 `deprecated_member_use` is no longer on in the repository, so we no longer need (most; see below) of these annotations. Since we will not be annotating deprecated usage going forward, the associated comments with TODOs have also been removed, for consistency with the new process. This also opportunistically removes `deprecated_member_use_from_same_package` everywhere, since that has been disabled for a long time, so they were cruft. I have ensured that issues are filed for all of these usages, with the new `p: deprecated api` tag, per the new process for tracking deprecated APIs that is now described in the Ecosystem gardener rotation handbook. (In summary: there will be a manual weekly process of checking for new deprecations and filing them, and the [update-stable-in-this-repo process](https://github.com/flutter/flutter/wiki/Updating-Packages-repo-for-a-stable-release) will involve causing anything that is unblocked to be re-triaged.) The only annotations that are left are for cases where we have integration tests testing deprecated APIs in that package, as those are false positives; they are conceptually `deprecated_member_use_from_same_package` and aren't tech debt (or used by clients), but technically are from a different package since integration tests are in the example app. This will prevent them from showing up in the manual weekly check. --- .../test/adaptive_layout_test.dart | 6 ------ .../test/simulated_layout.dart | 3 --- packages/flutter_image/lib/network.dart | 3 --- packages/flutter_image/test/network_test.dart | 6 ------ packages/flutter_markdown/lib/src/_functions_io.dart | 3 +-- .../flutter_markdown/lib/src/_functions_web.dart | 3 +-- packages/flutter_markdown/lib/src/builder.dart | 2 -- .../test/text_scale_factor_test.dart | 7 ++----- packages/flutter_markdown/test/utils.dart | 2 -- packages/flutter_migrate/lib/src/base/common.dart | 1 - packages/flutter_migrate/test/src/common.dart | 12 +++--------- .../test/src/test_flutter_command_runner.dart | 5 +---- packages/go_router_builder/CHANGELOG.md | 4 ++++ packages/go_router_builder/lib/src/route_config.dart | 12 ------------ packages/go_router_builder/lib/src/type_helpers.dart | 3 --- packages/go_router_builder/pubspec.yaml | 2 +- .../test/types/bitmap_test.dart | 1 - .../lib/src/types/picked_file/html.dart | 2 -- .../ios_platform_images/lib/ios_platform_images.dart | 4 ++-- packages/rfw/lib/src/flutter/core_widgets.dart | 2 +- .../url_launcher/test/src/legacy_api_test.dart | 8 ++------ .../url_launcher_platform_interface/lib/link.dart | 3 --- .../test/link_test.dart | 4 +--- packages/web_benchmarks/lib/src/recorder.dart | 3 +-- .../lib/src/android_webview_api_impls.dart | 1 - 25 files changed, 20 insertions(+), 82 deletions(-) diff --git a/packages/flutter_adaptive_scaffold/test/adaptive_layout_test.dart b/packages/flutter_adaptive_scaffold/test/adaptive_layout_test.dart index 5a84f4476e41..add379423f09 100644 --- a/packages/flutter_adaptive_scaffold/test/adaptive_layout_test.dart +++ b/packages/flutter_adaptive_scaffold/test/adaptive_layout_test.dart @@ -14,9 +14,6 @@ void main() { (WidgetTester tester) async { MediaQuery slot(double width) { return MediaQuery( - // TODO(stuartmorgan): Replace with .fromView once this package requires - // Flutter 3.8+. - // ignore: deprecated_member_use data: MediaQueryData.fromWindow(WidgetsBinding.instance.window) .copyWith(size: Size(width, 800)), child: Directionality( @@ -420,9 +417,6 @@ AnimatedWidget leftInOut(Widget child, Animation animation) { MediaQuery slot(double width) { return MediaQuery( - // TODO(stuartmorgan): Replace with .fromView once this package requires - // Flutter 3.8+. - // ignore: deprecated_member_use data: MediaQueryData.fromWindow(WidgetsBinding.instance.window) .copyWith(size: Size(width, 800)), child: Directionality( diff --git a/packages/flutter_adaptive_scaffold/test/simulated_layout.dart b/packages/flutter_adaptive_scaffold/test/simulated_layout.dart index c0de35d904c9..17d84e935a4a 100644 --- a/packages/flutter_adaptive_scaffold/test/simulated_layout.dart +++ b/packages/flutter_adaptive_scaffold/test/simulated_layout.dart @@ -151,9 +151,6 @@ enum SimulatedLayout { MediaQuery get slot { return MediaQuery( - // TODO(stuartmorgan): Replace with .fromView once this package requires - // Flutter 3.8+. - // ignore: deprecated_member_use data: MediaQueryData.fromWindow(WidgetsBinding.instance.window) .copyWith(size: Size(_width, _height)), child: Theme( diff --git a/packages/flutter_image/lib/network.dart b/packages/flutter_image/lib/network.dart index bce44052293d..620435efcdf0 100644 --- a/packages/flutter_image/lib/network.dart +++ b/packages/flutter_image/lib/network.dart @@ -101,9 +101,6 @@ class NetworkImageWithRetry extends ImageProvider { @override ImageStreamCompleter loadBuffer( NetworkImageWithRetry key, - // TODO(LongCatIsLooong): migrate to use new `loadImage` API. - // https://github.com/flutter/flutter/issues/132856 - // ignore: deprecated_member_use DecoderBufferCallback decode, ) { return OneFrameImageStreamCompleter(_loadWithRetry(key, decode), diff --git a/packages/flutter_image/test/network_test.dart b/packages/flutter_image/test/network_test.dart index 6270e5339407..692e6f5c1e23 100644 --- a/packages/flutter_image/test/network_test.dart +++ b/packages/flutter_image/test/network_test.dart @@ -142,9 +142,6 @@ void assertThatImageLoadingFails( ) { final ImageStreamCompleter completer = subject.loadBuffer( subject, - // TODO(LongCatIsLooong): migrate to use new `instantiateImageCodecWithSize` API. - // https://github.com/flutter/flutter/issues/132856 - // ignore: deprecated_member_use PaintingBinding.instance.instantiateImageCodecFromBuffer, ); completer.addListener(ImageStreamListener( @@ -162,9 +159,6 @@ void assertThatImageLoadingSucceeds( ) { final ImageStreamCompleter completer = subject.loadBuffer( subject, - // TODO(LongCatIsLooong): migrate to use new `instantiateImageCodecWithSize` API. - // https://github.com/flutter/flutter/issues/132856 - // ignore: deprecated_member_use PaintingBinding.instance.instantiateImageCodecFromBuffer, ); completer.addListener(ImageStreamListener( diff --git a/packages/flutter_markdown/lib/src/_functions_io.dart b/packages/flutter_markdown/lib/src/_functions_io.dart index cba2fd900b60..81fd5b8f22b6 100644 --- a/packages/flutter_markdown/lib/src/_functions_io.dart +++ b/packages/flutter_markdown/lib/src/_functions_io.dart @@ -64,8 +64,7 @@ final MarkdownStyleSheet Function(BuildContext, MarkdownStyleSheetBaseTheme?) } return result.copyWith( - textScaleFactor: - MediaQuery.textScaleFactorOf(context), // ignore: deprecated_member_use + textScaleFactor: MediaQuery.textScaleFactorOf(context), ); }; diff --git a/packages/flutter_markdown/lib/src/_functions_web.dart b/packages/flutter_markdown/lib/src/_functions_web.dart index e4851ca7f6bf..62692236a21e 100644 --- a/packages/flutter_markdown/lib/src/_functions_web.dart +++ b/packages/flutter_markdown/lib/src/_functions_web.dart @@ -66,8 +66,7 @@ final MarkdownStyleSheet Function(BuildContext, MarkdownStyleSheetBaseTheme?) } return result.copyWith( - textScaleFactor: - MediaQuery.textScaleFactorOf(context), // ignore: deprecated_member_use + textScaleFactor: MediaQuery.textScaleFactorOf(context), ); }; diff --git a/packages/flutter_markdown/lib/src/builder.dart b/packages/flutter_markdown/lib/src/builder.dart index 0c4a6d875e8a..659df8ae6fc7 100644 --- a/packages/flutter_markdown/lib/src/builder.dart +++ b/packages/flutter_markdown/lib/src/builder.dart @@ -867,7 +867,6 @@ class MarkdownBuilder implements md.NodeVisitor { if (selectable) { return SelectableText.rich( text!, - // ignore: deprecated_member_use textScaleFactor: styleSheet.textScaleFactor, textAlign: textAlign ?? TextAlign.start, onTap: onTapText, @@ -876,7 +875,6 @@ class MarkdownBuilder implements md.NodeVisitor { } else { return Text.rich( text!, - // ignore: deprecated_member_use textScaleFactor: styleSheet.textScaleFactor, textAlign: textAlign ?? TextAlign.start, key: k, diff --git a/packages/flutter_markdown/test/text_scale_factor_test.dart b/packages/flutter_markdown/test/text_scale_factor_test.dart index 2f3138a94aef..3710b3e0a62e 100644 --- a/packages/flutter_markdown/test/text_scale_factor_test.dart +++ b/packages/flutter_markdown/test/text_scale_factor_test.dart @@ -25,7 +25,7 @@ void defineTests() { ); final RichText richText = tester.widget(find.byType(RichText)); - expect(richText.textScaleFactor, 2.0); // ignore: deprecated_member_use + expect(richText.textScaleFactor, 2.0); }, ); @@ -36,7 +36,6 @@ void defineTests() { await tester.pumpWidget( boilerplate( const MediaQuery( - // ignore: deprecated_member_use data: MediaQueryData(textScaleFactor: 2.0), child: MarkdownBody( data: data, @@ -46,7 +45,7 @@ void defineTests() { ); final RichText richText = tester.widget(find.byType(RichText)); - expect(richText.textScaleFactor, 2.0); // ignore: deprecated_member_use + expect(richText.textScaleFactor, 2.0); }, ); @@ -57,7 +56,6 @@ void defineTests() { await tester.pumpWidget( boilerplate( const MediaQuery( - // ignore: deprecated_member_use data: MediaQueryData(textScaleFactor: 2.0), child: MarkdownBody( data: data, @@ -69,7 +67,6 @@ void defineTests() { final SelectableText selectableText = tester.widget(find.byType(SelectableText)); - // ignore: deprecated_member_use expect(selectableText.textScaleFactor, 2.0); }, ); diff --git a/packages/flutter_markdown/test/utils.dart b/packages/flutter_markdown/test/utils.dart index 5f6ec962646e..1cd902c30022 100644 --- a/packages/flutter_markdown/test/utils.dart +++ b/packages/flutter_markdown/test/utils.dart @@ -169,8 +169,6 @@ void expectLinkTap(MarkdownLink? actual, MarkdownLink expected) { } String dumpRenderView() { - // TODO(goderbauer): Migrate to rootElement once v3.9.0 is the oldest supported Flutter version. - // ignore: deprecated_member_use return WidgetsBinding.instance.renderViewElement!.toStringDeep().replaceAll( RegExp(r'SliverChildListDelegate#\d+', multiLine: true), 'SliverChildListDelegate', diff --git a/packages/flutter_migrate/lib/src/base/common.dart b/packages/flutter_migrate/lib/src/base/common.dart index 70804f56dd07..a848843fc2e3 100644 --- a/packages/flutter_migrate/lib/src/base/common.dart +++ b/packages/flutter_migrate/lib/src/base/common.dart @@ -150,7 +150,6 @@ Future asyncGuard( // ignore: avoid_catches_without_on_clauses, forwards to Future handleError(e, s); } - // ignore: deprecated_member_use }, onError: (Object e, StackTrace s) { handleError(e, s); }); diff --git a/packages/flutter_migrate/test/src/common.dart b/packages/flutter_migrate/test/src/common.dart index 2bc66ff6a61e..6115d5ea653f 100644 --- a/packages/flutter_migrate/test/src/common.dart +++ b/packages/flutter_migrate/test/src/common.dart @@ -10,18 +10,12 @@ import 'package:flutter_migrate/src/base/file_system.dart'; import 'package:flutter_migrate/src/base/io.dart'; import 'package:meta/meta.dart'; import 'package:path/path.dart' as path; // flutter_ignore: package_path_import -import 'package:test_api/test_api.dart' // ignore: deprecated_member_use - as test_package show test; -import 'package:test_api/test_api.dart' // ignore: deprecated_member_use - hide - test; +import 'package:test_api/test_api.dart' as test_package show test; +import 'package:test_api/test_api.dart' hide test; import 'test_utils.dart'; -export 'package:test_api/test_api.dart' // ignore: deprecated_member_use - hide - isInstanceOf, - test; +export 'package:test_api/test_api.dart' hide isInstanceOf, test; bool tryToDelete(FileSystemEntity fileEntity) { // This should not be necessary, but it turns out that diff --git a/packages/flutter_migrate/test/src/test_flutter_command_runner.dart b/packages/flutter_migrate/test/src/test_flutter_command_runner.dart index f07dccc3319a..7a1a2bd817c2 100644 --- a/packages/flutter_migrate/test/src/test_flutter_command_runner.dart +++ b/packages/flutter_migrate/test/src/test_flutter_command_runner.dart @@ -5,10 +5,7 @@ import 'package:args/command_runner.dart'; import 'package:flutter_migrate/src/base/command.dart'; -export 'package:test_api/test_api.dart' // ignore: deprecated_member_use - hide - isInstanceOf, - test; +export 'package:test_api/test_api.dart' hide isInstanceOf, test; CommandRunner createTestCommandRunner([MigrateCommand? command]) { final CommandRunner runner = TestCommandRunner(); diff --git a/packages/go_router_builder/CHANGELOG.md b/packages/go_router_builder/CHANGELOG.md index 96dbf5a3215a..2bf8adbca223 100644 --- a/packages/go_router_builder/CHANGELOG.md +++ b/packages/go_router_builder/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates dependencies to require `analyzer` 5.2.0 or later. + ## 2.4.1 * Fixes new lint warnings. diff --git a/packages/go_router_builder/lib/src/route_config.dart b/packages/go_router_builder/lib/src/route_config.dart index 1668f5e2740c..cdfdb03e14d1 100644 --- a/packages/go_router_builder/lib/src/route_config.dart +++ b/packages/go_router_builder/lib/src/route_config.dart @@ -447,9 +447,6 @@ abstract class RouteBaseConfig { ) { assert(!reader.isNull, 'reader should not be null'); final InterfaceType type = reader.objectValue.type! as InterfaceType; - // TODO(stuartmorgan): Remove this ignore once 'analyze' can be set to - // 5.2+ (when Flutter 3.4+ is on stable). - // ignore: deprecated_member_use final String typeName = type.element.name; final DartType typeParamType = type.typeArguments.single; if (typeParamType is! InterfaceType) { @@ -461,9 +458,6 @@ abstract class RouteBaseConfig { } // TODO(kevmoo): validate that this MUST be a subtype of `GoRouteData` - // TODO(stuartmorgan): Remove this ignore once 'analyze' can be set to - // 5.2+ (when Flutter 3.4+ is on stable). - // ignore: deprecated_member_use final InterfaceElement classElement = typeParamType.element; final RouteBaseConfig value; @@ -701,16 +695,10 @@ $routeDataClassName.$dataConvertionFunctionName( String _enumMapConst(InterfaceType type) { assert(type.isEnum); - // TODO(stuartmorgan): Remove this ignore once 'analyze' can be set to - // 5.2+ (when Flutter 3.4+ is on stable). - // ignore: deprecated_member_use final String enumName = type.element.name; final StringBuffer buffer = StringBuffer('const ${enumMapName(type)} = {'); - // TODO(stuartmorgan): Remove this ignore once 'analyze' can be set to - // 5.2+ (when Flutter 3.4+ is on stable). - // ignore: deprecated_member_use for (final FieldElement enumField in type.element.fields .where((FieldElement element) => element.isEnumConstant)) { buffer.writeln( diff --git a/packages/go_router_builder/lib/src/type_helpers.dart b/packages/go_router_builder/lib/src/type_helpers.dart index b17e88b2d52e..a22edc8310d0 100644 --- a/packages/go_router_builder/lib/src/type_helpers.dart +++ b/packages/go_router_builder/lib/src/type_helpers.dart @@ -87,9 +87,6 @@ String encodeField(PropertyAccessorElement element) { } /// Gets the name of the `const` map generated to help encode [Enum] types. -// TODO(stuartmorgan): Remove this ignore once 'analyze' can be set to -// 5.2+ (when Flutter 3.4+ is on stable). -// ignore: deprecated_member_use String enumMapName(InterfaceType type) => '_\$${type.element.name}EnumMap'; String _stateValueAccess(ParameterElement element, Set pathParameters) { diff --git a/packages/go_router_builder/pubspec.yaml b/packages/go_router_builder/pubspec.yaml index 83197ba3c691..244c4d9ebe76 100644 --- a/packages/go_router_builder/pubspec.yaml +++ b/packages/go_router_builder/pubspec.yaml @@ -10,7 +10,7 @@ environment: sdk: ">=3.0.0 <4.0.0" dependencies: - analyzer: ">=4.4.0 <7.0.0" + analyzer: ">=5.2.0 <7.0.0" async: ^2.8.0 build: ^2.0.0 build_config: ^1.0.0 diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/types/bitmap_test.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/types/bitmap_test.dart index 94132f66aa55..0d10abd1852c 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/types/bitmap_test.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/types/bitmap_test.dart @@ -17,7 +17,6 @@ void main() { final Object json = descriptor.toJson(); // Rehydrate a new bitmap descriptor... - // ignore: deprecated_member_use_from_same_package final BitmapDescriptor descriptorFromJson = BitmapDescriptor.fromJson(json); diff --git a/packages/image_picker/image_picker_platform_interface/lib/src/types/picked_file/html.dart b/packages/image_picker/image_picker_platform_interface/lib/src/types/picked_file/html.dart index 58dcb6ccda46..7d9761a57602 100644 --- a/packages/image_picker/image_picker_platform_interface/lib/src/types/picked_file/html.dart +++ b/packages/image_picker/image_picker_platform_interface/lib/src/types/picked_file/html.dart @@ -27,8 +27,6 @@ class PickedFile extends PickedFileBase { Future get _bytes async { if (_initBytes != null) { - // TODO(stuartmorgan): Remove this directive, https://github.com/flutter/flutter/issues/143113 - // ignore: deprecated_member_use return Future.value(UnmodifiableUint8ListView(_initBytes!)); } return http.readBytes(Uri.parse(path)); diff --git a/packages/ios_platform_images/lib/ios_platform_images.dart b/packages/ios_platform_images/lib/ios_platform_images.dart index 70894f82c8d4..1ff0c784296f 100644 --- a/packages/ios_platform_images/lib/ios_platform_images.dart +++ b/packages/ios_platform_images/lib/ios_platform_images.dart @@ -71,7 +71,7 @@ class _FutureMemoryImage extends ImageProvider<_FutureMemoryImage> { @override ImageStreamCompleter loadBuffer( _FutureMemoryImage key, - DecoderBufferCallback decode, // ignore: deprecated_member_use + DecoderBufferCallback decode, ) { return _FutureImageStreamCompleter( codec: _loadAsync(key, decode), @@ -81,7 +81,7 @@ class _FutureMemoryImage extends ImageProvider<_FutureMemoryImage> { Future _loadAsync( _FutureMemoryImage key, - DecoderBufferCallback decode, // ignore: deprecated_member_use + DecoderBufferCallback decode, ) { assert(key == this); return _futureBytes.then(ui.ImmutableBuffer.fromUint8List).then(decode); diff --git a/packages/rfw/lib/src/flutter/core_widgets.dart b/packages/rfw/lib/src/flutter/core_widgets.dart index 559d908b6ace..d1419d85fb55 100644 --- a/packages/rfw/lib/src/flutter/core_widgets.dart +++ b/packages/rfw/lib/src/flutter/core_widgets.dart @@ -658,7 +658,7 @@ Map get _coreWidgetsDefinitions => (['softWrap']), overflow: ArgumentDecoders.enumValue(TextOverflow.values, source, ['overflow']), - textScaleFactor: source.v(['textScaleFactor']), // ignore: deprecated_member_use + textScaleFactor: source.v(['textScaleFactor']), maxLines: source.v(['maxLines']), semanticsLabel: source.v(['semanticsLabel']), textWidthBasis: ArgumentDecoders.enumValue(TextWidthBasis.values, source, ['textWidthBasis']), diff --git a/packages/url_launcher/url_launcher/test/src/legacy_api_test.dart b/packages/url_launcher/url_launcher/test/src/legacy_api_test.dart index 14f0b57828e4..8a694546397c 100644 --- a/packages/url_launcher/url_launcher/test/src/legacy_api_test.dart +++ b/packages/url_launcher/url_launcher/test/src/legacy_api_test.dart @@ -238,9 +238,7 @@ void main() { _anonymize(TestWidgetsFlutterBinding.ensureInitialized())! as TestWidgetsFlutterBinding; debugDefaultTargetPlatformOverride = TargetPlatform.iOS; - // TODO(goderbauer): Migrate to binding.renderViews when that is available in the oldest supported stable. - final RenderView renderView = - binding.renderView; // ignore: deprecated_member_use + final RenderView renderView = binding.renderView; renderView.automaticSystemUiAdjustment = true; final Future launchResult = launch('http://flutter.dev/', statusBarBrightness: Brightness.dark); @@ -270,9 +268,7 @@ void main() { _anonymize(TestWidgetsFlutterBinding.ensureInitialized())! as TestWidgetsFlutterBinding; debugDefaultTargetPlatformOverride = TargetPlatform.android; - // TODO(goderbauer): Migrate to binding.renderViews when that is available in the oldest supported stable. - final RenderView renderView = - binding.renderView; // ignore: deprecated_member_use + final RenderView renderView = binding.renderView; expect(renderView.automaticSystemUiAdjustment, true); final Future launchResult = launch('http://flutter.dev/', statusBarBrightness: Brightness.dark); diff --git a/packages/url_launcher/url_launcher_platform_interface/lib/link.dart b/packages/url_launcher/url_launcher_platform_interface/lib/link.dart index a5310804ad05..10fe2dd630c0 100644 --- a/packages/url_launcher/url_launcher_platform_interface/lib/link.dart +++ b/packages/url_launcher/url_launcher_platform_interface/lib/link.dart @@ -86,9 +86,6 @@ abstract class LinkInfo { // TODO(ianh): Remove the first argument. Future pushRouteNameToFramework(Object? _, String routeName) { final Completer completer = Completer(); - // TODO(chunhtai): remove this ignore and migrate the code - // https://github.com/flutter/flutter/issues/124045. - // ignore: deprecated_member_use SystemNavigator.routeInformationUpdated(location: routeName); ui.channelBuffers.push( 'flutter/navigation', diff --git a/packages/url_launcher/url_launcher_platform_interface/test/link_test.dart b/packages/url_launcher/url_launcher_platform_interface/test/link_test.dart index ac5c48f6fc18..6c613c1561d2 100644 --- a/packages/url_launcher/url_launcher_platform_interface/test/link_test.dart +++ b/packages/url_launcher/url_launcher_platform_interface/test/link_test.dart @@ -83,9 +83,7 @@ class _RouteDelegate extends RouterDelegate if (_history.isEmpty) { return const Placeholder(key: Key('empty')); } - // TODO(chunhtai): remove this ignore and migrate the code - // https://github.com/flutter/flutter/issues/124045. - // ignore: unnecessary_string_interpolations, deprecated_member_use + // ignore: unnecessary_string_interpolations return Placeholder(key: Key('${_history.last.location}')); } } diff --git a/packages/web_benchmarks/lib/src/recorder.dart b/packages/web_benchmarks/lib/src/recorder.dart index c4b5ca8e3b55..49707b8c4b63 100644 --- a/packages/web_benchmarks/lib/src/recorder.dart +++ b/packages/web_benchmarks/lib/src/recorder.dart @@ -255,8 +255,7 @@ abstract class SceneBuilderRecorder extends Recorder { _profile.record('sceneBuildDuration', () { final Scene scene = sceneBuilder.build(); _profile.record('windowRenderDuration', () { - // TODO(goderbauer): Migrate to PlatformDispatcher.implicitView once v3.9.0 is the oldest supported Flutter version. - window.render(scene); // ignore: deprecated_member_use + window.render(scene); }, reported: false); }, reported: false); }, reported: true); diff --git a/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_api_impls.dart b/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_api_impls.dart index 854ed61bd8fc..f157c01a7424 100644 --- a/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_api_impls.dart +++ b/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_api_impls.dart @@ -720,7 +720,6 @@ class WebViewClientFlutterApiImpl extends WebViewClientFlutterApi { webViewInstance != null, 'InstanceManager does not contain a WebView with instanceId: $webViewInstanceId', ); - // ignore: deprecated_member_use_from_same_package if (instance!.onReceivedError != null) { instance.onReceivedError!( webViewInstance!, From cbb676a2b2d631a53ff96768d915bc5736b416d5 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Wed, 14 Feb 2024 10:11:23 -0800 Subject: [PATCH 16/40] [tools] Ignore analysis options files in .symlinks (#6119) When running `analyze` in a local tree that has done builds, there can be false positives of the "unexpected analysis options" check due to the .symlinks directory making other packages' analysis options show up in the check. This avoids following links to prevent those false positives. --- script/tool/lib/src/analyze_command.dart | 2 +- script/tool/test/analyze_command_test.dart | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/script/tool/lib/src/analyze_command.dart b/script/tool/lib/src/analyze_command.dart index 15a8ef2e125b..2f7d28217ab6 100644 --- a/script/tool/lib/src/analyze_command.dart +++ b/script/tool/lib/src/analyze_command.dart @@ -66,7 +66,7 @@ class AnalyzeCommand extends PackageLoopingCommand { /// Checks that there are no unexpected analysis_options.yaml files. bool _hasUnexpecetdAnalysisOptions(RepositoryPackage package) { final List files = - package.directory.listSync(recursive: true); + package.directory.listSync(recursive: true, followLinks: false); for (final FileSystemEntity file in files) { if (file.basename != 'analysis_options.yaml' && file.basename != '.analysis_options') { diff --git a/script/tool/test/analyze_command_test.dart b/script/tool/test/analyze_command_test.dart index 15da8db22cfb..27e92dd5e00d 100644 --- a/script/tool/test/analyze_command_test.dart +++ b/script/tool/test/analyze_command_test.dart @@ -273,6 +273,23 @@ void main() { ])); }); + test('ignores analysis options in the plugin .symlinks directory', + () async { + final RepositoryPackage plugin = createFakePlugin('foo', packagesDir, + extraFiles: ['analysis_options.yaml']); + final RepositoryPackage includingPackage = + createFakePlugin('bar', packagesDir); + // Simulate the local state of having built 'bar' if it includes 'foo'. + includingPackage.directory + .childDirectory('example') + .childDirectory('ios') + .childLink('.symlinks') + .createSync(plugin.directory.path, recursive: true); + + await runCapturingPrint( + runner, ['analyze', '--custom-analysis', 'foo']); + }); + test('takes an allow config file', () async { final RepositoryPackage plugin = createFakePlugin('foo', packagesDir, extraFiles: ['analysis_options.yaml']); From b87b3ba6105eecffc7c13e4ed9a49650a4ecd99e Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Wed, 14 Feb 2024 10:23:51 -0800 Subject: [PATCH 17/40] [flutter_image] Replace deprecated APIs (#6126) Now that it's available on every supported version, switch to `loadImage` instead of the deprecated `loadBuffer`. Fixes https://github.com/flutter/flutter/issues/132856 --- packages/flutter_image/CHANGELOG.md | 4 ++++ packages/flutter_image/lib/network.dart | 4 ++-- packages/flutter_image/pubspec.yaml | 2 +- packages/flutter_image/test/network_test.dart | 8 ++++---- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/packages/flutter_image/CHANGELOG.md b/packages/flutter_image/CHANGELOG.md index 987e7a5bb29f..7e83f85aa595 100644 --- a/packages/flutter_image/CHANGELOG.md +++ b/packages/flutter_image/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.1.11 + +* Replaces deprecated loadBuffer API usage. + ## 4.1.10 * Fixes image asset link to use image within package. diff --git a/packages/flutter_image/lib/network.dart b/packages/flutter_image/lib/network.dart index 620435efcdf0..8b1031cbdb71 100644 --- a/packages/flutter_image/lib/network.dart +++ b/packages/flutter_image/lib/network.dart @@ -99,9 +99,9 @@ class NetworkImageWithRetry extends ImageProvider { } @override - ImageStreamCompleter loadBuffer( + ImageStreamCompleter loadImage( NetworkImageWithRetry key, - DecoderBufferCallback decode, + ImageDecoderCallback decode, ) { return OneFrameImageStreamCompleter(_loadWithRetry(key, decode), informationCollector: () sync* { diff --git a/packages/flutter_image/pubspec.yaml b/packages/flutter_image/pubspec.yaml index 483576343d1d..99c0eb78f51a 100644 --- a/packages/flutter_image/pubspec.yaml +++ b/packages/flutter_image/pubspec.yaml @@ -3,7 +3,7 @@ description: > Image utilities for Flutter: improved network providers, effects, etc. repository: https://github.com/flutter/packages/tree/main/packages/flutter_image issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+flutter_image%22 -version: 4.1.10 +version: 4.1.11 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/flutter_image/test/network_test.dart b/packages/flutter_image/test/network_test.dart index 692e6f5c1e23..6d2a99b0cd1e 100644 --- a/packages/flutter_image/test/network_test.dart +++ b/packages/flutter_image/test/network_test.dart @@ -140,9 +140,9 @@ void assertThatImageLoadingFails( NetworkImageWithRetry subject, List errorLog, ) { - final ImageStreamCompleter completer = subject.loadBuffer( + final ImageStreamCompleter completer = subject.loadImage( subject, - PaintingBinding.instance.instantiateImageCodecFromBuffer, + PaintingBinding.instance.instantiateImageCodecWithSize, ); completer.addListener(ImageStreamListener( (ImageInfo image, bool synchronousCall) {}, @@ -157,9 +157,9 @@ void assertThatImageLoadingFails( void assertThatImageLoadingSucceeds( NetworkImageWithRetry subject, ) { - final ImageStreamCompleter completer = subject.loadBuffer( + final ImageStreamCompleter completer = subject.loadImage( subject, - PaintingBinding.instance.instantiateImageCodecFromBuffer, + PaintingBinding.instance.instantiateImageCodecWithSize, ); completer.addListener(ImageStreamListener( expectAsync2((ImageInfo image, bool synchronousCall) { From db96f93c3e16b17d6c847b452d577d0d64e627a6 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Wed, 14 Feb 2024 11:04:15 -0800 Subject: [PATCH 18/40] [flutter_migrate] Replace deprecated APIs (#6128) Updates package for `test_api` deprecation and deprecation of `runZoned`s `onError` parameter. Fixes https://github.com/flutter/flutter/issues/143447 Fixes https://github.com/flutter/flutter/issues/143455 --- packages/flutter_migrate/lib/src/base/common.dart | 4 ++-- packages/flutter_migrate/pubspec.yaml | 1 - packages/flutter_migrate/test/src/common.dart | 6 +++--- .../test/src/test_flutter_command_runner.dart | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/flutter_migrate/lib/src/base/common.dart b/packages/flutter_migrate/lib/src/base/common.dart index a848843fc2e3..6612e3a30ee0 100644 --- a/packages/flutter_migrate/lib/src/base/common.dart +++ b/packages/flutter_migrate/lib/src/base/common.dart @@ -138,7 +138,7 @@ Future asyncGuard( } } - runZoned(() async { + runZonedGuarded(() async { try { final T result = await fn(); if (!completer.isCompleted) { @@ -150,7 +150,7 @@ Future asyncGuard( // ignore: avoid_catches_without_on_clauses, forwards to Future handleError(e, s); } - }, onError: (Object e, StackTrace s) { + }, (Object e, StackTrace s) { handleError(e, s); }); diff --git a/packages/flutter_migrate/pubspec.yaml b/packages/flutter_migrate/pubspec.yaml index e46995af2705..222b6bdd8629 100644 --- a/packages/flutter_migrate/pubspec.yaml +++ b/packages/flutter_migrate/pubspec.yaml @@ -24,4 +24,3 @@ dev_dependencies: file_testing: 3.0.0 lints: ^2.0.0 test: ^1.16.0 - test_api: ^0.4.13 diff --git a/packages/flutter_migrate/test/src/common.dart b/packages/flutter_migrate/test/src/common.dart index 6115d5ea653f..a354020d47a3 100644 --- a/packages/flutter_migrate/test/src/common.dart +++ b/packages/flutter_migrate/test/src/common.dart @@ -10,12 +10,12 @@ import 'package:flutter_migrate/src/base/file_system.dart'; import 'package:flutter_migrate/src/base/io.dart'; import 'package:meta/meta.dart'; import 'package:path/path.dart' as path; // flutter_ignore: package_path_import -import 'package:test_api/test_api.dart' as test_package show test; -import 'package:test_api/test_api.dart' hide test; +import 'package:test/test.dart' as test_package show test; +import 'package:test/test.dart' hide test; import 'test_utils.dart'; -export 'package:test_api/test_api.dart' hide isInstanceOf, test; +export 'package:test/test.dart' hide isInstanceOf, test; bool tryToDelete(FileSystemEntity fileEntity) { // This should not be necessary, but it turns out that diff --git a/packages/flutter_migrate/test/src/test_flutter_command_runner.dart b/packages/flutter_migrate/test/src/test_flutter_command_runner.dart index 7a1a2bd817c2..9f4731dada09 100644 --- a/packages/flutter_migrate/test/src/test_flutter_command_runner.dart +++ b/packages/flutter_migrate/test/src/test_flutter_command_runner.dart @@ -5,7 +5,7 @@ import 'package:args/command_runner.dart'; import 'package:flutter_migrate/src/base/command.dart'; -export 'package:test_api/test_api.dart' hide isInstanceOf, test; +export 'package:test/test.dart' hide isInstanceOf, test; CommandRunner createTestCommandRunner([MigrateCommand? command]) { final CommandRunner runner = TestCommandRunner(); From 84a8e0a2d3b1395f74b8d7c1c4e7502104835043 Mon Sep 17 00:00:00 2001 From: engine-flutter-autoroll Date: Wed, 14 Feb 2024 14:12:21 -0500 Subject: [PATCH 19/40] Roll Flutter from eb5d0a434ef1 to a628814ebd25 (72 revisions) (#6118) Roll Flutter from eb5d0a434ef1 to a628814ebd25 (72 revisions) https://github.com/flutter/flutter/compare/eb5d0a434ef1...a628814ebd25 2024-02-13 matanlurey@users.noreply.github.com Allow deprecated members from the Dart SDK and Flutter Engine to roll in (flutter/flutter#143347) 2024-02-13 34871572+gmackall@users.noreply.github.com [Re-re-land] Enforce a policy on supported Gradle, Java, AGP, and KGP versions (flutter/flutter#143341) 2024-02-13 engine-flutter-autoroll@skia.org Roll Packages from 0a692590a885 to 9385bbb3cf46 (7 revisions) (flutter/flutter#143366) 2024-02-13 tessertaha@gmail.com Fix `InputDecorator`s `suffix` and `prefix` widgets are tappable when hidden (flutter/flutter#143308) 2024-02-13 pateltirth454@gmail.com Pass-Through `inputFormatters` in `DropdownMenu` (flutter/flutter#143250) 2024-02-13 tessertaha@gmail.com Fix `insetPadding` parameter nullability for dialogs (flutter/flutter#143305) 2024-02-12 43054281+camsim99@users.noreply.github.com Revert "Migrate integration_test plugin to Gradle Kotlin DSL (#142008)" (flutter/flutter#143329) 2024-02-12 rossllewallyn@proton.me Badge class doc typo - missing [ (flutter/flutter#143318) 2024-02-12 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Roll Flutter Engine from 1c3ecee77350 to a19077503a0c (8 revisions) (#143322)" (flutter/flutter#143338) 2024-02-12 engine-flutter-autoroll@skia.org Roll Flutter Engine from 1c3ecee77350 to a19077503a0c (8 revisions) (flutter/flutter#143322) 2024-02-12 kevmoo@users.noreply.github.com [web] Move JS interop to extension types (flutter/flutter#143274) 2024-02-12 32538273+ValentinVignal@users.noreply.github.com Add documentation for best practices for `StreamBuilder` like `FutureBuilder` (flutter/flutter#143295) 2024-02-12 engine-flutter-autoroll@skia.org Roll Flutter Engine from 8806987182a3 to 1c3ecee77350 (1 revision) (flutter/flutter#143315) 2024-02-12 nitesh.sharma@joshtechnologygroup.com Fix dual focus issue in CheckboxListTile, RadioListTile and SwitchListTile (flutter/flutter#143213) 2024-02-12 reidbaker@google.com Revert "[Re-land] Enforce a policy on supported Gradle, Java, AGP, and KGP versions" (flutter/flutter#143314) 2024-02-12 magder@google.com Update integration_test iOS FTL README script to remove targeted version (flutter/flutter#143248) 2024-02-12 scheglov@google.com Remove unnecessary 'debugLabel: null'. (flutter/flutter#143253) 2024-02-12 pateltirth454@gmail.com Introduce `iconAlignment` for the buttons with icon (flutter/flutter#137348) 2024-02-12 engine-flutter-autoroll@skia.org Roll Packages from 11152d2bc8f3 to 0a692590a885 (4 revisions) (flutter/flutter#143306) 2024-02-12 engine-flutter-autoroll@skia.org Roll Flutter Engine from 4f119619dfa8 to 8806987182a3 (1 revision) (flutter/flutter#143304) 2024-02-12 engine-flutter-autoroll@skia.org Roll Flutter Engine from b0753c0e25f8 to 4f119619dfa8 (1 revision) (flutter/flutter#143291) 2024-02-11 engine-flutter-autoroll@skia.org Roll Flutter Engine from 936495d94cc6 to b0753c0e25f8 (1 revision) (flutter/flutter#143282) 2024-02-11 engine-flutter-autoroll@skia.org Roll Flutter Engine from b06b3e0d75ad to 936495d94cc6 (1 revision) (flutter/flutter#143280) 2024-02-11 engine-flutter-autoroll@skia.org Roll Flutter Engine from 1478f4e75dd9 to b06b3e0d75ad (1 revision) (flutter/flutter#143275) 2024-02-10 31859944+LongCatIsLooong@users.noreply.github.com Fix text painter longest line resizing logic for `TextWidthBasis.longestLine` (flutter/flutter#143024) 2024-02-10 engine-flutter-autoroll@skia.org Roll Flutter Engine from e6ceb3504f50 to 1478f4e75dd9 (1 revision) (flutter/flutter#143273) 2024-02-10 zanderso@users.noreply.github.com Move Windows arm64 tests to bringup true (flutter/flutter#143272) 2024-02-10 engine-flutter-autoroll@skia.org Roll Flutter Engine from 3c5149ccde38 to e6ceb3504f50 (1 revision) (flutter/flutter#143267) 2024-02-10 engine-flutter-autoroll@skia.org Roll Flutter Engine from c587bd69985f to 3c5149ccde38 (2 revisions) (flutter/flutter#143266) 2024-02-10 engine-flutter-autoroll@skia.org Roll Flutter Engine from e08b6c899c42 to c587bd69985f (1 revision) (flutter/flutter#143265) 2024-02-10 engine-flutter-autoroll@skia.org Roll Flutter Engine from 1b8f23bbd099 to e08b6c899c42 (2 revisions) (flutter/flutter#143264) 2024-02-10 engine-flutter-autoroll@skia.org Roll Flutter Engine from 41daa5b913b9 to 1b8f23bbd099 (2 revisions) (flutter/flutter#143261) 2024-02-10 engine-flutter-autoroll@skia.org Roll Flutter Engine from f969c52f133a to 41daa5b913b9 (1 revision) (flutter/flutter#143258) 2024-02-10 engine-flutter-autoroll@skia.org Roll Flutter Engine from 6a3b0216ff5b to f969c52f133a (3 revisions) (flutter/flutter#143256) 2024-02-09 engine-flutter-autoroll@skia.org Roll Flutter Engine from 8c521eb24171 to 6a3b0216ff5b (4 revisions) (flutter/flutter#143251) 2024-02-09 polinach@google.com Upgrade leak_tracker. (flutter/flutter#143236) 2024-02-09 kris.pypen@gmail.com Fix: performance improvement on golden test comparison (flutter/flutter#142913) 2024-02-09 nathan.wilson1232@gmail.com Implementing `switch` expressions in `lib/src/material/` (flutter/flutter#142793) 2024-02-09 73116038+whiskeyPeak@users.noreply.github.com Add position data to `OnDragEnd` callback (flutter/flutter#140378) 2024-02-09 engine-flutter-autoroll@skia.org Roll Flutter Engine from 1232d598f7c4 to 8c521eb24171 (2 revisions) (flutter/flutter#143237) 2024-02-09 engine-flutter-autoroll@skia.org Roll Flutter Engine from 7a5390c6b3bd to 1232d598f7c4 (1 revision) (flutter/flutter#143235) 2024-02-09 magder@google.com Set plugin template minimum iOS version to 12.0 (flutter/flutter#143167) 2024-02-09 engine-flutter-autoroll@skia.org Roll Flutter Engine from 7a241130fcf8 to 7a5390c6b3bd (1 revision) (flutter/flutter#143231) 2024-02-09 barpac02@gmail.com Migrate integration_test plugin to Gradle Kotlin DSL (flutter/flutter#142008) 2024-02-09 engine-flutter-autoroll@skia.org Roll Flutter Engine from dcac9863a1fc to 7a241130fcf8 (1 revision) (flutter/flutter#143222) 2024-02-09 engine-flutter-autoroll@skia.org Roll Flutter Engine from 1508b11bf791 to dcac9863a1fc (1 revision) (flutter/flutter#143220) ... --- .ci/flutter_master.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/flutter_master.version b/.ci/flutter_master.version index 25ad3f63e2e1..51af7aebf640 100644 --- a/.ci/flutter_master.version +++ b/.ci/flutter_master.version @@ -1 +1 @@ -eb5d0a434ef13d34b532aa8c53a7be64b88963c2 +a628814ebd25bb7617aae636031ca880b9e25a57 From b4bd165079939a76e6f914b636e7710c443fff57 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Wed, 14 Feb 2024 17:05:49 -0800 Subject: [PATCH 20/40] [flutter_adaptive_scaffold] Replace deprecated APIs (#6129) Replaces the use of deprecated `MediaQueryData.fromWindow` and `window` in tests. Fixes https://github.com/flutter/flutter/issues/143397 Part of https://github.com/flutter/flutter/issues/143399 --- .../test/adaptive_layout_test.dart | 23 +++++++++---------- .../test/breakpoint_test.dart | 12 +++++----- .../test/simulated_layout.dart | 5 ++-- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/packages/flutter_adaptive_scaffold/test/adaptive_layout_test.dart b/packages/flutter_adaptive_scaffold/test/adaptive_layout_test.dart index add379423f09..5924f0a8a749 100644 --- a/packages/flutter_adaptive_scaffold/test/adaptive_layout_test.dart +++ b/packages/flutter_adaptive_scaffold/test/adaptive_layout_test.dart @@ -14,7 +14,7 @@ void main() { (WidgetTester tester) async { MediaQuery slot(double width) { return MediaQuery( - data: MediaQueryData.fromWindow(WidgetsBinding.instance.window) + data: MediaQueryData.fromView(tester.view) .copyWith(size: Size(width, 800)), child: Directionality( textDirection: TextDirection.ltr, @@ -120,11 +120,11 @@ void main() { testWidgets( 'slot layout properly switches between items with the appropriate animation', (WidgetTester tester) async { - await tester.pumpWidget(slot(300)); + await tester.pumpWidget(slot(300, tester)); expect(begin, findsOneWidget); expect(end, findsNothing); - await tester.pumpWidget(slot(500)); + await tester.pumpWidget(slot(500, tester)); await tester.pump(); await tester.pump(const Duration(milliseconds: 500)); expect(tester.widget(slideOut('0')).position.value, @@ -146,7 +146,7 @@ void main() { testWidgets('AnimatedSwitcher does not spawn duplicate keys on rapid resize', (WidgetTester tester) async { // Populate the smaller slot layout and let the animation settle. - await tester.pumpWidget(slot(300)); + await tester.pumpWidget(slot(300, tester)); await tester.pumpAndSettle(); expect(begin, findsOneWidget); expect(end, findsNothing); @@ -157,12 +157,12 @@ void main() { for (int i = 0; i < 2; i++) { // Resize between the two slot layouts, but do not pump the animation // until completion. - await tester.pumpWidget(slot(500)); + await tester.pumpWidget(slot(500, tester)); await tester.pump(const Duration(milliseconds: 100)); expect(begin, findsOneWidget); expect(end, findsOneWidget); - await tester.pumpWidget(slot(300)); + await tester.pumpWidget(slot(300, tester)); await tester.pump(const Duration(milliseconds: 100)); expect(begin, findsOneWidget); expect(end, findsOneWidget); @@ -171,18 +171,18 @@ void main() { testWidgets('slot layout can tolerate rapid changes in breakpoints', (WidgetTester tester) async { - await tester.pumpWidget(slot(300)); + await tester.pumpWidget(slot(300, tester)); expect(begin, findsOneWidget); expect(end, findsNothing); - await tester.pumpWidget(slot(500)); + await tester.pumpWidget(slot(500, tester)); await tester.pump(); await tester.pump(const Duration(milliseconds: 100)); expect(tester.widget(slideOut('0')).position.value, offsetMoreOrLessEquals(const Offset(-0.1, 0), epsilon: 0.05)); expect(tester.widget(slideIn('400')).position.value, offsetMoreOrLessEquals(const Offset(-0.9, 0), epsilon: 0.05)); - await tester.pumpWidget(slot(300)); + await tester.pumpWidget(slot(300, tester)); await tester.pumpAndSettle(); expect(begin, findsOneWidget); expect(end, findsNothing); @@ -415,10 +415,9 @@ AnimatedWidget leftInOut(Widget child, Animation animation) { ); } -MediaQuery slot(double width) { +MediaQuery slot(double width, WidgetTester tester) { return MediaQuery( - data: MediaQueryData.fromWindow(WidgetsBinding.instance.window) - .copyWith(size: Size(width, 800)), + data: MediaQueryData.fromView(tester.view).copyWith(size: Size(width, 800)), child: Directionality( textDirection: TextDirection.ltr, child: SlotLayout( diff --git a/packages/flutter_adaptive_scaffold/test/breakpoint_test.dart b/packages/flutter_adaptive_scaffold/test/breakpoint_test.dart index 9eada7dc9f21..6ecb20a27018 100644 --- a/packages/flutter_adaptive_scaffold/test/breakpoint_test.dart +++ b/packages/flutter_adaptive_scaffold/test/breakpoint_test.dart @@ -12,19 +12,19 @@ void main() { (WidgetTester tester) async { // Pump a small layout on a mobile device. The small slot // should give the mobile slot layout, not the desktop layout. - await tester.pumpWidget(SimulatedLayout.small.slot); + await tester.pumpWidget(SimulatedLayout.small.slot(tester)); await tester.pumpAndSettle(); expect(find.byKey(const Key('Breakpoints.smallMobile')), findsOneWidget); expect(find.byKey(const Key('Breakpoints.smallDesktop')), findsNothing); // Do the same with a medium layout on a mobile - await tester.pumpWidget(SimulatedLayout.medium.slot); + await tester.pumpWidget(SimulatedLayout.medium.slot(tester)); await tester.pumpAndSettle(); expect(find.byKey(const Key('Breakpoints.mediumMobile')), findsOneWidget); expect(find.byKey(const Key('Breakpoints.mediumDesktop')), findsNothing); // Large layout on mobile - await tester.pumpWidget(SimulatedLayout.large.slot); + await tester.pumpWidget(SimulatedLayout.large.slot(tester)); await tester.pumpAndSettle(); expect(find.byKey(const Key('Breakpoints.largeMobile')), findsOneWidget); expect(find.byKey(const Key('Breakpoints.largeDesktop')), findsNothing); @@ -34,19 +34,19 @@ void main() { (WidgetTester tester) async { // Pump a small layout on a desktop device. The small slot // should give the mobile slot layout, not the desktop layout. - await tester.pumpWidget(SimulatedLayout.small.slot); + await tester.pumpWidget(SimulatedLayout.small.slot(tester)); await tester.pumpAndSettle(); expect(find.byKey(const Key('Breakpoints.smallDesktop')), findsOneWidget); expect(find.byKey(const Key('Breakpoints.smallMobile')), findsNothing); // Do the same with a medium layout on a desktop - await tester.pumpWidget(SimulatedLayout.medium.slot); + await tester.pumpWidget(SimulatedLayout.medium.slot(tester)); await tester.pumpAndSettle(); expect(find.byKey(const Key('Breakpoints.mediumDesktop')), findsOneWidget); expect(find.byKey(const Key('Breakpoints.mediumMobile')), findsNothing); // Large layout on desktop - await tester.pumpWidget(SimulatedLayout.large.slot); + await tester.pumpWidget(SimulatedLayout.large.slot(tester)); await tester.pumpAndSettle(); expect(find.byKey(const Key('Breakpoints.largeDesktop')), findsOneWidget); expect(find.byKey(const Key('Breakpoints.largeMobile')), findsNothing); diff --git a/packages/flutter_adaptive_scaffold/test/simulated_layout.dart b/packages/flutter_adaptive_scaffold/test/simulated_layout.dart index 17d84e935a4a..706883d997db 100644 --- a/packages/flutter_adaptive_scaffold/test/simulated_layout.dart +++ b/packages/flutter_adaptive_scaffold/test/simulated_layout.dart @@ -4,6 +4,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_adaptive_scaffold/flutter_adaptive_scaffold.dart'; +import 'package:flutter_test/flutter_test.dart'; import 'test_breakpoints.dart'; @@ -149,9 +150,9 @@ enum SimulatedLayout { ); } - MediaQuery get slot { + MediaQuery slot(WidgetTester tester) { return MediaQuery( - data: MediaQueryData.fromWindow(WidgetsBinding.instance.window) + data: MediaQueryData.fromView(tester.view) .copyWith(size: Size(_width, _height)), child: Theme( data: ThemeData(), From 4035b62c086fd427ecfee05100dd97b7f76419ca Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Wed, 14 Feb 2024 17:05:51 -0800 Subject: [PATCH 21/40] [rfw] Replace deprecated `textScaleFactor` (#6130) Replaces the deprecated `textScaleFactor` with a linear `TextScaler`. Updates the minimum deployment version to 3.16 where the new API was added. Part of https://github.com/flutter/flutter/issues/143400 --- packages/rfw/CHANGELOG.md | 4 ++++ packages/rfw/example/hello/pubspec.yaml | 4 ++-- packages/rfw/example/local/pubspec.yaml | 4 ++-- packages/rfw/example/remote/pubspec.yaml | 4 ++-- packages/rfw/example/wasm/pubspec.yaml | 4 ++-- packages/rfw/lib/src/flutter/core_widgets.dart | 3 ++- packages/rfw/pubspec.yaml | 6 +++--- packages/rfw/test_coverage/pubspec.yaml | 2 +- 8 files changed, 18 insertions(+), 13 deletions(-) diff --git a/packages/rfw/CHANGELOG.md b/packages/rfw/CHANGELOG.md index 50ac27185949..8db008e12bee 100644 --- a/packages/rfw/CHANGELOG.md +++ b/packages/rfw/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.23 + +* Replaces usage of deprecated Flutter APIs. + ## 1.0.22 * Adds more testing to restore coverage to 100%. diff --git a/packages/rfw/example/hello/pubspec.yaml b/packages/rfw/example/hello/pubspec.yaml index 11158ccc2ced..8ee7d4e425ed 100644 --- a/packages/rfw/example/hello/pubspec.yaml +++ b/packages/rfw/example/hello/pubspec.yaml @@ -4,8 +4,8 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.2.0 + flutter: ">=3.16.0" dependencies: flutter: diff --git a/packages/rfw/example/local/pubspec.yaml b/packages/rfw/example/local/pubspec.yaml index fba0b95d798d..3c2e0d455fe0 100644 --- a/packages/rfw/example/local/pubspec.yaml +++ b/packages/rfw/example/local/pubspec.yaml @@ -4,8 +4,8 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.2.0 + flutter: ">=3.16.0" dependencies: flutter: diff --git a/packages/rfw/example/remote/pubspec.yaml b/packages/rfw/example/remote/pubspec.yaml index a801d881cc82..7da73e4d4a52 100644 --- a/packages/rfw/example/remote/pubspec.yaml +++ b/packages/rfw/example/remote/pubspec.yaml @@ -4,8 +4,8 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.2.0 + flutter: ">=3.16.0" dependencies: flutter: diff --git a/packages/rfw/example/wasm/pubspec.yaml b/packages/rfw/example/wasm/pubspec.yaml index a6d37e387d0a..07a4c0a4b3ec 100644 --- a/packages/rfw/example/wasm/pubspec.yaml +++ b/packages/rfw/example/wasm/pubspec.yaml @@ -4,8 +4,8 @@ publish_to: none # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.2.0 + flutter: ">=3.16.0" dependencies: flutter: diff --git a/packages/rfw/lib/src/flutter/core_widgets.dart b/packages/rfw/lib/src/flutter/core_widgets.dart index d1419d85fb55..379edfe5aa6c 100644 --- a/packages/rfw/lib/src/flutter/core_widgets.dart +++ b/packages/rfw/lib/src/flutter/core_widgets.dart @@ -649,6 +649,7 @@ Map get _coreWidgetsDefinitions => (['textScaleFactor']); return Text( text, style: ArgumentDecoders.textStyle(source, ['style']), @@ -658,7 +659,7 @@ Map get _coreWidgetsDefinitions => (['softWrap']), overflow: ArgumentDecoders.enumValue(TextOverflow.values, source, ['overflow']), - textScaleFactor: source.v(['textScaleFactor']), + textScaler: textScaleFactor == null ? null : TextScaler.linear(textScaleFactor), maxLines: source.v(['maxLines']), semanticsLabel: source.v(['semanticsLabel']), textWidthBasis: ArgumentDecoders.enumValue(TextWidthBasis.values, source, ['textWidthBasis']), diff --git a/packages/rfw/pubspec.yaml b/packages/rfw/pubspec.yaml index 756d32ae05b1..9dd0ddc38c91 100644 --- a/packages/rfw/pubspec.yaml +++ b/packages/rfw/pubspec.yaml @@ -2,11 +2,11 @@ name: rfw description: "Remote Flutter widgets: a library for rendering declarative widget description files at runtime." repository: https://github.com/flutter/packages/tree/main/packages/rfw issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+rfw%22 -version: 1.0.22 +version: 1.0.23 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.2.0 + flutter: ">=3.16.0" dependencies: flutter: diff --git a/packages/rfw/test_coverage/pubspec.yaml b/packages/rfw/test_coverage/pubspec.yaml index e69bf654234a..6c7624364f7e 100644 --- a/packages/rfw/test_coverage/pubspec.yaml +++ b/packages/rfw/test_coverage/pubspec.yaml @@ -4,7 +4,7 @@ version: 1.0.0 publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ^3.2.0 dependencies: lcov_parser: 0.1.1 From ef349bec8ee9d5fa3f69d73aa78ab9bb84ae0aa7 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Thu, 15 Feb 2024 03:41:35 -0800 Subject: [PATCH 22/40] [url_launcher] Replace deprecated RouteInformation APIs (#6127) Update for https://docs.flutter.dev/release/breaking-changes/route-information-uri and makes 3.13 the minimum supported version accordingly. Fixes https://github.com/flutter/flutter/issues/124045 --- .../url_launcher_platform_interface/CHANGELOG.md | 4 ++++ .../url_launcher_platform_interface/lib/link.dart | 2 +- .../url_launcher_platform_interface/pubspec.yaml | 6 +++--- .../url_launcher_platform_interface/test/link_test.dart | 3 +-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/url_launcher/url_launcher_platform_interface/CHANGELOG.md b/packages/url_launcher/url_launcher_platform_interface/CHANGELOG.md index 7692e2be7255..1cab4de35f51 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 @@ +## 2.3.2 + +* Replaces deprecated RouteInformation API usage. + ## 2.3.1 * Updates minimum required plugin_platform_interface version to 2.1.7. diff --git a/packages/url_launcher/url_launcher_platform_interface/lib/link.dart b/packages/url_launcher/url_launcher_platform_interface/lib/link.dart index 10fe2dd630c0..ef9ca201fcdb 100644 --- a/packages/url_launcher/url_launcher_platform_interface/lib/link.dart +++ b/packages/url_launcher/url_launcher_platform_interface/lib/link.dart @@ -86,7 +86,7 @@ abstract class LinkInfo { // TODO(ianh): Remove the first argument. Future pushRouteNameToFramework(Object? _, String routeName) { final Completer completer = Completer(); - SystemNavigator.routeInformationUpdated(location: routeName); + SystemNavigator.routeInformationUpdated(uri: Uri.parse(routeName)); ui.channelBuffers.push( 'flutter/navigation', _codec.encodeMethodCall( diff --git a/packages/url_launcher/url_launcher_platform_interface/pubspec.yaml b/packages/url_launcher/url_launcher_platform_interface/pubspec.yaml index 0fe27cacb401..f0898e7fba5a 100644 --- a/packages/url_launcher/url_launcher_platform_interface/pubspec.yaml +++ b/packages/url_launcher/url_launcher_platform_interface/pubspec.yaml @@ -4,11 +4,11 @@ repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22 # 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.3.1 +version: 2.3.2 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/url_launcher/url_launcher_platform_interface/test/link_test.dart b/packages/url_launcher/url_launcher_platform_interface/test/link_test.dart index 6c613c1561d2..09adcbdf49be 100644 --- a/packages/url_launcher/url_launcher_platform_interface/test/link_test.dart +++ b/packages/url_launcher/url_launcher_platform_interface/test/link_test.dart @@ -83,7 +83,6 @@ class _RouteDelegate extends RouterDelegate if (_history.isEmpty) { return const Placeholder(key: Key('empty')); } - // ignore: unnecessary_string_interpolations - return Placeholder(key: Key('${_history.last.location}')); + return Placeholder(key: Key(_history.last.uri.path)); } } From 8f730b9a60d8f3129d14876f50b5214a84383302 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Thu, 15 Feb 2024 10:23:06 -0800 Subject: [PATCH 23/40] [local_auth] Add compatibility with latest `intl` (#6138) `intl` 0.19.0 doesn't have any changes that break us, so we can expand our range of allowed versions for better ecosystem compatibility. Fixes https://github.com/flutter/flutter/issues/141779 --- packages/local_auth/local_auth_android/CHANGELOG.md | 3 ++- packages/local_auth/local_auth_android/pubspec.yaml | 4 ++-- packages/local_auth/local_auth_darwin/CHANGELOG.md | 4 ++++ packages/local_auth/local_auth_darwin/pubspec.yaml | 4 ++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/local_auth/local_auth_android/CHANGELOG.md b/packages/local_auth/local_auth_android/CHANGELOG.md index 4d1c6950cb96..276f60ff01be 100644 --- a/packages/local_auth/local_auth_android/CHANGELOG.md +++ b/packages/local_auth/local_auth_android/CHANGELOG.md @@ -1,5 +1,6 @@ -## NEXT +## 1.0.37 +* Adds compatibility with `intl` 0.19.0. * Updates compileSdk version to 34. ## 1.0.36 diff --git a/packages/local_auth/local_auth_android/pubspec.yaml b/packages/local_auth/local_auth_android/pubspec.yaml index 90b07e391153..160141f28f5b 100644 --- a/packages/local_auth/local_auth_android/pubspec.yaml +++ b/packages/local_auth/local_auth_android/pubspec.yaml @@ -2,7 +2,7 @@ name: local_auth_android description: Android implementation of the local_auth plugin. repository: https://github.com/flutter/packages/tree/main/packages/local_auth/local_auth_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+local_auth%22 -version: 1.0.36 +version: 1.0.37 environment: sdk: ">=3.0.0 <4.0.0" @@ -21,7 +21,7 @@ dependencies: flutter: sdk: flutter flutter_plugin_android_lifecycle: ^2.0.1 - intl: ">=0.17.0 <0.19.0" + intl: ">=0.17.0 <0.20.0" local_auth_platform_interface: ^1.0.1 dev_dependencies: diff --git a/packages/local_auth/local_auth_darwin/CHANGELOG.md b/packages/local_auth/local_auth_darwin/CHANGELOG.md index e5367d705efc..2d209e97bef5 100644 --- a/packages/local_auth/local_auth_darwin/CHANGELOG.md +++ b/packages/local_auth/local_auth_darwin/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.2.2 + +* Adds compatibility with `intl` 0.19.0. + ## 1.2.1 * Renames the Objective-C plugin classes to avoid runtime conflicts with diff --git a/packages/local_auth/local_auth_darwin/pubspec.yaml b/packages/local_auth/local_auth_darwin/pubspec.yaml index ab670c54c356..e4482d2eb9bb 100644 --- a/packages/local_auth/local_auth_darwin/pubspec.yaml +++ b/packages/local_auth/local_auth_darwin/pubspec.yaml @@ -2,7 +2,7 @@ name: local_auth_darwin description: iOS implementation of the local_auth plugin. repository: https://github.com/flutter/packages/tree/main/packages/local_auth/local_auth_darwin issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+local_auth%22 -version: 1.2.1 +version: 1.2.2 environment: sdk: ^3.2.3 @@ -20,7 +20,7 @@ flutter: dependencies: flutter: sdk: flutter - intl: ">=0.17.0 <0.19.0" + intl: ">=0.17.0 <0.20.0" local_auth_platform_interface: ^1.0.1 dev_dependencies: From e650b1040eb61764562df62884753b404c6ef259 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Thu, 15 Feb 2024 13:09:37 -0800 Subject: [PATCH 24/40] [google_sign_in] Clean up pre-Pigeon code (#6141) Internal native helper code was still using `id` arguments, doing type checking, and handling `NSNull`, none of which is relevant now that the calling code has been converted to Pigeon and is already strongly typed as `NSString`. --- .../google_sign_in_ios/CHANGELOG.md | 3 +- .../darwin/Classes/FLTGoogleSignInPlugin.m | 43 +++++++------------ .../google_sign_in_ios/pubspec.yaml | 2 +- 3 files changed, 19 insertions(+), 29 deletions(-) diff --git a/packages/google_sign_in/google_sign_in_ios/CHANGELOG.md b/packages/google_sign_in/google_sign_in_ios/CHANGELOG.md index 7126a66e6787..5d5716e1715d 100644 --- a/packages/google_sign_in/google_sign_in_ios/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in_ios/CHANGELOG.md @@ -1,5 +1,6 @@ -## NEXT +## 5.7.4 +* Improves type handling in Objective-C code. * Updates minimum iOS version to 12.0 and minimum Flutter version to 3.16.6. ## 5.7.3 diff --git a/packages/google_sign_in/google_sign_in_ios/darwin/Classes/FLTGoogleSignInPlugin.m b/packages/google_sign_in/google_sign_in_ios/darwin/Classes/FLTGoogleSignInPlugin.m index 2f7e558ec202..d7a5cd85303c 100644 --- a/packages/google_sign_in/google_sign_in_ios/darwin/Classes/FLTGoogleSignInPlugin.m +++ b/packages/google_sign_in/google_sign_in_ios/darwin/Classes/FLTGoogleSignInPlugin.m @@ -111,9 +111,9 @@ - (BOOL)handleOpenURLs:(NSArray *)urls { - (void)initializeSignInWithParameters:(nonnull FSIInitParams *)params error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { - GIDConfiguration *configuration = [self configurationWithClientIdArgument:params.clientId - serverClientIdArgument:params.serverClientId - hostedDomainArgument:params.hostedDomain]; + GIDConfiguration *configuration = [self configurationWithClientIdentifier:params.clientId + serverClientIdentifier:params.serverClientId + hostedDomain:params.hostedDomain]; self.requestedScopes = [NSSet setWithArray:params.scopes]; if (configuration != nil) { self.configuration = configuration; @@ -141,9 +141,9 @@ - (void)signInWithCompletion:(nonnull void (^)(FSIUserData *_Nullable, // If neither are available, do not set the configuration - GIDSignIn will automatically use // settings from the Info.plist (which is the recommended method). if (!self.configuration && self.googleServiceProperties) { - self.configuration = [self configurationWithClientIdArgument:nil - serverClientIdArgument:nil - hostedDomainArgument:nil]; + self.configuration = [self configurationWithClientIdentifier:nil + serverClientIdentifier:nil + hostedDomain:nil]; } if (self.configuration) { self.signIn.configuration = self.configuration; @@ -270,30 +270,19 @@ - (void)addScopes:(NSArray *)scopes #endif } -/// @return @c nil if GoogleService-Info.plist not found and clientId is not provided. -- (GIDConfiguration *)configurationWithClientIdArgument:(id)clientIDArg - serverClientIdArgument:(id)serverClientIDArg - hostedDomainArgument:(id)hostedDomainArg { - NSString *clientID; - BOOL hasDynamicClientId = [clientIDArg isKindOfClass:[NSString class]]; - if (hasDynamicClientId) { - clientID = clientIDArg; - } else if (self.googleServiceProperties) { - clientID = self.googleServiceProperties[kClientIdKey]; - } else { - // We couldn't resolve a clientId, without which we cannot create a GIDConfiguration. +/// @return @c nil if GoogleService-Info.plist not found and runtimeClientIdentifier is not +/// provided. +- (GIDConfiguration *)configurationWithClientIdentifier:(NSString *)runtimeClientIdentifier + serverClientIdentifier:(NSString *)runtimeServerClientIdentifier + hostedDomain:(NSString *)hostedDomain { + NSString *clientID = runtimeClientIdentifier ?: self.googleServiceProperties[kClientIdKey]; + if (!clientID) { + // Creating a GIDConfiguration requires a client identifier. return nil; } + NSString *serverClientID = + runtimeServerClientIdentifier ?: self.googleServiceProperties[kServerClientIdKey]; - BOOL hasDynamicServerClientId = [serverClientIDArg isKindOfClass:[NSString class]]; - NSString *serverClientID = hasDynamicServerClientId - ? serverClientIDArg - : self.googleServiceProperties[kServerClientIdKey]; - - NSString *hostedDomain = nil; - if (hostedDomainArg != [NSNull null]) { - hostedDomain = hostedDomainArg; - } return [[GIDConfiguration alloc] initWithClientID:clientID serverClientID:serverClientID hostedDomain:hostedDomain diff --git a/packages/google_sign_in/google_sign_in_ios/pubspec.yaml b/packages/google_sign_in/google_sign_in_ios/pubspec.yaml index 1e5044379f51..22c153723756 100644 --- a/packages/google_sign_in/google_sign_in_ios/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in_ios/pubspec.yaml @@ -2,7 +2,7 @@ name: google_sign_in_ios description: iOS implementation of the google_sign_in plugin. repository: https://github.com/flutter/packages/tree/main/packages/google_sign_in/google_sign_in_ios issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22 -version: 5.7.3 +version: 5.7.4 environment: sdk: ^3.2.3 From dcbaee53897d02a2511dbed593595dabc4e37310 Mon Sep 17 00:00:00 2001 From: Jackson Gardner Date: Thu, 15 Feb 2024 14:19:49 -0800 Subject: [PATCH 25/40] Explicitly pass the web renderer into the tests. (#6140) The web tests currently all assume to be using the html renderer. `flutter test` previously erroneously was serving files for the HTML renderer by default (which is not the intended behavior). After this was fixed, the tests started running on the CanvasKit renderer and some of them broke. If we are relying on the html renderer, we should explicitly pass it when running `flutter test` --- script/tool/lib/src/dart_test_command.dart | 7 +++++-- script/tool/lib/src/drive_examples_command.dart | 1 + script/tool/test/dart_test_command_test.dart | 10 +++++----- script/tool/test/drive_examples_command_test.dart | 7 +++++++ 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/script/tool/lib/src/dart_test_command.dart b/script/tool/lib/src/dart_test_command.dart index df0ee71400b3..1c188ff38ad9 100644 --- a/script/tool/lib/src/dart_test_command.dart +++ b/script/tool/lib/src/dart_test_command.dart @@ -98,9 +98,11 @@ class DartTestCommand extends PackageLoopingCommand { platform = 'chrome'; } + // All the web tests assume the html renderer currently. + final String? webRenderer = (platform == 'chrome') ? 'html' : null; bool passed; if (package.requiresFlutter()) { - passed = await _runFlutterTests(package, platform: platform); + passed = await _runFlutterTests(package, platform: platform, webRenderer: webRenderer); } else { passed = await _runDartTests(package, platform: platform); } @@ -109,7 +111,7 @@ class DartTestCommand extends PackageLoopingCommand { /// Runs the Dart tests for a Flutter package, returning true on success. Future _runFlutterTests(RepositoryPackage package, - {String? platform}) async { + {String? platform, String? webRenderer}) async { final String experiment = getStringArg(kEnableExperiment); final int exitCode = await processRunner.runAndStream( @@ -121,6 +123,7 @@ class DartTestCommand extends PackageLoopingCommand { // Flutter defaults to VM mode (under a different name) and explicitly // setting it is deprecated, so pass nothing in that case. if (platform != null && platform != 'vm') '--platform=$platform', + if (webRenderer != null) '--web-renderer=$webRenderer', ], workingDir: package.directory, ); diff --git a/script/tool/lib/src/drive_examples_command.dart b/script/tool/lib/src/drive_examples_command.dart index ff73044f6c16..f3baa5c7cee6 100644 --- a/script/tool/lib/src/drive_examples_command.dart +++ b/script/tool/lib/src/drive_examples_command.dart @@ -119,6 +119,7 @@ class DriveExamplesCommand extends PackageLoopingCommand { 'web-server', '--web-port=7357', '--browser-name=chrome', + '--web-renderer=html', if (platform.environment.containsKey('CHROME_EXECUTABLE')) '--chrome-binary=${platform.environment['CHROME_EXECUTABLE']}', ], diff --git a/script/tool/test/dart_test_command_test.dart b/script/tool/test/dart_test_command_test.dart index 5752d7439eb0..d56bb44b0fb1 100644 --- a/script/tool/test/dart_test_command_test.dart +++ b/script/tool/test/dart_test_command_test.dart @@ -265,7 +265,7 @@ void main() { orderedEquals([ ProcessCall( getFlutterCommand(mockPlatform), - const ['test', '--color', '--platform=chrome'], + const ['test', '--color', '--platform=chrome', '--web-renderer=html'], package.path), ]), ); @@ -289,7 +289,7 @@ void main() { orderedEquals([ ProcessCall( getFlutterCommand(mockPlatform), - const ['test', '--color', '--platform=chrome'], + const ['test', '--color', '--platform=chrome', '--web-renderer=html'], plugin.path), ]), ); @@ -314,7 +314,7 @@ void main() { orderedEquals([ ProcessCall( getFlutterCommand(mockPlatform), - const ['test', '--color', '--platform=chrome'], + const ['test', '--color', '--platform=chrome', '--web-renderer=html'], plugin.path), ]), ); @@ -339,7 +339,7 @@ void main() { orderedEquals([ ProcessCall( getFlutterCommand(mockPlatform), - const ['test', '--color', '--platform=chrome'], + const ['test', '--color', '--platform=chrome', '--web-renderer=html'], plugin.path), ]), ); @@ -409,7 +409,7 @@ void main() { orderedEquals([ ProcessCall( getFlutterCommand(mockPlatform), - const ['test', '--color', '--platform=chrome'], + const ['test', '--color', '--platform=chrome', '--web-renderer=html'], plugin.path), ]), ); diff --git a/script/tool/test/drive_examples_command_test.dart b/script/tool/test/drive_examples_command_test.dart index 60df1b70ae3e..92d4921a0b35 100644 --- a/script/tool/test/drive_examples_command_test.dart +++ b/script/tool/test/drive_examples_command_test.dart @@ -678,6 +678,7 @@ void main() { 'web-server', '--web-port=7357', '--browser-name=chrome', + '--web-renderer=html', '--driver', 'test_driver/integration_test.dart', '--target', @@ -726,6 +727,7 @@ void main() { 'web-server', '--web-port=7357', '--browser-name=chrome', + '--web-renderer=html', '--driver', 'test_driver/integration_test.dart', '--target', @@ -777,6 +779,7 @@ void main() { 'web-server', '--web-port=7357', '--browser-name=chrome', + '--web-renderer=html', '--chrome-binary=/path/to/chrome', '--driver', 'test_driver/integration_test.dart', @@ -1223,6 +1226,7 @@ void main() { 'web-server', '--web-port=7357', '--browser-name=chrome', + '--web-renderer=html', '--driver', 'test_driver/integration_test.dart', '--target', @@ -1237,6 +1241,7 @@ void main() { 'web-server', '--web-port=7357', '--browser-name=chrome', + '--web-renderer=html', '--driver', 'test_driver/integration_test.dart', '--target', @@ -1334,6 +1339,7 @@ void main() { 'web-server', '--web-port=7357', '--browser-name=chrome', + '--web-renderer=html', '--driver', 'test_driver/integration_test.dart', '--target', @@ -1413,6 +1419,7 @@ void main() { 'web-server', '--web-port=7357', '--browser-name=chrome', + '--web-renderer=html', '--driver', 'test_driver/integration_test.dart', '--target', From cc05af82e2148f7b6cd55745f6cfdab2bbad95d7 Mon Sep 17 00:00:00 2001 From: LouiseHsu Date: Thu, 15 Feb 2024 16:10:06 -0800 Subject: [PATCH 26/40] [in_app_purchase] fix skerror nullability (#6139) Should fix https://github.com/flutter/flutter/issues/143177 --- .../in_app_purchase_storekit/CHANGELOG.md | 4 ++++ .../in_app_purchase_storekit/darwin/Classes/messages.g.h | 4 ++-- .../in_app_purchase_storekit/darwin/Classes/messages.g.m | 2 +- .../in_app_purchase_storekit/lib/src/messages.g.dart | 6 +++--- .../src/store_kit_wrappers/sk_payment_queue_wrapper.dart | 5 ++++- .../in_app_purchase_storekit/pigeons/messages.dart | 2 +- .../in_app_purchase_storekit/pubspec.yaml | 2 +- .../test/store_kit_wrappers/pigeon_converter_test.dart | 9 +++++++++ 8 files changed, 25 insertions(+), 9 deletions(-) diff --git a/packages/in_app_purchase/in_app_purchase_storekit/CHANGELOG.md b/packages/in_app_purchase/in_app_purchase_storekit/CHANGELOG.md index 67ff21186e7b..c19e4a826dd8 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/CHANGELOG.md +++ b/packages/in_app_purchase/in_app_purchase_storekit/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.3.11 + +* Fixes SKError.userInfo not being nullable. + ## 0.3.10 * Converts `startProductRequest()`, `finishTransaction()`, `restoreTransactions()`, `presentCodeRedemptionSheet()` to pigeon. diff --git a/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/messages.g.h b/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/messages.g.h index 87a197212504..5d5b3a0c7799 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/messages.g.h +++ b/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/messages.g.h @@ -146,10 +146,10 @@ typedef NS_ENUM(NSUInteger, SKSubscriptionPeriodUnitMessage) { - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithCode:(NSInteger)code domain:(NSString *)domain - userInfo:(NSDictionary *)userInfo; + userInfo:(nullable NSDictionary *)userInfo; @property(nonatomic, assign) NSInteger code; @property(nonatomic, copy) NSString *domain; -@property(nonatomic, copy) NSDictionary *userInfo; +@property(nonatomic, copy, nullable) NSDictionary *userInfo; @end @interface SKPaymentDiscountMessage : NSObject diff --git a/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/messages.g.m b/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/messages.g.m index 79599d932e0e..bbb5d6b67eca 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/messages.g.m +++ b/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/messages.g.m @@ -218,7 +218,7 @@ - (NSArray *)toList { @implementation SKErrorMessage + (instancetype)makeWithCode:(NSInteger)code domain:(NSString *)domain - userInfo:(NSDictionary *)userInfo { + userInfo:(nullable NSDictionary *)userInfo { SKErrorMessage *pigeonResult = [[SKErrorMessage alloc] init]; pigeonResult.code = code; pigeonResult.domain = domain; diff --git a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/messages.g.dart b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/messages.g.dart index bfbd447de677..27a38c9e57a9 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/messages.g.dart +++ b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/messages.g.dart @@ -195,14 +195,14 @@ class SKErrorMessage { SKErrorMessage({ required this.code, required this.domain, - required this.userInfo, + this.userInfo, }); int code; String domain; - Map userInfo; + Map? userInfo; Object encode() { return [ @@ -217,7 +217,7 @@ class SKErrorMessage { return SKErrorMessage( code: result[0]! as int, domain: result[1]! as String, - userInfo: (result[2] as Map?)!.cast(), + userInfo: (result[2] as Map?)?.cast(), ); } } diff --git a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart index f8fd85fcc6b0..dd5571a7af0a 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart +++ b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart @@ -380,7 +380,10 @@ class SKError { /// Converts [SKErrorMessage] into the dart equivalent static SKError convertFromPigeon(SKErrorMessage msg) { - return SKError(code: msg.code, domain: msg.domain, userInfo: msg.userInfo); + return SKError( + code: msg.code, + domain: msg.domain, + userInfo: msg.userInfo ?? {}); } } diff --git a/packages/in_app_purchase/in_app_purchase_storekit/pigeons/messages.dart b/packages/in_app_purchase/in_app_purchase_storekit/pigeons/messages.dart index 9ada32ed2e0d..c5d352650408 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/pigeons/messages.dart +++ b/packages/in_app_purchase/in_app_purchase_storekit/pigeons/messages.dart @@ -91,7 +91,7 @@ class SKErrorMessage { final int code; final String domain; - final Map userInfo; + final Map? userInfo; } class SKPaymentDiscountMessage { diff --git a/packages/in_app_purchase/in_app_purchase_storekit/pubspec.yaml b/packages/in_app_purchase/in_app_purchase_storekit/pubspec.yaml index 97fa1dbd1869..920873e65273 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/pubspec.yaml +++ b/packages/in_app_purchase/in_app_purchase_storekit/pubspec.yaml @@ -2,7 +2,7 @@ name: in_app_purchase_storekit description: An implementation for the iOS and macOS platforms of the Flutter `in_app_purchase` plugin. This uses the StoreKit Framework. repository: https://github.com/flutter/packages/tree/main/packages/in_app_purchase/in_app_purchase_storekit issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22 -version: 0.3.10 +version: 0.3.11 environment: sdk: ^3.2.3 diff --git a/packages/in_app_purchase/in_app_purchase_storekit/test/store_kit_wrappers/pigeon_converter_test.dart b/packages/in_app_purchase/in_app_purchase_storekit/test/store_kit_wrappers/pigeon_converter_test.dart index 36881eb07986..3bdbd0af6124 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/test/store_kit_wrappers/pigeon_converter_test.dart +++ b/packages/in_app_purchase/in_app_purchase_storekit/test/store_kit_wrappers/pigeon_converter_test.dart @@ -95,4 +95,13 @@ void main() { SkProductResponseWrapper.convertFromPigeon(msg); expect(convertedWrapper, productResponse); }); + + test('test SKerror pigeon converter', () { + final SKErrorMessage msg = SKErrorMessage(code: 99, domain: 'domain'); + final SKError wrapper = SKError.convertFromPigeon(msg); + + expect(wrapper.code, 99); + expect(wrapper.domain, 'domain'); + expect(wrapper.userInfo, {}); + }); } From c56c12dd51ef606026ddc7745e343f3cd15b5237 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Thu, 15 Feb 2024 21:59:05 -0500 Subject: [PATCH 27/40] [tool] Add support for using a Kotlin test runner file (#6131) --- .../lib/src/firebase_test_lab_command.dart | 12 +++++- .../test/firebase_test_lab_command_test.dart | 42 +++++++++++++++++++ 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/script/tool/lib/src/firebase_test_lab_command.dart b/script/tool/lib/src/firebase_test_lab_command.dart index fa2d1e525fcd..5d2ab937c351 100644 --- a/script/tool/lib/src/firebase_test_lab_command.dart +++ b/script/tool/lib/src/firebase_test_lab_command.dart @@ -360,8 +360,16 @@ class FirebaseTestLabCommand extends PackageLoopingCommand { .where((FileSystemEntity entity) => entity is File) .cast() .any((File file) { - return file.basename.endsWith('.java') && - file.readAsStringSync().contains('@RunWith(FlutterTestRunner.class)'); + if (file.basename.endsWith('.java')) { + return file + .readAsStringSync() + .contains('@RunWith(FlutterTestRunner.class)'); + } else if (file.basename.endsWith('.kt')) { + return file + .readAsStringSync() + .contains('@RunWith(FlutterTestRunner::class)'); + } + return false; }); } } diff --git a/script/tool/test/firebase_test_lab_command_test.dart b/script/tool/test/firebase_test_lab_command_test.dart index 2bed0db0f085..067bf9cbaf58 100644 --- a/script/tool/test/firebase_test_lab_command_test.dart +++ b/script/tool/test/firebase_test_lab_command_test.dart @@ -564,6 +564,48 @@ public class MainActivityTest { ); }); + test('supports kotlin implementation of integration_test runner', () async { + const String kotlinTestFileRelativePath = + 'example/android/app/src/androidTest/MainActivityTest.kt'; + final RepositoryPackage plugin = + createFakePlugin('plugin', packagesDir, extraFiles: [ + 'test/plugin_test.dart', + 'example/integration_test/foo_test.dart', + 'example/android/gradlew', + kotlinTestFileRelativePath, + ]); + + // Kotlin equivalent of the test runner + childFileWithSubcomponents( + plugin.directory, p.posix.split(kotlinTestFileRelativePath)) + .writeAsStringSync(''' +@DartIntegrationTest +@RunWith(FlutterTestRunner::class) +class MainActivityTest { + @JvmField @Rule var rule = ActivityTestRule(MainActivity::class.java) +} +'''); + + final List output = await runCapturingPrint( + runner, + [ + 'firebase-test-lab', + '--results-bucket=a_bucket', + '--device', + 'model=redfin,version=30', + ], + ); + + expect( + output, + containsAllInOrder([ + contains('Running for plugin'), + contains('Testing example/integration_test/foo_test.dart...'), + contains('Ran for 1 package') + ]), + ); + }); + test('skips packages with no android directory', () async { createFakePackage('package', packagesDir, extraFiles: [ 'example/integration_test/foo_test.dart', From a36071b5e8e408b56f29980eefaf3d2b7e92404a Mon Sep 17 00:00:00 2001 From: engine-flutter-autoroll Date: Fri, 16 Feb 2024 11:24:59 -0500 Subject: [PATCH 28/40] Roll Flutter from a628814ebd25 to d7867ca7d635 (66 revisions) (#6146) Roll Flutter from a628814ebd25 to d7867ca7d635 (66 revisions) https://github.com/flutter/flutter/compare/a628814ebd25...d7867ca7d635 2024-02-16 engine-flutter-autoroll@skia.org Roll Packages from ef349bec8ee9 to c56c12dd51ef (5 revisions) (flutter/flutter#143581) 2024-02-16 tessertaha@gmail.com Update `MaterialStatesController` docs for calling `setState` in a listener (flutter/flutter#143453) 2024-02-16 tessertaha@gmail.com Update `DataTable` docs for disabled `DataRow` ink well (flutter/flutter#143450) 2024-02-16 engine-flutter-autoroll@skia.org Roll Flutter Engine from b7103bc8b374 to dd530f1556df (17 revisions) (flutter/flutter#143565) 2024-02-16 jason-simmons@users.noreply.github.com Manual roll Flutter Engine from b7103bc8b374 to 7de84271eb65 (flutter/flutter#143564) 2024-02-16 jason-simmons@users.noreply.github.com Manual roll Flutter Engine from d3c71d78f8ef to df0dc1fc06ca (flutter/flutter#143563) 2024-02-16 jason-simmons@users.noreply.github.com Manual roll Flutter Engine from bc4dd534a0fa to d3c71d78f8ef (flutter/flutter#143561) 2024-02-16 jason-simmons@users.noreply.github.com Manual roll Flutter Engine from edb2745e9834 to bc4dd534a0fa (flutter/flutter#143559) 2024-02-16 jason-simmons@users.noreply.github.com Manual roll Flutter Engine from 15a358bbaf71 to edb2745e9834 (flutter/flutter#143555) 2024-02-16 jonahwilliams@google.com [devicelab] retain prior events for flutter gallery. (flutter/flutter#143554) 2024-02-16 kustermann@google.com Reland "Disentangle and align flutter build web --wasm flags (#143517)" (flutter/flutter#143549) 2024-02-16 engine-flutter-autoroll@skia.org Roll Flutter Engine from 3af336bfb2df to 15a358bbaf71 (1 revision) (flutter/flutter#143428) 2024-02-15 barpac02@gmail.com Android Gradle file templates: make it easier to convert them to Kotlin DSL in the future (flutter/flutter#142146) 2024-02-15 godofredoc@google.com Remove bringup from win arm64 builds. (flutter/flutter#143548) 2024-02-15 jawscout@gmail.com Fix minor spelling error (flutter/flutter#143541) 2024-02-15 jonahwilliams@google.com [devicelab] migrate new gallery benchmarks to local copy. (flutter/flutter#143545) 2024-02-15 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 3.24.1 to 3.24.3 (flutter/flutter#143546) 2024-02-15 danny@tuppeny.com [flutter_tool] [dap] Forward Flutter progress events to DAP client (flutter/flutter#142524) 2024-02-15 matanlurey@users.noreply.github.com Swap the tasks that have been running fine for a while. (flutter/flutter#143544) 2024-02-15 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Disentangle and align `flutter build web --wasm` flags (#143517)" (flutter/flutter#143547) 2024-02-15 katelovett@google.com Reland simulatedAccessibilityTraversal fix (flutter/flutter#143527) 2024-02-15 kustermann@google.com Disentangle and align `flutter build web --wasm` flags (flutter/flutter#143517) 2024-02-15 jonahwilliams@google.com [devicelab] introduce new old gallery. (flutter/flutter#143486) 2024-02-15 godofredoc@google.com Remove certs dependency. (flutter/flutter#143495) 2024-02-15 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Fix and test SemanticsController.simulatedAccessibilityTraversal (#143386)" (flutter/flutter#143523) 2024-02-15 engine-flutter-autoroll@skia.org Roll Packages from a8642544730a to ef349bec8ee9 (9 revisions) (flutter/flutter#143521) 2024-02-15 u.hossein@yahoo.com Modify `plugin_ffi` and `package_ffi` template (flutter/flutter#143376) 2024-02-15 godofredoc@google.com Remove certs installation from win_arm builds. (flutter/flutter#143487) 2024-02-14 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[a11y] Add isEnabled semantics flag to text field (#143334)" (flutter/flutter#143494) 2024-02-14 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[a11y] Fix date picker cannot focus on the edit field (#143117)" (flutter/flutter#143493) 2024-02-14 jhy03261997@gmail.com [a11y] Fix date picker cannot focus on the edit field (flutter/flutter#143117) 2024-02-14 goderbauer@google.com cleanup now-irrelevant ignores for `deprecated_member_use` (flutter/flutter#143403) 2024-02-14 katelovett@google.com Fix and test SemanticsController.simulatedAccessibilityTraversal (flutter/flutter#143386) 2024-02-14 goderbauer@google.com Disable deprecation warnings for mega_gallery (flutter/flutter#143466) 2024-02-14 36861262+QuncCccccc@users.noreply.github.com The initial/selected item on popup menu should always be visible (flutter/flutter#143118) 2024-02-14 dacoharkes@google.com Roll native_assets_builder to 0.5.0 (flutter/flutter#143472) 2024-02-14 leroux_bruno@yahoo.fr InputDecorator M3 test migration step2 (flutter/flutter#143369) 2024-02-14 leroux_bruno@yahoo.fr Add more documentation for TextEditingController default constructor (flutter/flutter#143452) 2024-02-14 34871572+gmackall@users.noreply.github.com Format all kotlin according to ktlint (flutter/flutter#143390) 2024-02-14 fluttergithubbot@gmail.com Marks Linux_pixel_7pro integration_ui_keyboard_resize to be unflaky (flutter/flutter#143440) 2024-02-14 engine-flutter-autoroll@skia.org Roll Packages from 9385bbb3cf46 to a8642544730a (6 revisions) (flutter/flutter#143454) 2024-02-14 65850618+Anas35@users.noreply.github.com [tools] Add column header for emulators information (flutter/flutter#142853) 2024-02-14 kustermann@google.com Use `dart compile wasm` for wasm compilations (flutter/flutter#143298) 2024-02-14 jonahwilliams@google.com [devicelab] retain first frame data in certain integration tests. (flutter/flutter#143419) 2024-02-14 engine-flutter-autoroll@skia.org Roll Flutter Engine from 0849250a1419 to 3af336bfb2df (2 revisions) (flutter/flutter#143427) 2024-02-14 engine-flutter-autoroll@skia.org Roll Flutter Engine from 215d55f4f82d to 0849250a1419 (2 revisions) (flutter/flutter#143425) ... --- .ci/flutter_master.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/flutter_master.version b/.ci/flutter_master.version index 51af7aebf640..2e0bd6c9f916 100644 --- a/.ci/flutter_master.version +++ b/.ci/flutter_master.version @@ -1 +1 @@ -a628814ebd25bb7617aae636031ca880b9e25a57 +d7867ca7d635c025d8acbcc5cbcff4ca8ea35ab6 From 10a8b76ad9ba0a243c8e65cc2288304df54c573c Mon Sep 17 00:00:00 2001 From: engine-flutter-autoroll Date: Fri, 16 Feb 2024 11:42:20 -0500 Subject: [PATCH 29/40] Roll Flutter (stable) from 41456452f29d to bae5e49bc2a8 (1550 revisions) (#6145) https://github.com/flutter/flutter/compare/41456452f29d...bae5e49bc2a8 If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-stable-packages Please CC camillesimon@google.com,rmistry@google.com,stuartmorgan@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter (stable): https://github.com/flutter/flutter/issues/new/choose To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md --- .ci/flutter_stable.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/flutter_stable.version b/.ci/flutter_stable.version index 610194befabc..845fae768cba 100644 --- a/.ci/flutter_stable.version +++ b/.ci/flutter_stable.version @@ -1 +1 @@ -41456452f29d64e8deb623a3c927524bcf9f111b +bae5e49bc2a867403c43b2aae2de8f8c33b037e4 From cc34b78a0ce4b75536325df4a08db000a812a355 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Fri, 16 Feb 2024 09:34:11 -0800 Subject: [PATCH 30/40] [ci/various] Update for 3.19 stable (#6147) Does the steps from https://github.com/flutter/flutter/wiki/Updating-Packages-repo-for-a-stable-release to account for stable now being 3.19, and N-2 (and thus our minimum supported min version) being 3.13. These changes are version-bump-exempt [by repo policy](https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#version). --- .ci.yaml | 8 ++++---- .ci/targets/repo_checks.yaml | 2 +- .github/workflows/release.yml | 2 +- packages/animations/CHANGELOG.md | 4 ++++ packages/animations/example/pubspec.yaml | 4 ++-- packages/camera/camera/CHANGELOG.md | 1 + packages/camera/camera/example/pubspec.yaml | 4 ++-- packages/camera/camera/pubspec.yaml | 4 ++-- packages/camera/camera_android/CHANGELOG.md | 1 + packages/camera/camera_android/example/pubspec.yaml | 4 ++-- packages/camera/camera_android/pubspec.yaml | 4 ++-- packages/camera/camera_android_camerax/CHANGELOG.md | 4 ++++ .../camera/camera_android_camerax/example/pubspec.yaml | 4 ++-- packages/camera/camera_android_camerax/pubspec.yaml | 4 ++-- packages/camera/camera_platform_interface/CHANGELOG.md | 4 ++++ packages/camera/camera_platform_interface/pubspec.yaml | 4 ++-- packages/camera/camera_web/CHANGELOG.md | 4 ++++ packages/camera/camera_web/example/pubspec.yaml | 4 ++-- packages/camera/camera_windows/CHANGELOG.md | 4 ++++ packages/camera/camera_windows/example/pubspec.yaml | 4 ++-- packages/camera/camera_windows/pubspec.yaml | 4 ++-- packages/cross_file/CHANGELOG.md | 4 ++++ packages/cross_file/example/pubspec.yaml | 2 +- packages/css_colors/CHANGELOG.md | 4 ++++ packages/css_colors/pubspec.yaml | 4 ++-- packages/dynamic_layouts/CHANGELOG.md | 2 +- packages/dynamic_layouts/example/pubspec.yaml | 2 +- packages/dynamic_layouts/pubspec.yaml | 4 ++-- packages/espresso/CHANGELOG.md | 1 + packages/espresso/example/pubspec.yaml | 4 ++-- packages/espresso/pubspec.yaml | 4 ++-- .../CHANGELOG.md | 4 ++++ .../example/pubspec.yaml | 4 ++-- .../pubspec.yaml | 4 ++-- packages/file_selector/file_selector/CHANGELOG.md | 4 ++++ packages/file_selector/file_selector/example/pubspec.yaml | 4 ++-- packages/file_selector/file_selector/pubspec.yaml | 4 ++-- packages/file_selector/file_selector_android/CHANGELOG.md | 1 + .../file_selector_android/example/pubspec.yaml | 4 ++-- packages/file_selector/file_selector_android/pubspec.yaml | 4 ++-- packages/file_selector/file_selector_linux/CHANGELOG.md | 2 +- .../file_selector_linux/example/pubspec.yaml | 4 ++-- packages/file_selector/file_selector_linux/pubspec.yaml | 4 ++-- packages/file_selector/file_selector_macos/CHANGELOG.md | 2 +- .../file_selector_macos/example/pubspec.yaml | 4 ++-- packages/file_selector/file_selector_macos/pubspec.yaml | 4 ++-- .../file_selector_platform_interface/CHANGELOG.md | 4 ++++ .../file_selector_platform_interface/pubspec.yaml | 4 ++-- packages/file_selector/file_selector_web/CHANGELOG.md | 2 +- .../file_selector/file_selector_web/example/pubspec.yaml | 4 ++-- packages/file_selector/file_selector_windows/CHANGELOG.md | 2 +- .../file_selector_windows/example/pubspec.yaml | 4 ++-- packages/file_selector/file_selector_windows/pubspec.yaml | 4 ++-- packages/flutter_adaptive_scaffold/CHANGELOG.md | 4 ++++ packages/flutter_adaptive_scaffold/example/pubspec.yaml | 4 ++-- packages/flutter_adaptive_scaffold/pubspec.yaml | 4 ++-- packages/flutter_image/CHANGELOG.md | 4 ++++ packages/flutter_image/example/pubspec.yaml | 4 ++-- packages/flutter_image/pubspec.yaml | 4 ++-- packages/flutter_lints/CHANGELOG.md | 2 +- packages/flutter_lints/example/pubspec.yaml | 2 +- packages/flutter_lints/pubspec.yaml | 2 +- packages/flutter_markdown/CHANGELOG.md | 4 ++++ packages/flutter_markdown/example/pubspec.yaml | 4 ++-- packages/flutter_markdown/pubspec.yaml | 4 ++-- packages/flutter_migrate/CHANGELOG.md | 2 +- packages/flutter_migrate/pubspec.yaml | 2 +- packages/flutter_plugin_android_lifecycle/CHANGELOG.md | 2 +- .../flutter_plugin_android_lifecycle/example/pubspec.yaml | 4 ++-- packages/flutter_plugin_android_lifecycle/pubspec.yaml | 4 ++-- packages/flutter_template_images/CHANGELOG.md | 2 +- packages/flutter_template_images/pubspec.yaml | 2 +- packages/go_router/CHANGELOG.md | 4 ++++ packages/go_router/example/pubspec.yaml | 4 ++-- packages/go_router_builder/CHANGELOG.md | 1 + packages/go_router_builder/example/pubspec.yaml | 2 +- packages/go_router_builder/pubspec.yaml | 2 +- .../google_maps_flutter/google_maps_flutter/CHANGELOG.md | 4 ++++ .../google_maps_flutter/example/pubspec.yaml | 4 ++-- .../google_maps_flutter/google_maps_flutter/pubspec.yaml | 4 ++-- .../google_maps_flutter_android/CHANGELOG.md | 1 + .../google_maps_flutter_android/example/pubspec.yaml | 4 ++-- .../google_maps_flutter_android/pubspec.yaml | 4 ++-- .../google_maps_flutter_platform_interface/CHANGELOG.md | 4 ++++ .../google_maps_flutter_platform_interface/pubspec.yaml | 4 ++-- .../google_maps_flutter_web/CHANGELOG.md | 4 ++++ .../google_maps_flutter_web/example/pubspec.yaml | 4 ++-- .../google_sign_in/google_sign_in_android/CHANGELOG.md | 1 + .../google_sign_in_android/example/pubspec.yaml | 4 ++-- .../google_sign_in/google_sign_in_android/pubspec.yaml | 4 ++-- .../google_sign_in_platform_interface/CHANGELOG.md | 4 ++++ .../google_sign_in_platform_interface/pubspec.yaml | 4 ++-- packages/image_picker/image_picker/CHANGELOG.md | 1 + packages/image_picker/image_picker/example/pubspec.yaml | 4 ++-- packages/image_picker/image_picker/pubspec.yaml | 4 ++-- packages/image_picker/image_picker_android/CHANGELOG.md | 1 + .../image_picker_android/example/pubspec.yaml | 4 ++-- packages/image_picker/image_picker_android/pubspec.yaml | 4 ++-- packages/image_picker/image_picker_for_web/CHANGELOG.md | 4 ++++ .../image_picker_for_web/example/pubspec.yaml | 4 ++-- packages/image_picker/image_picker_for_web/pubspec.yaml | 4 ++-- packages/image_picker/image_picker_linux/CHANGELOG.md | 2 +- .../image_picker/image_picker_linux/example/pubspec.yaml | 4 ++-- packages/image_picker/image_picker_linux/pubspec.yaml | 4 ++-- packages/image_picker/image_picker_macos/CHANGELOG.md | 2 +- .../image_picker/image_picker_macos/example/pubspec.yaml | 4 ++-- packages/image_picker/image_picker_macos/pubspec.yaml | 4 ++-- .../image_picker_platform_interface/CHANGELOG.md | 4 ++++ .../image_picker_platform_interface/pubspec.yaml | 4 ++-- packages/image_picker/image_picker_windows/CHANGELOG.md | 2 +- .../image_picker_windows/example/pubspec.yaml | 4 ++-- packages/image_picker/image_picker_windows/pubspec.yaml | 4 ++-- packages/in_app_purchase/in_app_purchase/CHANGELOG.md | 1 + .../in_app_purchase/in_app_purchase/example/pubspec.yaml | 4 ++-- packages/in_app_purchase/in_app_purchase/pubspec.yaml | 4 ++-- .../in_app_purchase/in_app_purchase_android/CHANGELOG.md | 4 ++++ .../in_app_purchase_android/example/pubspec.yaml | 4 ++-- .../in_app_purchase/in_app_purchase_android/pubspec.yaml | 4 ++-- .../in_app_purchase_platform_interface/CHANGELOG.md | 4 ++++ .../in_app_purchase_platform_interface/pubspec.yaml | 4 ++-- packages/local_auth/local_auth/CHANGELOG.md | 1 + packages/local_auth/local_auth/example/pubspec.yaml | 4 ++-- packages/local_auth/local_auth/pubspec.yaml | 4 ++-- packages/local_auth/local_auth_android/CHANGELOG.md | 4 ++++ .../local_auth/local_auth_android/example/pubspec.yaml | 4 ++-- packages/local_auth/local_auth_android/pubspec.yaml | 4 ++-- .../local_auth/local_auth_platform_interface/CHANGELOG.md | 4 ++++ .../local_auth/local_auth_platform_interface/pubspec.yaml | 4 ++-- packages/local_auth/local_auth_windows/CHANGELOG.md | 4 ++++ .../local_auth/local_auth_windows/example/pubspec.yaml | 4 ++-- packages/local_auth/local_auth_windows/pubspec.yaml | 4 ++-- packages/metrics_center/CHANGELOG.md | 2 +- packages/metrics_center/pubspec.yaml | 2 +- packages/multicast_dns/CHANGELOG.md | 4 ++++ packages/multicast_dns/pubspec.yaml | 2 +- packages/palette_generator/CHANGELOG.md | 2 +- packages/palette_generator/example/pubspec.yaml | 4 ++-- packages/palette_generator/pubspec.yaml | 4 ++-- packages/path_provider/path_provider/CHANGELOG.md | 1 + packages/path_provider/path_provider/example/pubspec.yaml | 4 ++-- packages/path_provider/path_provider/pubspec.yaml | 4 ++-- packages/path_provider/path_provider_android/CHANGELOG.md | 1 + .../path_provider_android/example/pubspec.yaml | 4 ++-- packages/path_provider/path_provider_android/pubspec.yaml | 4 ++-- packages/path_provider/path_provider_linux/CHANGELOG.md | 2 +- .../path_provider_linux/example/pubspec.yaml | 4 ++-- packages/path_provider/path_provider_linux/pubspec.yaml | 4 ++-- .../path_provider_platform_interface/CHANGELOG.md | 4 ++++ .../path_provider_platform_interface/pubspec.yaml | 4 ++-- packages/path_provider/path_provider_windows/CHANGELOG.md | 2 +- .../path_provider_windows/example/pubspec.yaml | 4 ++-- packages/path_provider/path_provider_windows/pubspec.yaml | 4 ++-- packages/pigeon/CHANGELOG.md | 4 ++++ packages/pigeon/example/app/pubspec.yaml | 2 +- packages/pigeon/example/pubspec.yaml | 2 +- .../alternate_language_test_plugin/example/pubspec.yaml | 2 +- .../alternate_language_test_plugin/pubspec.yaml | 4 ++-- .../platform_tests/shared_test_plugin_code/pubspec.yaml | 4 ++-- .../platform_tests/test_plugin/example/pubspec.yaml | 2 +- packages/pigeon/platform_tests/test_plugin/pubspec.yaml | 4 ++-- packages/pigeon/pubspec.yaml | 2 +- packages/platform/CHANGELOG.md | 4 ++++ packages/platform/example/pubspec.yaml | 2 +- packages/platform/pubspec.yaml | 2 +- packages/plugin_platform_interface/CHANGELOG.md | 4 ++++ packages/plugin_platform_interface/pubspec.yaml | 2 +- packages/process/CHANGELOG.md | 4 ++++ packages/process/pubspec.yaml | 2 +- packages/quick_actions/quick_actions/CHANGELOG.md | 4 ++++ packages/quick_actions/quick_actions/example/pubspec.yaml | 4 ++-- packages/quick_actions/quick_actions/pubspec.yaml | 4 ++-- packages/quick_actions/quick_actions_android/CHANGELOG.md | 1 + .../quick_actions_android/example/pubspec.yaml | 4 ++-- packages/quick_actions/quick_actions_android/pubspec.yaml | 4 ++-- .../quick_actions_platform_interface/CHANGELOG.md | 4 ++++ .../quick_actions_platform_interface/pubspec.yaml | 4 ++-- .../shared_preferences/shared_preferences/CHANGELOG.md | 1 + .../shared_preferences/example/pubspec.yaml | 4 ++-- .../shared_preferences/shared_preferences/pubspec.yaml | 4 ++-- .../shared_preferences_android/CHANGELOG.md | 2 +- .../shared_preferences_android/example/pubspec.yaml | 4 ++-- .../shared_preferences_android/pubspec.yaml | 4 ++-- .../shared_preferences_linux/CHANGELOG.md | 2 +- .../shared_preferences_linux/example/pubspec.yaml | 4 ++-- .../shared_preferences_linux/pubspec.yaml | 4 ++-- .../shared_preferences_platform_interface/CHANGELOG.md | 4 ++++ .../shared_preferences_platform_interface/pubspec.yaml | 4 ++-- .../shared_preferences_windows/CHANGELOG.md | 2 +- .../shared_preferences_windows/example/pubspec.yaml | 4 ++-- .../shared_preferences_windows/pubspec.yaml | 4 ++-- packages/standard_message_codec/CHANGELOG.md | 2 +- packages/standard_message_codec/example/pubspec.yaml | 2 +- packages/standard_message_codec/pubspec.yaml | 2 +- packages/url_launcher/url_launcher_android/CHANGELOG.md | 4 ++++ .../url_launcher_android/example/pubspec.yaml | 4 ++-- packages/url_launcher/url_launcher_android/pubspec.yaml | 4 ++-- packages/url_launcher/url_launcher_linux/CHANGELOG.md | 4 ++++ .../url_launcher/url_launcher_linux/example/pubspec.yaml | 4 ++-- packages/url_launcher/url_launcher_linux/pubspec.yaml | 4 ++-- packages/url_launcher/url_launcher_macos/CHANGELOG.md | 2 +- .../url_launcher/url_launcher_macos/example/pubspec.yaml | 4 ++-- packages/url_launcher/url_launcher_macos/pubspec.yaml | 4 ++-- packages/url_launcher/url_launcher_windows/CHANGELOG.md | 4 ++++ .../url_launcher_windows/example/pubspec.yaml | 4 ++-- packages/url_launcher/url_launcher_windows/pubspec.yaml | 4 ++-- packages/video_player/video_player/CHANGELOG.md | 1 + packages/video_player/video_player/example/pubspec.yaml | 4 ++-- packages/video_player/video_player_android/CHANGELOG.md | 4 ++++ .../video_player_android/example/pubspec.yaml | 4 ++-- packages/video_player/video_player_android/pubspec.yaml | 4 ++-- .../video_player_platform_interface/CHANGELOG.md | 4 ++++ .../video_player_platform_interface/pubspec.yaml | 4 ++-- packages/video_player/video_player_web/CHANGELOG.md | 4 ++++ .../video_player/video_player_web/example/pubspec.yaml | 4 ++-- packages/web_benchmarks/CHANGELOG.md | 4 ++++ packages/web_benchmarks/testing/test_app/pubspec.yaml | 2 +- .../webview_flutter/webview_flutter_android/CHANGELOG.md | 1 + .../webview_flutter_android/example/pubspec.yaml | 4 ++-- .../webview_flutter/webview_flutter_android/pubspec.yaml | 4 ++-- .../webview_flutter_platform_interface/CHANGELOG.md | 4 ++++ .../webview_flutter_platform_interface/pubspec.yaml | 4 ++-- packages/webview_flutter/webview_flutter_web/CHANGELOG.md | 4 ++++ .../webview_flutter_web/example/pubspec.yaml | 4 ++-- packages/xdg_directories/CHANGELOG.md | 4 ++++ packages/xdg_directories/example/pubspec.yaml | 4 ++-- packages/xdg_directories/pubspec.yaml | 2 +- script/tool/lib/src/common/core.dart | 2 ++ third_party/packages/cupertino_icons/CHANGELOG.md | 4 ++++ third_party/packages/cupertino_icons/pubspec.yaml | 2 +- 229 files changed, 486 insertions(+), 287 deletions(-) diff --git a/.ci.yaml b/.ci.yaml index 28d98fe2b917..0b277d28053b 100644 --- a/.ci.yaml +++ b/.ci.yaml @@ -295,10 +295,10 @@ targets: timeout: 30 properties: target_file: analyze_legacy.yaml - channel: "3.13.9" + channel: "3.16.9" env_variables: >- { - "CHANNEL": "3.13.9" + "CHANNEL": "3.16.9" } - name: Linux analyze_legacy N-2 @@ -306,10 +306,10 @@ targets: timeout: 30 properties: target_file: analyze_legacy.yaml - channel: "3.10.6" + channel: "3.13.9" env_variables: >- { - "CHANNEL": "3.10.6" + "CHANNEL": "3.13.9" } - name: Linux_android custom_package_tests master diff --git a/.ci/targets/repo_checks.yaml b/.ci/targets/repo_checks.yaml index 588a0b849c4b..8e22ffd6ea50 100644 --- a/.ci/targets/repo_checks.yaml +++ b/.ci/targets/repo_checks.yaml @@ -19,7 +19,7 @@ tasks: script: .ci/scripts/tool_runner.sh args: - "pubspec-check" - - "--min-min-flutter-version=3.10.0" + - "--min-min-flutter-version=3.13.0" - "--allow-dependencies=script/configs/allowed_unpinned_deps.yaml" - "--allow-pinned-dependencies=script/configs/allowed_pinned_deps.yaml" always: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e34536db5cc9..adf983fdc5e5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,7 +31,7 @@ jobs: # the change if it doesn't. run: | cd $HOME - git clone https://github.com/flutter/flutter.git --depth 1 -b 3.16.6 _flutter + git clone https://github.com/flutter/flutter.git --depth 1 -b 3.19.0 _flutter echo "$HOME/_flutter/bin" >> $GITHUB_PATH cd $GITHUB_WORKSPACE # Checks out a copy of the repo. diff --git a/packages/animations/CHANGELOG.md b/packages/animations/CHANGELOG.md index d467c5d00982..45c5e527f73c 100644 --- a/packages/animations/CHANGELOG.md +++ b/packages/animations/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 2.0.11 * Fixes new lint warnings. diff --git a/packages/animations/example/pubspec.yaml b/packages/animations/example/pubspec.yaml index f7cb351ff738..2050ce2aa0ae 100644 --- a/packages/animations/example/pubspec.yaml +++ b/packages/animations/example/pubspec.yaml @@ -6,8 +6,8 @@ publish_to: none version: 0.0.1 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: animations: diff --git a/packages/camera/camera/CHANGELOG.md b/packages/camera/camera/CHANGELOG.md index 1a212b7be19c..8ad0b49fe98e 100644 --- a/packages/camera/camera/CHANGELOG.md +++ b/packages/camera/camera/CHANGELOG.md @@ -1,5 +1,6 @@ ## NEXT +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. * Updates support matrix in README to indicate that iOS 11 is no longer supported. * Clients on versions of Flutter that still support iOS 11 can continue to use this package with iOS 11, but will not receive any further updates to the iOS implementation. diff --git a/packages/camera/camera/example/pubspec.yaml b/packages/camera/camera/example/pubspec.yaml index fbfc6949e9f0..6555d3f352c7 100644 --- a/packages/camera/camera/example/pubspec.yaml +++ b/packages/camera/camera/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the camera plugin. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: camera: diff --git a/packages/camera/camera/pubspec.yaml b/packages/camera/camera/pubspec.yaml index 45e8b25fc545..dc5755bb8829 100644 --- a/packages/camera/camera/pubspec.yaml +++ b/packages/camera/camera/pubspec.yaml @@ -7,8 +7,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 0.10.5+9 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/camera/camera_android/CHANGELOG.md b/packages/camera/camera_android/CHANGELOG.md index 5afd95b3ab0f..d7bbc2bdecd5 100644 --- a/packages/camera/camera_android/CHANGELOG.md +++ b/packages/camera/camera_android/CHANGELOG.md @@ -1,5 +1,6 @@ ## NEXT +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. * Updates compileSdk version to 34. ## 0.10.8+16 diff --git a/packages/camera/camera_android/example/pubspec.yaml b/packages/camera/camera_android/example/pubspec.yaml index 51be7296139f..7cf7ef8e62d4 100644 --- a/packages/camera/camera_android/example/pubspec.yaml +++ b/packages/camera/camera_android/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the camera plugin. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: camera_android: diff --git a/packages/camera/camera_android/pubspec.yaml b/packages/camera/camera_android/pubspec.yaml index 2fc248806bc6..48a04d46ef30 100644 --- a/packages/camera/camera_android/pubspec.yaml +++ b/packages/camera/camera_android/pubspec.yaml @@ -6,8 +6,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 0.10.8+16 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/camera/camera_android_camerax/CHANGELOG.md b/packages/camera/camera_android_camerax/CHANGELOG.md index a96bfcefd993..ce4475ebf0fc 100644 --- a/packages/camera/camera_android_camerax/CHANGELOG.md +++ b/packages/camera/camera_android_camerax/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 0.5.0+32 * Removes all remaining `unawaited` calls to fix potential race conditions and updates the diff --git a/packages/camera/camera_android_camerax/example/pubspec.yaml b/packages/camera/camera_android_camerax/example/pubspec.yaml index bdb8f516770e..54b84cc0b696 100644 --- a/packages/camera/camera_android_camerax/example/pubspec.yaml +++ b/packages/camera/camera_android_camerax/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the camera_android_camerax plugin. publish_to: 'none' environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: camera_android_camerax: diff --git a/packages/camera/camera_android_camerax/pubspec.yaml b/packages/camera/camera_android_camerax/pubspec.yaml index c9da17866935..d6970d2e559e 100644 --- a/packages/camera/camera_android_camerax/pubspec.yaml +++ b/packages/camera/camera_android_camerax/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 0.5.0+32 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/camera/camera_platform_interface/CHANGELOG.md b/packages/camera/camera_platform_interface/CHANGELOG.md index e9082e4fbc0c..1db3ab335b91 100644 --- a/packages/camera/camera_platform_interface/CHANGELOG.md +++ b/packages/camera/camera_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 2.7.3 * Adds documentation to clarify that platform implementations of the plugin use diff --git a/packages/camera/camera_platform_interface/pubspec.yaml b/packages/camera/camera_platform_interface/pubspec.yaml index ff6ee2ce9b9d..de4de97acff1 100644 --- a/packages/camera/camera_platform_interface/pubspec.yaml +++ b/packages/camera/camera_platform_interface/pubspec.yaml @@ -7,8 +7,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 2.7.3 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: cross_file: ^0.3.1 diff --git a/packages/camera/camera_web/CHANGELOG.md b/packages/camera/camera_web/CHANGELOG.md index 9cff62b8a35e..4303457de66b 100644 --- a/packages/camera/camera_web/CHANGELOG.md +++ b/packages/camera/camera_web/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 0.3.2+4 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. diff --git a/packages/camera/camera_web/example/pubspec.yaml b/packages/camera/camera_web/example/pubspec.yaml index 12cdbce3f9b6..18b7681f00ac 100644 --- a/packages/camera/camera_web/example/pubspec.yaml +++ b/packages/camera/camera_web/example/pubspec.yaml @@ -2,8 +2,8 @@ name: camera_web_integration_tests publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: camera_platform_interface: ^2.1.0 diff --git a/packages/camera/camera_windows/CHANGELOG.md b/packages/camera/camera_windows/CHANGELOG.md index c96b193b8890..a0e5c3fcc626 100644 --- a/packages/camera/camera_windows/CHANGELOG.md +++ b/packages/camera/camera_windows/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 0.2.1+9 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. diff --git a/packages/camera/camera_windows/example/pubspec.yaml b/packages/camera/camera_windows/example/pubspec.yaml index 12b35ea258dc..9061be968f99 100644 --- a/packages/camera/camera_windows/example/pubspec.yaml +++ b/packages/camera/camera_windows/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the camera_windows plugin. publish_to: 'none' environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: camera_platform_interface: ^2.1.2 diff --git a/packages/camera/camera_windows/pubspec.yaml b/packages/camera/camera_windows/pubspec.yaml index e819d39433d0..1dd1413b5531 100644 --- a/packages/camera/camera_windows/pubspec.yaml +++ b/packages/camera/camera_windows/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 0.2.1+9 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/cross_file/CHANGELOG.md b/packages/cross_file/CHANGELOG.md index 2591d2ea9d22..c6113b298146 100644 --- a/packages/cross_file/CHANGELOG.md +++ b/packages/cross_file/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 0.3.3+8 * Now supports `dart2wasm` compilation. diff --git a/packages/cross_file/example/pubspec.yaml b/packages/cross_file/example/pubspec.yaml index cfc3baf8aeec..20c49e7b4198 100644 --- a/packages/cross_file/example/pubspec.yaml +++ b/packages/cross_file/example/pubspec.yaml @@ -3,7 +3,7 @@ description: Demonstrates how to use cross files. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ^3.1.0 dependencies: cross_file: diff --git a/packages/css_colors/CHANGELOG.md b/packages/css_colors/CHANGELOG.md index 72fc00b91ca4..e0cad34b67b1 100644 --- a/packages/css_colors/CHANGELOG.md +++ b/packages/css_colors/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 1.1.4 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. diff --git a/packages/css_colors/pubspec.yaml b/packages/css_colors/pubspec.yaml index b999cfe3f29a..9be487079870 100644 --- a/packages/css_colors/pubspec.yaml +++ b/packages/css_colors/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 1.1.4 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/dynamic_layouts/CHANGELOG.md b/packages/dynamic_layouts/CHANGELOG.md index 9b2f580186d3..19e3b118c04c 100644 --- a/packages/dynamic_layouts/CHANGELOG.md +++ b/packages/dynamic_layouts/CHANGELOG.md @@ -1,6 +1,6 @@ ## NEXT -* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. ## 0.0.1+1 diff --git a/packages/dynamic_layouts/example/pubspec.yaml b/packages/dynamic_layouts/example/pubspec.yaml index 44bdf667b84c..7d4558165e71 100644 --- a/packages/dynamic_layouts/example/pubspec.yaml +++ b/packages/dynamic_layouts/example/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: 'none' version: 1.0.0+1 environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ^3.1.0 dependencies: cupertino_icons: ^1.0.5 diff --git a/packages/dynamic_layouts/pubspec.yaml b/packages/dynamic_layouts/pubspec.yaml index f28d6250c514..4f2c39c6fc18 100644 --- a/packages/dynamic_layouts/pubspec.yaml +++ b/packages/dynamic_layouts/pubspec.yaml @@ -7,8 +7,8 @@ repository: https://github.com/flutter/packages/tree/main/packages/dynamic_layou publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/espresso/CHANGELOG.md b/packages/espresso/CHANGELOG.md index d01f02cb1650..13907513590c 100644 --- a/packages/espresso/CHANGELOG.md +++ b/packages/espresso/CHANGELOG.md @@ -1,5 +1,6 @@ ## NEXT +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. * Updates compileSdk version to 34. ## 0.3.0+7 diff --git a/packages/espresso/example/pubspec.yaml b/packages/espresso/example/pubspec.yaml index aa919920eef1..8518f1113656 100644 --- a/packages/espresso/example/pubspec.yaml +++ b/packages/espresso/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the espresso plugin. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/espresso/pubspec.yaml b/packages/espresso/pubspec.yaml index bd5b0d5b6109..cbd944c92d40 100644 --- a/packages/espresso/pubspec.yaml +++ b/packages/espresso/pubspec.yaml @@ -6,8 +6,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 0.3.0+7 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/extension_google_sign_in_as_googleapis_auth/CHANGELOG.md b/packages/extension_google_sign_in_as_googleapis_auth/CHANGELOG.md index 4d98d664590b..796cb4e57cc1 100644 --- a/packages/extension_google_sign_in_as_googleapis_auth/CHANGELOG.md +++ b/packages/extension_google_sign_in_as_googleapis_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 2.0.12 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. diff --git a/packages/extension_google_sign_in_as_googleapis_auth/example/pubspec.yaml b/packages/extension_google_sign_in_as_googleapis_auth/example/pubspec.yaml index fe07b28db9ad..454486b4727f 100644 --- a/packages/extension_google_sign_in_as_googleapis_auth/example/pubspec.yaml +++ b/packages/extension_google_sign_in_as_googleapis_auth/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Example of Google Sign-In plugin and googleapis. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: extension_google_sign_in_as_googleapis_auth: diff --git a/packages/extension_google_sign_in_as_googleapis_auth/pubspec.yaml b/packages/extension_google_sign_in_as_googleapis_auth/pubspec.yaml index 3adbd9677446..f8dfe51d0ac2 100644 --- a/packages/extension_google_sign_in_as_googleapis_auth/pubspec.yaml +++ b/packages/extension_google_sign_in_as_googleapis_auth/pubspec.yaml @@ -11,8 +11,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 2.0.12 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/file_selector/file_selector/CHANGELOG.md b/packages/file_selector/file_selector/CHANGELOG.md index 9b249e044af4..32358365bd7c 100644 --- a/packages/file_selector/file_selector/CHANGELOG.md +++ b/packages/file_selector/file_selector/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 1.0.3 * Fixes a typo in documentation comments. diff --git a/packages/file_selector/file_selector/example/pubspec.yaml b/packages/file_selector/file_selector/example/pubspec.yaml index 21d8ab959d6b..9d729f1b381f 100644 --- a/packages/file_selector/file_selector/example/pubspec.yaml +++ b/packages/file_selector/file_selector/example/pubspec.yaml @@ -5,8 +5,8 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: file_selector: diff --git a/packages/file_selector/file_selector/pubspec.yaml b/packages/file_selector/file_selector/pubspec.yaml index ed6a859d188f..d53b7b3efed1 100644 --- a/packages/file_selector/file_selector/pubspec.yaml +++ b/packages/file_selector/file_selector/pubspec.yaml @@ -6,8 +6,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 1.0.3 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/file_selector/file_selector_android/CHANGELOG.md b/packages/file_selector/file_selector_android/CHANGELOG.md index fb9d2a419af7..d71daf951fbf 100644 --- a/packages/file_selector/file_selector_android/CHANGELOG.md +++ b/packages/file_selector/file_selector_android/CHANGELOG.md @@ -1,5 +1,6 @@ ## NEXT +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. * Updates compileSdk version to 34. ## 0.5.0+7 diff --git a/packages/file_selector/file_selector_android/example/pubspec.yaml b/packages/file_selector/file_selector_android/example/pubspec.yaml index 47a7b79d95ed..96261cf2f32b 100644 --- a/packages/file_selector/file_selector_android/example/pubspec.yaml +++ b/packages/file_selector/file_selector_android/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the file_selector_android plugin. publish_to: 'none' environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: file_selector_android: diff --git a/packages/file_selector/file_selector_android/pubspec.yaml b/packages/file_selector/file_selector_android/pubspec.yaml index bb5423ec0e5f..9f0843771ff1 100644 --- a/packages/file_selector/file_selector_android/pubspec.yaml +++ b/packages/file_selector/file_selector_android/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 0.5.0+7 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/file_selector/file_selector_linux/CHANGELOG.md b/packages/file_selector/file_selector_linux/CHANGELOG.md index 8baccfa174a5..49e00d299137 100644 --- a/packages/file_selector/file_selector_linux/CHANGELOG.md +++ b/packages/file_selector/file_selector_linux/CHANGELOG.md @@ -1,6 +1,6 @@ ## NEXT -* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. ## 0.9.2+1 diff --git a/packages/file_selector/file_selector_linux/example/pubspec.yaml b/packages/file_selector/file_selector_linux/example/pubspec.yaml index 3ea072c97907..957bd132be6c 100644 --- a/packages/file_selector/file_selector_linux/example/pubspec.yaml +++ b/packages/file_selector/file_selector_linux/example/pubspec.yaml @@ -4,8 +4,8 @@ publish_to: 'none' version: 1.0.0+1 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: file_selector_linux: diff --git a/packages/file_selector/file_selector_linux/pubspec.yaml b/packages/file_selector/file_selector_linux/pubspec.yaml index f009fdb5f0d7..88a33e9aedef 100644 --- a/packages/file_selector/file_selector_linux/pubspec.yaml +++ b/packages/file_selector/file_selector_linux/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 0.9.2+1 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/file_selector/file_selector_macos/CHANGELOG.md b/packages/file_selector/file_selector_macos/CHANGELOG.md index 31e82ec844bc..03cc77eafe7f 100644 --- a/packages/file_selector/file_selector_macos/CHANGELOG.md +++ b/packages/file_selector/file_selector_macos/CHANGELOG.md @@ -1,6 +1,6 @@ ## NEXT -* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. ## 0.9.3+3 diff --git a/packages/file_selector/file_selector_macos/example/pubspec.yaml b/packages/file_selector/file_selector_macos/example/pubspec.yaml index 475ca24852c1..e211b2364a58 100644 --- a/packages/file_selector/file_selector_macos/example/pubspec.yaml +++ b/packages/file_selector/file_selector_macos/example/pubspec.yaml @@ -4,8 +4,8 @@ publish_to: 'none' version: 1.0.0 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: file_selector_macos: diff --git a/packages/file_selector/file_selector_macos/pubspec.yaml b/packages/file_selector/file_selector_macos/pubspec.yaml index e7489faee567..8f1599612c1b 100644 --- a/packages/file_selector/file_selector_macos/pubspec.yaml +++ b/packages/file_selector/file_selector_macos/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 0.9.3+3 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/file_selector/file_selector_platform_interface/CHANGELOG.md b/packages/file_selector/file_selector_platform_interface/CHANGELOG.md index 0389639b16df..03b3ab11380a 100644 --- a/packages/file_selector/file_selector_platform_interface/CHANGELOG.md +++ b/packages/file_selector/file_selector_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 2.6.2 * Updates minimum required plugin_platform_interface version to 2.1.7. diff --git a/packages/file_selector/file_selector_platform_interface/pubspec.yaml b/packages/file_selector/file_selector_platform_interface/pubspec.yaml index a117817c6e1e..6cc780129499 100644 --- a/packages/file_selector/file_selector_platform_interface/pubspec.yaml +++ b/packages/file_selector/file_selector_platform_interface/pubspec.yaml @@ -7,8 +7,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 2.6.2 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: cross_file: ^0.3.0 diff --git a/packages/file_selector/file_selector_web/CHANGELOG.md b/packages/file_selector/file_selector_web/CHANGELOG.md index 3f1428514c8a..40b7a853e5b3 100644 --- a/packages/file_selector/file_selector_web/CHANGELOG.md +++ b/packages/file_selector/file_selector_web/CHANGELOG.md @@ -1,6 +1,6 @@ ## NEXT -* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. ## 0.9.3 diff --git a/packages/file_selector/file_selector_web/example/pubspec.yaml b/packages/file_selector/file_selector_web/example/pubspec.yaml index e22b1742db4b..725ace61b00b 100644 --- a/packages/file_selector/file_selector_web/example/pubspec.yaml +++ b/packages/file_selector/file_selector_web/example/pubspec.yaml @@ -2,8 +2,8 @@ name: file_selector_web_integration_tests publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: file_selector_platform_interface: ^2.6.0 diff --git a/packages/file_selector/file_selector_windows/CHANGELOG.md b/packages/file_selector/file_selector_windows/CHANGELOG.md index 2b03c336ec5a..a20abf6153bf 100644 --- a/packages/file_selector/file_selector_windows/CHANGELOG.md +++ b/packages/file_selector/file_selector_windows/CHANGELOG.md @@ -1,6 +1,6 @@ ## NEXT -* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. ## 0.9.3+1 diff --git a/packages/file_selector/file_selector_windows/example/pubspec.yaml b/packages/file_selector/file_selector_windows/example/pubspec.yaml index 50334b575345..beec643cd93d 100644 --- a/packages/file_selector/file_selector_windows/example/pubspec.yaml +++ b/packages/file_selector/file_selector_windows/example/pubspec.yaml @@ -4,8 +4,8 @@ publish_to: 'none' version: 1.0.0 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: file_selector_platform_interface: ^2.6.0 diff --git a/packages/file_selector/file_selector_windows/pubspec.yaml b/packages/file_selector/file_selector_windows/pubspec.yaml index e6d0aba416c8..f031be5fd4d2 100644 --- a/packages/file_selector/file_selector_windows/pubspec.yaml +++ b/packages/file_selector/file_selector_windows/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 0.9.3+1 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/flutter_adaptive_scaffold/CHANGELOG.md b/packages/flutter_adaptive_scaffold/CHANGELOG.md index e6bcda993b60..623da45aaf86 100644 --- a/packages/flutter_adaptive_scaffold/CHANGELOG.md +++ b/packages/flutter_adaptive_scaffold/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 0.1.8 * Adds `transitionDuration` parameter for specifying how long the animation should be. diff --git a/packages/flutter_adaptive_scaffold/example/pubspec.yaml b/packages/flutter_adaptive_scaffold/example/pubspec.yaml index c4b4f725bf97..5c327ac86c82 100644 --- a/packages/flutter_adaptive_scaffold/example/pubspec.yaml +++ b/packages/flutter_adaptive_scaffold/example/pubspec.yaml @@ -4,8 +4,8 @@ publish_to: 'none' version: 0.0.1 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/flutter_adaptive_scaffold/pubspec.yaml b/packages/flutter_adaptive_scaffold/pubspec.yaml index eccb49b26f09..6ebf6d894f92 100644 --- a/packages/flutter_adaptive_scaffold/pubspec.yaml +++ b/packages/flutter_adaptive_scaffold/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ repository: https://github.com/flutter/packages/tree/main/packages/flutter_adaptive_scaffold environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/flutter_image/CHANGELOG.md b/packages/flutter_image/CHANGELOG.md index 7e83f85aa595..3f3e5560846e 100644 --- a/packages/flutter_image/CHANGELOG.md +++ b/packages/flutter_image/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 4.1.11 * Replaces deprecated loadBuffer API usage. diff --git a/packages/flutter_image/example/pubspec.yaml b/packages/flutter_image/example/pubspec.yaml index ceb653bce31d..3ee96174bd50 100644 --- a/packages/flutter_image/example/pubspec.yaml +++ b/packages/flutter_image/example/pubspec.yaml @@ -6,8 +6,8 @@ publish_to: "none" version: 1.0.0+1 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: cupertino_icons: ^1.0.2 diff --git a/packages/flutter_image/pubspec.yaml b/packages/flutter_image/pubspec.yaml index 99c0eb78f51a..87731b2afd0e 100644 --- a/packages/flutter_image/pubspec.yaml +++ b/packages/flutter_image/pubspec.yaml @@ -6,8 +6,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 4.1.11 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/flutter_lints/CHANGELOG.md b/packages/flutter_lints/CHANGELOG.md index 2977fc362600..959080a0e1c6 100644 --- a/packages/flutter_lints/CHANGELOG.md +++ b/packages/flutter_lints/CHANGELOG.md @@ -1,6 +1,6 @@ ## NEXT -* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. ## 3.0.1 diff --git a/packages/flutter_lints/example/pubspec.yaml b/packages/flutter_lints/example/pubspec.yaml index 51fb6c7b03e1..b03c52c0acce 100644 --- a/packages/flutter_lints/example/pubspec.yaml +++ b/packages/flutter_lints/example/pubspec.yaml @@ -4,7 +4,7 @@ description: A project that showcases how to enable the recommended lints for Fl publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ^3.1.0 # Add the latest version of `package:flutter_lints` as a dev_dependency. The # lint set provided by this package is activated in the `analysis_options.yaml` diff --git a/packages/flutter_lints/pubspec.yaml b/packages/flutter_lints/pubspec.yaml index d081e4b736f8..860eedbb55ee 100644 --- a/packages/flutter_lints/pubspec.yaml +++ b/packages/flutter_lints/pubspec.yaml @@ -5,7 +5,7 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 3.0.1 environment: - sdk: ^3.0.0 + sdk: ^3.1.0 dependencies: lints: ^3.0.0 diff --git a/packages/flutter_markdown/CHANGELOG.md b/packages/flutter_markdown/CHANGELOG.md index d6b2a3c32318..8feeca4bdae2 100644 --- a/packages/flutter_markdown/CHANGELOG.md +++ b/packages/flutter_markdown/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 0.6.19 * Replaces `RichText` with `Text.rich` so the widget can work with `SelectionArea` when `selectable` is set to false. diff --git a/packages/flutter_markdown/example/pubspec.yaml b/packages/flutter_markdown/example/pubspec.yaml index 593c0fe9cc17..a904473786a4 100644 --- a/packages/flutter_markdown/example/pubspec.yaml +++ b/packages/flutter_markdown/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the flutter_markdown package. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/flutter_markdown/pubspec.yaml b/packages/flutter_markdown/pubspec.yaml index e909e60da2d2..c3732a5c2cb8 100644 --- a/packages/flutter_markdown/pubspec.yaml +++ b/packages/flutter_markdown/pubspec.yaml @@ -7,8 +7,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 0.6.19 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/flutter_migrate/CHANGELOG.md b/packages/flutter_migrate/CHANGELOG.md index ff0e2330345a..03b422057f7b 100644 --- a/packages/flutter_migrate/CHANGELOG.md +++ b/packages/flutter_migrate/CHANGELOG.md @@ -1,6 +1,6 @@ ## NEXT -* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. ## 0.0.1+3 diff --git a/packages/flutter_migrate/pubspec.yaml b/packages/flutter_migrate/pubspec.yaml index 222b6bdd8629..d8dafc6b739a 100644 --- a/packages/flutter_migrate/pubspec.yaml +++ b/packages/flutter_migrate/pubspec.yaml @@ -6,7 +6,7 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ^3.1.0 dependencies: args: ^2.3.1 diff --git a/packages/flutter_plugin_android_lifecycle/CHANGELOG.md b/packages/flutter_plugin_android_lifecycle/CHANGELOG.md index f19cf5d41005..e4eb323897b3 100644 --- a/packages/flutter_plugin_android_lifecycle/CHANGELOG.md +++ b/packages/flutter_plugin_android_lifecycle/CHANGELOG.md @@ -1,7 +1,7 @@ ## NEXT +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. * Updates compileSdk version to 34. -* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. ## 2.0.17 diff --git a/packages/flutter_plugin_android_lifecycle/example/pubspec.yaml b/packages/flutter_plugin_android_lifecycle/example/pubspec.yaml index 45ae8b5c2a55..ce25da74efb6 100644 --- a/packages/flutter_plugin_android_lifecycle/example/pubspec.yaml +++ b/packages/flutter_plugin_android_lifecycle/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the flutter_plugin_android_lifecycle plugin publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/flutter_plugin_android_lifecycle/pubspec.yaml b/packages/flutter_plugin_android_lifecycle/pubspec.yaml index 3c88b63e0dd8..e39b286c83f9 100644 --- a/packages/flutter_plugin_android_lifecycle/pubspec.yaml +++ b/packages/flutter_plugin_android_lifecycle/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 2.0.17 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/flutter_template_images/CHANGELOG.md b/packages/flutter_template_images/CHANGELOG.md index 78d375e82f78..3d5ff3ede522 100644 --- a/packages/flutter_template_images/CHANGELOG.md +++ b/packages/flutter_template_images/CHANGELOG.md @@ -1,6 +1,6 @@ ## NEXT -* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. ## 4.2.1 diff --git a/packages/flutter_template_images/pubspec.yaml b/packages/flutter_template_images/pubspec.yaml index 867141ae9bd5..299aecef3cf3 100644 --- a/packages/flutter_template_images/pubspec.yaml +++ b/packages/flutter_template_images/pubspec.yaml @@ -5,7 +5,7 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 4.2.1 environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ^3.1.0 topics: - assets diff --git a/packages/go_router/CHANGELOG.md b/packages/go_router/CHANGELOG.md index 94fefe87e008..3b01fb1dbb49 100644 --- a/packages/go_router/CHANGELOG.md +++ b/packages/go_router/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 13.2.0 - Exposes full `Uri` on `GoRouterState` in `GoRouterRedirect` diff --git a/packages/go_router/example/pubspec.yaml b/packages/go_router/example/pubspec.yaml index 226ef8cddbf5..5eb27e8536b3 100644 --- a/packages/go_router/example/pubspec.yaml +++ b/packages/go_router/example/pubspec.yaml @@ -4,8 +4,8 @@ version: 3.0.1 publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: adaptive_navigation: ^0.0.4 diff --git a/packages/go_router_builder/CHANGELOG.md b/packages/go_router_builder/CHANGELOG.md index 2bf8adbca223..d73a3e682e89 100644 --- a/packages/go_router_builder/CHANGELOG.md +++ b/packages/go_router_builder/CHANGELOG.md @@ -1,5 +1,6 @@ ## NEXT +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. * Updates dependencies to require `analyzer` 5.2.0 or later. ## 2.4.1 diff --git a/packages/go_router_builder/example/pubspec.yaml b/packages/go_router_builder/example/pubspec.yaml index bd19dfdad92e..c9a2bd938c7d 100644 --- a/packages/go_router_builder/example/pubspec.yaml +++ b/packages/go_router_builder/example/pubspec.yaml @@ -3,7 +3,7 @@ description: go_router_builder examples publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ^3.1.0 dependencies: collection: ^1.15.0 diff --git a/packages/go_router_builder/pubspec.yaml b/packages/go_router_builder/pubspec.yaml index 244c4d9ebe76..1fc254577ff7 100644 --- a/packages/go_router_builder/pubspec.yaml +++ b/packages/go_router_builder/pubspec.yaml @@ -7,7 +7,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/go_router_bui issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+go_router_builder%22 environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ^3.1.0 dependencies: analyzer: ">=5.2.0 <7.0.0" diff --git a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md index 4ce6ad006acd..095e04709027 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 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 2.5.3 * Updates support matrix in README to indicate that iOS 11 is no longer supported. 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 cced821dd62b..efed14ceecbf 100644 --- a/packages/google_maps_flutter/google_maps_flutter/example/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the google_maps_flutter plugin. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: cupertino_icons: ^1.0.5 diff --git a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml index 482f6303545a..9b53f596fdf6 100644 --- a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 2.5.3 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md index ccc8251c834f..ba2011f39be2 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md @@ -1,5 +1,6 @@ ## NEXT +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. * Updates compileSdk version to 34. ## 2.6.2 diff --git a/packages/google_maps_flutter/google_maps_flutter_android/example/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_android/example/pubspec.yaml index 7cc11a51956d..f241ddc6c920 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/example/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_android/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the google_maps_flutter plugin. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: cupertino_icons: ^1.0.5 diff --git a/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml index 2f1ca0a71494..30b1644e313c 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 2.6.2 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: 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 29357462a727..1905f2c44e9f 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 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 2.4.3 * Updates minimum required plugin_platform_interface version to 2.1.7. 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 7f61bfe35727..2f30c38978f5 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 @@ -7,8 +7,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 2.4.3 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: collection: ^1.15.0 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 e46b0702bf9f..a8de9d0147e7 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 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 0.5.4+3 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. diff --git a/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml index c18683517975..7b2c31b6f537 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml @@ -3,8 +3,8 @@ publish_to: none # Tests require flutter beta or greater to run. environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/google_sign_in/google_sign_in_android/CHANGELOG.md b/packages/google_sign_in/google_sign_in_android/CHANGELOG.md index 7685f7bd164b..87622e88d6e6 100644 --- a/packages/google_sign_in/google_sign_in_android/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in_android/CHANGELOG.md @@ -1,5 +1,6 @@ ## NEXT +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. * Updates compileSdk version to 34. ## 6.1.21 diff --git a/packages/google_sign_in/google_sign_in_android/example/pubspec.yaml b/packages/google_sign_in/google_sign_in_android/example/pubspec.yaml index 9ce59baca38e..9452d74744c9 100644 --- a/packages/google_sign_in/google_sign_in_android/example/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in_android/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Example of Google Sign-In plugin. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/google_sign_in/google_sign_in_android/pubspec.yaml b/packages/google_sign_in/google_sign_in_android/pubspec.yaml index b54ebf9448d0..7f4e93169184 100644 --- a/packages/google_sign_in/google_sign_in_android/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in_android/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 6.1.21 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/google_sign_in/google_sign_in_platform_interface/CHANGELOG.md b/packages/google_sign_in/google_sign_in_platform_interface/CHANGELOG.md index 2a139da8b4ed..322e22f1d9a1 100644 --- a/packages/google_sign_in/google_sign_in_platform_interface/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 2.4.5 * Updates minimum required plugin_platform_interface version to 2.1.7. diff --git a/packages/google_sign_in/google_sign_in_platform_interface/pubspec.yaml b/packages/google_sign_in/google_sign_in_platform_interface/pubspec.yaml index be19e044e9fb..2e8654243ed5 100644 --- a/packages/google_sign_in/google_sign_in_platform_interface/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in_platform_interface/pubspec.yaml @@ -7,8 +7,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 2.4.5 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/image_picker/image_picker/CHANGELOG.md b/packages/image_picker/image_picker/CHANGELOG.md index 03e7bad04204..239cab4a328c 100644 --- a/packages/image_picker/image_picker/CHANGELOG.md +++ b/packages/image_picker/image_picker/CHANGELOG.md @@ -1,5 +1,6 @@ ## NEXT +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. * Updates support matrix in README to indicate that iOS 11 is no longer supported. * Clients on versions of Flutter that still support iOS 11 can continue to use this package with iOS 11, but will not receive any further updates to the iOS implementation. diff --git a/packages/image_picker/image_picker/example/pubspec.yaml b/packages/image_picker/image_picker/example/pubspec.yaml index f38127fe6706..b41127efc89b 100644 --- a/packages/image_picker/image_picker/example/pubspec.yaml +++ b/packages/image_picker/image_picker/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the image_picker plugin. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/image_picker/image_picker/pubspec.yaml b/packages/image_picker/image_picker/pubspec.yaml index d7abde05cfe7..a02e339a5842 100755 --- a/packages/image_picker/image_picker/pubspec.yaml +++ b/packages/image_picker/image_picker/pubspec.yaml @@ -6,8 +6,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 1.0.7 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/image_picker/image_picker_android/CHANGELOG.md b/packages/image_picker/image_picker_android/CHANGELOG.md index 266a9208f52c..b06dcfa43c85 100644 --- a/packages/image_picker/image_picker_android/CHANGELOG.md +++ b/packages/image_picker/image_picker_android/CHANGELOG.md @@ -1,5 +1,6 @@ ## NEXT +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. * Updates compileSdk version to 34. ## 0.8.9+3 diff --git a/packages/image_picker/image_picker_android/example/pubspec.yaml b/packages/image_picker/image_picker_android/example/pubspec.yaml index b8af22002f5f..c2fa9e98131c 100644 --- a/packages/image_picker/image_picker_android/example/pubspec.yaml +++ b/packages/image_picker/image_picker_android/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the image_picker plugin. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/image_picker/image_picker_android/pubspec.yaml b/packages/image_picker/image_picker_android/pubspec.yaml index 5883352ed505..5e575a36b937 100755 --- a/packages/image_picker/image_picker_android/pubspec.yaml +++ b/packages/image_picker/image_picker_android/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 0.8.9+3 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/image_picker/image_picker_for_web/CHANGELOG.md b/packages/image_picker/image_picker_for_web/CHANGELOG.md index 42111555330f..bc80d9584d93 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 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 3.0.2 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. diff --git a/packages/image_picker/image_picker_for_web/example/pubspec.yaml b/packages/image_picker/image_picker_for_web/example/pubspec.yaml index e00f7ebdd26c..4e1a99bb5530 100644 --- a/packages/image_picker/image_picker_for_web/example/pubspec.yaml +++ b/packages/image_picker/image_picker_for_web/example/pubspec.yaml @@ -2,8 +2,8 @@ name: image_picker_for_web_integration_tests publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/image_picker/image_picker_for_web/pubspec.yaml b/packages/image_picker/image_picker_for_web/pubspec.yaml index 65c8196de806..b4394843b87e 100644 --- a/packages/image_picker/image_picker_for_web/pubspec.yaml +++ b/packages/image_picker/image_picker_for_web/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 3.0.2 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/image_picker/image_picker_linux/CHANGELOG.md b/packages/image_picker/image_picker_linux/CHANGELOG.md index 041ef7bc4ad5..3fc7283141e8 100644 --- a/packages/image_picker/image_picker_linux/CHANGELOG.md +++ b/packages/image_picker/image_picker_linux/CHANGELOG.md @@ -1,6 +1,6 @@ ## NEXT -* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. ## 0.2.1+1 diff --git a/packages/image_picker/image_picker_linux/example/pubspec.yaml b/packages/image_picker/image_picker_linux/example/pubspec.yaml index d7ad404f71c4..a49e487d2434 100644 --- a/packages/image_picker/image_picker_linux/example/pubspec.yaml +++ b/packages/image_picker/image_picker_linux/example/pubspec.yaml @@ -4,8 +4,8 @@ publish_to: 'none' version: 1.0.0 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/image_picker/image_picker_linux/pubspec.yaml b/packages/image_picker/image_picker_linux/pubspec.yaml index 6867306c5fe8..5be7f927eec7 100644 --- a/packages/image_picker/image_picker_linux/pubspec.yaml +++ b/packages/image_picker/image_picker_linux/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 0.2.1+1 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/image_picker/image_picker_macos/CHANGELOG.md b/packages/image_picker/image_picker_macos/CHANGELOG.md index c2b949b5214d..2213848edf97 100644 --- a/packages/image_picker/image_picker_macos/CHANGELOG.md +++ b/packages/image_picker/image_picker_macos/CHANGELOG.md @@ -1,6 +1,6 @@ ## NEXT -* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. ## 0.2.1+1 diff --git a/packages/image_picker/image_picker_macos/example/pubspec.yaml b/packages/image_picker/image_picker_macos/example/pubspec.yaml index 0a04d688e99d..cff5501cfa2d 100644 --- a/packages/image_picker/image_picker_macos/example/pubspec.yaml +++ b/packages/image_picker/image_picker_macos/example/pubspec.yaml @@ -4,8 +4,8 @@ publish_to: 'none' version: 1.0.0 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/image_picker/image_picker_macos/pubspec.yaml b/packages/image_picker/image_picker_macos/pubspec.yaml index fa0c027250a2..5fc9563c02b7 100644 --- a/packages/image_picker/image_picker_macos/pubspec.yaml +++ b/packages/image_picker/image_picker_macos/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 0.2.1+1 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" 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 cf484f89cbe3..854437f5d232 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 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 2.9.3 * Updates minimum required plugin_platform_interface version to 2.1.7. diff --git a/packages/image_picker/image_picker_platform_interface/pubspec.yaml b/packages/image_picker/image_picker_platform_interface/pubspec.yaml index c18d8621d9ac..66b17ed51f47 100644 --- a/packages/image_picker/image_picker_platform_interface/pubspec.yaml +++ b/packages/image_picker/image_picker_platform_interface/pubspec.yaml @@ -7,8 +7,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 2.9.3 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: cross_file: ^0.3.1+1 diff --git a/packages/image_picker/image_picker_windows/CHANGELOG.md b/packages/image_picker/image_picker_windows/CHANGELOG.md index d77664fa2dc4..8575f8064c3b 100644 --- a/packages/image_picker/image_picker_windows/CHANGELOG.md +++ b/packages/image_picker/image_picker_windows/CHANGELOG.md @@ -1,6 +1,6 @@ ## NEXT -* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. ## 0.2.1+1 diff --git a/packages/image_picker/image_picker_windows/example/pubspec.yaml b/packages/image_picker/image_picker_windows/example/pubspec.yaml index cf5da891a496..983f9520e366 100644 --- a/packages/image_picker/image_picker_windows/example/pubspec.yaml +++ b/packages/image_picker/image_picker_windows/example/pubspec.yaml @@ -4,8 +4,8 @@ publish_to: 'none' version: 1.0.0 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/image_picker/image_picker_windows/pubspec.yaml b/packages/image_picker/image_picker_windows/pubspec.yaml index c2b40e62f4ef..23e4777888f0 100644 --- a/packages/image_picker/image_picker_windows/pubspec.yaml +++ b/packages/image_picker/image_picker_windows/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 0.2.1+1 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/in_app_purchase/in_app_purchase/CHANGELOG.md b/packages/in_app_purchase/in_app_purchase/CHANGELOG.md index 9b341a174b91..728a85ebf487 100644 --- a/packages/in_app_purchase/in_app_purchase/CHANGELOG.md +++ b/packages/in_app_purchase/in_app_purchase/CHANGELOG.md @@ -1,5 +1,6 @@ ## NEXT +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. * Updates support matrix in README to indicate that iOS 11 is no longer supported. * Clients on versions of Flutter that still support iOS 11 can continue to use this package with iOS 11, but will not receive any further updates to the iOS implementation. diff --git a/packages/in_app_purchase/in_app_purchase/example/pubspec.yaml b/packages/in_app_purchase/in_app_purchase/example/pubspec.yaml index 046930ffac5e..19cd0fd9ffe7 100644 --- a/packages/in_app_purchase/in_app_purchase/example/pubspec.yaml +++ b/packages/in_app_purchase/in_app_purchase/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the in_app_purchase plugin. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/in_app_purchase/in_app_purchase/pubspec.yaml b/packages/in_app_purchase/in_app_purchase/pubspec.yaml index 82ba18559ad9..2d5d3624ab72 100644 --- a/packages/in_app_purchase/in_app_purchase/pubspec.yaml +++ b/packages/in_app_purchase/in_app_purchase/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 3.1.13 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md b/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md index d495ff40c555..896e9f958995 100644 --- a/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md +++ b/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 0.3.1 * Adds alternative-billing-only APIs to InAppPurchaseAndroidPlatformAddition. diff --git a/packages/in_app_purchase/in_app_purchase_android/example/pubspec.yaml b/packages/in_app_purchase/in_app_purchase_android/example/pubspec.yaml index ed0e009ea070..9239f83a0a31 100644 --- a/packages/in_app_purchase/in_app_purchase_android/example/pubspec.yaml +++ b/packages/in_app_purchase/in_app_purchase_android/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the in_app_purchase_android plugin. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/in_app_purchase/in_app_purchase_android/pubspec.yaml b/packages/in_app_purchase/in_app_purchase_android/pubspec.yaml index 08f34f113fbc..7ce2e0080ce2 100644 --- a/packages/in_app_purchase/in_app_purchase_android/pubspec.yaml +++ b/packages/in_app_purchase/in_app_purchase_android/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 0.3.1 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/in_app_purchase/in_app_purchase_platform_interface/CHANGELOG.md b/packages/in_app_purchase/in_app_purchase_platform_interface/CHANGELOG.md index 9cd44dca940c..6baaa7f722dd 100644 --- a/packages/in_app_purchase/in_app_purchase_platform_interface/CHANGELOG.md +++ b/packages/in_app_purchase/in_app_purchase_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 1.3.7 * Updates minimum required plugin_platform_interface version to 2.1.7. diff --git a/packages/in_app_purchase/in_app_purchase_platform_interface/pubspec.yaml b/packages/in_app_purchase/in_app_purchase_platform_interface/pubspec.yaml index d87e073ec39c..a85144696cf8 100644 --- a/packages/in_app_purchase/in_app_purchase_platform_interface/pubspec.yaml +++ b/packages/in_app_purchase/in_app_purchase_platform_interface/pubspec.yaml @@ -7,8 +7,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 1.3.7 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/local_auth/local_auth/CHANGELOG.md b/packages/local_auth/local_auth/CHANGELOG.md index 59bea2be7328..475c3f5a3417 100644 --- a/packages/local_auth/local_auth/CHANGELOG.md +++ b/packages/local_auth/local_auth/CHANGELOG.md @@ -1,5 +1,6 @@ ## NEXT +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. * Updates support matrix in README to indicate that iOS 11 is no longer supported. * Clients on versions of Flutter that still support iOS 11 can continue to use this package with iOS 11, but will not receive any further updates to the iOS implementation. diff --git a/packages/local_auth/local_auth/example/pubspec.yaml b/packages/local_auth/local_auth/example/pubspec.yaml index fed63a9c674b..ea71356935a9 100644 --- a/packages/local_auth/local_auth/example/pubspec.yaml +++ b/packages/local_auth/local_auth/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the local_auth plugin. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/local_auth/local_auth/pubspec.yaml b/packages/local_auth/local_auth/pubspec.yaml index 4e2d8682a4b5..6573656a4496 100644 --- a/packages/local_auth/local_auth/pubspec.yaml +++ b/packages/local_auth/local_auth/pubspec.yaml @@ -6,8 +6,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 2.1.8 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/local_auth/local_auth_android/CHANGELOG.md b/packages/local_auth/local_auth_android/CHANGELOG.md index 276f60ff01be..7e7bf07ecabf 100644 --- a/packages/local_auth/local_auth_android/CHANGELOG.md +++ b/packages/local_auth/local_auth_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 1.0.37 * Adds compatibility with `intl` 0.19.0. diff --git a/packages/local_auth/local_auth_android/example/pubspec.yaml b/packages/local_auth/local_auth_android/example/pubspec.yaml index b0778daf0c15..4ef04f6f78d7 100644 --- a/packages/local_auth/local_auth_android/example/pubspec.yaml +++ b/packages/local_auth/local_auth_android/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the local_auth_android plugin. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/local_auth/local_auth_android/pubspec.yaml b/packages/local_auth/local_auth_android/pubspec.yaml index 160141f28f5b..cf6b9e61fbce 100644 --- a/packages/local_auth/local_auth_android/pubspec.yaml +++ b/packages/local_auth/local_auth_android/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 1.0.37 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/local_auth/local_auth_platform_interface/CHANGELOG.md b/packages/local_auth/local_auth_platform_interface/CHANGELOG.md index f29884f2add3..b4f21982f617 100644 --- a/packages/local_auth/local_auth_platform_interface/CHANGELOG.md +++ b/packages/local_auth/local_auth_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 1.0.10 * Updates minimum required plugin_platform_interface version to 2.1.7. diff --git a/packages/local_auth/local_auth_platform_interface/pubspec.yaml b/packages/local_auth/local_auth_platform_interface/pubspec.yaml index e11b89da0a22..028910200851 100644 --- a/packages/local_auth/local_auth_platform_interface/pubspec.yaml +++ b/packages/local_auth/local_auth_platform_interface/pubspec.yaml @@ -7,8 +7,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 1.0.10 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/local_auth/local_auth_windows/CHANGELOG.md b/packages/local_auth/local_auth_windows/CHANGELOG.md index 245730cdae9a..9da32d2c0f35 100644 --- a/packages/local_auth/local_auth_windows/CHANGELOG.md +++ b/packages/local_auth/local_auth_windows/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 1.0.10 * Adds pub topics to package metadata. diff --git a/packages/local_auth/local_auth_windows/example/pubspec.yaml b/packages/local_auth/local_auth_windows/example/pubspec.yaml index 5a52c7390c5c..a1b504427edb 100644 --- a/packages/local_auth/local_auth_windows/example/pubspec.yaml +++ b/packages/local_auth/local_auth_windows/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the local_auth_windows plugin. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/local_auth/local_auth_windows/pubspec.yaml b/packages/local_auth/local_auth_windows/pubspec.yaml index c51264a00f05..ac9fee60438e 100644 --- a/packages/local_auth/local_auth_windows/pubspec.yaml +++ b/packages/local_auth/local_auth_windows/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 1.0.10 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/metrics_center/CHANGELOG.md b/packages/metrics_center/CHANGELOG.md index 9fe761737228..0d589218f8ab 100644 --- a/packages/metrics_center/CHANGELOG.md +++ b/packages/metrics_center/CHANGELOG.md @@ -1,6 +1,6 @@ ## NEXT -* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. ## 1.0.12 diff --git a/packages/metrics_center/pubspec.yaml b/packages/metrics_center/pubspec.yaml index 7963e2e9334d..efc8ffcd5d92 100644 --- a/packages/metrics_center/pubspec.yaml +++ b/packages/metrics_center/pubspec.yaml @@ -6,7 +6,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/metrics_cente issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+metrics_center%22 environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ^3.1.0 dependencies: _discoveryapis_commons: ^1.0.0 diff --git a/packages/multicast_dns/CHANGELOG.md b/packages/multicast_dns/CHANGELOG.md index eb612875066b..1ea1abcd63e0 100644 --- a/packages/multicast_dns/CHANGELOG.md +++ b/packages/multicast_dns/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 0.3.2+6 * Improves links in README.md. diff --git a/packages/multicast_dns/pubspec.yaml b/packages/multicast_dns/pubspec.yaml index a0211e7a733a..301de701e497 100644 --- a/packages/multicast_dns/pubspec.yaml +++ b/packages/multicast_dns/pubspec.yaml @@ -5,7 +5,7 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 0.3.2+6 environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ^3.1.0 dependencies: meta: ^1.3.0 diff --git a/packages/palette_generator/CHANGELOG.md b/packages/palette_generator/CHANGELOG.md index 4d125eba21de..ffa196e4f515 100644 --- a/packages/palette_generator/CHANGELOG.md +++ b/packages/palette_generator/CHANGELOG.md @@ -1,6 +1,6 @@ ## NEXT -* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. ## 0.3.3+3 diff --git a/packages/palette_generator/example/pubspec.yaml b/packages/palette_generator/example/pubspec.yaml index 6baf08fd93bf..9c91033e284d 100644 --- a/packages/palette_generator/example/pubspec.yaml +++ b/packages/palette_generator/example/pubspec.yaml @@ -4,8 +4,8 @@ publish_to: none version: 0.1.0 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/palette_generator/pubspec.yaml b/packages/palette_generator/pubspec.yaml index a8696f182bf3..7c7dabcc6cc1 100644 --- a/packages/palette_generator/pubspec.yaml +++ b/packages/palette_generator/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 0.3.3+3 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: collection: ^1.15.0 diff --git a/packages/path_provider/path_provider/CHANGELOG.md b/packages/path_provider/path_provider/CHANGELOG.md index 9af2e472189d..03139c83d435 100644 --- a/packages/path_provider/path_provider/CHANGELOG.md +++ b/packages/path_provider/path_provider/CHANGELOG.md @@ -1,5 +1,6 @@ ## NEXT +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. * Updates support matrix in README to indicate that iOS 11 is no longer supported. * Clients on versions of Flutter that still support iOS 11 can continue to use this package with iOS 11, but will not receive any further updates to the iOS implementation. diff --git a/packages/path_provider/path_provider/example/pubspec.yaml b/packages/path_provider/path_provider/example/pubspec.yaml index 448581383b61..d05b5236fac3 100644 --- a/packages/path_provider/path_provider/example/pubspec.yaml +++ b/packages/path_provider/path_provider/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the path_provider plugin. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/path_provider/path_provider/pubspec.yaml b/packages/path_provider/path_provider/pubspec.yaml index 0d163f09dab4..d8c2188cdca0 100644 --- a/packages/path_provider/path_provider/pubspec.yaml +++ b/packages/path_provider/path_provider/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 2.1.2 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/path_provider/path_provider_android/CHANGELOG.md b/packages/path_provider/path_provider_android/CHANGELOG.md index e9ee13d76f53..082af0ea9e57 100644 --- a/packages/path_provider/path_provider_android/CHANGELOG.md +++ b/packages/path_provider/path_provider_android/CHANGELOG.md @@ -1,5 +1,6 @@ ## NEXT +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. * Updates compileSdk version to 34. ## 2.2.2 diff --git a/packages/path_provider/path_provider_android/example/pubspec.yaml b/packages/path_provider/path_provider_android/example/pubspec.yaml index e4ff9b2014e3..3512a22302b2 100644 --- a/packages/path_provider/path_provider_android/example/pubspec.yaml +++ b/packages/path_provider/path_provider_android/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the path_provider plugin. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/path_provider/path_provider_android/pubspec.yaml b/packages/path_provider/path_provider_android/pubspec.yaml index 586105100c64..e2cb134a1a6b 100644 --- a/packages/path_provider/path_provider_android/pubspec.yaml +++ b/packages/path_provider/path_provider_android/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 2.2.2 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/path_provider/path_provider_linux/CHANGELOG.md b/packages/path_provider/path_provider_linux/CHANGELOG.md index 6d5d10382543..f179d6fbb9cf 100644 --- a/packages/path_provider/path_provider_linux/CHANGELOG.md +++ b/packages/path_provider/path_provider_linux/CHANGELOG.md @@ -1,6 +1,6 @@ ## NEXT -* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. ## 2.2.1 diff --git a/packages/path_provider/path_provider_linux/example/pubspec.yaml b/packages/path_provider/path_provider_linux/example/pubspec.yaml index a435883e4b2b..8a65a40723c0 100644 --- a/packages/path_provider/path_provider_linux/example/pubspec.yaml +++ b/packages/path_provider/path_provider_linux/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the path_provider_linux plugin. publish_to: "none" environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/path_provider/path_provider_linux/pubspec.yaml b/packages/path_provider/path_provider_linux/pubspec.yaml index f5489ee9113d..3c0c8860ddea 100644 --- a/packages/path_provider/path_provider_linux/pubspec.yaml +++ b/packages/path_provider/path_provider_linux/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 2.2.1 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/path_provider/path_provider_platform_interface/CHANGELOG.md b/packages/path_provider/path_provider_platform_interface/CHANGELOG.md index 8b2b2bb88b14..81ee15c3d392 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 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 2.1.2 * Updates minimum required plugin_platform_interface version to 2.1.7. diff --git a/packages/path_provider/path_provider_platform_interface/pubspec.yaml b/packages/path_provider/path_provider_platform_interface/pubspec.yaml index 46ac2665272c..5b6757f0a20e 100644 --- a/packages/path_provider/path_provider_platform_interface/pubspec.yaml +++ b/packages/path_provider/path_provider_platform_interface/pubspec.yaml @@ -7,8 +7,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 2.1.2 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/path_provider/path_provider_windows/CHANGELOG.md b/packages/path_provider/path_provider_windows/CHANGELOG.md index 0540d63d31cb..ef77de70bf7a 100644 --- a/packages/path_provider/path_provider_windows/CHANGELOG.md +++ b/packages/path_provider/path_provider_windows/CHANGELOG.md @@ -1,6 +1,6 @@ ## NEXT -* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. ## 2.2.1 diff --git a/packages/path_provider/path_provider_windows/example/pubspec.yaml b/packages/path_provider/path_provider_windows/example/pubspec.yaml index bacb9df2f154..39c9d7277715 100644 --- a/packages/path_provider/path_provider_windows/example/pubspec.yaml +++ b/packages/path_provider/path_provider_windows/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the path_provider plugin. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/path_provider/path_provider_windows/pubspec.yaml b/packages/path_provider/path_provider_windows/pubspec.yaml index 87a7c874591e..6549c136c58f 100644 --- a/packages/path_provider/path_provider_windows/pubspec.yaml +++ b/packages/path_provider/path_provider_windows/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 2.2.1 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/pigeon/CHANGELOG.md b/packages/pigeon/CHANGELOG.md index 19d9bf0592df..967426ce7c2a 100644 --- a/packages/pigeon/CHANGELOG.md +++ b/packages/pigeon/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 17.0.0 * **Breaking Change** [kotlin] Converts Kotlin enum case generation to SCREAMING_SNAKE_CASE. diff --git a/packages/pigeon/example/app/pubspec.yaml b/packages/pigeon/example/app/pubspec.yaml index 512ac7e50f1c..ef237fb9bdd4 100644 --- a/packages/pigeon/example/app/pubspec.yaml +++ b/packages/pigeon/example/app/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: 'none' version: 1.0.0 environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ^3.1.0 dependencies: flutter: diff --git a/packages/pigeon/example/pubspec.yaml b/packages/pigeon/example/pubspec.yaml index a5b4b492b3df..b8b67ac2d9ea 100644 --- a/packages/pigeon/example/pubspec.yaml +++ b/packages/pigeon/example/pubspec.yaml @@ -3,7 +3,7 @@ description: example app to show basic usage of pigeon. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ^3.1.0 dependencies: diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/pubspec.yaml b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/pubspec.yaml index b7b9fa8c9385..68c11e25507d 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/pubspec.yaml +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/pubspec.yaml @@ -3,7 +3,7 @@ description: Pigeon test harness for alternate plugin languages. publish_to: 'none' environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ^3.1.0 dependencies: alternate_language_test_plugin: diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/pubspec.yaml b/packages/pigeon/platform_tests/alternate_language_test_plugin/pubspec.yaml index fe95acbea8af..b9bca67acb85 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/pubspec.yaml +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/pubspec.yaml @@ -4,8 +4,8 @@ version: 0.0.1 publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/pubspec.yaml b/packages/pigeon/platform_tests/shared_test_plugin_code/pubspec.yaml index 3e7ad2571530..52144d23ea3b 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/pubspec.yaml +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/pubspec.yaml @@ -4,8 +4,8 @@ version: 0.0.1 publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: build_runner: ^2.1.10 diff --git a/packages/pigeon/platform_tests/test_plugin/example/pubspec.yaml b/packages/pigeon/platform_tests/test_plugin/example/pubspec.yaml index b05f7b1910b2..ce9c5c7527ae 100644 --- a/packages/pigeon/platform_tests/test_plugin/example/pubspec.yaml +++ b/packages/pigeon/platform_tests/test_plugin/example/pubspec.yaml @@ -3,7 +3,7 @@ description: Pigeon test harness for primary plugin languages. publish_to: 'none' environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ^3.1.0 dependencies: flutter: diff --git a/packages/pigeon/platform_tests/test_plugin/pubspec.yaml b/packages/pigeon/platform_tests/test_plugin/pubspec.yaml index d073e7d5f6f4..75b456336e81 100644 --- a/packages/pigeon/platform_tests/test_plugin/pubspec.yaml +++ b/packages/pigeon/platform_tests/test_plugin/pubspec.yaml @@ -4,8 +4,8 @@ version: 0.0.1 publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/pigeon/pubspec.yaml b/packages/pigeon/pubspec.yaml index d969e5a08ed7..9693bac54588 100644 --- a/packages/pigeon/pubspec.yaml +++ b/packages/pigeon/pubspec.yaml @@ -5,7 +5,7 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 17.0.0 # This must match the version in lib/generator_tools.dart environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ^3.1.0 dependencies: analyzer: ">=5.13.0 <7.0.0" diff --git a/packages/platform/CHANGELOG.md b/packages/platform/CHANGELOG.md index 4c96a4197de3..0cbbc128d1c7 100644 --- a/packages/platform/CHANGELOG.md +++ b/packages/platform/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 3.1.4 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. diff --git a/packages/platform/example/pubspec.yaml b/packages/platform/example/pubspec.yaml index 9e719bae34a9..8991a8c61882 100644 --- a/packages/platform/example/pubspec.yaml +++ b/packages/platform/example/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: 'none' version: 1.0.0+1 environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ^3.1.0 dependencies: flutter: diff --git a/packages/platform/pubspec.yaml b/packages/platform/pubspec.yaml index 564b7cca5472..739f9921913f 100644 --- a/packages/platform/pubspec.yaml +++ b/packages/platform/pubspec.yaml @@ -5,7 +5,7 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 3.1.4 environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ^3.1.0 dev_dependencies: test: ^1.16.8 diff --git a/packages/plugin_platform_interface/CHANGELOG.md b/packages/plugin_platform_interface/CHANGELOG.md index 41e8982ecb95..6f3c3ab59c18 100644 --- a/packages/plugin_platform_interface/CHANGELOG.md +++ b/packages/plugin_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 2.1.8 * Fixes new lint warnings. diff --git a/packages/plugin_platform_interface/pubspec.yaml b/packages/plugin_platform_interface/pubspec.yaml index f94c3638f97a..d3d7aeadb632 100644 --- a/packages/plugin_platform_interface/pubspec.yaml +++ b/packages/plugin_platform_interface/pubspec.yaml @@ -18,7 +18,7 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 2.1.8 environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ^3.1.0 dependencies: meta: ^1.3.0 diff --git a/packages/process/CHANGELOG.md b/packages/process/CHANGELOG.md index 32697bd92772..7a7480a1c7bd 100644 --- a/packages/process/CHANGELOG.md +++ b/packages/process/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 5.0.2 * Removes mention of the removed record/replay feature from README. diff --git a/packages/process/pubspec.yaml b/packages/process/pubspec.yaml index 5f284c7bf1c6..394978f56970 100644 --- a/packages/process/pubspec.yaml +++ b/packages/process/pubspec.yaml @@ -5,7 +5,7 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 5.0.2 environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ^3.1.0 dependencies: file: '>=6.0.0 <8.0.0' diff --git a/packages/quick_actions/quick_actions/CHANGELOG.md b/packages/quick_actions/quick_actions/CHANGELOG.md index 6857b355e518..e23adf50b279 100644 --- a/packages/quick_actions/quick_actions/CHANGELOG.md +++ b/packages/quick_actions/quick_actions/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 1.0.7 * Updates minimum required plugin_platform_interface version to 2.1.7. diff --git a/packages/quick_actions/quick_actions/example/pubspec.yaml b/packages/quick_actions/quick_actions/example/pubspec.yaml index 0adf99a2b220..147706980289 100644 --- a/packages/quick_actions/quick_actions/example/pubspec.yaml +++ b/packages/quick_actions/quick_actions/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the quick_actions plugin. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/quick_actions/quick_actions/pubspec.yaml b/packages/quick_actions/quick_actions/pubspec.yaml index 82da5b21ba60..e58d223c3abb 100644 --- a/packages/quick_actions/quick_actions/pubspec.yaml +++ b/packages/quick_actions/quick_actions/pubspec.yaml @@ -6,8 +6,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 1.0.7 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/quick_actions/quick_actions_android/CHANGELOG.md b/packages/quick_actions/quick_actions_android/CHANGELOG.md index bf48a6447d53..6a86c14f2a15 100644 --- a/packages/quick_actions/quick_actions_android/CHANGELOG.md +++ b/packages/quick_actions/quick_actions_android/CHANGELOG.md @@ -1,5 +1,6 @@ ## NEXT +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. * Updates compileSdk version to 34. ## 1.0.10 diff --git a/packages/quick_actions/quick_actions_android/example/pubspec.yaml b/packages/quick_actions/quick_actions_android/example/pubspec.yaml index 89da7765e000..c393b89a8742 100644 --- a/packages/quick_actions/quick_actions_android/example/pubspec.yaml +++ b/packages/quick_actions/quick_actions_android/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the quick_actions plugin. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/quick_actions/quick_actions_android/pubspec.yaml b/packages/quick_actions/quick_actions_android/pubspec.yaml index cc74f8dccce1..cb63e771a3ba 100644 --- a/packages/quick_actions/quick_actions_android/pubspec.yaml +++ b/packages/quick_actions/quick_actions_android/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 1.0.10 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/quick_actions/quick_actions_platform_interface/CHANGELOG.md b/packages/quick_actions/quick_actions_platform_interface/CHANGELOG.md index e9c884d838d3..0cd6236412ca 100644 --- a/packages/quick_actions/quick_actions_platform_interface/CHANGELOG.md +++ b/packages/quick_actions/quick_actions_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 1.0.6 * Updates minimum required plugin_platform_interface version to 2.1.7. diff --git a/packages/quick_actions/quick_actions_platform_interface/pubspec.yaml b/packages/quick_actions/quick_actions_platform_interface/pubspec.yaml index 3ed38b23bfc6..7b222c69477d 100644 --- a/packages/quick_actions/quick_actions_platform_interface/pubspec.yaml +++ b/packages/quick_actions/quick_actions_platform_interface/pubspec.yaml @@ -7,8 +7,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 1.0.6 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/shared_preferences/shared_preferences/CHANGELOG.md b/packages/shared_preferences/shared_preferences/CHANGELOG.md index 71ab9ed8c3c6..f0f314583afb 100644 --- a/packages/shared_preferences/shared_preferences/CHANGELOG.md +++ b/packages/shared_preferences/shared_preferences/CHANGELOG.md @@ -1,5 +1,6 @@ ## NEXT +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. * Updates support matrix in README to indicate that iOS 11 is no longer supported. * Clients on versions of Flutter that still support iOS 11 can continue to use this package with iOS 11, but will not receive any further updates to the iOS implementation. diff --git a/packages/shared_preferences/shared_preferences/example/pubspec.yaml b/packages/shared_preferences/shared_preferences/example/pubspec.yaml index 94cf2977256e..b48401c1b183 100644 --- a/packages/shared_preferences/shared_preferences/example/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the shared_preferences plugin. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/shared_preferences/shared_preferences/pubspec.yaml b/packages/shared_preferences/shared_preferences/pubspec.yaml index 53c19f8a90b6..15e802c93ba8 100644 --- a/packages/shared_preferences/shared_preferences/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences/pubspec.yaml @@ -6,8 +6,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 2.2.2 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/shared_preferences/shared_preferences_android/CHANGELOG.md b/packages/shared_preferences/shared_preferences_android/CHANGELOG.md index a5e2beaca01f..b625a5cd67bc 100644 --- a/packages/shared_preferences/shared_preferences_android/CHANGELOG.md +++ b/packages/shared_preferences/shared_preferences_android/CHANGELOG.md @@ -1,7 +1,7 @@ ## NEXT +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. * Updates compileSdk version to 34. -* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. ## 2.2.1 diff --git a/packages/shared_preferences/shared_preferences_android/example/pubspec.yaml b/packages/shared_preferences/shared_preferences_android/example/pubspec.yaml index 557a556da67d..c394ef18c032 100644 --- a/packages/shared_preferences/shared_preferences_android/example/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_android/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the shared_preferences plugin. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/shared_preferences/shared_preferences_android/pubspec.yaml b/packages/shared_preferences/shared_preferences_android/pubspec.yaml index 7246a5471275..6339e50d4f14 100644 --- a/packages/shared_preferences/shared_preferences_android/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_android/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 2.2.1 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/shared_preferences/shared_preferences_linux/CHANGELOG.md b/packages/shared_preferences/shared_preferences_linux/CHANGELOG.md index 786f6423a7a7..122c2a9053d1 100644 --- a/packages/shared_preferences/shared_preferences_linux/CHANGELOG.md +++ b/packages/shared_preferences/shared_preferences_linux/CHANGELOG.md @@ -1,6 +1,6 @@ ## NEXT -* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. ## 2.3.2 diff --git a/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml b/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml index 4fda1a6cd89d..d4ffcd82cbba 100644 --- a/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the shared_preferences_linux plugin. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/shared_preferences/shared_preferences_linux/pubspec.yaml b/packages/shared_preferences/shared_preferences_linux/pubspec.yaml index 3091487236a5..02b6a89dd2df 100644 --- a/packages/shared_preferences/shared_preferences_linux/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_linux/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 2.3.2 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/shared_preferences/shared_preferences_platform_interface/CHANGELOG.md b/packages/shared_preferences/shared_preferences_platform_interface/CHANGELOG.md index f1e8cf30e552..d2d7a20fd579 100644 --- a/packages/shared_preferences/shared_preferences_platform_interface/CHANGELOG.md +++ b/packages/shared_preferences/shared_preferences_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 2.3.2 * Updates minimum required plugin_platform_interface version to 2.1.7. diff --git a/packages/shared_preferences/shared_preferences_platform_interface/pubspec.yaml b/packages/shared_preferences/shared_preferences_platform_interface/pubspec.yaml index cce54ad8811a..a027b6ec9716 100644 --- a/packages/shared_preferences/shared_preferences_platform_interface/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_platform_interface/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 2.3.2 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/shared_preferences/shared_preferences_windows/CHANGELOG.md b/packages/shared_preferences/shared_preferences_windows/CHANGELOG.md index a989b2a96769..52a62eea465b 100644 --- a/packages/shared_preferences/shared_preferences_windows/CHANGELOG.md +++ b/packages/shared_preferences/shared_preferences_windows/CHANGELOG.md @@ -1,6 +1,6 @@ ## NEXT -* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. ## 2.3.2 diff --git a/packages/shared_preferences/shared_preferences_windows/example/pubspec.yaml b/packages/shared_preferences/shared_preferences_windows/example/pubspec.yaml index b32e2cff8d97..bb8824bdc8f2 100644 --- a/packages/shared_preferences/shared_preferences_windows/example/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_windows/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the shared_preferences_windows plugin. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/shared_preferences/shared_preferences_windows/pubspec.yaml b/packages/shared_preferences/shared_preferences_windows/pubspec.yaml index a8ec73e29730..86cda786c90c 100644 --- a/packages/shared_preferences/shared_preferences_windows/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_windows/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 2.3.2 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/standard_message_codec/CHANGELOG.md b/packages/standard_message_codec/CHANGELOG.md index 9ce85a8b8334..6a37c02f14aa 100644 --- a/packages/standard_message_codec/CHANGELOG.md +++ b/packages/standard_message_codec/CHANGELOG.md @@ -1,6 +1,6 @@ ## NEXT -* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. ## 0.0.1+4 diff --git a/packages/standard_message_codec/example/pubspec.yaml b/packages/standard_message_codec/example/pubspec.yaml index 555ddde8b904..ed3c3f205a0b 100644 --- a/packages/standard_message_codec/example/pubspec.yaml +++ b/packages/standard_message_codec/example/pubspec.yaml @@ -4,7 +4,7 @@ version: 0.0.1 publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ^3.1.0 dependencies: standard_message_codec: diff --git a/packages/standard_message_codec/pubspec.yaml b/packages/standard_message_codec/pubspec.yaml index ee3ed1215d6c..fe6fb43b75f3 100644 --- a/packages/standard_message_codec/pubspec.yaml +++ b/packages/standard_message_codec/pubspec.yaml @@ -5,7 +5,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/standard_mess issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3Astandard_message_codec environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ^3.1.0 dev_dependencies: test: ^1.16.0 diff --git a/packages/url_launcher/url_launcher_android/CHANGELOG.md b/packages/url_launcher/url_launcher_android/CHANGELOG.md index 67b010334979..4afadbf00f62 100644 --- a/packages/url_launcher/url_launcher_android/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 6.3.0 * Adds support for `BrowserConfiguration`. diff --git a/packages/url_launcher/url_launcher_android/example/pubspec.yaml b/packages/url_launcher/url_launcher_android/example/pubspec.yaml index 0d99e391616f..90d59620b099 100644 --- a/packages/url_launcher/url_launcher_android/example/pubspec.yaml +++ b/packages/url_launcher/url_launcher_android/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the url_launcher plugin. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/url_launcher/url_launcher_android/pubspec.yaml b/packages/url_launcher/url_launcher_android/pubspec.yaml index 111318fa6819..661f5a7fd56a 100644 --- a/packages/url_launcher/url_launcher_android/pubspec.yaml +++ b/packages/url_launcher/url_launcher_android/pubspec.yaml @@ -4,8 +4,8 @@ repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22 version: 6.3.0 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/url_launcher/url_launcher_linux/CHANGELOG.md b/packages/url_launcher/url_launcher_linux/CHANGELOG.md index 54b486e4dc66..d9406f89be64 100644 --- a/packages/url_launcher/url_launcher_linux/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_linux/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 3.1.1 * Implements `launchUrl`. diff --git a/packages/url_launcher/url_launcher_linux/example/pubspec.yaml b/packages/url_launcher/url_launcher_linux/example/pubspec.yaml index 7c7c6691caad..5b19e5340144 100644 --- a/packages/url_launcher/url_launcher_linux/example/pubspec.yaml +++ b/packages/url_launcher/url_launcher_linux/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the url_launcher plugin. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/url_launcher/url_launcher_linux/pubspec.yaml b/packages/url_launcher/url_launcher_linux/pubspec.yaml index 46642f23b0fe..75acf1567837 100644 --- a/packages/url_launcher/url_launcher_linux/pubspec.yaml +++ b/packages/url_launcher/url_launcher_linux/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 3.1.1 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/url_launcher/url_launcher_macos/CHANGELOG.md b/packages/url_launcher/url_launcher_macos/CHANGELOG.md index 26ada5745bc8..df9447ad852f 100644 --- a/packages/url_launcher/url_launcher_macos/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_macos/CHANGELOG.md @@ -1,6 +1,6 @@ ## NEXT -* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. ## 3.1.0 diff --git a/packages/url_launcher/url_launcher_macos/example/pubspec.yaml b/packages/url_launcher/url_launcher_macos/example/pubspec.yaml index ef6b1f4cc3a8..0ef6245dba24 100644 --- a/packages/url_launcher/url_launcher_macos/example/pubspec.yaml +++ b/packages/url_launcher/url_launcher_macos/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the url_launcher plugin. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/url_launcher/url_launcher_macos/pubspec.yaml b/packages/url_launcher/url_launcher_macos/pubspec.yaml index b927feb57311..0a84ea922389 100644 --- a/packages/url_launcher/url_launcher_macos/pubspec.yaml +++ b/packages/url_launcher/url_launcher_macos/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 3.1.0 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/url_launcher/url_launcher_windows/CHANGELOG.md b/packages/url_launcher/url_launcher_windows/CHANGELOG.md index 478fe88e240e..495780fde7e1 100644 --- a/packages/url_launcher/url_launcher_windows/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_windows/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 3.1.1 * Updates `launchUrl` to return false instead of throwing when there is no handler. diff --git a/packages/url_launcher/url_launcher_windows/example/pubspec.yaml b/packages/url_launcher/url_launcher_windows/example/pubspec.yaml index dd8f16fb074c..e08f71f40f81 100644 --- a/packages/url_launcher/url_launcher_windows/example/pubspec.yaml +++ b/packages/url_launcher/url_launcher_windows/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates the Windows implementation of the url_launcher plugin. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/url_launcher/url_launcher_windows/pubspec.yaml b/packages/url_launcher/url_launcher_windows/pubspec.yaml index 098645490871..df2ec571feb9 100644 --- a/packages/url_launcher/url_launcher_windows/pubspec.yaml +++ b/packages/url_launcher/url_launcher_windows/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 3.1.1 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/video_player/video_player/CHANGELOG.md b/packages/video_player/video_player/CHANGELOG.md index cee8dabec2f3..c585875c22eb 100644 --- a/packages/video_player/video_player/CHANGELOG.md +++ b/packages/video_player/video_player/CHANGELOG.md @@ -1,5 +1,6 @@ ## NEXT +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. * Updates support matrix in README to indicate that iOS 11 is no longer supported. * Clients on versions of Flutter that still support iOS 11 can continue to use this package with iOS 11, but will not receive any further updates to the iOS implementation. diff --git a/packages/video_player/video_player/example/pubspec.yaml b/packages/video_player/video_player/example/pubspec.yaml index 2d6b903cf5fc..acf127ff63a2 100644 --- a/packages/video_player/video_player/example/pubspec.yaml +++ b/packages/video_player/video_player/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the video_player plugin. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/video_player/video_player_android/CHANGELOG.md b/packages/video_player/video_player_android/CHANGELOG.md index 1606316b5540..47f65e844fad 100644 --- a/packages/video_player/video_player_android/CHANGELOG.md +++ b/packages/video_player/video_player_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 2.4.12 * Updates compileSdk version to 34. diff --git a/packages/video_player/video_player_android/example/pubspec.yaml b/packages/video_player/video_player_android/example/pubspec.yaml index f1e9a91cf1b9..d7eea74093b9 100644 --- a/packages/video_player/video_player_android/example/pubspec.yaml +++ b/packages/video_player/video_player_android/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the video_player plugin. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/video_player/video_player_android/pubspec.yaml b/packages/video_player/video_player_android/pubspec.yaml index 3a8bbb0aceda..b9a6a30bf7a7 100644 --- a/packages/video_player/video_player_android/pubspec.yaml +++ b/packages/video_player/video_player_android/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 2.4.12 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/video_player/video_player_platform_interface/CHANGELOG.md b/packages/video_player/video_player_platform_interface/CHANGELOG.md index 1da900b1b4d8..3a7e95734606 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 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 6.2.2 * Updates minimum required plugin_platform_interface version to 2.1.7. diff --git a/packages/video_player/video_player_platform_interface/pubspec.yaml b/packages/video_player/video_player_platform_interface/pubspec.yaml index db79f069cef9..4ed09c217bbe 100644 --- a/packages/video_player/video_player_platform_interface/pubspec.yaml +++ b/packages/video_player/video_player_platform_interface/pubspec.yaml @@ -7,8 +7,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 6.2.2 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/video_player/video_player_web/CHANGELOG.md b/packages/video_player/video_player_web/CHANGELOG.md index 5c9deb860d1f..4ce1c96de5d8 100644 --- a/packages/video_player/video_player_web/CHANGELOG.md +++ b/packages/video_player/video_player_web/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 2.1.3 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. diff --git a/packages/video_player/video_player_web/example/pubspec.yaml b/packages/video_player/video_player_web/example/pubspec.yaml index 26bc4031ae48..866d089f8687 100644 --- a/packages/video_player/video_player_web/example/pubspec.yaml +++ b/packages/video_player/video_player_web/example/pubspec.yaml @@ -2,8 +2,8 @@ name: video_player_for_web_integration_tests publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/web_benchmarks/CHANGELOG.md b/packages/web_benchmarks/CHANGELOG.md index f401c3885b27..98e9f675b1fd 100644 --- a/packages/web_benchmarks/CHANGELOG.md +++ b/packages/web_benchmarks/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 1.1.1 * Fixes new lint warnings. diff --git a/packages/web_benchmarks/testing/test_app/pubspec.yaml b/packages/web_benchmarks/testing/test_app/pubspec.yaml index 45e860756d33..d7b492136046 100644 --- a/packages/web_benchmarks/testing/test_app/pubspec.yaml +++ b/packages/web_benchmarks/testing/test_app/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: 'none' version: 1.0.0+1 environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ^3.1.0 dependencies: flutter: diff --git a/packages/webview_flutter/webview_flutter_android/CHANGELOG.md b/packages/webview_flutter/webview_flutter_android/CHANGELOG.md index be9ac8adff10..403294ee39fe 100644 --- a/packages/webview_flutter/webview_flutter_android/CHANGELOG.md +++ b/packages/webview_flutter/webview_flutter_android/CHANGELOG.md @@ -1,5 +1,6 @@ ## NEXT +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. * Updates compileSdk to 34. ## 3.15.0 diff --git a/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml b/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml index 89a5a4c52b49..6665ea371585 100644 --- a/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the webview_flutter_android plugin. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/webview_flutter/webview_flutter_android/pubspec.yaml b/packages/webview_flutter/webview_flutter_android/pubspec.yaml index f57db1f17b49..9f3fd0602a1f 100644 --- a/packages/webview_flutter/webview_flutter_android/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_android/pubspec.yaml @@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 3.15.0 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/webview_flutter/webview_flutter_platform_interface/CHANGELOG.md b/packages/webview_flutter/webview_flutter_platform_interface/CHANGELOG.md index aac4c6261fcd..e61480a5107d 100644 --- a/packages/webview_flutter/webview_flutter_platform_interface/CHANGELOG.md +++ b/packages/webview_flutter/webview_flutter_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 2.10.0 * Adds `WebResourceRequest` and `WebResourceResponse` to `HttpResponseError`. diff --git a/packages/webview_flutter/webview_flutter_platform_interface/pubspec.yaml b/packages/webview_flutter/webview_flutter_platform_interface/pubspec.yaml index 8e00b1d3e2ab..006140a5bab8 100644 --- a/packages/webview_flutter/webview_flutter_platform_interface/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_platform_interface/pubspec.yaml @@ -7,8 +7,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 2.10.0 environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/webview_flutter/webview_flutter_web/CHANGELOG.md b/packages/webview_flutter/webview_flutter_web/CHANGELOG.md index 2774fce307f3..8788082fe8ef 100644 --- a/packages/webview_flutter/webview_flutter_web/CHANGELOG.md +++ b/packages/webview_flutter/webview_flutter_web/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 0.2.2+4 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. diff --git a/packages/webview_flutter/webview_flutter_web/example/pubspec.yaml b/packages/webview_flutter/webview_flutter_web/example/pubspec.yaml index 9e5851812158..82e758cfb9ff 100644 --- a/packages/webview_flutter/webview_flutter_web/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_web/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the webview_flutter_web plugin. publish_to: none environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/xdg_directories/CHANGELOG.md b/packages/xdg_directories/CHANGELOG.md index cb11d4827d84..06f96b25cd54 100644 --- a/packages/xdg_directories/CHANGELOG.md +++ b/packages/xdg_directories/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 1.0.4 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. diff --git a/packages/xdg_directories/example/pubspec.yaml b/packages/xdg_directories/example/pubspec.yaml index ae3cb9dd538b..f643abedbfc9 100644 --- a/packages/xdg_directories/example/pubspec.yaml +++ b/packages/xdg_directories/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the xdg_directories package. publish_to: 'none' environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: ^3.1.0 + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/xdg_directories/pubspec.yaml b/packages/xdg_directories/pubspec.yaml index 85358008c68f..cdb1c0d91902 100644 --- a/packages/xdg_directories/pubspec.yaml +++ b/packages/xdg_directories/pubspec.yaml @@ -5,7 +5,7 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 1.0.4 environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ^3.1.0 platforms: linux: diff --git a/script/tool/lib/src/common/core.dart b/script/tool/lib/src/common/core.dart index 4f3743a67923..cd3df27d2bd5 100644 --- a/script/tool/lib/src/common/core.dart +++ b/script/tool/lib/src/common/core.dart @@ -71,6 +71,8 @@ final Map _dartSdkForFlutterSdk = { Version(3, 13, 9): Version(3, 1, 5), Version(3, 16, 0): Version(3, 2, 0), Version(3, 16, 6): Version(3, 2, 3), + Version(3, 16, 9): Version(3, 2, 6), + Version(3, 19, 0): Version(3, 3, 0), }; /// Returns the version of the Dart SDK that shipped with the given Flutter diff --git a/third_party/packages/cupertino_icons/CHANGELOG.md b/third_party/packages/cupertino_icons/CHANGELOG.md index 636e9af1b794..bf852906f508 100644 --- a/third_party/packages/cupertino_icons/CHANGELOG.md +++ b/third_party/packages/cupertino_icons/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. + ## 1.0.7 * Adds example.md file to display usage. diff --git a/third_party/packages/cupertino_icons/pubspec.yaml b/third_party/packages/cupertino_icons/pubspec.yaml index 322124cf4e7b..c0753bb4a594 100644 --- a/third_party/packages/cupertino_icons/pubspec.yaml +++ b/third_party/packages/cupertino_icons/pubspec.yaml @@ -6,7 +6,7 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ version: 1.0.7 environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ^3.1.0 dev_dependencies: flutter: From b4d8ad7196bcd0536c26152c47ba4f80e3cabe51 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 Feb 2024 17:34:12 +0000 Subject: [PATCH 31/40] Bump github/codeql-action from 3.24.1 to 3.24.3 (#6142) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.24.1 to 3.24.3.
Changelog

Sourced from github/codeql-action's changelog.

CodeQL Action Changelog

See the releases page for the relevant changes to the CodeQL CLI and language packs.

Note that the only difference between v2 and v3 of the CodeQL Action is the node version they support, with v3 running on node 20 while we continue to release v2 to support running on node 16. For example 3.22.11 was the first v3 release and is functionally identical to 2.22.11. This approach ensures an easy way to track exactly which features are included in different versions, indicated by the minor and patch version numbers.

[UNRELEASED]

No user facing changes.

3.24.3 - 15 Feb 2024

  • Fix an issue where the CodeQL Action would fail to load a configuration specified by the config input to the init Action. #2147

3.24.2 - 15 Feb 2024

  • Enable improved multi-threaded performance on larger runners for GitHub Enterprise Server users. This feature is already available to GitHub.com users. #2141

3.24.1 - 13 Feb 2024

  • Update default CodeQL bundle version to 2.16.2. #2124
  • The CodeQL action no longer fails if it can't write to the telemetry api endpoint. #2121

3.24.0 - 02 Feb 2024

  • CodeQL Python analysis will no longer install dependencies on GitHub Enterprise Server, as is already the case for GitHub.com. See release notes for 3.23.0 for more details. #2106

3.23.2 - 26 Jan 2024

  • On Linux, the maximum possible value for the --threads option now respects the CPU count as specified in cgroup files to more accurately reflect the number of available cores when running in containers. #2083
  • Update default CodeQL bundle version to 2.16.1. #2096

3.23.1 - 17 Jan 2024

  • Update default CodeQL bundle version to 2.16.0. #2073
  • Change the retention period for uploaded debug artifacts to 7 days. Previously, this was whatever the repository default was. #2079

3.23.0 - 08 Jan 2024

  • We are rolling out a feature in January 2024 that will disable Python dependency installation by default for all users. This improves the speed of analysis while having only a very minor impact on results. You can override this behavior by setting CODEQL_ACTION_DISABLE_PYTHON_DEPENDENCY_INSTALLATION=false in your workflow, however we plan to remove this ability in future versions of the CodeQL Action. #2031
  • The CodeQL Action now requires CodeQL version 2.11.6 or later. For more information, see the corresponding changelog entry for CodeQL Action version 2.22.7. #2009

3.22.12 - 22 Dec 2023

  • Update default CodeQL bundle version to 2.15.5. #2047

3.22.11 - 13 Dec 2023

  • [v3+ only] The CodeQL Action now runs on Node.js v20. #2006

... (truncated)

Commits
  • 3796146 Merge pull request #2148 from github/update-v3.24.3-3a7796d6a
  • 01d302a Update changelog for v3.24.3
  • 3a7796d Merge pull request #2147 from github/henrymercer/fix-config-outside-workspace...
  • 56b93f2 Add changelog note
  • 381e65f Allow generated user config file to be outside the workspace
  • d88d538 Add PR check for specifying configuration using the config input
  • dc983b3 Merge pull request #2143 from github/mergeback/v3.24.2-to-main-ece8414c
  • 66a4732 Update checked-in dependencies
  • e62fb8e Update changelog and version after v3.24.2
  • ece8414 Merge pull request #2142 from github/update-v3.24.2-1a41e5519
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github/codeql-action&package-manager=github_actions&previous-version=3.24.1&new-version=3.24.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- .github/workflows/scorecards-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml index 22b29f63e70a..6f3299ad195d 100644 --- a/.github/workflows/scorecards-analysis.yml +++ b/.github/workflows/scorecards-analysis.yml @@ -49,6 +49,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@e675ced7a7522a761fc9c8eb26682c8b27c42b2b # v1.0.26 + uses: github/codeql-action/upload-sarif@379614612a29c9e28f31f39a59013eb8012a51f0 # v1.0.26 with: sarif_file: results.sarif From f865bafd86f3af6a68bf8e4cfefd6cc535ac9ce6 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Fri, 16 Feb 2024 19:52:24 -0500 Subject: [PATCH 32/40] Raise gradle wrapper version of legacy project (#6132) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When running `flutter create` for a new plugin on `master`, this error is printed from the legacy build_all_packages test. ![Screenshot 2024-02-09 at 3 08 35รขย€ยฏPM](https://github.com/flutter/packages/assets/10687576/0f22382c-6c88-4aab-8e80-d385ef2892fa) It looks like only 6.7.1 is required to work with new plugins, so this is only a minor bump. --- .ci/legacy_project/README.md | 3 +++ .../android/gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.ci/legacy_project/README.md b/.ci/legacy_project/README.md index 98ad7d49aede..0e23f626fb41 100644 --- a/.ci/legacy_project/README.md +++ b/.ci/legacy_project/README.md @@ -39,3 +39,6 @@ and then deleting everything but `android/` from it: jcenter.bintray.com shutdown. - Update `compileSdkVersion` from 30 to 33 to maintain compatibility with plugins that use API 34. +- Updates `gradle-wrapper.properties` from `6.7` to `6.7.1`, to add + support for the Kotlin gradle plugin. If a user runs into this + error, the error message is clear on how to upgrade. diff --git a/.ci/legacy_project/all_packages/android/gradle/wrapper/gradle-wrapper.properties b/.ci/legacy_project/all_packages/android/gradle/wrapper/gradle-wrapper.properties index bc6a58afdda2..939efa2951bf 100644 --- a/.ci/legacy_project/all_packages/android/gradle/wrapper/gradle-wrapper.properties +++ b/.ci/legacy_project/all_packages/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip From 0af905d779d52fc81ffc239c211e8c5956154f34 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Sat, 17 Feb 2024 08:41:26 -0800 Subject: [PATCH 33/40] [flutter_migrate] Implement lineTerminator in the MemoryStdout fake (#6152) https://dart-review.googlesource.com/c/sdk/+/326761/24/sdk/lib/io/stdio.dart#380 added a `lineTerminator` field to `Stdout`. See https://github.com/flutter/flutter/issues/143614 --- packages/flutter_migrate/test/src/fakes.dart | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/flutter_migrate/test/src/fakes.dart b/packages/flutter_migrate/test/src/fakes.dart index 498213a6f7b0..fda5a28879bb 100644 --- a/packages/flutter_migrate/test/src/fakes.dart +++ b/packages/flutter_migrate/test/src/fakes.dart @@ -132,6 +132,15 @@ class MemoryStdout extends MemoryIOSink implements io.Stdout { bool _hasTerminal = true; + @override + // ignore: override_on_non_overriding_member + String get lineTerminator => '\n'; + @override + // ignore: override_on_non_overriding_member + set lineTerminator(String value) { + throw UnimplementedError('Setting the line terminator is not supported'); + } + @override io.IOSink get nonBlocking => this; From 84ff11d7ee5aa605018e128a8a5c912955261a06 Mon Sep 17 00:00:00 2001 From: engine-flutter-autoroll Date: Mon, 19 Feb 2024 12:14:24 -0500 Subject: [PATCH 34/40] Roll Flutter from d7867ca7d635 to 064c340baf0e (33 revisions) (#6161) Roll Flutter from d7867ca7d635 to 064c340baf0e (33 revisions) https://github.com/flutter/flutter/compare/d7867ca7d635...064c340baf0e 2024-02-19 engine-flutter-autoroll@skia.org Roll Flutter Engine from f71b7eee2266 to 714215d42e57 (1 revision) (flutter/flutter#143708) 2024-02-19 engine-flutter-autoroll@skia.org Roll Flutter Engine from 07c73b0c8413 to f71b7eee2266 (2 revisions) (flutter/flutter#143694) 2024-02-19 engine-flutter-autoroll@skia.org Roll Flutter Engine from 80d6745c6fd6 to 07c73b0c8413 (1 revision) (flutter/flutter#143682) 2024-02-19 engine-flutter-autoroll@skia.org Roll Flutter Engine from 67abf6eb36a1 to 80d6745c6fd6 (1 revision) (flutter/flutter#143676) 2024-02-18 engine-flutter-autoroll@skia.org Roll Flutter Engine from 8ae232196fc9 to 67abf6eb36a1 (1 revision) (flutter/flutter#143673) 2024-02-18 engine-flutter-autoroll@skia.org Roll Flutter Engine from f636f9635438 to 8ae232196fc9 (1 revision) (flutter/flutter#143659) 2024-02-18 ybz975218925@gmail.com Fixed the issue of incorrect item position when prototypeItem is set in SliverReorderableList. (flutter/flutter#142880) 2024-02-18 ybz975218925@gmail.com ShowCaretOnScreen is correctly scheduled within a SliverMainAxisGroup (flutter/flutter#141671) 2024-02-18 engine-flutter-autoroll@skia.org Roll Flutter Engine from 0ebd580cb8a7 to f636f9635438 (1 revision) (flutter/flutter#143657) 2024-02-17 engine-flutter-autoroll@skia.org Roll Flutter Engine from c807aeaab89c to 0ebd580cb8a7 (1 revision) (flutter/flutter#143655) 2024-02-17 engine-flutter-autoroll@skia.org Roll Flutter Engine from e51d4f1e285a to c807aeaab89c (4 revisions) (flutter/flutter#143652) 2024-02-17 jason-simmons@users.noreply.github.com Manual roll Packages from c56c12dd51ef to 0af905d779d5 (flutter/flutter#143651) 2024-02-17 jason-simmons@users.noreply.github.com Add an override annotation to the lineTerminator setter in the MemoryStdout fake class (flutter/flutter#143646) 2024-02-17 leroux_bruno@yahoo.fr InputDecorator M3 tests migration - Step3 (flutter/flutter#143520) 2024-02-17 leroux_bruno@yahoo.fr Update InputDecoration.contentPadding documentation (flutter/flutter#143519) 2024-02-17 jonahwilliams@google.com [Impeller] skip selectable text goldens for instability. (flutter/flutter#143627) 2024-02-17 engine-flutter-autoroll@skia.org Roll Flutter Engine from 2ed159a786ef to e51d4f1e285a (2 revisions) (flutter/flutter#143624) 2024-02-17 jonahwilliams@google.com [Impeller] skip perspective transformed text goldens. (flutter/flutter#143623) 2024-02-17 jonahwilliams@google.com [framework] Skip 5 failing framework tests. (flutter/flutter#143618) 2024-02-17 engine-flutter-autoroll@skia.org Roll Flutter Engine from afb270929a6c to 2ed159a786ef (1 revision) (flutter/flutter#143622) 2024-02-17 engine-flutter-autoroll@skia.org Roll Flutter Engine from c4fe6f01e0f5 to afb270929a6c (1 revision) (flutter/flutter#143619) 2024-02-16 bquinlan@google.com Implement `lineTerminator` in `MemoryStdout` Fake (flutter/flutter#143608) 2024-02-16 engine-flutter-autoroll@skia.org Roll Flutter Engine from 2eed3fbb293a to c4fe6f01e0f5 (3 revisions) (flutter/flutter#143615) 2024-02-16 31859944+LongCatIsLooong@users.noreply.github.com Don't paint the cursor for an invalid selection (flutter/flutter#143533) 2024-02-16 engine-flutter-autoroll@skia.org Roll Flutter Engine from 13dc857bf2ef to 2eed3fbb293a (2 revisions) (flutter/flutter#143609) 2024-02-16 goderbauer@google.com Fix implementation imports outside of lib (flutter/flutter#143594) 2024-02-16 andrewrkolos@gmail.com add parsing of assets transformer declarations in pubspec.yaml (flutter/flutter#143557) 2024-02-16 engine-flutter-autoroll@skia.org Roll Flutter Engine from 5fd5ccf32d08 to 13dc857bf2ef (6 revisions) (flutter/flutter#143607) 2024-02-16 goderbauer@google.com Fix SemanticsFinder for multi-view (flutter/flutter#143485) 2024-02-16 andrewrkolos@gmail.com rebuild the asset bundle if a file has been modified between `flutter test` runs (flutter/flutter#143569) 2024-02-16 pateltirth454@gmail.com Added Missing Field Name in Doc Comment in SnackBarThemeData (flutter/flutter#143588) 2024-02-16 nate.w5687@gmail.com Implementing `switch` expressions [refactoring `flutter/lib/src/`] (flutter/flutter#143496) 2024-02-16 engine-flutter-autoroll@skia.org Roll Flutter Engine from dd530f1556df to 5fd5ccf32d08 (3 revisions) (flutter/flutter#143593) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC dit@google.com,rmistry@google.com,stuartmorgan@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: ... --- .ci/flutter_master.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/flutter_master.version b/.ci/flutter_master.version index 2e0bd6c9f916..359ddb64593e 100644 --- a/.ci/flutter_master.version +++ b/.ci/flutter_master.version @@ -1 +1 @@ -d7867ca7d635c025d8acbcc5cbcff4ca8ea35ab6 +064c340baf0e23790374f5b34ea067c2478e7fd1 From 947e34ce9fedcdd6750b54eb1cc74b854b49ab48 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Tue, 20 Feb 2024 07:51:08 -0800 Subject: [PATCH 35/40] [flutter_markdown] Replace deprecated API (#6134) * Internally, removes use of the deprecated framework methods related to `textScaleFactor`, in favor of the newer `textScaler`. * Plumbs that same change through the public API of this package, deprecating the style sheet's `textScaleFactor` and adding a `textScaler`. * Updates the min Flutter SDK to 3.16 where the new APIs were added. * Also updates test code that uses the deprecated `renderViewElement` to use `rootElement` instead. Fixes https://github.com/flutter/flutter/issues/143400 Fixes https://github.com/flutter/flutter/issues/143448 --- packages/flutter_markdown/CHANGELOG.md | 10 +++- .../flutter_markdown/example/pubspec.yaml | 4 +- .../lib/src/_functions_io.dart | 2 +- .../lib/src/_functions_web.dart | 2 +- .../flutter_markdown/lib/src/builder.dart | 4 +- .../flutter_markdown/lib/src/style_sheet.dart | 48 +++++++++++++-- packages/flutter_markdown/pubspec.yaml | 6 +- packages/flutter_markdown/test/all.dart | 4 +- .../test/style_sheet_test.dart | 60 +++++++++++++++++++ ...factor_test.dart => text_scaler_test.dart} | 23 +++---- packages/flutter_markdown/test/utils.dart | 2 +- 11 files changed, 134 insertions(+), 31 deletions(-) rename packages/flutter_markdown/test/{text_scale_factor_test.dart => text_scaler_test.dart} (69%) diff --git a/packages/flutter_markdown/CHANGELOG.md b/packages/flutter_markdown/CHANGELOG.md index 8feeca4bdae2..9d901df3fa72 100644 --- a/packages/flutter_markdown/CHANGELOG.md +++ b/packages/flutter_markdown/CHANGELOG.md @@ -1,6 +1,10 @@ -## NEXT +## 0.6.20 -* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. +* Adds `textScaler` to `MarkdownStyleSheet`, and deprecates `textScaleFactor`. + * Clients using `textScaleFactor: someFactor` should replace it with + `TextScaler.linear(someFactor)` to preserve behavior. +* Removes use of deprecated Flutter framework `textScaleFactor` methods. +* Updates minimum supported SDK version to Flutter 3.16. ## 0.6.19 @@ -44,7 +48,7 @@ * Introduces a new `MarkdownElementBuilder.visitElementAfterWithContext()` method passing the widget `BuildContext` and the parent text's `TextStyle`. - + ## 0.6.16 * Adds `tableVerticalAlignment` property to allow aligning table cells vertically. diff --git a/packages/flutter_markdown/example/pubspec.yaml b/packages/flutter_markdown/example/pubspec.yaml index a904473786a4..c536ac0ce8d5 100644 --- a/packages/flutter_markdown/example/pubspec.yaml +++ b/packages/flutter_markdown/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the flutter_markdown package. publish_to: none environment: - sdk: ^3.1.0 - flutter: ">=3.13.0" + sdk: ^3.2.0 + flutter: ">=3.16.0" dependencies: flutter: diff --git a/packages/flutter_markdown/lib/src/_functions_io.dart b/packages/flutter_markdown/lib/src/_functions_io.dart index 81fd5b8f22b6..b3020573e165 100644 --- a/packages/flutter_markdown/lib/src/_functions_io.dart +++ b/packages/flutter_markdown/lib/src/_functions_io.dart @@ -64,7 +64,7 @@ final MarkdownStyleSheet Function(BuildContext, MarkdownStyleSheetBaseTheme?) } return result.copyWith( - textScaleFactor: MediaQuery.textScaleFactorOf(context), + textScaler: MediaQuery.textScalerOf(context), ); }; diff --git a/packages/flutter_markdown/lib/src/_functions_web.dart b/packages/flutter_markdown/lib/src/_functions_web.dart index 62692236a21e..7adf81654bed 100644 --- a/packages/flutter_markdown/lib/src/_functions_web.dart +++ b/packages/flutter_markdown/lib/src/_functions_web.dart @@ -66,7 +66,7 @@ final MarkdownStyleSheet Function(BuildContext, MarkdownStyleSheetBaseTheme?) } return result.copyWith( - textScaleFactor: MediaQuery.textScaleFactorOf(context), + textScaler: MediaQuery.textScalerOf(context), ); }; diff --git a/packages/flutter_markdown/lib/src/builder.dart b/packages/flutter_markdown/lib/src/builder.dart index 659df8ae6fc7..5d3cb10a8e43 100644 --- a/packages/flutter_markdown/lib/src/builder.dart +++ b/packages/flutter_markdown/lib/src/builder.dart @@ -867,7 +867,7 @@ class MarkdownBuilder implements md.NodeVisitor { if (selectable) { return SelectableText.rich( text!, - textScaleFactor: styleSheet.textScaleFactor, + textScaler: styleSheet.textScaler, textAlign: textAlign ?? TextAlign.start, onTap: onTapText, key: k, @@ -875,7 +875,7 @@ class MarkdownBuilder implements md.NodeVisitor { } else { return Text.rich( text!, - textScaleFactor: styleSheet.textScaleFactor, + textScaler: styleSheet.textScaler, textAlign: textAlign ?? TextAlign.start, key: k, ); diff --git a/packages/flutter_markdown/lib/src/style_sheet.dart b/packages/flutter_markdown/lib/src/style_sheet.dart index 8d73d318aa9c..7fc16d9881e0 100644 --- a/packages/flutter_markdown/lib/src/style_sheet.dart +++ b/packages/flutter_markdown/lib/src/style_sheet.dart @@ -59,8 +59,19 @@ class MarkdownStyleSheet { this.orderedListAlign = WrapAlignment.start, this.blockquoteAlign = WrapAlignment.start, this.codeblockAlign = WrapAlignment.start, - this.textScaleFactor, - }) : _styles = { + @Deprecated('Use textScaler instead.') this.textScaleFactor, + TextScaler? textScaler, + }) : assert( + textScaler == null || textScaleFactor == null, + 'textScaleFactor is deprecated and cannot be specified when textScaler is specified.', + ), + textScaler = textScaler ?? + // Internally, only textScaler is used, so convert the scale factor + // to a linear scaler. + (textScaleFactor == null + ? null + : TextScaler.linear(textScaleFactor)), + _styles = { 'a': a, 'p': p, 'li': p, @@ -380,8 +391,19 @@ class MarkdownStyleSheet { WrapAlignment? orderedListAlign, WrapAlignment? blockquoteAlign, WrapAlignment? codeblockAlign, - double? textScaleFactor, + @Deprecated('Use textScaler instead.') double? textScaleFactor, + TextScaler? textScaler, }) { + assert( + textScaler == null || textScaleFactor == null, + 'textScaleFactor is deprecated and cannot be specified when textScaler is specified.', + ); + // If either of textScaler or textScaleFactor is non-null, pass null for the + // other instead of the previous value, since only one is allowed. + final TextScaler? newTextScaler = + textScaler ?? (textScaleFactor == null ? this.textScaler : null); + final double? nextTextScaleFactor = + textScaleFactor ?? (textScaler == null ? this.textScaleFactor : null); return MarkdownStyleSheet( a: a ?? this.a, p: p ?? this.p, @@ -435,7 +457,8 @@ class MarkdownStyleSheet { orderedListAlign: orderedListAlign ?? this.orderedListAlign, blockquoteAlign: blockquoteAlign ?? this.blockquoteAlign, codeblockAlign: codeblockAlign ?? this.codeblockAlign, - textScaleFactor: textScaleFactor ?? this.textScaleFactor, + textScaler: newTextScaler, + textScaleFactor: nextTextScaleFactor, ); } @@ -497,6 +520,11 @@ class MarkdownStyleSheet { blockquoteAlign: other.blockquoteAlign, codeblockAlign: other.codeblockAlign, textScaleFactor: other.textScaleFactor, + // Only one of textScaler and textScaleFactor can be passed. If + // other.textScaleFactor is non-null, then the sheet was created with a + // textScaleFactor and the textScaler was derived from that, so should be + // ignored so that the textScaleFactor continues to be set. + textScaler: other.textScaleFactor == null ? other.textScaler : null, ); } @@ -650,7 +678,14 @@ class MarkdownStyleSheet { /// The [WrapAlignment] to use for a code block. Defaults to start. final WrapAlignment codeblockAlign; - /// The text scale factor to use in textual elements + /// The text scaler to use in textual elements. + final TextScaler? textScaler; + + /// The text scale factor to use in textual elements. + /// + /// This will be non-null only if the sheet was created with the deprecated + /// [textScaleFactor] instead of [textScaler]. + @Deprecated('Use textScaler instead.') final double? textScaleFactor; /// A [Map] from element name to the corresponding [TextStyle] object. @@ -717,7 +752,7 @@ class MarkdownStyleSheet { other.orderedListAlign == orderedListAlign && other.blockquoteAlign == blockquoteAlign && other.codeblockAlign == codeblockAlign && - other.textScaleFactor == textScaleFactor; + other.textScaler == textScaler; } @override @@ -774,6 +809,7 @@ class MarkdownStyleSheet { orderedListAlign, blockquoteAlign, codeblockAlign, + textScaler, textScaleFactor, ]); } diff --git a/packages/flutter_markdown/pubspec.yaml b/packages/flutter_markdown/pubspec.yaml index c3732a5c2cb8..0a3c89d24e77 100644 --- a/packages/flutter_markdown/pubspec.yaml +++ b/packages/flutter_markdown/pubspec.yaml @@ -4,11 +4,11 @@ description: A Markdown renderer for Flutter. Create rich text output, formatted with simple Markdown tags. repository: https://github.com/flutter/packages/tree/main/packages/flutter_markdown issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+flutter_markdown%22 -version: 0.6.19 +version: 0.6.20 environment: - sdk: ^3.1.0 - flutter: ">=3.13.0" + sdk: ^3.2.0 + flutter: ">=3.16.0" dependencies: flutter: diff --git a/packages/flutter_markdown/test/all.dart b/packages/flutter_markdown/test/all.dart index 44387e0afe9c..28338dbdcf30 100644 --- a/packages/flutter_markdown/test/all.dart +++ b/packages/flutter_markdown/test/all.dart @@ -18,7 +18,7 @@ import 'selection_area_compatibility_test.dart' as selection_area_test; import 'style_sheet_test.dart' as style_sheet_test; import 'table_test.dart' as table_test; import 'text_alignment_test.dart' as text_alignment_test; -import 'text_scale_factor_test.dart' as text_scale_factor; +import 'text_scaler_test.dart' as text_scaler; import 'text_test.dart' as text_test; import 'uri_test.dart' as uri_test; @@ -40,6 +40,6 @@ void main() { table_test.defineTests(); text_test.defineTests(); text_alignment_test.defineTests(); - text_scale_factor.defineTests(); + text_scaler.defineTests(); uri_test.defineTests(); } diff --git a/packages/flutter_markdown/test/style_sheet_test.dart b/packages/flutter_markdown/test/style_sheet_test.dart index ad8c1f0c695b..b48465a415a0 100644 --- a/packages/flutter_markdown/test/style_sheet_test.dart +++ b/packages/flutter_markdown/test/style_sheet_test.dart @@ -398,5 +398,65 @@ void defineTests() { ); }, ); + + testWidgets( + 'deprecated textScaleFactor is converted to linear scaler', + (WidgetTester tester) async { + const double scaleFactor = 2.0; + final MarkdownStyleSheet style = MarkdownStyleSheet( + textScaleFactor: scaleFactor, + ); + + expect(style.textScaler, const TextScaler.linear(scaleFactor)); + expect(style.textScaleFactor, scaleFactor); + }, + ); + + testWidgets( + 'deprecated textScaleFactor is null when a scaler is provided', + (WidgetTester tester) async { + const TextScaler scaler = TextScaler.linear(2.0); + final MarkdownStyleSheet style = MarkdownStyleSheet( + textScaler: scaler, + ); + + expect(style.textScaler, scaler); + expect(style.textScaleFactor, null); + }, + ); + + testWidgets( + 'copyWith textScaler overwrites both textScaler and textScaleFactor', + (WidgetTester tester) async { + final MarkdownStyleSheet original = MarkdownStyleSheet( + textScaleFactor: 2.0, + ); + + const TextScaler newScaler = TextScaler.linear(3.0); + final MarkdownStyleSheet copy = original.copyWith( + textScaler: newScaler, + ); + + expect(copy.textScaler, newScaler); + expect(copy.textScaleFactor, null); + }, + ); + + testWidgets( + 'copyWith textScaleFactor overwrites both textScaler and textScaleFactor', + (WidgetTester tester) async { + final MarkdownStyleSheet original = MarkdownStyleSheet( + textScaleFactor: 2.0, + ); + + const double newScaleFactor = 3.0; + final MarkdownStyleSheet copy = original.copyWith( + textScaleFactor: newScaleFactor, + ); + + expect(copy.textScaler, const TextScaler.linear(newScaleFactor)); + expect(copy.textScaleFactor, newScaleFactor); + }, + ); }); } diff --git a/packages/flutter_markdown/test/text_scale_factor_test.dart b/packages/flutter_markdown/test/text_scaler_test.dart similarity index 69% rename from packages/flutter_markdown/test/text_scale_factor_test.dart rename to packages/flutter_markdown/test/text_scaler_test.dart index 3710b3e0a62e..bc3ff911ef4e 100644 --- a/packages/flutter_markdown/test/text_scale_factor_test.dart +++ b/packages/flutter_markdown/test/text_scaler_test.dart @@ -10,33 +10,35 @@ import 'utils.dart'; void main() => defineTests(); void defineTests() { - group('Text Scale Factor', () { + group('Text Scaler', () { testWidgets( - 'should use style textScaleFactor in RichText', + 'should use style textScaler in RichText', (WidgetTester tester) async { + const TextScaler scaler = TextScaler.linear(2.0); const String data = 'Hello'; await tester.pumpWidget( boilerplate( MarkdownBody( - styleSheet: MarkdownStyleSheet(textScaleFactor: 2.0), + styleSheet: MarkdownStyleSheet(textScaler: scaler), data: data, ), ), ); final RichText richText = tester.widget(find.byType(RichText)); - expect(richText.textScaleFactor, 2.0); + expect(richText.textScaler, scaler); }, ); testWidgets( - 'should use MediaQuery textScaleFactor in RichText', + 'should use MediaQuery textScaler in RichText', (WidgetTester tester) async { + const TextScaler scaler = TextScaler.linear(2.0); const String data = 'Hello'; await tester.pumpWidget( boilerplate( const MediaQuery( - data: MediaQueryData(textScaleFactor: 2.0), + data: MediaQueryData(textScaler: scaler), child: MarkdownBody( data: data, ), @@ -45,18 +47,19 @@ void defineTests() { ); final RichText richText = tester.widget(find.byType(RichText)); - expect(richText.textScaleFactor, 2.0); + expect(richText.textScaler, scaler); }, ); testWidgets( - 'should use MediaQuery textScaleFactor in SelectableText.rich', + 'should use MediaQuery textScaler in SelectableText.rich', (WidgetTester tester) async { + const TextScaler scaler = TextScaler.linear(2.0); const String data = 'Hello'; await tester.pumpWidget( boilerplate( const MediaQuery( - data: MediaQueryData(textScaleFactor: 2.0), + data: MediaQueryData(textScaler: scaler), child: MarkdownBody( data: data, selectable: true, @@ -67,7 +70,7 @@ void defineTests() { final SelectableText selectableText = tester.widget(find.byType(SelectableText)); - expect(selectableText.textScaleFactor, 2.0); + expect(selectableText.textScaler, scaler); }, ); }); diff --git a/packages/flutter_markdown/test/utils.dart b/packages/flutter_markdown/test/utils.dart index 1cd902c30022..2d1a4ff27de5 100644 --- a/packages/flutter_markdown/test/utils.dart +++ b/packages/flutter_markdown/test/utils.dart @@ -169,7 +169,7 @@ void expectLinkTap(MarkdownLink? actual, MarkdownLink expected) { } String dumpRenderView() { - return WidgetsBinding.instance.renderViewElement!.toStringDeep().replaceAll( + return WidgetsBinding.instance.rootElement!.toStringDeep().replaceAll( RegExp(r'SliverChildListDelegate#\d+', multiLine: true), 'SliverChildListDelegate', ); From 8bba41b0c046228339c2b2577c0afcca76629b5f Mon Sep 17 00:00:00 2001 From: engine-flutter-autoroll Date: Tue, 20 Feb 2024 11:20:20 -0500 Subject: [PATCH 36/40] Roll Flutter from 064c340baf0e to 5129806e6c63 (9 revisions) (#6164) https://github.com/flutter/flutter/compare/064c340baf0e...5129806e6c63 2024-02-20 engine-flutter-autoroll@skia.org Roll Flutter Engine from 0abe2b9d6c7c to 781f308c6555 (1 revision) (flutter/flutter#143750) 2024-02-20 engine-flutter-autoroll@skia.org Roll Flutter Engine from 92aad0d0fcee to 0abe2b9d6c7c (1 revision) (flutter/flutter#143745) 2024-02-20 engine-flutter-autoroll@skia.org Roll Flutter Engine from 2335115f08d3 to 92aad0d0fcee (2 revisions) (flutter/flutter#143736) 2024-02-20 engine-flutter-autoroll@skia.org Roll Flutter Engine from e96c18b6c5ee to 2335115f08d3 (1 revision) (flutter/flutter#143731) 2024-02-20 greg@zulip.com Small fixes in TextEditingController docs (flutter/flutter#143717) 2024-02-19 engine-flutter-autoroll@skia.org Roll Flutter Engine from b41494f009f4 to e96c18b6c5ee (1 revision) (flutter/flutter#143722) 2024-02-19 engine-flutter-autoroll@skia.org Roll Flutter Engine from 714215d42e57 to b41494f009f4 (1 revision) (flutter/flutter#143713) 2024-02-19 git@reb0.org Reland (2): "Fix how Gradle resolves Android plugin" (flutter/flutter#142498) 2024-02-19 engine-flutter-autoroll@skia.org Roll Packages from 0af905d779d5 to 84ff11d7ee5a (1 revision) (flutter/flutter#143710) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC dit@google.com,rmistry@google.com,stuartmorgan@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md --- .ci/flutter_master.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/flutter_master.version b/.ci/flutter_master.version index 359ddb64593e..1dd06e656959 100644 --- a/.ci/flutter_master.version +++ b/.ci/flutter_master.version @@ -1 +1 @@ -064c340baf0e23790374f5b34ea067c2478e7fd1 +5129806e6c6331870b2a17606d1ddf71421f9fa7 From b21dce5f4964adf1e6c90225377a00f65652c428 Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Tue, 20 Feb 2024 14:00:12 -0800 Subject: [PATCH 37/40] [web] Updates package:web dependency to ^0.5.0. (#5791) This PR updates the packages that are using `package:web` to version `^0.5.0`. Ancilliary changes: * Bump `environment` to `flutter: ">=3.19.0"` and `sdk: ^3.3.0`. * Bump version to next `Y` * Clean-up code that was kept for compatibility with versions of `web: <0.5.0`. The main exception to this is `package:google_sign_in_web`, which depends on a version of `google_identity_services_web` that has a dependency on package:web that is `<0.5.0`, so that package needs to have a range until `google_identity_services_web` gets published with the new ^0.5.0 dependency. Co-Authored-By: David Iglesias --- packages/cross_file/CHANGELOG.md | 5 +- packages/cross_file/lib/src/types/html.dart | 8 +- packages/cross_file/pubspec.yaml | 6 +- .../cross_file/test/x_file_html_test.dart | 6 +- .../file_selector_web/CHANGELOG.md | 5 +- .../integration_test/dom_helper_test.dart | 35 +- .../file_selector_web/example/pubspec.yaml | 6 +- .../file_selector_web/lib/src/dom_helper.dart | 11 +- .../file_selector_web/pubspec.yaml | 8 +- .../google_identity_services_web/CHANGELOG.md | 5 + .../integration_test/js_interop_id_test.dart | 4 +- .../example/pubspec.yaml | 3 +- .../src/js_interop/google_accounts_id.dart | 4 +- .../src/js_interop/package_web_tweaks.dart | 67 ++- .../lib/src/js_loader.dart | 8 +- .../google_identity_services_web/pubspec.yaml | 6 +- .../google_sign_in_web/CHANGELOG.md | 5 + .../google_sign_in_web/example/pubspec.yaml | 6 +- .../google_sign_in_web/pubspec.yaml | 8 +- .../image_picker_for_web/example/pubspec.yaml | 1 - packages/metrics_center/CHANGELOG.md | 3 +- packages/metrics_center/pubspec.yaml | 4 +- .../test/gcs_lock_test.mocks.dart | 392 +++++++++++++----- .../pointer_interceptor_web/CHANGELOG.md | 5 + .../example/pubspec.yaml | 6 +- .../pointer_interceptor_web/pubspec.yaml | 8 +- .../shared_preferences_web/CHANGELOG.md | 5 + .../shared_preferences_web_test.dart | 3 +- .../example/pubspec.yaml | 3 +- .../shared_preferences_web/pubspec.yaml | 8 +- .../url_launcher_web/CHANGELOG.md | 5 + .../integration_test/link_widget_test.dart | 9 +- .../url_launcher_web_test.dart | 13 +- .../url_launcher_web/example/pubspec.yaml | 6 +- .../url_launcher_web/lib/src/link.dart | 15 +- .../url_launcher_web/pubspec.yaml | 8 +- .../video_player_web/CHANGELOG.md | 4 +- .../example/integration_test/utils.dart | 44 +- .../video_player_web/example/pubspec.yaml | 8 +- .../video_player_web/pubspec.yaml | 6 +- packages/web_benchmarks/CHANGELOG.md | 5 +- packages/web_benchmarks/lib/client.dart | 12 +- packages/web_benchmarks/lib/src/recorder.dart | 2 +- packages/web_benchmarks/pubspec.yaml | 9 +- 44 files changed, 500 insertions(+), 290 deletions(-) diff --git a/packages/cross_file/CHANGELOG.md b/packages/cross_file/CHANGELOG.md index c6113b298146..52b11b97de35 100644 --- a/packages/cross_file/CHANGELOG.md +++ b/packages/cross_file/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 0.3.4 -* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. +* Updates to web code to package `web: ^0.5.0`. +* Updates SDK version to Dart `^3.3.0`. ## 0.3.3+8 diff --git a/packages/cross_file/lib/src/types/html.dart b/packages/cross_file/lib/src/types/html.dart index 9eb95b448d88..a58dc35278b5 100644 --- a/packages/cross_file/lib/src/types/html.dart +++ b/packages/cross_file/lib/src/types/html.dart @@ -66,9 +66,7 @@ class XFile extends XFileBase { super(path) { if (path == null) { _browserBlob = _createBlobFromBytes(bytes, mimeType); - // TODO(kevmoo): drop ignore when pkg:web constraint excludes v0.3 - // ignore: unnecessary_cast - _path = URL.createObjectURL(_browserBlob! as JSObject); + _path = URL.createObjectURL(_browserBlob!); } else { _path = path; } @@ -131,9 +129,7 @@ class XFile extends XFileBase { // Attempt to re-hydrate the blob from the `path` via a (local) HttpRequest. // Note that safari hangs if the Blob is >=4GB, so bail out in that case. - // TODO(kevmoo): Remove ignore and fix when the MIN Dart SDK is 3.3 - // ignore: unnecessary_non_null_assertion - if (isSafari() && _length != null && _length! >= _fourGigabytes) { + if (isSafari() && _length != null && _length >= _fourGigabytes) { throw Exception('Safari cannot handle XFiles larger than 4GB.'); } diff --git a/packages/cross_file/pubspec.yaml b/packages/cross_file/pubspec.yaml index c2b8f2f53424..b7b7f7af1088 100644 --- a/packages/cross_file/pubspec.yaml +++ b/packages/cross_file/pubspec.yaml @@ -2,14 +2,14 @@ name: cross_file description: An abstraction to allow working with files across multiple platforms. repository: https://github.com/flutter/packages/tree/main/packages/cross_file issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+cross_file%22 -version: 0.3.3+8 +version: 0.3.4 environment: - sdk: ^3.2.0 + sdk: ^3.3.0 dependencies: meta: ^1.3.0 - web: '>=0.3.0 <0.5.0' + web: ^0.5.0 dev_dependencies: path: ^1.8.1 diff --git a/packages/cross_file/test/x_file_html_test.dart b/packages/cross_file/test/x_file_html_test.dart index 4b002cac158b..4b1dabd1583d 100644 --- a/packages/cross_file/test/x_file_html_test.dart +++ b/packages/cross_file/test/x_file_html_test.dart @@ -69,10 +69,10 @@ void main() { test('Stores data as a Blob', () async { // Read the blob from its path 'natively' final html.Response response = - (await html.window.fetch(file.path.toJS).toDart)! as html.Response; + await html.window.fetch(file.path.toJS).toDart; - final JSAny? arrayBuffer = await response.arrayBuffer().toDart; - final ByteBuffer data = (arrayBuffer! as JSArrayBuffer).toDart; + final JSAny arrayBuffer = await response.arrayBuffer().toDart; + final ByteBuffer data = (arrayBuffer as JSArrayBuffer).toDart; expect(data.asUint8List(), equals(bytes)); }); diff --git a/packages/file_selector/file_selector_web/CHANGELOG.md b/packages/file_selector/file_selector_web/CHANGELOG.md index 40b7a853e5b3..e2dd2901aa8e 100644 --- a/packages/file_selector/file_selector_web/CHANGELOG.md +++ b/packages/file_selector/file_selector_web/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 0.9.4 -* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. +* Updates web code to package `web: ^0.5.0`. +* Updates SDK version to Dart `^3.3.0`. Flutter `^3.16.0`. ## 0.9.3 diff --git a/packages/file_selector/file_selector_web/example/integration_test/dom_helper_test.dart b/packages/file_selector/file_selector_web/example/integration_test/dom_helper_test.dart index 1cec6fc7ad10..c4697a70a5d4 100644 --- a/packages/file_selector/file_selector_web/example/integration_test/dom_helper_test.dart +++ b/packages/file_selector/file_selector_web/example/integration_test/dom_helper_test.dart @@ -18,11 +18,10 @@ void main() { FileList? createFileList(List files) { final DataTransfer dataTransfer = DataTransfer(); + // Tear-offs of external extension type interop member 'add' are disallowed. + // ignore: prefer_foreach for (final File e in files) { - // TODO(srujzs): This is necessary in order to support package:web 0.4.0. - // This was not needed with 0.3.0, hence the lint. - // ignore: unnecessary_cast - dataTransfer.items.add(e as JSAny); + dataTransfer.items.add(e); } return dataTransfer.files; } @@ -46,13 +45,8 @@ void main() { }); group('getFiles', () { - final File mockFile1 = - // TODO(srujzs): Remove once typed JSArrays (JSArray) get to `stable`. - // ignore: always_specify_types - File(['123456'].jsify as JSArray, 'file1.txt'); - // TODO(srujzs): Remove once typed JSArrays (JSArray) get to `stable`. - // ignore: always_specify_types - final File mockFile2 = File([].jsify as JSArray, 'file2.txt'); + final File mockFile1 = File(['123456'.toJS].toJS, 'file1.txt'); + final File mockFile2 = File([].toJS, 'file2.txt'); testWidgets('works', (_) async { final Future> futureFiles = domHelper.getFiles( @@ -114,10 +108,7 @@ void main() { testWidgets('sets the attributes and clicks it', (_) async { const String accept = '.jpg,.png'; const bool multiple = true; - bool wasClicked = false; - - //ignore: unawaited_futures - input.onClick.first.then((_) => wasClicked = true); + final Future wasClicked = input.onClick.first.then((_) => true); final Future> futureFile = domHelper.getFiles( accept: accept, @@ -125,21 +116,19 @@ void main() { input: input, ); - expect(input.matches('body'), true); + expect(input.isConnected, true, + reason: 'input must be injected into the DOM'); expect(input.accept, accept); expect(input.multiple, multiple); - expect( - wasClicked, - true, - reason: - 'The should be clicked otherwise no dialog will be shown', - ); + expect(await wasClicked, true, + reason: + 'The should be clicked otherwise no dialog will be shown'); setFilesAndTriggerChange([]); await futureFile; // It should be already removed from the DOM after the file is resolved. - expect(input.parentElement, isNull); + expect(input.isConnected, isFalse); }); }); }); diff --git a/packages/file_selector/file_selector_web/example/pubspec.yaml b/packages/file_selector/file_selector_web/example/pubspec.yaml index 725ace61b00b..689ab97657e7 100644 --- a/packages/file_selector/file_selector_web/example/pubspec.yaml +++ b/packages/file_selector/file_selector_web/example/pubspec.yaml @@ -2,8 +2,8 @@ name: file_selector_web_integration_tests publish_to: none environment: - sdk: ^3.1.0 - flutter: ">=3.13.0" + sdk: ^3.3.0 + flutter: ">=3.19.0" dependencies: file_selector_platform_interface: ^2.6.0 @@ -11,7 +11,7 @@ dependencies: path: ../ flutter: sdk: flutter - web: '>=0.3.0 <0.5.0' + web: ^0.5.0 dev_dependencies: flutter_test: diff --git a/packages/file_selector/file_selector_web/lib/src/dom_helper.dart b/packages/file_selector/file_selector_web/lib/src/dom_helper.dart index 7684a12286d7..309f0ee432f1 100644 --- a/packages/file_selector/file_selector_web/lib/src/dom_helper.dart +++ b/packages/file_selector/file_selector_web/lib/src/dom_helper.dart @@ -14,11 +14,11 @@ import 'package:web/helpers.dart'; class DomHelper { /// Default constructor, initializes the container DOM element. DomHelper() { - final Element body = querySelector('body')!; + final Element body = document.querySelector('body')!; body.appendChild(_container); } - final Element _container = createElementTag('file-selector'); + final Element _container = document.createElement('file-selector'); /// Sets the attributes and waits for a file to be selected. Future> getFiles({ @@ -28,7 +28,7 @@ class DomHelper { }) { final Completer> completer = Completer>(); final HTMLInputElement inputElement = - input ?? (createElementTag('input') as HTMLInputElement) + input ?? (document.createElement('input') as HTMLInputElement) ..type = 'file'; _container.appendChild( @@ -72,10 +72,7 @@ class DomHelper { } XFile _convertFileToXFile(File file) => XFile( - // TODO(srujzs): This is necessary in order to support package:web 0.4.0. - // This was not needed with 0.3.0, hence the lint. - // ignore: unnecessary_cast - URL.createObjectURL(file as JSObject), + URL.createObjectURL(file), name: file.name, length: file.size, lastModified: DateTime.fromMillisecondsSinceEpoch(file.lastModified), diff --git a/packages/file_selector/file_selector_web/pubspec.yaml b/packages/file_selector/file_selector_web/pubspec.yaml index 3c3ca15c3aa9..edc74e3064ea 100644 --- a/packages/file_selector/file_selector_web/pubspec.yaml +++ b/packages/file_selector/file_selector_web/pubspec.yaml @@ -2,11 +2,11 @@ name: file_selector_web description: Web platform implementation of file_selector repository: https://github.com/flutter/packages/tree/main/packages/file_selector/file_selector_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+file_selector%22 -version: 0.9.3 +version: 0.9.4 environment: - sdk: ^3.2.0 - flutter: ">=3.16.0" + sdk: ^3.3.0 + flutter: ">=3.19.0" flutter: plugin: @@ -22,7 +22,7 @@ dependencies: sdk: flutter flutter_web_plugins: sdk: flutter - web: '>=0.3.0 <0.5.0' + web: ^0.5.0 dev_dependencies: flutter_test: diff --git a/packages/google_identity_services_web/CHANGELOG.md b/packages/google_identity_services_web/CHANGELOG.md index 92c96c07bdce..fe739cab00e5 100644 --- a/packages/google_identity_services_web/CHANGELOG.md +++ b/packages/google_identity_services_web/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.3.1 + +* Updates web code to package `web: ^0.5.0`. +* Updates SDK version to Dart `^3.3.0`. Flutter `^3.19.0`. + ## 0.3.0+2 * Adds `fedcm_auto` to `CredentialSelectBy` enum. diff --git a/packages/google_identity_services_web/example/integration_test/js_interop_id_test.dart b/packages/google_identity_services_web/example/integration_test/js_interop_id_test.dart index 77914b746740..1d1c5c29ea81 100644 --- a/packages/google_identity_services_web/example/integration_test/js_interop_id_test.dart +++ b/packages/google_identity_services_web/example/integration_test/js_interop_id_test.dart @@ -66,9 +66,7 @@ void main() async { expectConfigValue('login_uri', 'https://www.example.com/login'); expectConfigValue('native_callback', utils.isAJs('function')); expectConfigValue('cancel_on_tap_outside', isFalse); - // TODO(srujzs): Remove once typed JSArrays (JSArray) get to `stable`. - // ignore: always_specify_types - expectConfigValue('allowed_parent_origin', isA()); + expectConfigValue('allowed_parent_origin', isA>()); expectConfigValue('prompt_parent_id', 'some_dom_id'); expectConfigValue('nonce', 's0m3_r4ndOM_vALu3'); expectConfigValue('context', 'signin'); diff --git a/packages/google_identity_services_web/example/pubspec.yaml b/packages/google_identity_services_web/example/pubspec.yaml index e53f85dff1cb..46bdaf47c9e0 100644 --- a/packages/google_identity_services_web/example/pubspec.yaml +++ b/packages/google_identity_services_web/example/pubspec.yaml @@ -1,7 +1,6 @@ name: google_identity_services_web_example description: An example for the google_identity_services_web package, OneTap. publish_to: 'none' -version: 0.0.1 environment: flutter: ">=3.16.0" @@ -13,7 +12,7 @@ dependencies: google_identity_services_web: path: ../ http: ">=0.13.0 <2.0.0" - web: ">=0.3.0 <0.5.0" + web: ^0.5.0 dev_dependencies: build_runner: ^2.1.10 # To extract README excerpts only. diff --git a/packages/google_identity_services_web/lib/src/js_interop/google_accounts_id.dart b/packages/google_identity_services_web/lib/src/js_interop/google_accounts_id.dart index a02197e0cf83..8467854640e8 100644 --- a/packages/google_identity_services_web/lib/src/js_interop/google_accounts_id.dart +++ b/packages/google_identity_services_web/lib/src/js_interop/google_accounts_id.dart @@ -338,9 +338,7 @@ abstract class IdConfiguration { JSString? context, JSString? state_cookie_domain, JSString? ux_mode, - // TODO(srujzs): Remove once typed JSArrays (JSArray) get to `stable`. - // ignore: always_specify_types - JSArray? allowed_parent_origin, + JSArray? allowed_parent_origin, JSFunction? intermediate_iframe_close_callback, JSBoolean? itp_support, JSString? login_hint, diff --git a/packages/google_identity_services_web/lib/src/js_interop/package_web_tweaks.dart b/packages/google_identity_services_web/lib/src/js_interop/package_web_tweaks.dart index 76dc411c103e..b05fbc5a49a2 100644 --- a/packages/google_identity_services_web/lib/src/js_interop/package_web_tweaks.dart +++ b/packages/google_identity_services_web/lib/src/js_interop/package_web_tweaks.dart @@ -2,34 +2,75 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/// Provides some useful tweaks to `package:web`. -library package_web_tweaks; - import 'dart:js_interop'; + import 'package:web/web.dart' as web; +// TODO(kevmoo): Make this file unnecessary, https://github.com/dart-lang/web/issues/175 + /// This extension gives web.window a nullable getter to the `trustedTypes` /// property, which needs to be used to check for feature support. extension NullableTrustedTypesGetter on web.Window { + /// (Nullable) Bindings to window.trustedTypes. + /// + /// This may be null if the browser doesn't support the Trusted Types API. + /// + /// See: https://developer.mozilla.org/en-US/docs/Web/API/Trusted_Types_API + @JS('trustedTypes') + external TrustedTypePolicyFactory? get nullableTrustedTypes; + + /// Bindings to window.trustedTypes. + /// + /// This will crash if accessed in a browser that doesn't support the + /// Trusted Types API. /// + /// See: https://developer.mozilla.org/en-US/docs/Web/API/Trusted_Types_API @JS('trustedTypes') - external web.TrustedTypePolicyFactory? get nullableTrustedTypes; + external TrustedTypePolicyFactory get trustedTypes; } -/// This extension allows a trusted type policy to create a script URL without -/// the `args` parameter (which in Chrome currently fails). -extension CreateScriptUrlWithoutArgs on web.TrustedTypePolicy { +/// This extension allows setting a TrustedScriptURL as the src of a script element, +/// which currently only accepts a string. +extension TrustedTypeSrcAttribute on web.HTMLScriptElement { + @JS('src') + external set trustedSrc(TrustedScriptURL value); +} + +// TODO(kevmoo): drop all of this once `pkg:web` publishes `0.5.1`. + +/// Bindings to a JS TrustedScriptURL. +/// +/// See: https://developer.mozilla.org/en-US/docs/Web/API/TrustedScriptURL +extension type TrustedScriptURL._(JSObject _) implements JSObject {} + +/// Bindings to a JS TrustedTypePolicyFactory. +/// +/// See: https://developer.mozilla.org/en-US/docs/Web/API/TrustedTypePolicyFactory +extension type TrustedTypePolicyFactory._(JSObject _) implements JSObject { + /// + external TrustedTypePolicy createPolicy( + String policyName, [ + TrustedTypePolicyOptions policyOptions, + ]); +} + +/// Bindings to a JS TrustedTypePolicy. +/// +/// See: https://developer.mozilla.org/en-US/docs/Web/API/TrustedTypePolicy +extension type TrustedTypePolicy._(JSObject _) implements JSObject { /// @JS('createScriptURL') - external web.TrustedScriptURL createScriptURLNoArgs( + external TrustedScriptURL createScriptURLNoArgs( String input, ); } -/// This extension allows setting a TrustedScriptURL as the src of a script element, -/// which currently only accepts a string. -extension TrustedTypeSrcAttribute on web.HTMLScriptElement { +/// Bindings to a JS TrustedTypePolicyOptions (anonymous). +/// +/// See: https://developer.mozilla.org/en-US/docs/Web/API/TrustedTypePolicyFactory/createPolicy#policyoptions +extension type TrustedTypePolicyOptions._(JSObject _) implements JSObject { /// - @JS('src') - external set srcTT(web.TrustedScriptURL value); + external factory TrustedTypePolicyOptions({ + JSFunction createScriptURL, + }); } diff --git a/packages/google_identity_services_web/lib/src/js_loader.dart b/packages/google_identity_services_web/lib/src/js_loader.dart index bd876f98c5ce..620ad2129269 100644 --- a/packages/google_identity_services_web/lib/src/js_loader.dart +++ b/packages/google_identity_services_web/lib/src/js_loader.dart @@ -25,15 +25,15 @@ Future loadWebSdk({ onGoogleLibraryLoad = () => completer.complete(); // If TrustedTypes are available, prepare a trusted URL. - web.TrustedScriptURL? trustedUrl; + TrustedScriptURL? trustedUrl; if (web.window.nullableTrustedTypes != null) { web.console.debug( 'TrustedTypes available. Creating policy: $trustedTypePolicyName'.toJS, ); try { - final web.TrustedTypePolicy policy = web.window.trustedTypes.createPolicy( + final TrustedTypePolicy policy = web.window.trustedTypes.createPolicy( trustedTypePolicyName, - web.TrustedTypePolicyOptions( + TrustedTypePolicyOptions( createScriptURL: ((JSString url) => _url).toJS, )); trustedUrl = policy.createScriptURLNoArgs(_url); @@ -47,7 +47,7 @@ Future loadWebSdk({ ..async = true ..defer = true; if (trustedUrl != null) { - script.srcTT = trustedUrl; + script.trustedSrc = trustedUrl; } else { script.src = _url; } diff --git a/packages/google_identity_services_web/pubspec.yaml b/packages/google_identity_services_web/pubspec.yaml index 2f1e5b913901..84502a1f6a49 100644 --- a/packages/google_identity_services_web/pubspec.yaml +++ b/packages/google_identity_services_web/pubspec.yaml @@ -2,14 +2,14 @@ name: google_identity_services_web description: A Dart JS-interop layer for Google Identity Services. Google's new sign-in SDK for Web that supports multiple types of credentials. repository: https://github.com/flutter/packages/tree/main/packages/google_identity_services_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_identiy_services_web%22 -version: 0.3.0+2 +version: 0.3.1 environment: - sdk: ">=3.2.0 <4.0.0" + sdk: ^3.3.0 dependencies: meta: ^1.3.0 - web: ">=0.3.0 <0.5.0" + web: ^0.5.0 dev_dependencies: path: ^1.8.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 73a6b806ac13..2c9c5863c8e2 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.12.3+3 + +* Updates SDK version to Dart `^3.3.0`. Flutter `^3.19.0`. +* Prepares update to package `web: ^0.5.0`. + ## 0.12.3+2 * Fixes new lint warnings. diff --git a/packages/google_sign_in/google_sign_in_web/example/pubspec.yaml b/packages/google_sign_in/google_sign_in_web/example/pubspec.yaml index a7c48aa6d3bd..1c53b0fa93c9 100644 --- a/packages/google_sign_in/google_sign_in_web/example/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in_web/example/pubspec.yaml @@ -2,8 +2,8 @@ name: google_sign_in_web_integration_tests publish_to: none environment: - sdk: ">=3.2.0 <4.0.0" - flutter: ">=3.16.0" + sdk: ^3.3.0 + flutter: ">=3.19.0" dependencies: cupertino_icons: ^1.0.2 @@ -22,7 +22,7 @@ dev_dependencies: integration_test: sdk: flutter mockito: 5.4.4 - web: ">=0.3.0 <0.5.0" + web: ">=0.3.0 <0.6.0" flutter: uses-material-design: true 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 834e666b34ae..82b9cd3cd289 100644 --- a/packages/google_sign_in/google_sign_in_web/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in_web/pubspec.yaml @@ -3,11 +3,11 @@ description: Flutter plugin for Google Sign-In, a secure authentication system for signing in with a Google account on Android, iOS and Web. repository: https://github.com/flutter/packages/tree/main/packages/google_sign_in/google_sign_in_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22 -version: 0.12.3+2 +version: 0.12.3+3 environment: - sdk: ">=3.2.0 <4.0.0" - flutter: ">=3.16.0" + sdk: ^3.3.0 + flutter: ">=3.19.0" flutter: plugin: @@ -25,7 +25,7 @@ dependencies: google_identity_services_web: ^0.3.0 google_sign_in_platform_interface: ^2.4.0 http: ">=0.13.0 <2.0.0" - web: ">=0.3.0 <0.5.0" + web: ">=0.3.0 <0.6.0" # because google_identity_services dev_dependencies: flutter_test: diff --git a/packages/image_picker/image_picker_for_web/example/pubspec.yaml b/packages/image_picker/image_picker_for_web/example/pubspec.yaml index 4e1a99bb5530..2efe50fa6375 100644 --- a/packages/image_picker/image_picker_for_web/example/pubspec.yaml +++ b/packages/image_picker/image_picker_for_web/example/pubspec.yaml @@ -17,4 +17,3 @@ dev_dependencies: sdk: flutter integration_test: sdk: flutter - js: ^0.6.3 diff --git a/packages/metrics_center/CHANGELOG.md b/packages/metrics_center/CHANGELOG.md index 0d589218f8ab..a661251dc1d2 100644 --- a/packages/metrics_center/CHANGELOG.md +++ b/packages/metrics_center/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 1.0.13 * Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. +* Updates dependency on `package:googleapis` to `^12.0.0`. ## 1.0.12 diff --git a/packages/metrics_center/pubspec.yaml b/packages/metrics_center/pubspec.yaml index efc8ffcd5d92..581be39e283c 100644 --- a/packages/metrics_center/pubspec.yaml +++ b/packages/metrics_center/pubspec.yaml @@ -1,5 +1,5 @@ name: metrics_center -version: 1.0.12 +version: 1.0.13 description: Support multiple performance metrics sources/formats and destinations. repository: https://github.com/flutter/packages/tree/main/packages/metrics_center @@ -12,7 +12,7 @@ dependencies: _discoveryapis_commons: ^1.0.0 crypto: ^3.0.1 gcloud: ^0.8.2 - googleapis: ^3.0.0 + googleapis: ^12.0.0 googleapis_auth: ^1.1.0 http: ">=0.13.0 <2.0.0" diff --git a/packages/metrics_center/test/gcs_lock_test.mocks.dart b/packages/metrics_center/test/gcs_lock_test.mocks.dart index f28daf64f6e5..d013ac823f25 100644 --- a/packages/metrics_center/test/gcs_lock_test.mocks.dart +++ b/packages/metrics_center/test/gcs_lock_test.mocks.dart @@ -60,9 +60,20 @@ class _FakeStreamedResponse_2 extends _i1.SmartFake ); } -class _FakeBucketAccessControlsResource_3 extends _i1.SmartFake +class _FakeAnywhereCacheResource_3 extends _i1.SmartFake + implements _i4.AnywhereCacheResource { + _FakeAnywhereCacheResource_3( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeBucketAccessControlsResource_4 extends _i1.SmartFake implements _i4.BucketAccessControlsResource { - _FakeBucketAccessControlsResource_3( + _FakeBucketAccessControlsResource_4( Object parent, Invocation parentInvocation, ) : super( @@ -71,9 +82,9 @@ class _FakeBucketAccessControlsResource_3 extends _i1.SmartFake ); } -class _FakeBucketsResource_4 extends _i1.SmartFake +class _FakeBucketsResource_5 extends _i1.SmartFake implements _i4.BucketsResource { - _FakeBucketsResource_4( + _FakeBucketsResource_5( Object parent, Invocation parentInvocation, ) : super( @@ -82,9 +93,9 @@ class _FakeBucketsResource_4 extends _i1.SmartFake ); } -class _FakeChannelsResource_5 extends _i1.SmartFake +class _FakeChannelsResource_6 extends _i1.SmartFake implements _i4.ChannelsResource { - _FakeChannelsResource_5( + _FakeChannelsResource_6( Object parent, Invocation parentInvocation, ) : super( @@ -93,9 +104,20 @@ class _FakeChannelsResource_5 extends _i1.SmartFake ); } -class _FakeDefaultObjectAccessControlsResource_6 extends _i1.SmartFake +class _FakeDefaultObjectAccessControlsResource_7 extends _i1.SmartFake implements _i4.DefaultObjectAccessControlsResource { - _FakeDefaultObjectAccessControlsResource_6( + _FakeDefaultObjectAccessControlsResource_7( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeManagedFoldersResource_8 extends _i1.SmartFake + implements _i4.ManagedFoldersResource { + _FakeManagedFoldersResource_8( Object parent, Invocation parentInvocation, ) : super( @@ -104,9 +126,9 @@ class _FakeDefaultObjectAccessControlsResource_6 extends _i1.SmartFake ); } -class _FakeNotificationsResource_7 extends _i1.SmartFake +class _FakeNotificationsResource_9 extends _i1.SmartFake implements _i4.NotificationsResource { - _FakeNotificationsResource_7( + _FakeNotificationsResource_9( Object parent, Invocation parentInvocation, ) : super( @@ -115,9 +137,9 @@ class _FakeNotificationsResource_7 extends _i1.SmartFake ); } -class _FakeObjectAccessControlsResource_8 extends _i1.SmartFake +class _FakeObjectAccessControlsResource_10 extends _i1.SmartFake implements _i4.ObjectAccessControlsResource { - _FakeObjectAccessControlsResource_8( + _FakeObjectAccessControlsResource_10( Object parent, Invocation parentInvocation, ) : super( @@ -126,9 +148,9 @@ class _FakeObjectAccessControlsResource_8 extends _i1.SmartFake ); } -class _FakeObjectsResource_9 extends _i1.SmartFake +class _FakeObjectsResource_11 extends _i1.SmartFake implements _i4.ObjectsResource { - _FakeObjectsResource_9( + _FakeObjectsResource_11( Object parent, Invocation parentInvocation, ) : super( @@ -137,9 +159,20 @@ class _FakeObjectsResource_9 extends _i1.SmartFake ); } -class _FakeProjectsResource_10 extends _i1.SmartFake +class _FakeOperationsResource_12 extends _i1.SmartFake + implements _i4.OperationsResource { + _FakeOperationsResource_12( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeProjectsResource_13 extends _i1.SmartFake implements _i4.ProjectsResource { - _FakeProjectsResource_10( + _FakeProjectsResource_13( Object parent, Invocation parentInvocation, ) : super( @@ -148,8 +181,9 @@ class _FakeProjectsResource_10 extends _i1.SmartFake ); } -class _FakeObject_11 extends _i1.SmartFake implements _i4.Object { - _FakeObject_11( +class _FakeGoogleLongrunningOperation_14 extends _i1.SmartFake + implements _i4.GoogleLongrunningOperation { + _FakeGoogleLongrunningOperation_14( Object parent, Invocation parentInvocation, ) : super( @@ -158,8 +192,8 @@ class _FakeObject_11 extends _i1.SmartFake implements _i4.Object { ); } -class _FakeObject_12 extends _i1.SmartFake implements Object { - _FakeObject_12( +class _FakeObject_15 extends _i1.SmartFake implements _i4.Object { + _FakeObject_15( Object parent, Invocation parentInvocation, ) : super( @@ -168,8 +202,8 @@ class _FakeObject_12 extends _i1.SmartFake implements Object { ); } -class _FakePolicy_13 extends _i1.SmartFake implements _i4.Policy { - _FakePolicy_13( +class _FakeObject_16 extends _i1.SmartFake implements Object { + _FakeObject_16( Object parent, Invocation parentInvocation, ) : super( @@ -178,8 +212,8 @@ class _FakePolicy_13 extends _i1.SmartFake implements _i4.Policy { ); } -class _FakeObjects_14 extends _i1.SmartFake implements _i4.Objects { - _FakeObjects_14( +class _FakePolicy_17 extends _i1.SmartFake implements _i4.Policy { + _FakePolicy_17( Object parent, Invocation parentInvocation, ) : super( @@ -188,9 +222,19 @@ class _FakeObjects_14 extends _i1.SmartFake implements _i4.Objects { ); } -class _FakeRewriteResponse_15 extends _i1.SmartFake +class _FakeObjects_18 extends _i1.SmartFake implements _i4.Objects { + _FakeObjects_18( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeRewriteResponse_19 extends _i1.SmartFake implements _i4.RewriteResponse { - _FakeRewriteResponse_15( + _FakeRewriteResponse_19( Object parent, Invocation parentInvocation, ) : super( @@ -199,9 +243,9 @@ class _FakeRewriteResponse_15 extends _i1.SmartFake ); } -class _FakeTestIamPermissionsResponse_16 extends _i1.SmartFake +class _FakeTestIamPermissionsResponse_20 extends _i1.SmartFake implements _i4.TestIamPermissionsResponse { - _FakeTestIamPermissionsResponse_16( + _FakeTestIamPermissionsResponse_20( Object parent, Invocation parentInvocation, ) : super( @@ -210,8 +254,8 @@ class _FakeTestIamPermissionsResponse_16 extends _i1.SmartFake ); } -class _FakeChannel_17 extends _i1.SmartFake implements _i4.Channel { - _FakeChannel_17( +class _FakeChannel_21 extends _i1.SmartFake implements _i4.Channel { + _FakeChannel_21( Object parent, Invocation parentInvocation, ) : super( @@ -473,11 +517,20 @@ class MockStorageApi extends _i1.Mock implements _i4.StorageApi { _i1.throwOnMissingStub(this); } + @override + _i4.AnywhereCacheResource get anywhereCache => (super.noSuchMethod( + Invocation.getter(#anywhereCache), + returnValue: _FakeAnywhereCacheResource_3( + this, + Invocation.getter(#anywhereCache), + ), + ) as _i4.AnywhereCacheResource); + @override _i4.BucketAccessControlsResource get bucketAccessControls => (super.noSuchMethod( Invocation.getter(#bucketAccessControls), - returnValue: _FakeBucketAccessControlsResource_3( + returnValue: _FakeBucketAccessControlsResource_4( this, Invocation.getter(#bucketAccessControls), ), @@ -486,7 +539,7 @@ class MockStorageApi extends _i1.Mock implements _i4.StorageApi { @override _i4.BucketsResource get buckets => (super.noSuchMethod( Invocation.getter(#buckets), - returnValue: _FakeBucketsResource_4( + returnValue: _FakeBucketsResource_5( this, Invocation.getter(#buckets), ), @@ -495,7 +548,7 @@ class MockStorageApi extends _i1.Mock implements _i4.StorageApi { @override _i4.ChannelsResource get channels => (super.noSuchMethod( Invocation.getter(#channels), - returnValue: _FakeChannelsResource_5( + returnValue: _FakeChannelsResource_6( this, Invocation.getter(#channels), ), @@ -505,16 +558,25 @@ class MockStorageApi extends _i1.Mock implements _i4.StorageApi { _i4.DefaultObjectAccessControlsResource get defaultObjectAccessControls => (super.noSuchMethod( Invocation.getter(#defaultObjectAccessControls), - returnValue: _FakeDefaultObjectAccessControlsResource_6( + returnValue: _FakeDefaultObjectAccessControlsResource_7( this, Invocation.getter(#defaultObjectAccessControls), ), ) as _i4.DefaultObjectAccessControlsResource); + @override + _i4.ManagedFoldersResource get managedFolders => (super.noSuchMethod( + Invocation.getter(#managedFolders), + returnValue: _FakeManagedFoldersResource_8( + this, + Invocation.getter(#managedFolders), + ), + ) as _i4.ManagedFoldersResource); + @override _i4.NotificationsResource get notifications => (super.noSuchMethod( Invocation.getter(#notifications), - returnValue: _FakeNotificationsResource_7( + returnValue: _FakeNotificationsResource_9( this, Invocation.getter(#notifications), ), @@ -524,7 +586,7 @@ class MockStorageApi extends _i1.Mock implements _i4.StorageApi { _i4.ObjectAccessControlsResource get objectAccessControls => (super.noSuchMethod( Invocation.getter(#objectAccessControls), - returnValue: _FakeObjectAccessControlsResource_8( + returnValue: _FakeObjectAccessControlsResource_10( this, Invocation.getter(#objectAccessControls), ), @@ -533,16 +595,25 @@ class MockStorageApi extends _i1.Mock implements _i4.StorageApi { @override _i4.ObjectsResource get objects => (super.noSuchMethod( Invocation.getter(#objects), - returnValue: _FakeObjectsResource_9( + returnValue: _FakeObjectsResource_11( this, Invocation.getter(#objects), ), ) as _i4.ObjectsResource); + @override + _i4.OperationsResource get operations => (super.noSuchMethod( + Invocation.getter(#operations), + returnValue: _FakeOperationsResource_12( + this, + Invocation.getter(#operations), + ), + ) as _i4.OperationsResource); + @override _i4.ProjectsResource get projects => (super.noSuchMethod( Invocation.getter(#projects), - returnValue: _FakeProjectsResource_10( + returnValue: _FakeProjectsResource_13( this, Invocation.getter(#projects), ), @@ -553,6 +624,48 @@ class MockStorageApi extends _i1.Mock implements _i4.StorageApi { /// /// See the documentation for Mockito's code generation for more information. class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { + @override + _i6.Future<_i4.GoogleLongrunningOperation> bulkRestore( + _i4.BulkRestoreObjectsRequest? request, + String? bucket, { + String? $fields, + }) => + (super.noSuchMethod( + Invocation.method( + #bulkRestore, + [ + request, + bucket, + ], + {#$fields: $fields}, + ), + returnValue: _i6.Future<_i4.GoogleLongrunningOperation>.value( + _FakeGoogleLongrunningOperation_14( + this, + Invocation.method( + #bulkRestore, + [ + request, + bucket, + ], + {#$fields: $fields}, + ), + )), + returnValueForMissingStub: + _i6.Future<_i4.GoogleLongrunningOperation>.value( + _FakeGoogleLongrunningOperation_14( + this, + Invocation.method( + #bulkRestore, + [ + request, + bucket, + ], + {#$fields: $fields}, + ), + )), + ) as _i6.Future<_i4.GoogleLongrunningOperation>); + @override _i6.Future<_i4.Object> compose( _i4.ComposeRequest? request, @@ -562,7 +675,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { String? ifGenerationMatch, String? ifMetagenerationMatch, String? kmsKeyName, - String? provisionalUserProject, String? userProject, String? $fields, }) => @@ -579,12 +691,11 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifGenerationMatch: ifGenerationMatch, #ifMetagenerationMatch: ifMetagenerationMatch, #kmsKeyName: kmsKeyName, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, ), - returnValue: _i6.Future<_i4.Object>.value(_FakeObject_11( + returnValue: _i6.Future<_i4.Object>.value(_FakeObject_15( this, Invocation.method( #compose, @@ -598,13 +709,12 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifGenerationMatch: ifGenerationMatch, #ifMetagenerationMatch: ifMetagenerationMatch, #kmsKeyName: kmsKeyName, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, ), )), - returnValueForMissingStub: _i6.Future<_i4.Object>.value(_FakeObject_11( + returnValueForMissingStub: _i6.Future<_i4.Object>.value(_FakeObject_15( this, Invocation.method( #compose, @@ -618,7 +728,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifGenerationMatch: ifGenerationMatch, #ifMetagenerationMatch: ifMetagenerationMatch, #kmsKeyName: kmsKeyName, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, @@ -644,7 +753,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { String? ifSourceMetagenerationMatch, String? ifSourceMetagenerationNotMatch, String? projection, - String? provisionalUserProject, String? sourceGeneration, String? userProject, String? $fields, @@ -671,13 +779,12 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifSourceMetagenerationMatch: ifSourceMetagenerationMatch, #ifSourceMetagenerationNotMatch: ifSourceMetagenerationNotMatch, #projection: projection, - #provisionalUserProject: provisionalUserProject, #sourceGeneration: sourceGeneration, #userProject: userProject, #$fields: $fields, }, ), - returnValue: _i6.Future<_i4.Object>.value(_FakeObject_11( + returnValue: _i6.Future<_i4.Object>.value(_FakeObject_15( this, Invocation.method( #copy, @@ -700,14 +807,13 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifSourceMetagenerationMatch: ifSourceMetagenerationMatch, #ifSourceMetagenerationNotMatch: ifSourceMetagenerationNotMatch, #projection: projection, - #provisionalUserProject: provisionalUserProject, #sourceGeneration: sourceGeneration, #userProject: userProject, #$fields: $fields, }, ), )), - returnValueForMissingStub: _i6.Future<_i4.Object>.value(_FakeObject_11( + returnValueForMissingStub: _i6.Future<_i4.Object>.value(_FakeObject_15( this, Invocation.method( #copy, @@ -730,7 +836,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifSourceMetagenerationMatch: ifSourceMetagenerationMatch, #ifSourceMetagenerationNotMatch: ifSourceMetagenerationNotMatch, #projection: projection, - #provisionalUserProject: provisionalUserProject, #sourceGeneration: sourceGeneration, #userProject: userProject, #$fields: $fields, @@ -748,7 +853,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { String? ifGenerationNotMatch, String? ifMetagenerationMatch, String? ifMetagenerationNotMatch, - String? provisionalUserProject, String? userProject, String? $fields, }) => @@ -765,7 +869,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifGenerationNotMatch: ifGenerationNotMatch, #ifMetagenerationMatch: ifMetagenerationMatch, #ifMetagenerationNotMatch: ifMetagenerationNotMatch, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, @@ -784,7 +887,7 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { String? ifMetagenerationMatch, String? ifMetagenerationNotMatch, String? projection, - String? provisionalUserProject, + bool? softDeleted, String? userProject, String? $fields, _i10.DownloadOptions? downloadOptions = _i10.DownloadOptions.metadata, @@ -803,13 +906,13 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifMetagenerationMatch: ifMetagenerationMatch, #ifMetagenerationNotMatch: ifMetagenerationNotMatch, #projection: projection, - #provisionalUserProject: provisionalUserProject, + #softDeleted: softDeleted, #userProject: userProject, #$fields: $fields, #downloadOptions: downloadOptions, }, ), - returnValue: _i6.Future.value(_FakeObject_12( + returnValue: _i6.Future.value(_FakeObject_16( this, Invocation.method( #get, @@ -824,14 +927,14 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifMetagenerationMatch: ifMetagenerationMatch, #ifMetagenerationNotMatch: ifMetagenerationNotMatch, #projection: projection, - #provisionalUserProject: provisionalUserProject, + #softDeleted: softDeleted, #userProject: userProject, #$fields: $fields, #downloadOptions: downloadOptions, }, ), )), - returnValueForMissingStub: _i6.Future.value(_FakeObject_12( + returnValueForMissingStub: _i6.Future.value(_FakeObject_16( this, Invocation.method( #get, @@ -846,7 +949,7 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifMetagenerationMatch: ifMetagenerationMatch, #ifMetagenerationNotMatch: ifMetagenerationNotMatch, #projection: projection, - #provisionalUserProject: provisionalUserProject, + #softDeleted: softDeleted, #userProject: userProject, #$fields: $fields, #downloadOptions: downloadOptions, @@ -860,7 +963,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { String? bucket, String? object, { String? generation, - String? provisionalUserProject, String? userProject, String? $fields, }) => @@ -873,12 +975,11 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ], { #generation: generation, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, ), - returnValue: _i6.Future<_i4.Policy>.value(_FakePolicy_13( + returnValue: _i6.Future<_i4.Policy>.value(_FakePolicy_17( this, Invocation.method( #getIamPolicy, @@ -888,13 +989,12 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ], { #generation: generation, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, ), )), - returnValueForMissingStub: _i6.Future<_i4.Policy>.value(_FakePolicy_13( + returnValueForMissingStub: _i6.Future<_i4.Policy>.value(_FakePolicy_17( this, Invocation.method( #getIamPolicy, @@ -904,7 +1004,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ], { #generation: generation, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, @@ -925,7 +1024,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { String? name, String? predefinedAcl, String? projection, - String? provisionalUserProject, String? userProject, String? $fields, _i10.UploadOptions? uploadOptions = _i10.UploadOptions.defaultOptions, @@ -948,14 +1046,13 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #name: name, #predefinedAcl: predefinedAcl, #projection: projection, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, #uploadOptions: uploadOptions, #uploadMedia: uploadMedia, }, ), - returnValue: _i6.Future<_i4.Object>.value(_FakeObject_11( + returnValue: _i6.Future<_i4.Object>.value(_FakeObject_15( this, Invocation.method( #insert, @@ -973,7 +1070,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #name: name, #predefinedAcl: predefinedAcl, #projection: projection, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, #uploadOptions: uploadOptions, @@ -981,7 +1077,7 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { }, ), )), - returnValueForMissingStub: _i6.Future<_i4.Object>.value(_FakeObject_11( + returnValueForMissingStub: _i6.Future<_i4.Object>.value(_FakeObject_15( this, Invocation.method( #insert, @@ -999,7 +1095,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #name: name, #predefinedAcl: predefinedAcl, #projection: projection, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, #uploadOptions: uploadOptions, @@ -1014,12 +1109,14 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { String? bucket, { String? delimiter, String? endOffset, + bool? includeFoldersAsPrefixes, bool? includeTrailingDelimiter, + String? matchGlob, int? maxResults, String? pageToken, String? prefix, String? projection, - String? provisionalUserProject, + bool? softDeleted, String? startOffset, String? userProject, bool? versions, @@ -1032,19 +1129,21 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { { #delimiter: delimiter, #endOffset: endOffset, + #includeFoldersAsPrefixes: includeFoldersAsPrefixes, #includeTrailingDelimiter: includeTrailingDelimiter, + #matchGlob: matchGlob, #maxResults: maxResults, #pageToken: pageToken, #prefix: prefix, #projection: projection, - #provisionalUserProject: provisionalUserProject, + #softDeleted: softDeleted, #startOffset: startOffset, #userProject: userProject, #versions: versions, #$fields: $fields, }, ), - returnValue: _i6.Future<_i4.Objects>.value(_FakeObjects_14( + returnValue: _i6.Future<_i4.Objects>.value(_FakeObjects_18( this, Invocation.method( #list, @@ -1052,12 +1151,14 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { { #delimiter: delimiter, #endOffset: endOffset, + #includeFoldersAsPrefixes: includeFoldersAsPrefixes, #includeTrailingDelimiter: includeTrailingDelimiter, + #matchGlob: matchGlob, #maxResults: maxResults, #pageToken: pageToken, #prefix: prefix, #projection: projection, - #provisionalUserProject: provisionalUserProject, + #softDeleted: softDeleted, #startOffset: startOffset, #userProject: userProject, #versions: versions, @@ -1066,7 +1167,7 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ), )), returnValueForMissingStub: - _i6.Future<_i4.Objects>.value(_FakeObjects_14( + _i6.Future<_i4.Objects>.value(_FakeObjects_18( this, Invocation.method( #list, @@ -1074,12 +1175,14 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { { #delimiter: delimiter, #endOffset: endOffset, + #includeFoldersAsPrefixes: includeFoldersAsPrefixes, #includeTrailingDelimiter: includeTrailingDelimiter, + #matchGlob: matchGlob, #maxResults: maxResults, #pageToken: pageToken, #prefix: prefix, #projection: projection, - #provisionalUserProject: provisionalUserProject, + #softDeleted: softDeleted, #startOffset: startOffset, #userProject: userProject, #versions: versions, @@ -1099,9 +1202,9 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { String? ifGenerationNotMatch, String? ifMetagenerationMatch, String? ifMetagenerationNotMatch, + bool? overrideUnlockedRetention, String? predefinedAcl, String? projection, - String? provisionalUserProject, String? userProject, String? $fields, }) => @@ -1119,14 +1222,14 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifGenerationNotMatch: ifGenerationNotMatch, #ifMetagenerationMatch: ifMetagenerationMatch, #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #overrideUnlockedRetention: overrideUnlockedRetention, #predefinedAcl: predefinedAcl, #projection: projection, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, ), - returnValue: _i6.Future<_i4.Object>.value(_FakeObject_11( + returnValue: _i6.Future<_i4.Object>.value(_FakeObject_15( this, Invocation.method( #patch, @@ -1141,15 +1244,15 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifGenerationNotMatch: ifGenerationNotMatch, #ifMetagenerationMatch: ifMetagenerationMatch, #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #overrideUnlockedRetention: overrideUnlockedRetention, #predefinedAcl: predefinedAcl, #projection: projection, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, ), )), - returnValueForMissingStub: _i6.Future<_i4.Object>.value(_FakeObject_11( + returnValueForMissingStub: _i6.Future<_i4.Object>.value(_FakeObject_15( this, Invocation.method( #patch, @@ -1164,9 +1267,90 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifGenerationNotMatch: ifGenerationNotMatch, #ifMetagenerationMatch: ifMetagenerationMatch, #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #overrideUnlockedRetention: overrideUnlockedRetention, #predefinedAcl: predefinedAcl, #projection: projection, - #provisionalUserProject: provisionalUserProject, + #userProject: userProject, + #$fields: $fields, + }, + ), + )), + ) as _i6.Future<_i4.Object>); + + @override + _i6.Future<_i4.Object> restore( + _i4.Object? request, + String? bucket, + String? object, + String? generation, { + bool? copySourceAcl, + String? ifGenerationMatch, + String? ifGenerationNotMatch, + String? ifMetagenerationMatch, + String? ifMetagenerationNotMatch, + String? projection, + String? userProject, + String? $fields, + }) => + (super.noSuchMethod( + Invocation.method( + #restore, + [ + request, + bucket, + object, + generation, + ], + { + #copySourceAcl: copySourceAcl, + #ifGenerationMatch: ifGenerationMatch, + #ifGenerationNotMatch: ifGenerationNotMatch, + #ifMetagenerationMatch: ifMetagenerationMatch, + #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #projection: projection, + #userProject: userProject, + #$fields: $fields, + }, + ), + returnValue: _i6.Future<_i4.Object>.value(_FakeObject_15( + this, + Invocation.method( + #restore, + [ + request, + bucket, + object, + generation, + ], + { + #copySourceAcl: copySourceAcl, + #ifGenerationMatch: ifGenerationMatch, + #ifGenerationNotMatch: ifGenerationNotMatch, + #ifMetagenerationMatch: ifMetagenerationMatch, + #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #projection: projection, + #userProject: userProject, + #$fields: $fields, + }, + ), + )), + returnValueForMissingStub: _i6.Future<_i4.Object>.value(_FakeObject_15( + this, + Invocation.method( + #restore, + [ + request, + bucket, + object, + generation, + ], + { + #copySourceAcl: copySourceAcl, + #ifGenerationMatch: ifGenerationMatch, + #ifGenerationNotMatch: ifGenerationNotMatch, + #ifMetagenerationMatch: ifMetagenerationMatch, + #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #projection: projection, #userProject: userProject, #$fields: $fields, }, @@ -1193,7 +1377,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { String? ifSourceMetagenerationNotMatch, String? maxBytesRewrittenPerCall, String? projection, - String? provisionalUserProject, String? rewriteToken, String? sourceGeneration, String? userProject, @@ -1222,7 +1405,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifSourceMetagenerationNotMatch: ifSourceMetagenerationNotMatch, #maxBytesRewrittenPerCall: maxBytesRewrittenPerCall, #projection: projection, - #provisionalUserProject: provisionalUserProject, #rewriteToken: rewriteToken, #sourceGeneration: sourceGeneration, #userProject: userProject, @@ -1230,7 +1412,7 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { }, ), returnValue: - _i6.Future<_i4.RewriteResponse>.value(_FakeRewriteResponse_15( + _i6.Future<_i4.RewriteResponse>.value(_FakeRewriteResponse_19( this, Invocation.method( #rewrite, @@ -1254,7 +1436,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifSourceMetagenerationNotMatch: ifSourceMetagenerationNotMatch, #maxBytesRewrittenPerCall: maxBytesRewrittenPerCall, #projection: projection, - #provisionalUserProject: provisionalUserProject, #rewriteToken: rewriteToken, #sourceGeneration: sourceGeneration, #userProject: userProject, @@ -1263,7 +1444,7 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ), )), returnValueForMissingStub: - _i6.Future<_i4.RewriteResponse>.value(_FakeRewriteResponse_15( + _i6.Future<_i4.RewriteResponse>.value(_FakeRewriteResponse_19( this, Invocation.method( #rewrite, @@ -1287,7 +1468,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifSourceMetagenerationNotMatch: ifSourceMetagenerationNotMatch, #maxBytesRewrittenPerCall: maxBytesRewrittenPerCall, #projection: projection, - #provisionalUserProject: provisionalUserProject, #rewriteToken: rewriteToken, #sourceGeneration: sourceGeneration, #userProject: userProject, @@ -1303,7 +1483,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { String? bucket, String? object, { String? generation, - String? provisionalUserProject, String? userProject, String? $fields, }) => @@ -1317,12 +1496,11 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ], { #generation: generation, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, ), - returnValue: _i6.Future<_i4.Policy>.value(_FakePolicy_13( + returnValue: _i6.Future<_i4.Policy>.value(_FakePolicy_17( this, Invocation.method( #setIamPolicy, @@ -1333,13 +1511,12 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ], { #generation: generation, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, ), )), - returnValueForMissingStub: _i6.Future<_i4.Policy>.value(_FakePolicy_13( + returnValueForMissingStub: _i6.Future<_i4.Policy>.value(_FakePolicy_17( this, Invocation.method( #setIamPolicy, @@ -1350,7 +1527,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ], { #generation: generation, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, @@ -1364,7 +1540,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { String? object, List? permissions, { String? generation, - String? provisionalUserProject, String? userProject, String? $fields, }) => @@ -1378,13 +1553,12 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ], { #generation: generation, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, ), returnValue: _i6.Future<_i4.TestIamPermissionsResponse>.value( - _FakeTestIamPermissionsResponse_16( + _FakeTestIamPermissionsResponse_20( this, Invocation.method( #testIamPermissions, @@ -1395,7 +1569,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ], { #generation: generation, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, @@ -1403,7 +1576,7 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { )), returnValueForMissingStub: _i6.Future<_i4.TestIamPermissionsResponse>.value( - _FakeTestIamPermissionsResponse_16( + _FakeTestIamPermissionsResponse_20( this, Invocation.method( #testIamPermissions, @@ -1414,7 +1587,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ], { #generation: generation, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, @@ -1432,9 +1604,9 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { String? ifGenerationNotMatch, String? ifMetagenerationMatch, String? ifMetagenerationNotMatch, + bool? overrideUnlockedRetention, String? predefinedAcl, String? projection, - String? provisionalUserProject, String? userProject, String? $fields, }) => @@ -1452,14 +1624,14 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifGenerationNotMatch: ifGenerationNotMatch, #ifMetagenerationMatch: ifMetagenerationMatch, #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #overrideUnlockedRetention: overrideUnlockedRetention, #predefinedAcl: predefinedAcl, #projection: projection, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, ), - returnValue: _i6.Future<_i4.Object>.value(_FakeObject_11( + returnValue: _i6.Future<_i4.Object>.value(_FakeObject_15( this, Invocation.method( #update, @@ -1474,15 +1646,15 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifGenerationNotMatch: ifGenerationNotMatch, #ifMetagenerationMatch: ifMetagenerationMatch, #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #overrideUnlockedRetention: overrideUnlockedRetention, #predefinedAcl: predefinedAcl, #projection: projection, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, ), )), - returnValueForMissingStub: _i6.Future<_i4.Object>.value(_FakeObject_11( + returnValueForMissingStub: _i6.Future<_i4.Object>.value(_FakeObject_15( this, Invocation.method( #update, @@ -1497,9 +1669,9 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #ifGenerationNotMatch: ifGenerationNotMatch, #ifMetagenerationMatch: ifMetagenerationMatch, #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #overrideUnlockedRetention: overrideUnlockedRetention, #predefinedAcl: predefinedAcl, #projection: projection, - #provisionalUserProject: provisionalUserProject, #userProject: userProject, #$fields: $fields, }, @@ -1518,7 +1690,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { String? pageToken, String? prefix, String? projection, - String? provisionalUserProject, String? startOffset, String? userProject, bool? versions, @@ -1539,14 +1710,13 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #pageToken: pageToken, #prefix: prefix, #projection: projection, - #provisionalUserProject: provisionalUserProject, #startOffset: startOffset, #userProject: userProject, #versions: versions, #$fields: $fields, }, ), - returnValue: _i6.Future<_i4.Channel>.value(_FakeChannel_17( + returnValue: _i6.Future<_i4.Channel>.value(_FakeChannel_21( this, Invocation.method( #watchAll, @@ -1562,7 +1732,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #pageToken: pageToken, #prefix: prefix, #projection: projection, - #provisionalUserProject: provisionalUserProject, #startOffset: startOffset, #userProject: userProject, #versions: versions, @@ -1571,7 +1740,7 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ), )), returnValueForMissingStub: - _i6.Future<_i4.Channel>.value(_FakeChannel_17( + _i6.Future<_i4.Channel>.value(_FakeChannel_21( this, Invocation.method( #watchAll, @@ -1587,7 +1756,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { #pageToken: pageToken, #prefix: prefix, #projection: projection, - #provisionalUserProject: provisionalUserProject, #startOffset: startOffset, #userProject: userProject, #versions: versions, diff --git a/packages/pointer_interceptor/pointer_interceptor_web/CHANGELOG.md b/packages/pointer_interceptor/pointer_interceptor_web/CHANGELOG.md index 28955127a78e..58a970e78f7d 100644 --- a/packages/pointer_interceptor/pointer_interceptor_web/CHANGELOG.md +++ b/packages/pointer_interceptor/pointer_interceptor_web/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.10.2 + +* Updates web code to package `web: ^0.5.0`. +* Updates SDK version to Dart `^3.3.0`. Flutter `^3.19.0`. + ## 0.10.1+2 * Fixes "width and height missing" warning on web. diff --git a/packages/pointer_interceptor/pointer_interceptor_web/example/pubspec.yaml b/packages/pointer_interceptor/pointer_interceptor_web/example/pubspec.yaml index 2132641ca791..06625c07fbb7 100644 --- a/packages/pointer_interceptor/pointer_interceptor_web/example/pubspec.yaml +++ b/packages/pointer_interceptor/pointer_interceptor_web/example/pubspec.yaml @@ -3,8 +3,8 @@ description: "Demonstrates how to use the pointer_interceptor_web plugin." publish_to: 'none' environment: - sdk: ^3.2.0 - flutter: '>=3.16.0' + sdk: ^3.3.0 + flutter: ">=3.19.0" dependencies: cupertino_icons: ^1.0.2 @@ -13,7 +13,7 @@ dependencies: pointer_interceptor_platform_interface: ^0.10.0 pointer_interceptor_web: path: ../../pointer_interceptor_web - web: '>=0.3.0 <0.5.0' + web: ^0.5.0 dev_dependencies: flutter_test: diff --git a/packages/pointer_interceptor/pointer_interceptor_web/pubspec.yaml b/packages/pointer_interceptor/pointer_interceptor_web/pubspec.yaml index ff1f0747d9d5..83e41de9e23e 100644 --- a/packages/pointer_interceptor/pointer_interceptor_web/pubspec.yaml +++ b/packages/pointer_interceptor/pointer_interceptor_web/pubspec.yaml @@ -2,11 +2,11 @@ name: pointer_interceptor_web description: Web implementation of the pointer_interceptor plugin. repository: https://github.com/flutter/packages/tree/main/packages/pointer_interceptor/pointer_interceptor_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3Apointer_interceptor -version: 0.10.1+2 +version: 0.10.2 environment: - sdk: ^3.2.0 - flutter: '>=3.16.0' + sdk: ^3.3.0 + flutter: ">=3.19.0" flutter: plugin: @@ -23,7 +23,7 @@ dependencies: sdk: flutter plugin_platform_interface: ^2.1.7 pointer_interceptor_platform_interface: ^0.10.0 - web: '>=0.3.0 <0.5.0' + web: ^0.5.0 dev_dependencies: flutter_test: diff --git a/packages/shared_preferences/shared_preferences_web/CHANGELOG.md b/packages/shared_preferences/shared_preferences_web/CHANGELOG.md index 5f5d8c246cd6..5cb8dc3b6120 100644 --- a/packages/shared_preferences/shared_preferences_web/CHANGELOG.md +++ b/packages/shared_preferences/shared_preferences_web/CHANGELOG.md @@ -1,3 +1,8 @@ +## 2.3.0 + +* Updates web code to package `web: ^0.5.0`. +* Updates SDK version to Dart `^3.3.0`. Flutter `^3.19.0`. + ## 2.2.2 * Updates minimum supported SDK version to Dart 3.2. diff --git a/packages/shared_preferences/shared_preferences_web/example/integration_test/shared_preferences_web_test.dart b/packages/shared_preferences/shared_preferences_web/example/integration_test/shared_preferences_web_test.dart index 9f0faae41367..0238ba578a45 100644 --- a/packages/shared_preferences/shared_preferences_web/example/integration_test/shared_preferences_web_test.dart +++ b/packages/shared_preferences/shared_preferences_web/example/integration_test/shared_preferences_web_test.dart @@ -9,8 +9,7 @@ import 'package:shared_preferences_platform_interface/shared_preferences_platfor import 'package:shared_preferences_platform_interface/types.dart'; import 'package:shared_preferences_web/shared_preferences_web.dart'; import 'package:shared_preferences_web/src/keys_extension.dart'; - -import 'package:web/helpers.dart' as html; +import 'package:web/web.dart' as html; void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); diff --git a/packages/shared_preferences/shared_preferences_web/example/pubspec.yaml b/packages/shared_preferences/shared_preferences_web/example/pubspec.yaml index bf6ca2a883df..44672c4e6425 100644 --- a/packages/shared_preferences/shared_preferences_web/example/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_web/example/pubspec.yaml @@ -11,11 +11,10 @@ dependencies: shared_preferences_platform_interface: ^2.3.0 shared_preferences_web: path: ../ - web: '>=0.3.0 <0.5.0' + web: ^0.5.0 dev_dependencies: flutter_test: sdk: flutter integration_test: sdk: flutter - js: ^0.6.3 diff --git a/packages/shared_preferences/shared_preferences_web/pubspec.yaml b/packages/shared_preferences/shared_preferences_web/pubspec.yaml index ceb1dfebcf7a..1278a54a3e51 100644 --- a/packages/shared_preferences/shared_preferences_web/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_web/pubspec.yaml @@ -2,11 +2,11 @@ name: shared_preferences_web description: Web platform implementation of shared_preferences repository: https://github.com/flutter/packages/tree/main/packages/shared_preferences/shared_preferences_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+shared_preferences%22 -version: 2.2.2 +version: 2.3.0 environment: - sdk: ">=3.2.0 <4.0.0" - flutter: ">=3.16.0" + sdk: ^3.3.0 + flutter: ">=3.19.0" flutter: plugin: @@ -22,7 +22,7 @@ dependencies: flutter_web_plugins: sdk: flutter shared_preferences_platform_interface: ^2.3.0 - web: '>=0.3.0 <0.5.0' + web: ^0.5.0 dev_dependencies: flutter_test: diff --git a/packages/url_launcher/url_launcher_web/CHANGELOG.md b/packages/url_launcher/url_launcher_web/CHANGELOG.md index 641b48d27cf2..5e3d6d42b35e 100644 --- a/packages/url_launcher/url_launcher_web/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_web/CHANGELOG.md @@ -1,3 +1,8 @@ +## 2.3.0 + +* Updates web code to package `web: ^0.5.0`. +* Updates SDK version to Dart `^3.3.0`. Flutter `^3.19.0`. + ## 2.2.3 * Fixes new lint warnings. diff --git a/packages/url_launcher/url_launcher_web/example/integration_test/link_widget_test.dart b/packages/url_launcher/url_launcher_web/example/integration_test/link_widget_test.dart index 528cff32c0e5..9cd76d03c80c 100644 --- a/packages/url_launcher/url_launcher_web/example/integration_test/link_widget_test.dart +++ b/packages/url_launcher/url_launcher_web/example/integration_test/link_widget_test.dart @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'dart:js_util'; +import 'dart:js_interop'; +import 'dart:js_interop_unsafe'; import 'dart:ui_web' as ui_web; import 'package:flutter/widgets.dart'; @@ -10,7 +11,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; import 'package:url_launcher_platform_interface/link.dart'; import 'package:url_launcher_web/src/link.dart'; -import 'package:web/helpers.dart' as html; +import 'package:web/web.dart' as html; void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); @@ -177,7 +178,7 @@ html.Element _findSingleAnchor() { html.NodeList anchors = html.document.querySelectorAll('a'); for (int i = 0; i < anchors.length; i++) { final html.Element anchor = anchors.item(i)! as html.Element; - if (hasProperty(anchor, linkViewIdProperty)) { + if (anchor.hasProperty(linkViewIdProperty.toJS).toDart) { foundAnchors.add(anchor); } } @@ -189,7 +190,7 @@ html.Element _findSingleAnchor() { anchors = shadowRoot.querySelectorAll('a'); for (int i = 0; i < anchors.length; i++) { final html.Element anchor = anchors.item(i)! as html.Element; - if (hasProperty(anchor, linkViewIdProperty)) { + if (anchor.hasProperty(linkViewIdProperty.toJS).toDart) { foundAnchors.add(anchor); } } diff --git a/packages/url_launcher/url_launcher_web/example/integration_test/url_launcher_web_test.dart b/packages/url_launcher/url_launcher_web/example/integration_test/url_launcher_web_test.dart index ec01d28163aa..b75903873467 100644 --- a/packages/url_launcher/url_launcher_web/example/integration_test/url_launcher_web_test.dart +++ b/packages/url_launcher/url_launcher_web/example/integration_test/url_launcher_web_test.dart @@ -3,14 +3,13 @@ // found in the LICENSE file. import 'dart:js_interop'; -import 'dart:js_util'; import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; import 'package:mockito/mockito.dart' show Mock, any, verify, when; import 'package:url_launcher_platform_interface/url_launcher_platform_interface.dart'; import 'package:url_launcher_web/url_launcher_web.dart'; -import 'package:web/helpers.dart' as html; +import 'package:web/web.dart' as html; abstract class MyWindow { html.Window? open(Object? a, Object? b, Object? c); @@ -33,6 +32,7 @@ void main() { group('UrlLauncherPlugin', () { late MockWindow mockWindow; late MockNavigator mockNavigator; + late html.Window jsMockWindow; late UrlLauncherPlugin plugin; @@ -40,10 +40,9 @@ void main() { mockWindow = MockWindow(); mockNavigator = MockNavigator(); - final html.Window jsMockWindow = - createDartExport(mockWindow) as html.Window; + jsMockWindow = createJSInteropWrapper(mockWindow) as html.Window; final html.Navigator jsMockNavigator = - createDartExport(mockNavigator) as html.Navigator; + createJSInteropWrapper(mockNavigator) as html.Navigator; when(mockWindow.navigator).thenReturn(jsMockNavigator); @@ -53,7 +52,7 @@ void main() { when(mockNavigator.userAgent).thenReturn( 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36'); - plugin = UrlLauncherPlugin(debugWindow: mockWindow as html.Window); + plugin = UrlLauncherPlugin(debugWindow: jsMockWindow); }); group('canLaunch', () { @@ -185,7 +184,7 @@ void main() { when(mockNavigator.userAgent).thenReturn( 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.5.1 Safari/605.1.15'); // Recreate the plugin, so it grabs the overrides from this group - plugin = UrlLauncherPlugin(debugWindow: mockWindow as html.Window); + plugin = UrlLauncherPlugin(debugWindow: jsMockWindow); }); testWidgets('http urls should be launched in a new window', diff --git a/packages/url_launcher/url_launcher_web/example/pubspec.yaml b/packages/url_launcher/url_launcher_web/example/pubspec.yaml index eca281ef0a2f..c87511dd84b8 100644 --- a/packages/url_launcher/url_launcher_web/example/pubspec.yaml +++ b/packages/url_launcher/url_launcher_web/example/pubspec.yaml @@ -2,8 +2,8 @@ name: regular_integration_tests publish_to: none environment: - sdk: ^3.2.0 - flutter: ">=3.16.0" + sdk: ^3.3.0 + flutter: ">=3.19.0" dependencies: flutter: @@ -18,4 +18,4 @@ dev_dependencies: url_launcher_platform_interface: ^2.2.0 url_launcher_web: path: ../ - web: '>=0.3.0 <0.5.0' + web: ^0.5.0 diff --git a/packages/url_launcher/url_launcher_web/lib/src/link.dart b/packages/url_launcher/url_launcher_web/lib/src/link.dart index b2217fafb805..558f3a135a27 100644 --- a/packages/url_launcher/url_launcher_web/lib/src/link.dart +++ b/packages/url_launcher/url_launcher_web/lib/src/link.dart @@ -3,7 +3,8 @@ // found in the LICENSE file. import 'dart:async'; -import 'dart:js_util'; +import 'dart:js_interop'; +import 'dart:js_interop_unsafe'; import 'dart:ui_web' as ui_web; import 'package:flutter/foundation.dart'; @@ -12,7 +13,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:url_launcher_platform_interface/link.dart'; -import 'package:web/helpers.dart' as html; +import 'package:web/web.dart' as html; /// The unique identifier for the view type to be used for link platform views. const String linkViewType = '__url_launcher::link'; @@ -172,7 +173,7 @@ class LinkViewController extends PlatformViewController { Future _initialize() async { _element = html.document.createElement('a') as html.HTMLElement; - setProperty(_element, linkViewIdProperty, viewId); + _element[linkViewIdProperty] = viewId.toJS; _element.style ..opacity = '0' ..display = 'block' @@ -283,11 +284,7 @@ class LinkViewController extends PlatformViewController { int? getViewIdFromTarget(html.Event event) { final html.Element? linkElement = getLinkElementFromTarget(event); if (linkElement != null) { - // TODO(stuartmorgan): Remove this ignore (and change to getProperty) - // once the templated version is available on stable. On master (2.8) this - // is already not necessary. - // ignore: return_of_invalid_type - return getProperty(linkElement, linkViewIdProperty); + return linkElement.getProperty(linkViewIdProperty.toJS).toDartInt; } return null; } @@ -316,5 +313,5 @@ html.Element? getLinkElementFromTarget(html.Event event) { bool isLinkElement(html.Element? element) { return element != null && element.tagName == 'A' && - hasProperty(element, linkViewIdProperty); + element.hasProperty(linkViewIdProperty.toJS).toDart; } diff --git a/packages/url_launcher/url_launcher_web/pubspec.yaml b/packages/url_launcher/url_launcher_web/pubspec.yaml index 6c89bba58091..35154b5a6d2b 100644 --- a/packages/url_launcher/url_launcher_web/pubspec.yaml +++ b/packages/url_launcher/url_launcher_web/pubspec.yaml @@ -2,11 +2,11 @@ name: url_launcher_web description: Web platform implementation of url_launcher repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22 -version: 2.2.3 +version: 2.3.0 environment: - sdk: ^3.2.0 - flutter: ">=3.16.0" + sdk: ^3.3.0 + flutter: ">=3.19.0" flutter: plugin: @@ -22,7 +22,7 @@ dependencies: flutter_web_plugins: sdk: flutter url_launcher_platform_interface: ^2.2.0 - web: '>=0.3.0 <0.5.0' + web: ^0.5.0 dev_dependencies: flutter_test: diff --git a/packages/video_player/video_player_web/CHANGELOG.md b/packages/video_player/video_player_web/CHANGELOG.md index 4ce1c96de5d8..8e9e9f21f736 100644 --- a/packages/video_player/video_player_web/CHANGELOG.md +++ b/packages/video_player/video_player_web/CHANGELOG.md @@ -1,6 +1,6 @@ -## NEXT +## 2.2.0 -* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. +* Updates SDK version to Dart `^3.3.0`. Flutter `^3.19.0`. ## 2.1.3 diff --git a/packages/video_player/video_player_web/example/integration_test/utils.dart b/packages/video_player/video_player_web/example/integration_test/utils.dart index 6be5b5abcc75..75af525d4103 100644 --- a/packages/video_player/video_player_web/example/integration_test/utils.dart +++ b/packages/video_player/video_player_web/example/integration_test/utils.dart @@ -2,12 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -@JS() -library integration_test_utils; - -import 'dart:html'; - -import 'package:js/js.dart'; +import 'dart:js_interop'; +import 'dart:js_interop_unsafe'; +import 'package:web/web.dart' as web; // Returns the URL to load an asset from this example app as a network source. // @@ -22,35 +19,40 @@ String getUrlForAssetAsNetworkSource(String assetKey) { '?raw=true'; } -@JS() -@anonymous -class _Descriptor { +extension type Descriptor._(JSObject _) implements JSObject { // May also contain "configurable" and "enumerable" bools. // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description - external factory _Descriptor({ + external factory Descriptor({ // bool configurable, // bool enumerable, - bool writable, - Object value, + JSBoolean writable, + JSAny value, }); } -@JS('Object.defineProperty') -external void _defineProperty( +void _defineProperty( Object object, String property, - _Descriptor description, -); + Descriptor description, +) { + (globalContext['Object'] as JSObject?)?.callMethod( + 'defineProperty'.toJS, + object as JSObject, + property.toJS, + description, + ); +} /// Forces a VideoElement to report "Infinity" duration. /// /// Uses JS Object.defineProperty to set the value of a readonly property. -void setInfinityDuration(VideoElement element) { +void setInfinityDuration(Object videoElement) { + assert(videoElement is web.HTMLVideoElement); _defineProperty( - element, + videoElement, 'duration', - _Descriptor( - writable: true, - value: double.infinity, + Descriptor( + writable: true.toJS, + value: double.infinity.toJS, )); } diff --git a/packages/video_player/video_player_web/example/pubspec.yaml b/packages/video_player/video_player_web/example/pubspec.yaml index 866d089f8687..bd2f3ba48788 100644 --- a/packages/video_player/video_player_web/example/pubspec.yaml +++ b/packages/video_player/video_player_web/example/pubspec.yaml @@ -2,16 +2,16 @@ name: video_player_for_web_integration_tests publish_to: none environment: - sdk: ^3.1.0 - flutter: ">=3.13.0" + sdk: ^3.3.0 + flutter: ">=3.19.0" dependencies: flutter: sdk: flutter - js: ^0.6.0 - video_player_platform_interface: ">=6.1.0 <7.0.0" + video_player_platform_interface: ^6.1.0 video_player_web: path: ../ + web: ^0.5.0 dev_dependencies: flutter_test: diff --git a/packages/video_player/video_player_web/pubspec.yaml b/packages/video_player/video_player_web/pubspec.yaml index 81ad0e6d1bf7..0cb69f88b743 100644 --- a/packages/video_player/video_player_web/pubspec.yaml +++ b/packages/video_player/video_player_web/pubspec.yaml @@ -2,11 +2,11 @@ name: video_player_web description: Web platform implementation of video_player. repository: https://github.com/flutter/packages/tree/main/packages/video_player/video_player_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22 -version: 2.1.3 +version: 2.2.0 environment: - sdk: ">=3.1.0 <4.0.0" - flutter: ">=3.13.0" + sdk: ^3.3.0 + flutter: ">=3.19.0" flutter: plugin: diff --git a/packages/web_benchmarks/CHANGELOG.md b/packages/web_benchmarks/CHANGELOG.md index 98e9f675b1fd..c4b3cf125ad2 100644 --- a/packages/web_benchmarks/CHANGELOG.md +++ b/packages/web_benchmarks/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 1.2.0 -* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. +* Updates to web code to package `web: ^0.5.0`. +* Updates SDK version to Dart `^3.3.0`. Flutter `^3.19.0`. ## 1.1.1 diff --git a/packages/web_benchmarks/lib/client.dart b/packages/web_benchmarks/lib/client.dart index baaab84fe504..d1c52d775fb8 100644 --- a/packages/web_benchmarks/lib/client.dart +++ b/packages/web_benchmarks/lib/client.dart @@ -7,7 +7,7 @@ import 'dart:convert' show json; import 'dart:js_interop'; import 'dart:math' as math; -import 'package:web/helpers.dart'; +import 'package:web/web.dart'; import 'src/common.dart'; import 'src/recorder.dart'; @@ -157,9 +157,7 @@ void _printResultsToScreen(Profile profile) { profile.scoreData.forEach((String scoreKey, Timeseries timeseries) { body.appendHtml('

$scoreKey

'); body.appendHtml('
${timeseries.computeStats()}
'); - // TODO(kevmoo): remove `NodeGlue` cast when we no longer need to support - // pkg:web 0.3.0 - NodeGlue(body).append(TimeseriesVisualization(timeseries).render()); + body.appendChild(TimeseriesVisualization(timeseries).render()); }); } @@ -168,7 +166,7 @@ class TimeseriesVisualization { /// Creates a visualization for a [Timeseries]. TimeseriesVisualization(this._timeseries) { _stats = _timeseries.computeStats(); - _canvas = CanvasElement(); + _canvas = HTMLCanvasElement(); _screenWidth = window.screen.width; _canvas.width = _screenWidth; _canvas.height = (_kCanvasHeight * window.devicePixelRatio).round(); @@ -192,7 +190,7 @@ class TimeseriesVisualization { final Timeseries _timeseries; late TimeseriesStats _stats; - late CanvasElement _canvas; + late HTMLCanvasElement _canvas; late CanvasRenderingContext2D _ctx; late int _screenWidth; @@ -215,7 +213,7 @@ class TimeseriesVisualization { } /// Renders the timeseries into a `` and returns the canvas element. - CanvasElement render() { + HTMLCanvasElement render() { _ctx.translate(0, _kCanvasHeight * window.devicePixelRatio); _ctx.scale(1, -window.devicePixelRatio); diff --git a/packages/web_benchmarks/lib/src/recorder.dart b/packages/web_benchmarks/lib/src/recorder.dart index 49707b8c4b63..7488c44c2c41 100644 --- a/packages/web_benchmarks/lib/src/recorder.dart +++ b/packages/web_benchmarks/lib/src/recorder.dart @@ -15,7 +15,7 @@ import 'package:flutter/scheduler.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'package:meta/meta.dart'; -import 'package:web/helpers.dart' as html; +import 'package:web/web.dart' as html; import 'common.dart'; diff --git a/packages/web_benchmarks/pubspec.yaml b/packages/web_benchmarks/pubspec.yaml index aa89736869cb..584e69706ee3 100644 --- a/packages/web_benchmarks/pubspec.yaml +++ b/packages/web_benchmarks/pubspec.yaml @@ -2,11 +2,11 @@ name: web_benchmarks description: A benchmark harness for performance-testing Flutter apps in Chrome. repository: https://github.com/flutter/packages/tree/main/packages/web_benchmarks issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+web_benchmarks%22 -version: 1.1.1 +version: 1.2.0 environment: - sdk: ">=3.2.0 <4.0.0" - flutter: ">=3.16.0" + sdk: ^3.3.0 + flutter: ">=3.19.0" dependencies: collection: ^1.18.0 @@ -14,6 +14,7 @@ dependencies: sdk: flutter flutter_test: sdk: flutter + http: ^1.0.0 logging: ^1.0.2 meta: ^1.7.0 path: ^1.8.0 @@ -21,7 +22,7 @@ dependencies: shelf: ^1.2.0 shelf_static: ^1.1.0 test: ^1.19.5 - web: '>=0.3.0 <0.5.0' + web: ^0.5.0 webkit_inspection_protocol: ^1.0.0 topics: From 48048f6bc779d86394397bcdceb1ce345210e27c Mon Sep 17 00:00:00 2001 From: David Iglesias Date: Tue, 20 Feb 2024 15:46:50 -0800 Subject: [PATCH 38/40] [google_sign_in_web] Updates package:web dependency to 0.5.0. (#6167) This PR updates `google_sign_in_web` to use package `web: ^0.5.0`. ## Testing Manually verified using the `example/lib/button_tester.dart` app. This should be text exempt? This is a refactor with no semantic change (also, I wouldn't know how to test we're using `package:web` the expected way!) I removed a couple of `//ignore` at least! ## Issues * Fast follow of: https://github.com/flutter/packages/pull/5791 --- .../google_sign_in_web/CHANGELOG.md | 4 ++++ .../google_sign_in_web/example/pubspec.yaml | 4 ++-- .../src/flexible_size_html_element_view.dart | 17 +++++------------ .../google_sign_in_web/pubspec.yaml | 6 +++--- 4 files changed, 14 insertions(+), 17 deletions(-) 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 2c9c5863c8e2..49d02d368bae 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,7 @@ +## 0.12.4 + +* Updates dependencies to `web: ^0.5.0` and `google_identity_services_web: ^0.3.1`. + ## 0.12.3+3 * Updates SDK version to Dart `^3.3.0`. Flutter `^3.19.0`. diff --git a/packages/google_sign_in/google_sign_in_web/example/pubspec.yaml b/packages/google_sign_in/google_sign_in_web/example/pubspec.yaml index 1c53b0fa93c9..e260814e73bb 100644 --- a/packages/google_sign_in/google_sign_in_web/example/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in_web/example/pubspec.yaml @@ -9,7 +9,7 @@ dependencies: cupertino_icons: ^1.0.2 flutter: sdk: flutter - google_identity_services_web: ^0.3.0 + google_identity_services_web: ^0.3.1 google_sign_in_platform_interface: ^2.4.0 google_sign_in_web: path: ../ @@ -22,7 +22,7 @@ dev_dependencies: integration_test: sdk: flutter mockito: 5.4.4 - web: ">=0.3.0 <0.6.0" + web: ^0.5.0 flutter: uses-material-design: true diff --git a/packages/google_sign_in/google_sign_in_web/lib/src/flexible_size_html_element_view.dart b/packages/google_sign_in/google_sign_in_web/lib/src/flexible_size_html_element_view.dart index 63acfb84836e..6fa019ed909a 100644 --- a/packages/google_sign_in/google_sign_in_web/lib/src/flexible_size_html_element_view.dart +++ b/packages/google_sign_in/google_sign_in_web/lib/src/flexible_size_html_element_view.dart @@ -73,13 +73,10 @@ class _FlexHtmlElementView extends State { /// The function called whenever an observed resize occurs. void _onResizeEntries( - // TODO(srujzs): Remove once typed JSArrays (JSArray) get to `stable`. - // ignore: always_specify_types - JSArray resizes, + JSArray resizes, web.ResizeObserver observer, ) { - final web.DOMRectReadOnly rect = - resizes.toDart.cast().last.contentRect; + final web.DOMRectReadOnly rect = resizes.toDart.last.contentRect; if (rect.width > 0 && rect.height > 0) { _doResize(Size(rect.width.toDouble(), rect.height.toDouble())); } @@ -90,14 +87,10 @@ class _FlexHtmlElementView extends State { /// When mutations are received, this function attaches a Resize Observer to /// the first child of the mutation, which will drive void _onMutationRecords( - // TODO(srujzs): Remove once typed JSArrays (JSArray) get to `stable`. - // ignore: always_specify_types - JSArray mutations, + JSArray mutations, web.MutationObserver observer, ) { - mutations.toDart - .cast() - .forEach((web.MutationRecord mutation) { + for (final web.MutationRecord mutation in mutations.toDart) { if (mutation.addedNodes.length > 0) { final web.Element? element = _locateSizeProvider(mutation.addedNodes); if (element != null) { @@ -108,7 +101,7 @@ class _FlexHtmlElementView extends State { return; } } - }); + } } /// Registers a MutationObserver on the root element of the HtmlElementView. 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 82b9cd3cd289..b7ed804cc930 100644 --- a/packages/google_sign_in/google_sign_in_web/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in_web/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for Google Sign-In, a secure authentication system for signing in with a Google account on Android, iOS and Web. repository: https://github.com/flutter/packages/tree/main/packages/google_sign_in/google_sign_in_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22 -version: 0.12.3+3 +version: 0.12.4 environment: sdk: ^3.3.0 @@ -22,10 +22,10 @@ dependencies: sdk: flutter flutter_web_plugins: sdk: flutter - google_identity_services_web: ^0.3.0 + google_identity_services_web: ^0.3.1 google_sign_in_platform_interface: ^2.4.0 http: ">=0.13.0 <2.0.0" - web: ">=0.3.0 <0.6.0" # because google_identity_services + web: ^0.5.0 dev_dependencies: flutter_test: From cd5d7d88d277d081af35017c1c8356e085e92d5e Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Wed, 21 Feb 2024 07:39:20 -0800 Subject: [PATCH 39/40] [local_auth] Switch iOS endorsement to `local_auth_darwin` (#6107) Updates to use `local_auth_darwin` instead of the discontinued `local_auth_ios`. --- packages/local_auth/local_auth/CHANGELOG.md | 9 +++++---- packages/local_auth/local_auth/README.md | 4 ++-- .../local_auth/example/lib/readme_excerpts.dart | 2 +- packages/local_auth/local_auth/example/pubspec.yaml | 6 +++--- packages/local_auth/local_auth/lib/src/local_auth.dart | 2 +- packages/local_auth/local_auth/pubspec.yaml | 10 +++++----- .../local_auth/local_auth/test/local_auth_test.dart | 2 +- script/configs/allowed_unpinned_deps.yaml | 4 ---- 8 files changed, 18 insertions(+), 21 deletions(-) diff --git a/packages/local_auth/local_auth/CHANGELOG.md b/packages/local_auth/local_auth/CHANGELOG.md index 475c3f5a3417..b7b2c263da5f 100644 --- a/packages/local_auth/local_auth/CHANGELOG.md +++ b/packages/local_auth/local_auth/CHANGELOG.md @@ -1,9 +1,10 @@ -## NEXT +## 2.2.0 -* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. +* Switches endorsed iOS implementation to `local_auth_darwin`. + * Clients directly importing `local_auth_ios` for auth strings should switch + dependencies and imports to `local_auth_darwin`. No other change is necessary. * Updates support matrix in README to indicate that iOS 11 is no longer supported. -* Clients on versions of Flutter that still support iOS 11 can continue to use this - package with iOS 11, but will not receive any further updates to the iOS implementation. +* Updates minimum supported SDK version to Flutter 3.16.6. ## 2.1.8 diff --git a/packages/local_auth/local_auth/README.md b/packages/local_auth/local_auth/README.md index 8c86785d21f3..78c0b2038a19 100644 --- a/packages/local_auth/local_auth/README.md +++ b/packages/local_auth/local_auth/README.md @@ -136,7 +136,7 @@ instance, to customize Android and iOS: ```dart import 'package:local_auth_android/local_auth_android.dart'; -import 'package:local_auth_ios/local_auth_ios.dart'; +import 'package:local_auth_darwin/local_auth_darwin.dart'; // ยทยทยท final bool didAuthenticate = await auth.authenticate( localizedReason: 'Please authenticate to show account balance', @@ -281,7 +281,7 @@ the Android theme directly in `android/app/src/main/AndroidManifest.xml`: diff --git a/packages/local_auth/local_auth/example/lib/readme_excerpts.dart b/packages/local_auth/local_auth/example/lib/readme_excerpts.dart index 8ae4a3c34178..b0ee0e9daf0d 100644 --- a/packages/local_auth/local_auth/example/lib/readme_excerpts.dart +++ b/packages/local_auth/local_auth/example/lib/readme_excerpts.dart @@ -20,7 +20,7 @@ import 'package:local_auth/local_auth.dart'; // #docregion CustomMessages import 'package:local_auth_android/local_auth_android.dart'; -import 'package:local_auth_ios/local_auth_ios.dart'; +import 'package:local_auth_darwin/local_auth_darwin.dart'; // #enddocregion CustomMessages void main() { diff --git a/packages/local_auth/local_auth/example/pubspec.yaml b/packages/local_auth/local_auth/example/pubspec.yaml index ea71356935a9..73265f90cd33 100644 --- a/packages/local_auth/local_auth/example/pubspec.yaml +++ b/packages/local_auth/local_auth/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the local_auth plugin. publish_to: none environment: - sdk: ^3.1.0 - flutter: ">=3.13.0" + sdk: ^3.2.3 + flutter: ">=3.16.6" dependencies: flutter: @@ -17,7 +17,7 @@ dependencies: # the parent directory to use the current plugin's version. path: ../ local_auth_android: ^1.0.0 - local_auth_ios: ^1.0.1 + local_auth_darwin: ^1.2.1 dev_dependencies: build_runner: ^2.1.10 diff --git a/packages/local_auth/local_auth/lib/src/local_auth.dart b/packages/local_auth/local_auth/lib/src/local_auth.dart index e369f67187a5..9046743dd5d3 100644 --- a/packages/local_auth/local_auth/lib/src/local_auth.dart +++ b/packages/local_auth/local_auth/lib/src/local_auth.dart @@ -12,7 +12,7 @@ import 'dart:async'; import 'package:flutter/services.dart'; import 'package:local_auth_android/local_auth_android.dart'; -import 'package:local_auth_ios/local_auth_ios.dart'; +import 'package:local_auth_darwin/local_auth_darwin.dart'; import 'package:local_auth_platform_interface/local_auth_platform_interface.dart'; import 'package:local_auth_windows/local_auth_windows.dart'; diff --git a/packages/local_auth/local_auth/pubspec.yaml b/packages/local_auth/local_auth/pubspec.yaml index 6573656a4496..f36bc4049def 100644 --- a/packages/local_auth/local_auth/pubspec.yaml +++ b/packages/local_auth/local_auth/pubspec.yaml @@ -3,11 +3,11 @@ description: Flutter plugin for Android and iOS devices to allow local authentication via fingerprint, touch ID, face ID, passcode, pin, or pattern. repository: https://github.com/flutter/packages/tree/main/packages/local_auth/local_auth issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+local_auth%22 -version: 2.1.8 +version: 2.2.0 environment: - sdk: ^3.1.0 - flutter: ">=3.13.0" + sdk: ^3.2.3 + flutter: ">=3.16.6" flutter: plugin: @@ -15,7 +15,7 @@ flutter: android: default_package: local_auth_android ios: - default_package: local_auth_ios + default_package: local_auth_darwin windows: default_package: local_auth_windows @@ -23,7 +23,7 @@ dependencies: flutter: sdk: flutter local_auth_android: ^1.0.0 - local_auth_ios: ^1.0.1 + local_auth_darwin: ^1.2.1 local_auth_platform_interface: ^1.0.1 local_auth_windows: ^1.0.0 diff --git a/packages/local_auth/local_auth/test/local_auth_test.dart b/packages/local_auth/local_auth/test/local_auth_test.dart index 00196a8b875e..aa9c5cf5e6b6 100644 --- a/packages/local_auth/local_auth/test/local_auth_test.dart +++ b/packages/local_auth/local_auth/test/local_auth_test.dart @@ -6,7 +6,7 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:local_auth/local_auth.dart'; import 'package:local_auth_android/local_auth_android.dart'; -import 'package:local_auth_ios/local_auth_ios.dart'; +import 'package:local_auth_darwin/local_auth_darwin.dart'; import 'package:local_auth_platform_interface/local_auth_platform_interface.dart'; import 'package:local_auth_windows/local_auth_windows.dart'; import 'package:mockito/mockito.dart'; diff --git a/script/configs/allowed_unpinned_deps.yaml b/script/configs/allowed_unpinned_deps.yaml index 7387401c5313..fe4c138b0a63 100644 --- a/script/configs/allowed_unpinned_deps.yaml +++ b/script/configs/allowed_unpinned_deps.yaml @@ -6,10 +6,6 @@ ## Explicit allowances -# Temporary during transition to local_auth_darwin. Can be removed once -# the default endorsement changes. -- local_auth_ios - # Owned by individual Flutter Team members. # Ideally we would not do this, since there's no clear plan for what # would happen if the individuals left the Flutter Team, and the From e88ca69b5d975eb37b4f513070224eb72f629ef7 Mon Sep 17 00:00:00 2001 From: Bas de Vaan Date: Wed, 21 Feb 2024 16:43:20 +0100 Subject: [PATCH 40/40] [camera_android_camerax] Fix typo in readme (#6143) This pull request fixes the typo `pubsepc.yaml` to the correct value `pubspec.yaml` in the `README.md`. https://github.com/flutter/flutter/issues/143572 --- packages/camera/camera_android_camerax/CHANGELOG.md | 3 ++- packages/camera/camera_android_camerax/README.md | 2 +- packages/camera/camera_android_camerax/pubspec.yaml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/camera/camera_android_camerax/CHANGELOG.md b/packages/camera/camera_android_camerax/CHANGELOG.md index ce4475ebf0fc..e97f2a550309 100644 --- a/packages/camera/camera_android_camerax/CHANGELOG.md +++ b/packages/camera/camera_android_camerax/CHANGELOG.md @@ -1,5 +1,6 @@ -## NEXT +## 0.5.0+33 +* Fixes typo in `README.md`. * Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. ## 0.5.0+32 diff --git a/packages/camera/camera_android_camerax/README.md b/packages/camera/camera_android_camerax/README.md index 3a2e49d7e60d..13967faa2001 100644 --- a/packages/camera/camera_android_camerax/README.md +++ b/packages/camera/camera_android_camerax/README.md @@ -12,7 +12,7 @@ the title, which will be actively triaged. This package is [non-endorsed][3]; the endorsed Android implementation of `camera` is [`camera_android`][4]. To use this implementation of the plugin instead of -`camera_android`, you will need to specify it in your `pubsepc.yaml` file as a +`camera_android`, you will need to specify it in your `pubspec.yaml` file as a dependency in addition to `camera`: ```yaml diff --git a/packages/camera/camera_android_camerax/pubspec.yaml b/packages/camera/camera_android_camerax/pubspec.yaml index d6970d2e559e..fee04bae156f 100644 --- a/packages/camera/camera_android_camerax/pubspec.yaml +++ b/packages/camera/camera_android_camerax/pubspec.yaml @@ -2,7 +2,7 @@ name: camera_android_camerax description: Android implementation of the camera plugin using the CameraX library. repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_android_camerax issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22 -version: 0.5.0+32 +version: 0.5.0+33 environment: sdk: ^3.1.0