addToCache method

Future<void> addToCache(
  1. String key,
  2. Uint8List imageBytes
)

Implementation

Future<void> addToCache(String key, Uint8List imageBytes) async {
  final res = await promiseToFutureAsMap(
    jsInvokeMethod("addToCache", imageBytes, key),
  );

  if (res == null) throw Exception("no data received from js");

  if (res["error"] != null) throw Exception(res["error"]);
}