branch backend + ajout du serveur backend, next, et sqlite
This commit is contained in:
@@ -15,6 +15,7 @@ import '../../data/repositories/session_repository.dart';
|
||||
import '../../services/target_detection_service.dart';
|
||||
import '../../services/score_calculator_service.dart';
|
||||
import '../../services/grouping_analyzer_service.dart';
|
||||
import '../../services/wallet_identity_service.dart';
|
||||
import 'analysis_provider.dart';
|
||||
import 'widgets/target_overlay.dart';
|
||||
import 'widgets/target_calibration.dart';
|
||||
@@ -133,6 +134,47 @@ class _AnalysisScreenContentState extends State<_AnalysisScreenContent> {
|
||||
);
|
||||
},
|
||||
),
|
||||
FutureBuilder<bool>(
|
||||
future: WalletIdentityService().isUploadEnabled(),
|
||||
builder: (context, snapshot) {
|
||||
final isEnabled = snapshot.data ?? false;
|
||||
if (!isEnabled) return const SizedBox.shrink();
|
||||
|
||||
return IconButton(
|
||||
icon: const Icon(Icons.cloud_upload),
|
||||
onPressed: () async {
|
||||
final provider = context.read<AnalysisProvider>();
|
||||
if (provider.state != AnalysisState.success) return;
|
||||
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Exportation en cours...')),
|
||||
);
|
||||
|
||||
final success = await provider.exportToAiBackend();
|
||||
|
||||
if (context.mounted) {
|
||||
ScaffoldMessenger.of(context).hideCurrentSnackBar();
|
||||
if (success) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('Export réussi vers le backend IA !'),
|
||||
backgroundColor: AppTheme.successColor,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(provider.errorMessage ?? 'Erreur d\'export'),
|
||||
backgroundColor: AppTheme.errorColor,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
tooltip: 'Exporter pour IA',
|
||||
);
|
||||
},
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.help_outline),
|
||||
onPressed: () => _showHelpDialog(context),
|
||||
|
||||
Reference in New Issue
Block a user