title: _Callback<>, _toByteData() and _futurize() not defined
body: <p>I'm having this issue in Flutter:</p>
  <p><code>Error: The method '_futurize' isn't defined for the class '_MainPage'.</code></p>
  <p><code>Error: The method '_toByteData' isn't defined for the class '_MainPage'</code></p>
  <p><code>Error: '_Callback' isn't a type.</code></p>
  <p>This is in the function mentioned at <a href="https://api.flutter.dev/flutter/dart-ui/Image/toByteData.html" rel="nofollow noreferrer">https://api.flutter.dev/flutter/dart-ui/Image/toByteData.html</a>, which is used to obtain the binary value of an image.</p>
  <p>Actual code is:</p>
  <pre><code>Future&lt;ByteData?&gt; toByteData({ImageByteFormat format = ImageByteFormat.rawRgba}) {
    return _futurize((_Callback&lt;ByteData&gt; callback) {
      return _toByteData(format.index, (Uint8List? encoded) {
        callback(encoded!.buffer.asByteData());
      });
    });
  }
  </code></pre>