Skip to content

Instantly share code, notes, and snippets.

@azamsharp
Created December 17, 2019 21:31
Show Gist options
  • Save azamsharp/2cd878052561fd2996a15123a719e83f to your computer and use it in GitHub Desktop.
Save azamsharp/2cd878052561fd2996a15123a719e83f to your computer and use it in GitHub Desktop.
void _takePicture(BuildContext context) async {
try {
await _initializeCameraControllerFuture;
final path =
join((await getTemporaryDirectory()).path, '${DateTime.now()}.png');
await _cameraController.takePicture(path);
Navigator.pop(context,path);
} catch (e) {
print(e);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment