nettoyage du code avec cunning

This commit is contained in:
2026-02-14 22:33:35 +01:00
parent 7e55c52ae7
commit f78184d2cd
8 changed files with 406 additions and 38 deletions

View File

@@ -274,6 +274,68 @@ class _AnalysisScreenContentState extends State<_AnalysisScreenContent> {
),
child: Column(
children: [
// Auto-calibrate button
SizedBox(
width: double.infinity,
child: ElevatedButton.icon(
onPressed: () async {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Row(
children: [
SizedBox(
width: 20,
height: 20,
child: CircularProgressIndicator(
strokeWidth: 2,
color: Colors.white,
),
),
SizedBox(width: 12),
Text('Auto-calibration en cours...'),
],
),
duration: Duration(seconds: 2),
),
);
final success = await provider
.autoCalibrateTarget();
if (context.mounted) {
ScaffoldMessenger.of(
context,
).hideCurrentSnackBar();
if (success) {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text(
'Cible calibrée automatiquement',
),
backgroundColor: AppTheme.successColor,
),
);
} else {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text(
'Échec de la calibration auto',
),
backgroundColor: AppTheme.errorColor,
),
);
}
}
},
icon: const Icon(Icons.auto_fix_high),
label: const Text('Auto-Calibrer la Cible'),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.deepPurple,
foregroundColor: Colors.white,
),
),
),
const SizedBox(height: 16),
// Ring count slider
Row(
children: [