copyFromAssets static method
Implementation
static Future<void> copyFromAssets(
String assetsPath, String destinationPath) async {
ByteData data = await rootBundle.load(assetsPath);
List<int> bytes =
data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes);
String path = destinationPath;
if (File(path).existsSync()) {
File(path).deleteSync();
}
await File(path).create();
await File(path).writeAsBytes(bytes);
}