mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-10 14:07:59 -06:00
fix: Update search
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
import 'package:camera/camera.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CameraView extends StatelessWidget {
|
||||
const CameraView({super.key, required this.controller});
|
||||
|
||||
final CameraController controller;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (!controller.value.isInitialized) {
|
||||
return Container();
|
||||
}
|
||||
|
||||
return Center(
|
||||
child: CameraPreview(controller),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import 'package:camera/camera.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:paperless_document_scanner/types/edge_detection_result.dart';
|
||||
|
||||
import 'camera_view.dart';
|
||||
import 'cropping_preview.dart';
|
||||
import 'edge_detector.dart';
|
||||
import 'image_view.dart';
|
||||
@@ -65,10 +64,6 @@ class _ScanState extends State<Scan> {
|
||||
return ImageView(imagePath: croppedImagePath!);
|
||||
}
|
||||
|
||||
if (imagePath == null && edgeDetectionResult == null) {
|
||||
return CameraView(controller: controller);
|
||||
}
|
||||
|
||||
return ImagePreview(
|
||||
imagePath: imagePath!,
|
||||
edgeDetectionResult: edgeDetectionResult,
|
||||
@@ -129,22 +124,19 @@ class _ScanState extends State<Scan> {
|
||||
imagePath = filePath;
|
||||
});
|
||||
|
||||
EdgeDetectionResult result =
|
||||
await EdgeDetector().detectEdgesFromFile(filePath);
|
||||
EdgeDetectionResult result = await EdgeDetector().detectEdgesFromFile(filePath);
|
||||
|
||||
setState(() {
|
||||
edgeDetectionResult = result;
|
||||
});
|
||||
}
|
||||
|
||||
Future _processImage(
|
||||
String filePath, EdgeDetectionResult edgeDetectionResult) async {
|
||||
Future _processImage(String filePath, EdgeDetectionResult edgeDetectionResult) async {
|
||||
if (!mounted) {
|
||||
return;
|
||||
}
|
||||
|
||||
bool result = await EdgeDetector()
|
||||
.processImageFromFile(filePath, edgeDetectionResult);
|
||||
bool result = await EdgeDetector().processImageFromFile(filePath, edgeDetectionResult);
|
||||
|
||||
if (result == false) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user