Interface constructor

Interface(
  1. String name
)

Creates a Interface with a unique name.

Implementation

Interface(this.name) {
  if (Platform.isIOS || Platform.isMacOS) {
    _runtime = InterfaceRuntimeObjC();
  } else if (Platform.isAndroid) {
    _runtime = InterfaceRuntimeJava();
  } else {
    throw 'Platform not supported: ${Platform.localeName}';
  }
  _nativeObjectPointer = _runtime.nativeObjectPointerForInterfaceName(name);
  if (_nativeObjectPointer == nullptr) {
    throw 'Pointer of native object is nullptr!';
  }
  _methodTable = _runtime.methodTableWithInterfaceName(name);
}