m3_lightmeter/lib/screens/metering/components/camera_container/models/camera_error_type.dart
Vadim a183a5433e
ML-25 Revise permission handling (#26)
* fixed permission handling

* translations cleanup

* [Android] removed unused permissions
2023-02-11 00:49:51 +03:00

17 lines
553 B
Dart

import 'package:flutter/material.dart';
import 'package:lightmeter/generated/l10n.dart';
enum CameraErrorType { noCamerasDetected, permissionNotGranted, other }
extension CameraErrorTypeString on CameraErrorType {
String toStringLocalized(BuildContext context) {
switch (this) {
case CameraErrorType.noCamerasDetected:
return S.of(context).noCamerasDetected;
case CameraErrorType.permissionNotGranted:
return S.of(context).noCameraPermission;
default:
return S.of(context).otherCameraError;
}
}
}