toByteData method

Uint8List toByteData()

Implementation

Uint8List toByteData() {
  // Check if the string contains a Base64 prefix (e.g., 'data:image/png;base64,')
  if (contains(',') && split(',').length > 1) {
    return base64Decode(split(',')[1]);
  } else {
    return base64Decode(
      this,
    ); // If there's no prefix, decode the whole string
  }
}