outputNameToIndexAsync method

Future<int> outputNameToIndexAsync(
  1. String name
)

Implementation

Future<int> outputNameToIndexAsync(String name) async {
  final cName = name.toNativeUtf8().cast<ffi.Char>();
  final rval = cvRunAsync<int>(
    (callback) => cffi.Layer_OutputNameToIndex_Async(ref, cName, callback),
    (c, p) {
      final rval = p.cast<ffi.Int>().value;
      calloc.free(p);
      return c.complete(rval);
    },
  );
  calloc.free(cName);
  return rval;
}