executeSync<S> method
- @protected
- FlutterRustBridgeSyncTask task
inherited
Similar to executeNormal
, except that this will return synchronously
Implementation
@protected
S executeSync<S>(FlutterRustBridgeSyncTask task) {
final raw = task.callFfi();
final bytes = Uint8List.fromList(raw.ptr.asTypedList(raw.len));
final success = raw.success > 0;
inner.free_WireSyncReturnStruct(raw);
if (success) {
return task.parseSuccessData(bytes);
} else {
throw FfiException('EXECUTE_SYNC', utf8.decode(bytes), null);
}
}