fromJson static method

BarcodeStatus fromJson(
  1. JsonObject json
)

Implementation

static BarcodeStatus fromJson(JsonObject json) => BarcodeStatus(
      hasCameraPermission: json['hasCameraPermission'],
      availableCameras:
          (json['availableCameras'] as List).map((i) => CameraFacing.values[i as int]).toList(growable: false),
      hasFlash: json['hasFlash'],
      cameraFacing: (json['cameraFacing'] as int).let((i) => CameraFacing.values[i == -1 ? 0 : i]),
      cameraEnabled: json['cameraEnabled'],
      flashEnabled: json['flashEnabled'],
      scanEnabled: json['scanEnabled'],
    );