implementation de cunning pour scanner l'image et la redresser

This commit is contained in:
2026-02-13 22:18:35 +01:00
parent 91fcd931e8
commit 7e55c52ae7
12 changed files with 273 additions and 104 deletions

View File

@@ -119,7 +119,8 @@ class _CropScreenState extends State<CropScreen> {
_viewportSize = Size(constraints.maxWidth, constraints.maxHeight);
// Taille du carré de crop (90% de la plus petite dimension)
_cropSize = math.min(constraints.maxWidth, constraints.maxHeight) * 0.85;
_cropSize =
math.min(constraints.maxWidth, constraints.maxHeight) * 0.85;
// Calculer l'échelle initiale si pas encore fait
if (_scale == 1.0 && _offset == Offset.zero) {
@@ -138,7 +139,7 @@ class _CropScreenState extends State<CropScreen> {
child: Transform(
transform: Matrix4.identity()
..setTranslationRaw(_offset.dx, _offset.dy, 0)
..scale(_scale, _scale, 1.0),
..scale(_scale, _scale),
alignment: Alignment.center,
child: Image.file(
File(widget.imagePath),
@@ -153,10 +154,7 @@ class _CropScreenState extends State<CropScreen> {
// Overlay de recadrage
Positioned.fill(
child: IgnorePointer(
child: CropOverlay(
cropSize: _cropSize,
showGrid: true,
),
child: CropOverlay(cropSize: _cropSize, showGrid: true),
),
),