|
@@ -8,6 +8,7 @@ import 'package:get/get.dart';
|
|
|
import 'package:image_gallery_saver/image_gallery_saver.dart';
|
|
|
import 'package:vitalapp/architecture/utils/prompt_box.dart';
|
|
|
import 'package:vitalapp/managers/interfaces/cache.dart';
|
|
|
+import 'package:fis_common/logger/logger.dart';
|
|
|
import 'dart:ui' as ui;
|
|
|
import 'index.dart';
|
|
|
|
|
@@ -25,13 +26,6 @@ class FacialRecognitionController extends GetxController
|
|
|
double _maxAvailableExposureOffset = 0.0;
|
|
|
double _minAvailableZoom = 1.0;
|
|
|
double _maxAvailableZoom = 1.0;
|
|
|
-
|
|
|
- // CameraController? controller;
|
|
|
- XFile? imageFile;
|
|
|
- XFile? videoFile;
|
|
|
- // VideoPlayerController? videoController;
|
|
|
- VoidCallback? videoPlayerListener;
|
|
|
- bool enableAudio = true;
|
|
|
double _currentScale = 1.0;
|
|
|
double _baseScale = 1.0;
|
|
|
|
|
@@ -60,7 +54,7 @@ class FacialRecognitionController extends GetxController
|
|
|
// await kCameraController!.setZoomLevel(_currentScale);
|
|
|
}
|
|
|
|
|
|
- /// 修改对焦点 TODO
|
|
|
+ /// 修改对焦点 [暂不执行]
|
|
|
void onViewFinderTap(TapDownDetails details, BoxConstraints constraints) {
|
|
|
if (kCameraController == null) {
|
|
|
return;
|
|
@@ -83,9 +77,9 @@ class FacialRecognitionController extends GetxController
|
|
|
if (_cameras.isNotEmpty) {
|
|
|
// state.isCameraReady = true;
|
|
|
}
|
|
|
- print("cameras: ${_cameras.length}");
|
|
|
+ // print("cameras: ${_cameras.length}");
|
|
|
} on CameraException catch (e) {
|
|
|
- print("cameras: ${e.code} ${e.description}");
|
|
|
+ logger.e("cameras: ${e.code} ${e.description}");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -233,9 +227,10 @@ class FacialRecognitionController extends GetxController
|
|
|
void debugShowCache() async {
|
|
|
final cacheManager = Get.find<ICacheManager>();
|
|
|
double cacheSize = await cacheManager.getCacheSize();
|
|
|
- print('cacheSize = $cacheSize : ${formatSize(cacheSize)}');
|
|
|
double imageCacheSize = await cacheManager.getImageCacheSize();
|
|
|
- print('imageCacheSize = $imageCacheSize : ${formatSize(imageCacheSize)}');
|
|
|
+ debugPrint('cacheSize = $cacheSize : ${formatSize(cacheSize)}');
|
|
|
+ debugPrint(
|
|
|
+ 'imageCacheSize = $imageCacheSize : ${formatSize(imageCacheSize)}');
|
|
|
}
|
|
|
|
|
|
static String formatSize(double value) {
|
|
@@ -255,8 +250,6 @@ class FacialRecognitionController extends GetxController
|
|
|
|
|
|
// 将图像保存到相册
|
|
|
await ImageGallerySaver.saveImage(bytes, quality: 100);
|
|
|
-
|
|
|
- print('图像已保存到相册!');
|
|
|
}
|
|
|
|
|
|
/// 处理图像裁切
|
|
@@ -306,9 +299,7 @@ class FacialRecognitionController extends GetxController
|
|
|
takePicture().then((XFile? file) async {
|
|
|
// imageFile = file;
|
|
|
if (file != null) {
|
|
|
- print('Picture saved to ${file.path}');
|
|
|
- String savePath = await clipLocalImage(file, 1.8);
|
|
|
- print('clipPicture saved to $savePath');
|
|
|
+ await clipLocalImage(file, 1.8);
|
|
|
|
|
|
/// TODO 上传给server,获取返回值信息
|
|
|
if (true) {
|