Skip to content

Commit 536dd7f

Browse files
[plugin_platform_interface] PlatformInterface documentation fixes
Updates the documentation for `PlatformInterface` to reflect that the token should be `static final` rather than `static const`. This was fixed in flutter#2417.
1 parent 498df33 commit 536dd7f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/plugin_platform_interface/lib/plugin_platform_interface.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import 'package:meta/meta.dart';
2222
///
2323
/// static UrlLauncherPlatform _instance = MethodChannelUrlLauncher();
2424
///
25-
/// static const Object _token = Object();
25+
/// static final Object _token = Object();
2626
///
2727
/// static UrlLauncherPlatform get instance => _instance;
2828
///
@@ -40,7 +40,7 @@ import 'package:meta/meta.dart';
4040
/// to include the [MockPlatformInterfaceMixin] for the verification to be temporarily disabled. See
4141
/// [MockPlatformInterfaceMixin] for a sample of using Mockito to mock a platform interface.
4242
abstract class PlatformInterface {
43-
/// Pass a private, class-specific `const Object()` as the `token`.
43+
/// Pass a private, class-specific `Object()` as the `token`.
4444
PlatformInterface({required Object token}) : _instanceToken = token;
4545

4646
final Object? _instanceToken;
@@ -83,7 +83,7 @@ abstract class PlatformInterface {
8383
///
8484
/// This class is intended for use in tests only.
8585
///
86-
/// Sample usage (assuming UrlLauncherPlatform extends [PlatformInterface]:
86+
/// Sample usage (assuming `UrlLauncherPlatform` extends [PlatformInterface]):
8787
///
8888
/// ```dart
8989
/// class UrlLauncherPlatformMock extends Mock

0 commit comments

Comments
 (0)