m3_lightmeter/lib/screens/metering/components/camera_container/models/camera_error_type.dart

18 lines
553 B
Dart
Raw Permalink Normal View History

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;
}
}
}