- Dockerfile optimisé avec build multi-stage - Configuration nginx pour ynov.ptits-pas.fr - Correction URL API: supernounou.local → ynov.ptits-pas.fr/api - Support SPA avec try_files pour Flutter routing
28 lines
760 B
Dart
28 lines
760 B
Dart
import 'package:http/http.dart' as http;
|
|
import 'dart:convert';
|
|
|
|
class BugReportService {
|
|
static const String _apiUrl = 'https://ynov.ptits-pas.fr/api/bug-reports';
|
|
|
|
static Future<void> sendReport(String description) async {
|
|
try {
|
|
final response = await http.post(
|
|
Uri.parse(_apiUrl),
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
},
|
|
body: jsonEncode({
|
|
'description': description,
|
|
'timestamp': DateTime.now().toIso8601String(),
|
|
'platform': 'web', // TODO: Ajouter la détection de la plateforme
|
|
}),
|
|
);
|
|
|
|
if (response.statusCode != 200) {
|
|
throw Exception('Erreur lors de l\'envoi du rapport');
|
|
}
|
|
} catch (e) {
|
|
rethrow;
|
|
}
|
|
}
|
|
} |