decodeImageFromList function

Future<Image> decodeImageFromList (Uint8List list)

Creates an image from a list of bytes.

This function attempts to interpret the given bytes an image. If successful, the returned Future resolves to the decoded image. Otherwise, the Future resolves to null.

Implementation

Future<ui.Image> decodeImageFromList(Uint8List list) {
  final Completer<ui.Image> completer = Completer<ui.Image>();
  ui.decodeImageFromList(list, completer.complete);
  return completer.future;
}