QOL: Update file service
This commit is contained in:
@@ -52,8 +52,7 @@ class _MihBusinessProfilePreviewState extends State<MihBusinessProfilePreview> {
|
|||||||
return Row(
|
return Row(
|
||||||
children: [
|
children: [
|
||||||
FutureBuilder(
|
FutureBuilder(
|
||||||
future: MihFileApi.getMinioFileUrl(
|
future: MihFileApi.getMinioFileUrl(widget.business.logo_path),
|
||||||
widget.business.logo_path, context),
|
|
||||||
builder: (context, asyncSnapshot) {
|
builder: (context, asyncSnapshot) {
|
||||||
if (asyncSnapshot.connectionState == ConnectionState.done &&
|
if (asyncSnapshot.connectionState == ConnectionState.done &&
|
||||||
asyncSnapshot.hasData) {
|
asyncSnapshot.hasData) {
|
||||||
|
|||||||
@@ -27,8 +27,7 @@ class _MihPersonalProfilePreviewState extends State<MihPersonalProfilePreview> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
futureImageUrl =
|
futureImageUrl = MihFileApi.getMinioFileUrl(widget.user.pro_pic_path);
|
||||||
MihFileApi.getMinioFileUrl(widget.user.pro_pic_path, context);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@@ -96,14 +96,12 @@ class _MihHomeState extends State<MihHome> {
|
|||||||
// Business Profile Set Up aleary
|
// Business Profile Set Up aleary
|
||||||
logoUrl = await MihFileApi.getMinioFileUrl(
|
logoUrl = await MihFileApi.getMinioFileUrl(
|
||||||
context.read<MzansiProfileProvider>().business!.logo_path,
|
context.read<MzansiProfileProvider>().business!.logo_path,
|
||||||
context,
|
|
||||||
);
|
);
|
||||||
context.read<MzansiProfileProvider>().setBusinessProfilePicUrl(logoUrl);
|
context.read<MzansiProfileProvider>().setBusinessProfilePicUrl(logoUrl);
|
||||||
// Get Business User
|
// Get Business User
|
||||||
await MihMyBusinessUserServices().getBusinessUser(context);
|
await MihMyBusinessUserServices().getBusinessUser(context);
|
||||||
signatureUrl = await MihFileApi.getMinioFileUrl(
|
signatureUrl = await MihFileApi.getMinioFileUrl(
|
||||||
context.read<MzansiProfileProvider>().businessUser!.sig_path,
|
context.read<MzansiProfileProvider>().businessUser!.sig_path,
|
||||||
context,
|
|
||||||
);
|
);
|
||||||
context
|
context
|
||||||
.read<MzansiProfileProvider>()
|
.read<MzansiProfileProvider>()
|
||||||
@@ -184,7 +182,6 @@ class _MihHomeState extends State<MihHome> {
|
|||||||
if (!mounted) return;
|
if (!mounted) return;
|
||||||
url = await MihFileApi.getMinioFileUrl(
|
url = await MihFileApi.getMinioFileUrl(
|
||||||
context.read<MzansiProfileProvider>().user!.pro_pic_path,
|
context.read<MzansiProfileProvider>().user!.pro_pic_path,
|
||||||
context,
|
|
||||||
);
|
);
|
||||||
context.read<MzansiProfileProvider>().setUserProfilePicUrl(url);
|
context.read<MzansiProfileProvider>().setUserProfilePicUrl(url);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class _MihMineSweeperLeaderBoardState extends State<MihMineSweeperLeaderBoard> {
|
|||||||
List<ImageProvider<Object>?> userPictures = [];
|
List<ImageProvider<Object>?> userPictures = [];
|
||||||
String userPicUrl = "";
|
String userPicUrl = "";
|
||||||
for (final ranking in mineSweeperProvider.leaderboard!) {
|
for (final ranking in mineSweeperProvider.leaderboard!) {
|
||||||
userPicUrl = await MihFileApi.getMinioFileUrl(ranking.proPicUrl, context);
|
userPicUrl = await MihFileApi.getMinioFileUrl(ranking.proPicUrl);
|
||||||
userPictures.add(NetworkImage(userPicUrl));
|
userPictures.add(NetworkImage(userPicUrl));
|
||||||
}
|
}
|
||||||
mineSweeperProvider.setLeaderboardUserPictures(
|
mineSweeperProvider.setLeaderboardUserPictures(
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ class _MihBusinessDetailsSetUpState extends State<MihBusinessDetailsSetUp> {
|
|||||||
await uploadFile(mzansiProfileProvider, newSelectedLogoPic);
|
await uploadFile(mzansiProfileProvider, newSelectedLogoPic);
|
||||||
if (successUpload) {
|
if (successUpload) {
|
||||||
String logoUrl = await MihFileApi.getMinioFileUrl(
|
String logoUrl = await MihFileApi.getMinioFileUrl(
|
||||||
mzansiProfileProvider.business!.logo_path, context);
|
mzansiProfileProvider.business!.logo_path);
|
||||||
mzansiProfileProvider.setBusinessProfilePicUrl(logoUrl);
|
mzansiProfileProvider.setBusinessProfilePicUrl(logoUrl);
|
||||||
}
|
}
|
||||||
await createBusinessUserAPICall(mzansiProfileProvider);
|
await createBusinessUserAPICall(mzansiProfileProvider);
|
||||||
@@ -123,7 +123,7 @@ class _MihBusinessDetailsSetUpState extends State<MihBusinessDetailsSetUp> {
|
|||||||
await uploadFile(mzansiProfileProvider, newSelectedSignaturePic);
|
await uploadFile(mzansiProfileProvider, newSelectedSignaturePic);
|
||||||
if (successUpload) {
|
if (successUpload) {
|
||||||
String sigUrl = await MihFileApi.getMinioFileUrl(
|
String sigUrl = await MihFileApi.getMinioFileUrl(
|
||||||
mzansiProfileProvider.businessUser!.sig_path, context);
|
mzansiProfileProvider.businessUser!.sig_path);
|
||||||
mzansiProfileProvider.setBusinessUserSignatureUrl(sigUrl);
|
mzansiProfileProvider.setBusinessUserSignatureUrl(sigUrl);
|
||||||
String message =
|
String message =
|
||||||
"Your business profile is now live! You can now start connecting with customers and growing your business.";
|
"Your business profile is now live! You can now start connecting with customers and growing your business.";
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class _MihBusinessDetailsViewState extends State<MihBusinessDetailsView> {
|
|||||||
MzansiDirectoryProvider directoryProvider =
|
MzansiDirectoryProvider directoryProvider =
|
||||||
context.read<MzansiDirectoryProvider>();
|
context.read<MzansiDirectoryProvider>();
|
||||||
futureImageUrl = MihFileApi.getMinioFileUrl(
|
futureImageUrl = MihFileApi.getMinioFileUrl(
|
||||||
directoryProvider.selectedBusiness!.logo_path, context);
|
directoryProvider.selectedBusiness!.logo_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@@ -344,7 +344,7 @@ class _MihBusinessQrCodeState extends State<MihBusinessQrCode> {
|
|||||||
business = profileProvider.business!;
|
business = profileProvider.business!;
|
||||||
}
|
}
|
||||||
_checkUserSession();
|
_checkUserSession();
|
||||||
futureImageUrl = MihFileApi.getMinioFileUrl(business.logo_path, context);
|
futureImageUrl = MihFileApi.getMinioFileUrl(business.logo_path);
|
||||||
qrCodedata =
|
qrCodedata =
|
||||||
"${AppEnviroment.baseAppUrl}/business-profile/view?business_id=";
|
"${AppEnviroment.baseAppUrl}/business-profile/view?business_id=";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class _MihPersonalProfileViewState extends State<MihPersonalProfileView> {
|
|||||||
MzansiDirectoryProvider directoryProvider =
|
MzansiDirectoryProvider directoryProvider =
|
||||||
context.read<MzansiDirectoryProvider>();
|
context.read<MzansiDirectoryProvider>();
|
||||||
futureImageUrl = MihFileApi.getMinioFileUrl(
|
futureImageUrl = MihFileApi.getMinioFileUrl(
|
||||||
directoryProvider.selectedUser!.pro_pic_path, context);
|
directoryProvider.selectedUser!.pro_pic_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@@ -531,8 +531,7 @@ class _BuildPatientsListState extends State<BuildMyPatientListList> {
|
|||||||
patientManagerProvider.myPaitentList![index].app_id, context)
|
patientManagerProvider.myPaitentList![index].app_id, context)
|
||||||
.then((user) async {
|
.then((user) async {
|
||||||
user;
|
user;
|
||||||
String url =
|
String url = await MihFileApi.getMinioFileUrl(user!.pro_pic_path);
|
||||||
await MihFileApi.getMinioFileUrl(user!.pro_pic_path, context);
|
|
||||||
patientManagerProvider.setSelectedPatientProfilePicUrl(url);
|
patientManagerProvider.setSelectedPatientProfilePicUrl(url);
|
||||||
});
|
});
|
||||||
patientProfileChoicePopUp(
|
patientProfileChoicePopUp(
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ class _BuildClaimStatementFileListState
|
|||||||
String teporaryFileUrl = "";
|
String teporaryFileUrl = "";
|
||||||
await MihFileApi.getMinioFileUrl(
|
await MihFileApi.getMinioFileUrl(
|
||||||
filePath,
|
filePath,
|
||||||
context,
|
|
||||||
).then((value) {
|
).then((value) {
|
||||||
teporaryFileUrl = value;
|
teporaryFileUrl = value;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ class _BuildFilesListState extends State<BuildFilesList> {
|
|||||||
String teporaryFileUrl = "";
|
String teporaryFileUrl = "";
|
||||||
await MihFileApi.getMinioFileUrl(
|
await MihFileApi.getMinioFileUrl(
|
||||||
filePath,
|
filePath,
|
||||||
context,
|
|
||||||
).then((value) {
|
).then((value) {
|
||||||
teporaryFileUrl = value;
|
teporaryFileUrl = value;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ class MihBusinessDetailsServices {
|
|||||||
businessMissionVision,
|
businessMissionVision,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
String newProPicUrl = await MihFileApi.getMinioFileUrl(filePath, context);
|
String newProPicUrl = await MihFileApi.getMinioFileUrl(filePath);
|
||||||
provider.setBusinessProfilePicUrl(newProPicUrl);
|
provider.setBusinessProfilePicUrl(newProPicUrl);
|
||||||
return 200;
|
return 200;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ class MihFileApi {
|
|||||||
|
|
||||||
static Future<String> getMinioFileUrl(
|
static Future<String> getMinioFileUrl(
|
||||||
String filePath,
|
String filePath,
|
||||||
BuildContext context,
|
|
||||||
) async {
|
) async {
|
||||||
// loadingPopUp(context);
|
// loadingPopUp(context);
|
||||||
// print("here");
|
// print("here");
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ class MihMyBusinessUserServices {
|
|||||||
bUserAccess,
|
bUserAccess,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
String newProPicUrl = await MihFileApi.getMinioFileUrl(filePath, context);
|
String newProPicUrl = await MihFileApi.getMinioFileUrl(filePath);
|
||||||
provider.setBusinessUserSignatureUrl(newProPicUrl);
|
provider.setBusinessUserSignatureUrl(newProPicUrl);
|
||||||
return 200;
|
return 200;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ class MihUserServices {
|
|||||||
purpose,
|
purpose,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
String newProPicUrl = await MihFileApi.getMinioFileUrl(filePath, context);
|
String newProPicUrl = await MihFileApi.getMinioFileUrl(filePath);
|
||||||
context.read<MzansiProfileProvider>().setUserProfilePicUrl(newProPicUrl);
|
context.read<MzansiProfileProvider>().setUserProfilePicUrl(newProPicUrl);
|
||||||
return response.statusCode;
|
return response.statusCode;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user