multiple api calls for profile picture fix
This commit is contained in:
parent
a95712b59b
commit
34afc0b42a
1 changed files with 2 additions and 2 deletions
|
|
@ -70,6 +70,7 @@ class _HomeState extends State<Home> {
|
||||||
} else {
|
} else {
|
||||||
busData = null;
|
busData = null;
|
||||||
}
|
}
|
||||||
|
//get profile picture
|
||||||
getFileUrlApiCall(userData).then((results) {
|
getFileUrlApiCall(userData).then((results) {
|
||||||
setState(() {
|
setState(() {
|
||||||
proPicUrl = results;
|
proPicUrl = results;
|
||||||
|
|
@ -157,14 +158,13 @@ class _HomeState extends State<Home> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
profile = getProfile();
|
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return FutureBuilder(
|
return FutureBuilder(
|
||||||
future: profile,
|
future: getProfile(),
|
||||||
builder: (BuildContext context, snapshot) {
|
builder: (BuildContext context, snapshot) {
|
||||||
if (snapshot.connectionState == ConnectionState.done) {
|
if (snapshot.connectionState == ConnectionState.done) {
|
||||||
if (snapshot.hasData) {
|
if (snapshot.hasData) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue