fix(watch): corrige l'URL serveur et ajoute les tests associes (#186)

Aligne http_api_client.dart avec la config watch (build.gradle.kts,
WatchHeartRateCollector) et couvre le comportement par des tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-31 16:58:07 +02:00
parent 89558808af
commit e7ff1c2a19
5 changed files with 223 additions and 5 deletions

View File

@ -18,6 +18,9 @@ final class HttpApiClient {
defaultValue: '',
);
static const androidEmulatorDefaultBaseUrl = 'http://10.0.2.2:8090';
static const localDefaultBaseUrl = 'http://localhost:8080';
static String get defaultBaseUrl =>
defaultBaseUrlFor(isAndroid: Platform.isAndroid);
@ -30,9 +33,9 @@ final class HttpApiClient {
return configured;
}
if (isAndroid) {
return 'http://10.0.2.2:8080';
return androidEmulatorDefaultBaseUrl;
}
return 'http://localhost:8080';
return localDefaultBaseUrl;
}
final Uri baseUrl;