mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-10-19 23:00:39 +00:00
18 lines
553 B
Dart
18 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;
|
||
|
}
|
||
|
}
|
||
|
}
|