fix error when profile picture is not given
This commit is contained in:
BIN
Frontend/patient_manager/images/i-dont-know-2.png
Normal file
BIN
Frontend/patient_manager/images/i-dont-know-2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
BIN
Frontend/patient_manager/images/i-dont-know.png
Normal file
BIN
Frontend/patient_manager/images/i-dont-know.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
@@ -98,6 +98,17 @@ class _HomeState extends State<Home> {
|
|||||||
return HomeArguments(userData, bUserData, busData, userPic);
|
return HomeArguments(userData, bUserData, busData, userPic);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImageProvider<Object>? isPictureAvailable(String url) {
|
||||||
|
if (url == "") {
|
||||||
|
return const AssetImage('images/i-dont-know-2.png');
|
||||||
|
} else if (url != "") {
|
||||||
|
return NetworkImage(url);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// <a href="https://www.flaticon.com/free-icons/dont-know" title="dont know icons">Dont know icons created by Freepik - Flaticon</a>
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
// TODO: implement dispose
|
// TODO: implement dispose
|
||||||
@@ -121,7 +132,7 @@ class _HomeState extends State<Home> {
|
|||||||
signedInUser: snapshot.requireData.signedInUser,
|
signedInUser: snapshot.requireData.signedInUser,
|
||||||
businessUser: snapshot.data!.businessUser,
|
businessUser: snapshot.data!.businessUser,
|
||||||
business: snapshot.data!.business,
|
business: snapshot.data!.business,
|
||||||
propicFile: NetworkImage(snapshot.data!.profilePicUrl),
|
propicFile: isPictureAvailable(snapshot.data!.profilePicUrl),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return Center(
|
return Center(
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ class _ProfileUserUpdateState extends State<ProfileUserUpdate> {
|
|||||||
radius: 50,
|
radius: 50,
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 110,
|
width: 120,
|
||||||
child: Image(image: logoFrame),
|
child: Image(image: logoFrame),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user