From a8bb8330c3663d570fcd0950eafdefb501470f22 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Fri, 17 Nov 2023 12:48:38 -0800 Subject: [PATCH] [plugin_platform_interface] Switch mixin to `mixin class` (#5420) The test mixin is currently declared as a `class`, which causes problems for projects with a minimum Dart version of 3.0. This switches it to `mixin class`; ideally it would just be a `mixin`, but in theory that could break something, so since this is such a core package in the ecosystem we want to be as conservative as possible. (While the breaking change would only in theory happen to test code, it's possible that someone ignored the `visibleForTesting`, and we have an easy way to avoid the possibility entirely.) Fixes https://github.com/flutter/flutter/issues/123241 --- packages/plugin_platform_interface/CHANGELOG.md | 6 ++++++ .../lib/plugin_platform_interface.dart | 2 +- packages/plugin_platform_interface/pubspec.yaml | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/plugin_platform_interface/CHANGELOG.md b/packages/plugin_platform_interface/CHANGELOG.md index 055d6e0afa46..3ad68b19a606 100644 --- a/packages/plugin_platform_interface/CHANGELOG.md +++ b/packages/plugin_platform_interface/CHANGELOG.md @@ -1,3 +1,9 @@ +## 2.1.7 + +* Changes `MockPlatformInterfaceMixin` to a `mixin class` for better + compatibility with projects that have a minumum Dart SDK version of 3.0. +* Updates minimum supported SDK version to Dart 3.0. + ## 2.1.6 * Adds pub topics to package metadata. diff --git a/packages/plugin_platform_interface/lib/plugin_platform_interface.dart b/packages/plugin_platform_interface/lib/plugin_platform_interface.dart index 6733b29953b0..63408dd1e37e 100644 --- a/packages/plugin_platform_interface/lib/plugin_platform_interface.dart +++ b/packages/plugin_platform_interface/lib/plugin_platform_interface.dart @@ -126,4 +126,4 @@ abstract class PlatformInterface { /// implements UrlLauncherPlatform {} /// ``` @visibleForTesting -abstract class MockPlatformInterfaceMixin implements PlatformInterface {} +abstract mixin class MockPlatformInterfaceMixin implements PlatformInterface {} diff --git a/packages/plugin_platform_interface/pubspec.yaml b/packages/plugin_platform_interface/pubspec.yaml index b9bc3f824046..9c83848759ed 100644 --- a/packages/plugin_platform_interface/pubspec.yaml +++ b/packages/plugin_platform_interface/pubspec.yaml @@ -15,10 +15,10 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+ # be done when absolutely necessary and after the ecosystem has already migrated to 2.X.Y version # that is forward compatible with 3.0.0 (ideally the ecosystem have migrated to depend on: # `plugin_platform_interface: >=2.X.Y <4.0.0`). -version: 2.1.6 +version: 2.1.7 environment: - sdk: ">=2.19.0 <4.0.0" + sdk: ">=3.0.0 <4.0.0" dependencies: meta: ^1.3.0