saveToGallery static method

Future<String> saveToGallery(
  1. String filePath
)

Implementation

static Future<String> saveToGallery(String filePath) async {
  final file = File(filePath);
  final directory = await getApplicationDocumentsDirectory();
  final destinationPath =
      '${directory.path}/snap_saved_${DateTime.now().millisecondsSinceEpoch}.png';
  await file.copy(destinationPath);
  return destinationPath;
}