takePhoto method

Future<void> takePhoto(
  1. BuildContext context
)

Implementation

Future<void> takePhoto(BuildContext context) async {
  if (cameraInitialized.value) {
    Helper.showLoading(buildContext: context);
    XFile? file = await cameraController?.takePicture();
    debugPrint("file : ${file?.path}");
    if (context.mounted) Helper.hideLoading(context: context);
    // Get.back(result: file);
    if (context.mounted) Navigator.pop(context, file);
  }
}