Throw an exception in Image.toByteData rather than hang forever. (flutter/engine#15152)

This commit is contained in:
Harry Terkelsen
2020-01-08 11:20:27 -08:00
committed by GitHub
parent feb5125ef9
commit 0ed2450659

View File

@@ -136,6 +136,11 @@ class HtmlImage implements ui.Image {
}
}
// TODO(het): Support this for asset images and images generated from
// `Picture`s.
/// Returns an error message on failure, null on success.
String _toByteData(int format, Callback<Uint8List> callback) => null;
String _toByteData(int format, Callback<Uint8List> callback) {
callback(null);
return 'Image.toByteData is not supported in Flutter for Web';
}
}