instance property
MediaManagerPlatform
get
instance
The default singleton instance of MediaManagerPlatform to use.
Defaults to MethodChannelMediaManager if no other implementation is set.
To provide a custom implementation:
MediaManagerPlatform.instance = MyCustomMediaManager();
Implementation
static MediaManagerPlatform get instance => _instance;
set
instance
(MediaManagerPlatform instance)
Sets the platform instance to a specific implementation.
Platform implementations should call this when they register themselves, providing their own platform-specific class that extends MediaManagerPlatform.
Throws an assertion error if the instance doesn't extend MediaManagerPlatform or if the platform interface token doesn't match.
Implementation
static set instance(MediaManagerPlatform instance) {
PlatformInterface.verifyToken(instance, _token);
_instance = instance;
}