Autocalibration de la cible sur le centre de la cible ok + petite correction de la distortion mais pas tres fonctionnel
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
library;
|
||||
|
||||
import 'dart:io';
|
||||
import 'package:cunning_document_scanner/cunning_document_scanner.dart';
|
||||
import 'package:google_mlkit_document_scanner/google_mlkit_document_scanner.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import '../../core/constants/app_constants.dart';
|
||||
@@ -84,8 +84,8 @@ class _CaptureScreenState extends State<CaptureScreen> {
|
||||
floatingActionButton: _selectedImagePath != null
|
||||
? FloatingActionButton.extended(
|
||||
onPressed: _analyzeImage,
|
||||
icon: const Icon(Icons.analytics),
|
||||
label: const Text('Analyser'),
|
||||
icon: const Icon(Icons.arrow_forward),
|
||||
label: const Text('Suivant'),
|
||||
)
|
||||
: null,
|
||||
);
|
||||
@@ -205,10 +205,18 @@ class _CaptureScreenState extends State<CaptureScreen> {
|
||||
setState(() => _isLoading = true);
|
||||
|
||||
try {
|
||||
final List<String>? pictures = await CunningDocumentScanner.getPictures();
|
||||
final options = DocumentScannerOptions(
|
||||
documentFormat: DocumentFormat.jpeg,
|
||||
mode: ScannerMode.base,
|
||||
pageLimit: 1,
|
||||
isGalleryImport: false,
|
||||
);
|
||||
|
||||
if (pictures != null && pictures.isNotEmpty) {
|
||||
setState(() => _selectedImagePath = pictures.first);
|
||||
final scanner = DocumentScanner(options: options);
|
||||
final documents = await scanner.scanDocument();
|
||||
|
||||
if (documents.images.isNotEmpty) {
|
||||
setState(() => _selectedImagePath = documents.images.first);
|
||||
}
|
||||
} catch (e) {
|
||||
if (mounted) {
|
||||
|
||||
Reference in New Issue
Block a user