Skip to content

Commit dba9cce

Browse files
author
Harry Terkelsen
authored
Throw an exception in Image.toByteData rather than hang forever. (flutter#15152)
1 parent 155ee3c commit dba9cce

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/web_ui/lib/src/engine/html_image_codec.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ class HtmlImage implements ui.Image {
136136
}
137137
}
138138

139+
// TODO(het): Support this for asset images and images generated from
140+
// `Picture`s.
139141
/// Returns an error message on failure, null on success.
140-
String _toByteData(int format, Callback<Uint8List> callback) => null;
142+
String _toByteData(int format, Callback<Uint8List> callback) {
143+
callback(null);
144+
return 'Image.toByteData is not supported in Flutter for Web';
145+
}
141146
}

0 commit comments

Comments
 (0)