Skip to content

Commit

Permalink
[plugin_platform_interface] PlatformInterface documentation fixes
Browse files Browse the repository at this point in the history
Updates the documentation for `PlatformInterface` to reflect that the token should be `static final` rather than `static const`. This was fixed in flutter#2417.
  • Loading branch information
collin-jackson authored Aug 4, 2021
1 parent 498df33 commit 536dd7f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import 'package:meta/meta.dart';
///
/// static UrlLauncherPlatform _instance = MethodChannelUrlLauncher();
///
/// static const Object _token = Object();
/// static final Object _token = Object();
///
/// static UrlLauncherPlatform get instance => _instance;
///
Expand All @@ -40,7 +40,7 @@ import 'package:meta/meta.dart';
/// to include the [MockPlatformInterfaceMixin] for the verification to be temporarily disabled. See
/// [MockPlatformInterfaceMixin] for a sample of using Mockito to mock a platform interface.
abstract class PlatformInterface {
/// Pass a private, class-specific `const Object()` as the `token`.
/// Pass a private, class-specific `Object()` as the `token`.
PlatformInterface({required Object token}) : _instanceToken = token;

final Object? _instanceToken;
Expand Down Expand Up @@ -83,7 +83,7 @@ abstract class PlatformInterface {
///
/// This class is intended for use in tests only.
///
/// Sample usage (assuming UrlLauncherPlatform extends [PlatformInterface]:
/// Sample usage (assuming `UrlLauncherPlatform` extends [PlatformInterface]):
///
/// ```dart
/// class UrlLauncherPlatformMock extends Mock
Expand Down

0 comments on commit 536dd7f

Please sign in to comment.