Skip to content

Commit

Permalink
[plugin_platform_interface] Switch mixin to mixin class (#5420)
Browse files Browse the repository at this point in the history
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 flutter/flutter#123241
  • Loading branch information
stuartmorgan committed Nov 17, 2023
1 parent 14ed53b commit a8bb833
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions packages/plugin_platform_interface/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,4 @@ abstract class PlatformInterface {
/// implements UrlLauncherPlatform {}
/// ```
@visibleForTesting
abstract class MockPlatformInterfaceMixin implements PlatformInterface {}
abstract mixin class MockPlatformInterfaceMixin implements PlatformInterface {}
4 changes: 2 additions & 2 deletions packages/plugin_platform_interface/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a8bb833

Please sign in to comment.