remove old file get api use
This commit is contained in:
parent
8912e77b03
commit
d7e4ac134d
19 changed files with 80 additions and 109 deletions
|
|
@ -57,8 +57,6 @@ class _MihLinuxInstallInstructionsState
|
|||
MihSnackBar(
|
||||
child: Text('Command copied to clipboard!'),
|
||||
),
|
||||
// const SnackBar(
|
||||
// content: Text('Command copied to clipboard!')),
|
||||
);
|
||||
},
|
||||
tooltip: 'Copy command',
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import 'package:mzansi_innovation_hub/mih_providers/mzansi_directory_provider.da
|
|||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_alert_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_business_details_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_file_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_mzansi_directory_services.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
|
|
@ -34,15 +33,11 @@ class _MihAddBookmarkAlertState extends State<MihAddBookmarkAlert> {
|
|||
directoryProvider,
|
||||
);
|
||||
List<Business> favBus = [];
|
||||
Map<String, Future<String>> favBusImages = {};
|
||||
Future<String> businessLogoUrl;
|
||||
for (var bus in directoryProvider.bookmarkedBusinesses) {
|
||||
await MihBusinessDetailsServices()
|
||||
.getBusinessDetailsByBusinessId(bus.business_id)
|
||||
.then((business) async {
|
||||
favBus.add(business!);
|
||||
businessLogoUrl = MihFileApi.getMinioFileUrl(business.logo_path);
|
||||
favBusImages[business.business_id] = businessLogoUrl;
|
||||
});
|
||||
}
|
||||
directoryProvider.setFavouriteBusinesses(
|
||||
|
|
|
|||
|
|
@ -39,15 +39,11 @@ class _MihDeleteBookmarkAlertState extends State<MihDeleteBookmarkAlert> {
|
|||
directoryProvider,
|
||||
);
|
||||
List<Business> favBus = [];
|
||||
Map<String, Future<String>> favBusImages = {};
|
||||
Future<String> businessLogoUrl;
|
||||
for (var bus in directoryProvider.bookmarkedBusinesses) {
|
||||
await MihBusinessDetailsServices()
|
||||
.getBusinessDetailsByBusinessId(bus.business_id)
|
||||
.then((business) async {
|
||||
favBus.add(business!);
|
||||
businessLogoUrl = MihFileApi.getMinioFileUrl(business.logo_path);
|
||||
favBusImages[business.business_id] = businessLogoUrl;
|
||||
});
|
||||
}
|
||||
directoryProvider.setFavouriteBusinesses(
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ class _MihBusinessDetailsSetUpState extends State<MihBusinessDetailsSetUp> {
|
|||
bool successUpload =
|
||||
await uploadFile(mzansiProfileProvider, newSelectedLogoPic);
|
||||
if (successUpload) {
|
||||
String logoUrl = await MihFileApi.getMinioFileUrl(
|
||||
String logoUrl = MihFileApi.getMinioFileUrlV2(
|
||||
mzansiProfileProvider.business!.logo_path);
|
||||
mzansiProfileProvider.setBusinessProfilePicUrl(logoUrl);
|
||||
}
|
||||
|
|
@ -110,7 +110,7 @@ class _MihBusinessDetailsSetUpState extends State<MihBusinessDetailsSetUp> {
|
|||
bool successUpload =
|
||||
await uploadFile(mzansiProfileProvider, newSelectedSignaturePic);
|
||||
if (successUpload) {
|
||||
String sigUrl = await MihFileApi.getMinioFileUrl(
|
||||
String sigUrl = MihFileApi.getMinioFileUrlV2(
|
||||
mzansiProfileProvider.businessUser!.sig_path);
|
||||
mzansiProfileProvider.setBusinessUserSignatureUrl(sigUrl);
|
||||
String message =
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ class MihBusinessDetailsView extends StatefulWidget {
|
|||
}
|
||||
|
||||
class _MihBusinessDetailsViewState extends State<MihBusinessDetailsView> {
|
||||
late Future<String> futureImageUrl;
|
||||
PlatformFile? file;
|
||||
|
||||
@override
|
||||
|
|
@ -35,10 +34,6 @@ class _MihBusinessDetailsViewState extends State<MihBusinessDetailsView> {
|
|||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
MzansiDirectoryProvider directoryProvider =
|
||||
context.read<MzansiDirectoryProvider>();
|
||||
futureImageUrl = MihFileApi.getMinioFileUrl(
|
||||
directoryProvider.selectedBusiness!.logo_path);
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ class MihBusinessQrCode extends StatefulWidget {
|
|||
}
|
||||
|
||||
class _MihBusinessQrCodeState extends State<MihBusinessQrCode> {
|
||||
late Future<String> futureImageUrl;
|
||||
late Business business;
|
||||
PlatformFile? file;
|
||||
late String qrCodedata;
|
||||
|
|
@ -313,7 +312,6 @@ class _MihBusinessQrCodeState extends State<MihBusinessQrCode> {
|
|||
business = profileProvider.business!;
|
||||
}
|
||||
_checkUserSession();
|
||||
futureImageUrl = MihFileApi.getMinioFileUrl(business.logo_path);
|
||||
qrCodedata = "${AppEnviroment.baseAppUrl}/business-profile/view/";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ class MihPersonalProfileView extends StatefulWidget {
|
|||
}
|
||||
|
||||
class _MihPersonalProfileViewState extends State<MihPersonalProfileView> {
|
||||
late Future<String> futureImageUrl;
|
||||
late Future<List<ProfileLink>> futureLinks;
|
||||
PlatformFile? file;
|
||||
|
||||
|
|
@ -40,8 +39,6 @@ class _MihPersonalProfileViewState extends State<MihPersonalProfileView> {
|
|||
super.initState();
|
||||
MzansiDirectoryProvider directoryProvider =
|
||||
context.read<MzansiDirectoryProvider>();
|
||||
futureImageUrl = MihFileApi.getMinioFileUrl(
|
||||
directoryProvider.selectedUser!.pro_pic_path);
|
||||
futureLinks = MihProfileLinksServices.getUserProfileLinksMD(
|
||||
directoryProvider, directoryProvider.selectedUser!.app_id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ class MihPersonalQrCode extends StatefulWidget {
|
|||
|
||||
class _MihPersonalQrCodeState extends State<MihPersonalQrCode> {
|
||||
late AppUser user;
|
||||
late Future<String> futureImageUrl;
|
||||
PlatformFile? file;
|
||||
int qrSize = 500;
|
||||
ScreenshotController screenshotController = ScreenshotController();
|
||||
|
|
@ -310,7 +309,6 @@ class _MihPersonalQrCodeState extends State<MihPersonalQrCode> {
|
|||
user = profileProvider.user!;
|
||||
}
|
||||
_checkUserSession();
|
||||
futureImageUrl = MihFileApi.getMinioFileUrl(user.pro_pic_path);
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
|||
|
|
@ -444,7 +444,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);
|
||||
String url = MihFileApi.getMinioFileUrlV2(user!.pro_pic_path);
|
||||
patientManagerProvider.setSelectedPatientProfilePicUrl(url);
|
||||
});
|
||||
patientProfileChoicePopUp(
|
||||
|
|
|
|||
|
|
@ -38,16 +38,16 @@ class _BuildClaimStatementFileListState
|
|||
int progress = 0;
|
||||
late StreamSubscription progressStream;
|
||||
|
||||
Future<String> getFileUrlApiCall(String filePath) async {
|
||||
String teporaryFileUrl = "";
|
||||
await MihFileApi.getMinioFileUrl(
|
||||
filePath,
|
||||
).then((value) {
|
||||
teporaryFileUrl = value;
|
||||
});
|
||||
return teporaryFileUrl;
|
||||
}
|
||||
|
||||
// Future<String> getFileUrlApiCall(String filePath) async {
|
||||
// String teporaryFileUrl = "";
|
||||
// await MihFileApi.getMinioFileUrl(
|
||||
// filePath,
|
||||
// ).then((value) {
|
||||
// teporaryFileUrl = value;
|
||||
// });
|
||||
// return teporaryFileUrl;
|
||||
// }
|
||||
//
|
||||
String getFileName(String path) {
|
||||
//print(pdfLink.split(".")[1]);
|
||||
return path.split("/").last;
|
||||
|
|
@ -282,14 +282,13 @@ class _BuildClaimStatementFileListState
|
|||
onTap: () async {
|
||||
MihFileViewerProvider fileViewerProvider =
|
||||
context.read<MihFileViewerProvider>();
|
||||
await getFileUrlApiCall(patientManagerProvider
|
||||
.patientClaimsDocuments![index].file_path)
|
||||
.then((urlHere) {
|
||||
//print(url);
|
||||
fileViewerProvider.setFilePath(patientManagerProvider
|
||||
.patientClaimsDocuments![index].file_path);
|
||||
fileViewerProvider.setFileLink(urlHere);
|
||||
});
|
||||
String fileUrl = MihFileApi.getMinioFileUrlV2(
|
||||
patientManagerProvider
|
||||
.patientClaimsDocuments![index].file_path);
|
||||
//print(url);
|
||||
fileViewerProvider.setFilePath(patientManagerProvider
|
||||
.patientClaimsDocuments![index].file_path);
|
||||
fileViewerProvider.setFileLink(fileUrl);
|
||||
|
||||
viewFilePopUp(
|
||||
patientManagerProvider,
|
||||
|
|
|
|||
|
|
@ -38,16 +38,16 @@ class _BuildFilesListState extends State<BuildFilesList> {
|
|||
int progress = 0;
|
||||
late StreamSubscription progressStream;
|
||||
|
||||
Future<String> getFileUrlApiCall(String filePath) async {
|
||||
String teporaryFileUrl = "";
|
||||
await MihFileApi.getMinioFileUrl(
|
||||
filePath,
|
||||
).then((value) {
|
||||
teporaryFileUrl = value;
|
||||
});
|
||||
return teporaryFileUrl;
|
||||
}
|
||||
|
||||
// Future<String> getFileUrlApiCall(String filePath) async {
|
||||
// String teporaryFileUrl = "";
|
||||
// await MihFileApi.getMinioFileUrl(
|
||||
// filePath,
|
||||
// ).then((value) {
|
||||
// teporaryFileUrl = value;
|
||||
// });
|
||||
// return teporaryFileUrl;
|
||||
// }
|
||||
//
|
||||
String getFileName(String path) {
|
||||
//print(pdfLink.split(".")[1]);
|
||||
return path.split("/").last;
|
||||
|
|
@ -309,14 +309,13 @@ class _BuildFilesListState extends State<BuildFilesList> {
|
|||
onTap: () async {
|
||||
MihFileViewerProvider fileViewerProvider =
|
||||
context.read<MihFileViewerProvider>();
|
||||
await getFileUrlApiCall(patientManagerProvider
|
||||
.patientDocuments![index].file_path)
|
||||
.then((urlHere) {
|
||||
//print(url);
|
||||
fileViewerProvider.setFilePath(patientManagerProvider
|
||||
.patientDocuments![index].file_path);
|
||||
fileViewerProvider.setFileLink(urlHere);
|
||||
});
|
||||
String fileUrl = MihFileApi.getMinioFileUrlV2(
|
||||
patientManagerProvider
|
||||
.patientDocuments![index].file_path);
|
||||
//print(url);
|
||||
fileViewerProvider.setFilePath(patientManagerProvider
|
||||
.patientDocuments![index].file_path);
|
||||
fileViewerProvider.setFileLink(fileUrl);
|
||||
viewFilePopUp(
|
||||
patientManagerProvider,
|
||||
patientManagerProvider.patientDocuments![index].file_name,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:ken_logger/ken_logger.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||
|
|
@ -61,12 +62,9 @@ class _PatientDocumentsState extends State<PatientDocuments> {
|
|||
int statusCode =
|
||||
await MihPatientServices().addPatientFile(file, patientManagerProvider);
|
||||
if (statusCode == 201) {
|
||||
setState(() {
|
||||
selectedFileController.clear();
|
||||
});
|
||||
var fname = file!.name.replaceAll(RegExp(r' '), '-');
|
||||
// end loading circle
|
||||
Navigator.of(context).pop();
|
||||
context.pop();
|
||||
String message =
|
||||
"The file $fname has been successfully generated and added to ${patientManagerProvider.selectedPatient!.first_name} ${patientManagerProvider.selectedPatient!.last_name}'s record. You can now access and download it for their use.";
|
||||
successPopUp("Successfully Uplouded File", message);
|
||||
|
|
@ -77,6 +75,8 @@ class _PatientDocumentsState extends State<PatientDocuments> {
|
|||
|
||||
Future<void> uploadSelectedFile(
|
||||
PatientManagerProvider patientManagerProvider, PlatformFile? file) async {
|
||||
KenLogger.success(
|
||||
"Patient app id: ${patientManagerProvider.selectedPatient!.app_id}");
|
||||
var response = await MihFileApi.uploadFile(
|
||||
patientManagerProvider.selectedPatient!.app_id,
|
||||
env,
|
||||
|
|
@ -84,6 +84,7 @@ class _PatientDocumentsState extends State<PatientDocuments> {
|
|||
file,
|
||||
context,
|
||||
);
|
||||
KenLogger.success("Response code: $response");
|
||||
if (response == 200) {
|
||||
await addPatientFileLocationToDB(patientManagerProvider, file);
|
||||
} else {
|
||||
|
|
@ -462,6 +463,9 @@ class _PatientDocumentsState extends State<PatientDocuments> {
|
|||
onPressed: () {
|
||||
context.pop();
|
||||
context.pop();
|
||||
setState(() {
|
||||
selectedFileController.clear();
|
||||
});
|
||||
},
|
||||
buttonColor: MihColors.primary(),
|
||||
elevation: 10,
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class _PatientProfileState extends State<PatientProfile> {
|
|||
AppUser? patientUserDetails = await MihUserServices().getMIHUserDetails(
|
||||
patientManagerProvider.selectedPatient!.app_id, context);
|
||||
String patientProPicUrl =
|
||||
await MihFileApi.getMinioFileUrl(patientUserDetails!.pro_pic_path);
|
||||
MihFileApi.getMinioFileUrlV2(patientUserDetails!.pro_pic_path);
|
||||
patientManagerProvider.setSelectedPatientProfilePicUrl(patientProPicUrl);
|
||||
}
|
||||
patientManagerProvider.setPersonalMode(mzansiProfileProvider.personalHome);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue