dealImageInfo function

ImageProvider<Object> dealImageInfo(
  1. String src
)

Implementation

ImageProvider<Object> dealImageInfo(String src) {
  if (urlMatch.hasMatch(src)) {
    return NetworkImage(src);
  }
  if (fileMatch.hasMatch(src)) {
    return FileImage(File(src));
  }
  if (src.contains('base64')) {
    String val = src.split(',')[1];
    Uint8List bytes = const Base64Decoder().convert(val);
    return MemoryImage(bytes);
  }
  return const AssetImage('lib/assets/avatar.png');
}