multiple api calls for profile picture fix

This commit is contained in:
2024-09-03 13:32:33 +02:00
parent a95712b59b
commit 34afc0b42a

View File

@@ -70,6 +70,7 @@ class _HomeState extends State<Home> {
} else {
busData = null;
}
//get profile picture
getFileUrlApiCall(userData).then((results) {
setState(() {
proPicUrl = results;
@@ -157,14 +158,13 @@ class _HomeState extends State<Home> {
@override
void initState() {
profile = getProfile();
super.initState();
}
@override
Widget build(BuildContext context) {
return FutureBuilder(
future: profile,
future: getProfile(),
builder: (BuildContext context, snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
if (snapshot.hasData) {