2022-12-14 17:33:38 +00:00
|
|
|
import 'package:camera/camera.dart';
|
|
|
|
|
|
|
|
abstract class CameraState {
|
|
|
|
const CameraState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class CameraInitState extends CameraState {
|
|
|
|
const CameraInitState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class CameraLoadingState extends CameraState {
|
|
|
|
const CameraLoadingState();
|
|
|
|
}
|
|
|
|
|
2022-12-21 19:31:22 +00:00
|
|
|
class CameraInitializedState extends CameraState {
|
2022-12-14 17:33:38 +00:00
|
|
|
final CameraController controller;
|
|
|
|
|
2022-12-21 19:31:22 +00:00
|
|
|
const CameraInitializedState(this.controller);
|
|
|
|
}
|
|
|
|
|
|
|
|
class CameraActiveState extends CameraState {
|
|
|
|
final double minZoom;
|
|
|
|
final double maxZoom;
|
|
|
|
final double currentZoom;
|
|
|
|
final double minExposureOffset;
|
|
|
|
final double maxExposureOffset;
|
|
|
|
final double? exposureOffsetStep;
|
|
|
|
final double currentExposureOffset;
|
|
|
|
|
|
|
|
const CameraActiveState({
|
|
|
|
required this.minZoom,
|
|
|
|
required this.maxZoom,
|
|
|
|
required this.currentZoom,
|
|
|
|
required this.minExposureOffset,
|
|
|
|
required this.maxExposureOffset,
|
|
|
|
required this.exposureOffsetStep,
|
|
|
|
required this.currentExposureOffset,
|
|
|
|
});
|
2022-12-14 17:33:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
class CameraErrorState extends CameraState {
|
|
|
|
const CameraErrorState();
|
|
|
|
}
|