require<T> static method
Implementation
static Future<T> require<T>(String method, [Object? arguments]) async {
final handler = _handlers[method];
if (handler == null) {
throw StateError(
'Native binding "$method" is not registered. Generate and register an FFI/ffigen or JNI/jnigen binding before calling this API.',
);
}
final value = await handler(arguments);
if (value is! T) {
throw StateError(
'Native binding "$method" returned ${value.runtimeType}, expected $T.',
);
}
return value;
}