getImage static method

Future<Uint8List> getImage(
  1. String imgPath
)

Implementation

static Future<Uint8List> getImage(String imgPath) async {
  final imgFile = File(imgPath);
  final exist = await imgFile.exists();
  if (exist) {
    return imgFile.readAsBytes();
  } else {
    throw Exception('print imgFile is not exist');
  }
}