initialize static method

Future<void> initialize({
  1. bool printLogs = false,
})

Initializes the camera by fetching the list of available cameras.

  • printLogs: If true, debug logs will be printed.

Implementation

static Future<void> initialize({bool printLogs = false}) async {
  try {
    _cameras = await availableCameras();
    _printLogs = printLogs;
  } on CameraException catch (e) {
    logError(e.code, e.description);
  }
}