instance property
MicrophonePlatformInterface
instance
The default instance of the MicrophonePlatformInterface to use.
Platform-specific plugins should override this with their own platform-specific class that extends MicrophonePlatformInterface when they register themselves.
Defaults to MethodChannelMicrophone.
Implementation
static MicrophonePlatformInterface get instance => _instance;
Sets the default instance of the MicrophonePlatformInterface.
This will be removed after https://github.com/flutter/flutter/issues/43368 has been resolved.
Implementation
static set instance(MicrophonePlatformInterface instance) {
if (!instance.isMock) {
try {
instance._verifyProvidesDefaultImplementations();
} on NoSuchMethodError catch (_) {
throw AssertionError(
'Platform interfaces must not be implemented with `implements`');
}
}
_instance = instance;
}