feat: mise en place du projet et création de la page de login

This commit is contained in:
Julien Martin
2025-05-02 21:30:31 +02:00
parent d5015b9c42
commit d3663a28ad
91 changed files with 9494 additions and 191 deletions
@@ -0,0 +1,28 @@
import 'package:http/http.dart' as http;
import 'dart:convert';
class BugReportService {
static const String _apiUrl = 'https://api.supernounou.local/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;
}
}
}