From 943895accbc50b5093135ed0247d5a29c8b94539 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Sun, 23 Jun 2024 15:11:35 +0200 Subject: [PATCH] decode utf8 --- covas_mobile/android/build.gradle | 2 +- covas_mobile/lib/MyHomePage.dart | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/covas_mobile/android/build.gradle b/covas_mobile/android/build.gradle index 83ae220..3cdaac9 100644 --- a/covas_mobile/android/build.gradle +++ b/covas_mobile/android/build.gradle @@ -26,6 +26,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/covas_mobile/lib/MyHomePage.dart b/covas_mobile/lib/MyHomePage.dart index eb641e0..95879f8 100644 --- a/covas_mobile/lib/MyHomePage.dart +++ b/covas_mobile/lib/MyHomePage.dart @@ -66,17 +66,17 @@ class _MyHomePageState extends State with ShowErrorDialog { String former = ""; if (accessToken.isNotEmpty) { - var urlGet = Uri.parse("http://${globals.api}/users"); + var urlGet = Uri.parse("http://${globals.api}/events"); var responseGet = await http.get(urlGet, headers: {HttpHeaders.cookieHeader: 'access_token=${accessToken}'}); stderr.writeln('Response Get status: ${responseGet.statusCode}'); if (responseGet.statusCode == 200) { stderr.writeln('Username : ${responseGet.body}'); - var json = jsonDecode(responseGet.body); + var json = jsonDecode(utf8.decode(responseGet.bodyBytes)); for (var user in json) { - stderr.writeln('email : ${user['email']}'); - former = "$former\n ${user['email']}"; + stderr.writeln('name : ${user['name']}'); + former = "$former\n ${user['name']} : ${user["place"]}"; } } else { var text = "";