copyFile static method

Future<bool> copyFile(
  1. String sourcePath,
  2. String destinationPath
)

Implementation

static Future<bool> copyFile(String sourcePath, String destinationPath) async {
  try {
    final sourceFile = File(sourcePath);
    if (await sourceFile.exists()) {
      await sourceFile.copy(destinationPath);
      return true;
    }
    return false;
  } catch (e) {
    return false;
  }
}