saveFileFromPath method

  1. @override
Future<String?> saveFileFromPath({
  1. required String filePath,
  2. String? folderPath,
  3. bool saveToRoot = false,
})
override

Implementation

@override
Future<String?> saveFileFromPath({
  required String filePath,
  String? folderPath,
  bool saveToRoot = false,
}) async {
  final file = File(filePath);
  if (!await file.exists()) return null;

  final bytes = await file.readAsBytes();
  final fileName = filePath.split('/').last;
  final result = await saveFile(
    bytes: bytes,
    fileName: fileName,
    folderPath: folderPath,
    saveToRoot: saveToRoot,
  );
  return result;
}