toDataUrl method

FutureOr<String> toDataUrl()

Returns a data URI containing the canvas data in PNG format. See toPNG.

Implementation

FutureOr<String> toDataUrl() {
  var pngData = toPNG();
  if (pngData is Future<Uint8List>) {
    return pngData.then(_toDataUrlImpl);
  } else {
    return _toDataUrlImpl(pngData);
  }
}