File tree 5 files changed +10
-10
lines changed
packages/plugin_platform_interface
5 files changed +10
-10
lines changed Original file line number Diff line number Diff line change
1
+ ## 1.0.1
2
+
3
+ * Fixed a bug that made all platform interfaces appear as mocks in release builds (https://github.com/flutter/flutter/issues/46941 ).
4
+
1
5
## 1.0.0 - Initial release.
2
6
3
7
* Provides ` PlatformInterface ` with common mechanism for enforcing that a platform interface
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ abstract class UrlLauncherPlatform extends PlatformInterface {
18
18
19
19
static UrlLauncherPlatform _instance = MethodChannelUrlLauncher();
20
20
21
- static const Object _token = Object();
21
+ static final Object _token = Object();
22
22
23
23
static UrlLauncherPlatform get instance => _instance;
24
24
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ abstract class PlatformInterface {
57
57
/// This is implemented as a static method so that it cannot be overridden
58
58
/// with `noSuchMethod` .
59
59
static void verifyToken (PlatformInterface instance, Object token) {
60
- if (identical ( instance._instanceToken, MockPlatformInterfaceMixin ._token) ) {
60
+ if (instance is MockPlatformInterfaceMixin ) {
61
61
bool assertionsEnabled = false ;
62
62
assert (() {
63
63
assertionsEnabled = true ;
@@ -67,6 +67,7 @@ abstract class PlatformInterface {
67
67
throw AssertionError (
68
68
'`MockPlatformInterfaceMixin` is not intended for use in release builds.' );
69
69
}
70
+ return ;
70
71
}
71
72
if (! identical (token, instance._instanceToken)) {
72
73
throw AssertionError (
@@ -90,9 +91,4 @@ abstract class PlatformInterface {
90
91
/// implements UrlLauncherPlatform {}
91
92
/// ```
92
93
@visibleForTesting
93
- abstract class MockPlatformInterfaceMixin implements PlatformInterface {
94
- static const Object _token = Object ();
95
-
96
- @override
97
- Object get _instanceToken => _token;
98
- }
94
+ abstract class MockPlatformInterfaceMixin implements PlatformInterface {}
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ description: Reusable base class for Flutter plugin platform interfaces.
12
12
# be done when absolutely necessary and after the ecosystem has already migrated to 1.X.Y version
13
13
# that is forward compatible with 2.0.0 (ideally the ecosystem have migrated to depend on:
14
14
# `plugin_platform_interface: >=1.X.Y <3.0.0`).
15
- version : 1.0.0
15
+ version : 1.0.1
16
16
17
17
homepage : https://github.com/flutter/plugins/plugin_platform_interface
18
18
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import 'package:plugin_platform_interface/plugin_platform_interface.dart';
10
10
class SamplePluginPlatform extends PlatformInterface {
11
11
SamplePluginPlatform () : super (token: _token);
12
12
13
- static const Object _token = Object ();
13
+ static final Object _token = Object ();
14
14
15
15
static set instance (SamplePluginPlatform instance) {
16
16
PlatformInterface .verifyToken (instance, _token);
You can’t perform that action at this time.
0 commit comments