feat: implement autoregulation for kettlebell training

This commit is contained in:
Patryk Hegenberg 2025-06-22 17:07:56 +02:00
parent a3e36b1975
commit 4fac48e81e
9 changed files with 417 additions and 117 deletions

View file

@ -9,17 +9,19 @@ Future<void> sendTrainingToBackend({
required int sets,
}) async {
final uuid = await DeviceIdService.getOrCreateUUID();
final url = Uri.parse('http://192.169.178.43:8000/trainings/');
final response = await http.post(
url,
headers: {'Content-Type': 'application/json'},
body: jsonEncode({
'reps': reps,
'rest': rest,
'sets': sets,
'uuid': uuid,
}),
);
final url = Uri.parse('http://192.169.178.43:8080/trainings/');
final response = await http
.post(
url,
headers: {'Content-Type': 'application/json'},
body: jsonEncode({
'reps': reps,
'rest': rest,
'sets': sets,
'uuid': uuid,
}),
)
.timeout(const Duration(seconds: 5));
if (response.statusCode == 200) {
print('Training erfolgreich an Backend gesendet.');
} else {