fix: cadre de centrage au ratio de la photo + bouton calibration Valider

This commit is contained in:
qguillaume
2026-06-16 11:29:08 +02:00
parent 00ae0117c5
commit c4880ccb68
2 changed files with 22 additions and 11 deletions

View File

@@ -268,7 +268,7 @@ class _AnalysisScreenContentState extends State<_AnalysisScreenContent> {
_openImpactEditor(context.read<AnalysisProvider>()); _openImpactEditor(context.read<AnalysisProvider>());
}, },
child: const Text( child: const Text(
'TERMINER', 'VALIDER',
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,

View File

@@ -101,17 +101,28 @@ class _CropScreenState extends State<CropScreen> {
? const Center(child: CircularProgressIndicator(color: Color(0xFF1A73E8))) ? const Center(child: CircularProgressIndicator(color: Color(0xFF1A73E8)))
: Column( : Column(
children: [ children: [
// Zone interactive de crop // Zone interactive de crop. Le cadre épouse le ratio réel de la photo
// (AspectRatio) → la photo le remplit bord à bord, sans bande noire de
// letterbox. La fenêtre de visée carrée reste centrée à l'intérieur.
Expanded( Expanded(
child: Container( child: Padding(
margin: const EdgeInsets.all(20), padding: const EdgeInsets.all(20),
decoration: BoxDecoration( child: Center(
borderRadius: BorderRadius.circular(12), child: AspectRatio(
border: Border.all(color: Colors.white10), aspectRatio: (_imageSize != null && _imageSize!.height > 0)
), ? _imageSize!.width / _imageSize!.height
child: ClipRRect( : 1.0,
borderRadius: BorderRadius.circular(12), child: Container(
child: _imageLoaded ? _buildInteractiveCrop() : const Center(child: CircularProgressIndicator()), decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
border: Border.all(color: Colors.white10),
),
child: ClipRRect(
borderRadius: BorderRadius.circular(12),
child: _imageLoaded ? _buildInteractiveCrop() : const Center(child: CircularProgressIndicator()),
),
),
),
), ),
), ),
), ),