shoot method

Future<XFile> shoot()

Implementation

Future<XFile> shoot() async {
  if (controller == null || !controller!.value.isInitialized) {
    debugPrint("Controller nicht initialisiert, starte Kamera...");
    await start();
  }
  try {
    _latestPic = await controller!.takePicture();
    notifyListeners();
    return latestPic!;
  } catch (e) {
    debugPrint("Fehler beim Aufnehmen des Bildes: $e");
    throw Exception("Fehler beim Aufnehmen des Bildes");
  }
}