saveImage static method

Future<String> saveImage(
  1. Uint8List byteData
)

Implementation

static Future<String> saveImage(Uint8List byteData) async {
  final directory = (await getTemporaryDirectory()).path;
  String path = '$directory/${DateTime.now().millisecondsSinceEpoch}.png';
  final imgFile = File(path);
  try {
    await imgFile.writeAsBytes(byteData);
    LogTool.log('saveSuccess:$path');
  } catch (_) {
    path = '';
  }
  return Future.value(path);
}