state.dart 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import 'package:flutter/services.dart';
  2. import 'package:get/get.dart';
  3. class IdCardScanState {
  4. /// bool 相机是否已经加载完毕
  5. final _isCameraReady = false.obs;
  6. set isCameraReady(value) => _isCameraReady.value = value;
  7. bool get isCameraReady => _isCameraReady.value;
  8. /// 是否正在识别身份证
  9. final _isIdCardScanning = false.obs;
  10. set isIdCardScanning(value) => _isIdCardScanning.value = value;
  11. bool get isIdCardScanning => _isIdCardScanning.value;
  12. /// 是否正在进行人脸录入
  13. final _isRunningFaceInput = false.obs;
  14. set isRunningFaceInput(value) => _isRunningFaceInput.value = value;
  15. bool get isRunningFaceInput => _isRunningFaceInput.value;
  16. /// 是否正在使用前置相机
  17. final _isUsingFrontCamera = false.obs;
  18. set isUsingFrontCamera(value) => _isUsingFrontCamera.value = value;
  19. bool get isUsingFrontCamera => _isUsingFrontCamera.value;
  20. /// 正在处理中的图像的本地路径
  21. final _processingImageLocalPath = ''.obs;
  22. set processingImageLocalPath(value) =>
  23. _processingImageLocalPath.value = value;
  24. String get processingImageLocalPath => _processingImageLocalPath.value;
  25. /// 本地离线正在处理中的图像的Uint8List
  26. final Rx<Uint8List?> _processingImageUint8List = Rx(null);
  27. set processingImageUint8List(value) =>
  28. _processingImageUint8List.value = value;
  29. Uint8List? get processingImageUint8List => _processingImageUint8List.value;
  30. }