handleImagePath static method

Future<String> handleImagePath(
  1. String path
)

Implementation

static Future<String> handleImagePath(String path) async {
  var bytes = await rootBundle.load(path);
  String dir = (await getApplicationDocumentsDirectory()).path;
  var imageName = path.split("/").last;
  String logoPath = '$dir/$imageName';
  var _ = await writeToFile(bytes, logoPath);
  return logoPath;
}