getImageSource function

String getImageSource(
  1. String url,
  2. String format
)

Get the image source for an image

Implementation

String getImageSource(String url, String format) {
  if (url.startsWith('#')) {
    return "data:image/$format;base64,${url.substring(1, url.length - format.length)}";
  } else {
    return url;
  }
}