saveFile method

Future<XFile> saveFile(
  1. Uint8List fileContent
)

Implementation

Future<XFile> saveFile(Uint8List fileContent) async {
  final name = 'catcher_2_${DateTime.now().microsecondsSinceEpoch}.png';
  final path = (_path?.isEmpty ?? true) ? name : '$_path/$name';
  final file = XFile.fromData(fileContent, path: path, name: name);
  if (_path != null && _path!.isNotEmpty) {
    await file.saveTo(path);
  }
  return file;
}