Turn bio into IIFE
This commit is contained in:
parent
e788ed03e5
commit
8f9bf91056
|
@ -29,25 +29,25 @@ class UserProfile extends HookWidget {
|
||||||
|
|
||||||
var userViewSnap = useFuture(_userView, preserveState: false);
|
var userViewSnap = useFuture(_userView, preserveState: false);
|
||||||
|
|
||||||
Widget bio;
|
Widget bio = () {
|
||||||
|
if (userViewSnap.hasData) {
|
||||||
if (userViewSnap.hasData) {
|
if (userViewSnap.data.bio != null) {
|
||||||
if (userViewSnap.data.bio != null) {
|
return Padding(
|
||||||
bio = Padding(
|
padding: const EdgeInsets.all(10),
|
||||||
padding: const EdgeInsets.all(10),
|
child: Text(userViewSnap.data.bio),
|
||||||
child: Text(userViewSnap.data.bio),
|
);
|
||||||
);
|
} else {
|
||||||
|
return Center(
|
||||||
|
child: Text(
|
||||||
|
'no bio',
|
||||||
|
style: const TextStyle(fontStyle: FontStyle.italic),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
bio = Center(
|
return Center(child: CircularProgressIndicator());
|
||||||
child: Text(
|
|
||||||
'no bio',
|
|
||||||
style: const TextStyle(fontStyle: FontStyle.italic),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
} else {
|
}();
|
||||||
bio = Center(child: CircularProgressIndicator());
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget tabs() => DefaultTabController(
|
Widget tabs() => DefaultTabController(
|
||||||
length: 3,
|
length: 3,
|
||||||
|
|
Loading…
Reference in New Issue