instance property

MidtransPluginPlatform get instance

The default instance of MidtransPluginPlatform to use.

Defaults to MethodChannelMidtransPlugin.

Implementation

static MidtransPluginPlatform get instance {
  if (_instance == null) {
    MethodChannelMidtransPlugin.setMethodCallHandlers();
  }

  return _instance ??= MethodChannelMidtransPlugin.instance;
}
set instance (MidtransPluginPlatform instance)

Platform-specific implementations should set this with their own platform-specific class that extends MidtransPluginPlatform when they register themselves.

Implementation

static set instance(MidtransPluginPlatform instance) {
  PlatformInterface.verifyToken(instance, _token);
  _instance = instance;
}