diff --git a/lib/web_ui/lib/src/engine/html_image_codec.dart b/lib/web_ui/lib/src/engine/html_image_codec.dart
index 3ccd1faf11cb9..18a109b6697cd 100644
--- a/lib/web_ui/lib/src/engine/html_image_codec.dart
+++ b/lib/web_ui/lib/src/engine/html_image_codec.dart
@@ -129,6 +129,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 callback) => null;
+ String _toByteData(int format, Callback callback) {
+ callback(null);
+ return 'Image.toByteData is not supported in Flutter for Web';
+ }
}