saveSnapshotTo method

Future<void> saveSnapshotTo(
  1. String path
)

Pauses the video and saves a snapshot in the provided path. The snapshot will be saved as a png.

Implementation

Future<void> saveSnapshotTo(String path) async {
  Snapshot? snapshot = await getSnapshot();
  if (snapshot != null) {
    File(path).writeAsBytes(snapshot.image, flush: true);
  }
}