The consequence is that someone could develop an implementation of UniLinksPlatform using implements instead of extends, and everything would work initially but changes to the platform interface would break that implementation.
To fix, use a static final Object _token = Object(); instead of static const Object _token = Object(); in UniLinksPlatform.
To Reproduce
Steps to reproduce the behavior:
Build a class that implements UniLinksPlatform instead of using extends. Use const Object() as the token. e.g.
Make an app that depends on the new class and imports the file where it is defined.
Make a minor change to UniLinksPlatform (adding a method).
Compile error "DontDoThis is missing implementations for these members"
Expected behavior
Should not be possible to build a class that implements UniLinksPlatform because UniLinksPlatform uses a token that can't be impersonated.
This can be done by changing the token to static final Object _token = Object().
Smartphone (please complete the following information):
N/A (reproduces on web)
Describe the bug This plugin should not use a
const Object()
as the platform interface token. There was an error in the documentation forplugin_platform_interface
; see https://github.com/flutter/flutter/issues/96178.The consequence is that someone could develop an implementation of
UniLinksPlatform
usingimplements
instead ofextends
, and everything would work initially but changes to the platform interface would break that implementation.To fix, use a
static final Object _token = Object();
instead ofstatic const Object _token = Object();
inUniLinksPlatform
.To Reproduce Steps to reproduce the behavior:
UniLinksPlatform
instead of usingextends
. Useconst Object()
as the token. e.g.UniLinksPlatform
(adding a method).DontDoThis
is missing implementations for these members"Expected behavior Should not be possible to build a class that implements
UniLinksPlatform
becauseUniLinksPlatform
uses a token that can't be impersonated.This can be done by changing the token to
static final Object _token = Object()
.Smartphone (please complete the following information): N/A (reproduces on web)
/cc @stuartmorgan