parsePayloadAsBase64 static method

String? parsePayloadAsBase64(
  1. String? dataURL
)

Parses the Data URL to a Base-64 string.

Implementation

static String? parsePayloadAsBase64(String? dataURL) {
  if (dataURL == null || dataURL.length < 5 || !dataURL.startsWith('data:')) {
    return null;
  }
  var idx = dataURL.indexOf(',');
  return dataURL.substring(idx + 1);
}