fix multiple api calles to get profile picture

This commit is contained in:
2024-09-03 10:12:25 +02:00
parent 7cfc1fa28e
commit 23d9a1211c

View File

@@ -70,7 +70,12 @@ class _HomeState extends State<Home> {
} 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<Home> {
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,