registerProtocolCallback function
Register callback function for selector in protocol.
Protocol protocolType
must be used in native code.
This function is only used for pure Dart class which implements a objc protocol.
Implementation
bool registerProtocolCallback(
dynamic target, Function callback, String selName, Type protocolType) {
String protoName = protocolType.toString();
SEL selector = SEL(selName);
Protocol protocol = Protocol(protoName);
// Use Dart Function signature to create a native method.
Pointer<Utf8> types =
nativeProtocolMethodTypes(protocol.toPointer(), selector.toPointer());
return registerMethodCallback(target, selector, callback, types);
}