getImageFromLocalStorage function

Future<Uint8List?> getImageFromLocalStorage()

Implementation

Future<Uint8List?> getImageFromLocalStorage() async {
  var prefs = await SharedPreferences.getInstance();
  String? base = prefs.getString(LOC_STORAGE_KEY);
  if (base != null) {
    return base64.decode(base.replaceFirst(RegExp(r'data:image/[^;]+;base64,'), ''));
  }
  return null;
}