implement method

void implement(
  1. ObjCProtocolBuilder builder,
  2. T? function
)

Implement this method on the protocol builder using a Dart function.

The implemented method must be invoked by ObjC code running on the same thread as the isolate that called implementMethod. Invoking the method on the wrong thread will result in a crash.

Note: You cannot call this method after you have called builder.build.

Implementation

void implement(ObjCProtocolBuilder builder, T? function) {
  if (function != null) {
    implementWithBlock(builder, _createBlock(function));
  }
}