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