lookupFunction<T extends Function, F extends Function> method
Null safety
Looks up a native function and returns it as a Dart function.
T
is the C function signature, and F
is the Dart function signature.
For example:
int32_t add(int32_t a, int32_t b) {
return a + b;
}
DynamicLibrary dylib = DynamicLibrary.executable();
final add = dylib.lookupFunction<Int32 Function(Int32, Int32), int Function(int, int)>(
'add');
Implementation
external F lookupFunction<T extends Function, F extends Function>(
String symbolName,
{bool isLeaf: false});