fix Mzansi profiles QR code in offline mode
This commit is contained in:
parent
d722251d50
commit
003c8b7c0d
3 changed files with 101 additions and 73 deletions
|
|
@ -175,6 +175,8 @@ class _MihBusinessQrCodeState extends State<MihBusinessQrCode> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget displayBusinessQRCode(double profilePictureWidth) {
|
Widget displayBusinessQRCode(double profilePictureWidth) {
|
||||||
|
MzansiProfileProvider profileprovider =
|
||||||
|
context.read<MzansiProfileProvider>();
|
||||||
return Screenshot(
|
return Screenshot(
|
||||||
controller: screenshotController,
|
controller: screenshotController,
|
||||||
child: Material(
|
child: Material(
|
||||||
|
|
@ -193,7 +195,19 @@ class _MihBusinessQrCodeState extends State<MihBusinessQrCode> {
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
FutureBuilder(
|
widget.business == null
|
||||||
|
? MihCircleAvatar(
|
||||||
|
imageFile: profileprovider.businessProfilePicture,
|
||||||
|
width: profilePictureWidth,
|
||||||
|
expandable: true,
|
||||||
|
editable: false,
|
||||||
|
fileNameController: TextEditingController(),
|
||||||
|
userSelectedfile: file,
|
||||||
|
frameColor: MihColors.primary(),
|
||||||
|
backgroundColor: MihColors.secondary(),
|
||||||
|
onChange: () {},
|
||||||
|
)
|
||||||
|
: FutureBuilder(
|
||||||
future: futureImageUrl,
|
future: futureImageUrl,
|
||||||
builder: (context, asyncSnapshot) {
|
builder: (context, asyncSnapshot) {
|
||||||
if (asyncSnapshot.connectionState ==
|
if (asyncSnapshot.connectionState ==
|
||||||
|
|
|
||||||
|
|
@ -231,7 +231,7 @@ class _MihBusinessReviewsState extends State<MihBusinessReviews> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return Center(child: Text('Error'));
|
return Center(child: Text('Error: MIH in Offline Mode'));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -174,6 +174,8 @@ class _MihPersonalQrCodeState extends State<MihPersonalQrCode> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget displayPersonalQRCode(double profilePictureWidth) {
|
Widget displayPersonalQRCode(double profilePictureWidth) {
|
||||||
|
MzansiProfileProvider profileProvider =
|
||||||
|
context.read<MzansiProfileProvider>();
|
||||||
return Screenshot(
|
return Screenshot(
|
||||||
controller: screenshotController,
|
controller: screenshotController,
|
||||||
child: Material(
|
child: Material(
|
||||||
|
|
@ -192,7 +194,19 @@ class _MihPersonalQrCodeState extends State<MihPersonalQrCode> {
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
FutureBuilder(
|
widget.user == null
|
||||||
|
? MihCircleAvatar(
|
||||||
|
imageFile: profileProvider.userProfilePicture,
|
||||||
|
width: profilePictureWidth,
|
||||||
|
expandable: true,
|
||||||
|
editable: false,
|
||||||
|
fileNameController: TextEditingController(),
|
||||||
|
userSelectedfile: file,
|
||||||
|
frameColor: MihColors.primary(),
|
||||||
|
backgroundColor: MihColors.secondary(),
|
||||||
|
onChange: () {},
|
||||||
|
)
|
||||||
|
: FutureBuilder(
|
||||||
future: futureImageUrl,
|
future: futureImageUrl,
|
||||||
builder: (context, asyncSnapshot) {
|
builder: (context, asyncSnapshot) {
|
||||||
if (asyncSnapshot.connectionState ==
|
if (asyncSnapshot.connectionState ==
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue