From 23d9a1211caf8f3d6e42066ea90a7c518fc0f860 Mon Sep 17 00:00:00 2001 From: yaso-meth Date: Tue, 3 Sep 2024 10:12:25 +0200 Subject: [PATCH] fix multiple api calles to get profile picture --- Frontend/patient_manager/lib/pages/home.dart | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Frontend/patient_manager/lib/pages/home.dart b/Frontend/patient_manager/lib/pages/home.dart index b4f4d88f..c50c05a5 100644 --- a/Frontend/patient_manager/lib/pages/home.dart +++ b/Frontend/patient_manager/lib/pages/home.dart @@ -70,7 +70,12 @@ class _HomeState extends State { } else { busData = null; } - + getFileUrlApiCall(userData).then((results) { + setState(() { + proPicUrl = results; + propicFile = NetworkImage(proPicUrl); + }); + }); return BusinessArguments(userData, bUserData, busData); } @@ -163,13 +168,6 @@ class _HomeState extends State { builder: (BuildContext context, snapshot) { if (snapshot.connectionState == ConnectionState.done) { if (snapshot.hasData) { - getFileUrlApiCall(snapshot.requireData.signedInUser) - .then((results) { - setState(() { - proPicUrl = results; - propicFile = NetworkImage(proPicUrl); - }); - }); return HomeTileGrid( signedInUser: snapshot.requireData.signedInUser, businessUser: snapshot.data!.businessUser,