pull/343/head
haroon amjad 2 weeks ago
parent 4972295606
commit adde5c2036

@ -211,10 +211,8 @@ class ApiClientImp implements ApiClient {
}
// body['TokenID'] = "@dm!n";
// body['PatientID'] = 1018977;
// body['PatientID'] = 89754444;
// body['PatientID'] = 5974668;
// body['PatientID'] = 53320;
// body['PatientID'] = 4769748;
// body['PatientTypeID'] = 1;
// body['PatientOutSA'] = 0;
// body['SessionID'] = "45786230487560q";

@ -12,6 +12,7 @@ import 'package:hmg_patient_app_new/features/contact_us/models/resp_models/get_p
import 'package:hmg_patient_app_new/features/contact_us/models/resp_models/get_status_coc_response_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart';
import 'package:hmg_patient_app_new/services/error_handler_service.dart';
import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart';
import 'package:permission_handler/permission_handler.dart';
class ContactUsViewModel extends ChangeNotifier {
@ -308,7 +309,15 @@ class ContactUsViewModel extends ChangeNotifier {
final result = await contactUsRepo.insertCOCItem(requestInsertCOCItem: requestInsertCOCItem, patientSelectedAppointment: patientFeedbackSelectedAppointment);
result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure),
(failure) async {
LoaderBottomSheet.hideLoader();
await errorHandlerService.handleError(failure: failure);
},
// (failure) async {
// if(onError != null) {
// onError(failure.toString());
// }
// },
(apiResponse) {
if (apiResponse.messageStatus == 2) {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});

@ -53,7 +53,7 @@ abstract class MyAppointmentsRepo {
Future<Either<Failure, GenericApiModel<List<PatientAppointmentHistoryResponseModel>>>> getPatientAppointmentsForTimeLine();
Future<Either<Failure, GenericApiModel<List<PatientAppointmentHistoryResponseModel>>>> getPatientDoctorsList();
Future<Either<Failure, GenericApiModel<List<PatientAppointmentHistoryResponseModel>>>> getPatientDoctorsList({bool isTop8 = false});
Future<Either<Failure, GenericApiModel<List<GetFavoriteDoctorsListModel>>>> getFavouriteDoctorsList();
@ -514,11 +514,12 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
}
@override
Future<Either<Failure, GenericApiModel<List<PatientAppointmentHistoryResponseModel>>>> getPatientDoctorsList() async {
Future<Either<Failure, GenericApiModel<List<PatientAppointmentHistoryResponseModel>>>> getPatientDoctorsList({bool isTop8 = false}) async {
Map<String, dynamic> mapDevice = {
"Top": 0,
"beforeDays": 0,
"exludType": 4,
"IsTop8": isTop8,
};
try {

@ -211,6 +211,11 @@ class MyAppointmentsViewModel extends ChangeNotifier {
notifyListeners();
}
setIsMyDoctorsDataToBeLoaded(bool val) {
isMyDoctorsDataToBeLoaded = val;
notifyListeners();
}
setIsAppointmentDataToBeLoaded(bool val) {
if (val) {
isMyAppointmentsLoading = true;
@ -675,13 +680,13 @@ class MyAppointmentsViewModel extends ChangeNotifier {
);
}
Future<void> getPatientMyDoctors({Function(dynamic)? onSuccess, Function(String)? onError}) async {
Future<void> getPatientMyDoctors({bool isTop8 = false, Function(dynamic)? onSuccess, Function(String)? onError}) async {
if (!isMyDoctorsDataToBeLoaded) return;
isPatientMyDoctorsLoading = true;
patientMyDoctorsList.clear();
notifyListeners();
final result = await myAppointmentsRepo.getPatientDoctorsList();
final result = await myAppointmentsRepo.getPatientDoctorsList(isTop8: isTop8);
result.fold(
// (failure) async => await errorHandlerService.handleError(failure: failure),

@ -39,7 +39,7 @@ class _MyDoctorsPageState extends State<MyDoctorsPage> {
@override
void initState() {
scheduleMicrotask(() {
myAppointmentsViewModel.getPatientMyDoctors();
myAppointmentsViewModel.getPatientMyDoctors(isTop8: false);
});
super.initState();
}

@ -101,7 +101,7 @@ class AppointmentDoctorCard extends StatelessWidget {
Row(
children: [
Expanded(
child: patientAppointmentHistoryResponseModel.doctorNameObj!.toText16(
child: (patientAppointmentHistoryResponseModel.doctorNameObj ?? "").toText16(
isBold: true,
isEnglishOnly: !Utils.isArabicText(patientAppointmentHistoryResponseModel.doctorNameObj ?? ""),
textOverflow: TextOverflow.ellipsis,

@ -66,14 +66,14 @@ class _BookAppointmentPageState extends State<BookAppointmentPage> {
// bookAppointmentsViewModel.getLocation();
immediateLiveCareViewModel.initImmediateLiveCare();
if (appState.isAuthenticated) {
getIt.get<MyAppointmentsViewModel>().getPatientMyDoctors();
getIt.get<MyAppointmentsViewModel>().getPatientMyDoctors(isTop8: true);
getIt.get<MyAppointmentsViewModel>().getPatientFavouriteDoctors();
}
});
WidgetsBinding.instance.addPostFrameCallback((_) {
if (bookAppointmentsViewModel.selectedTabIndex == 1) {
if (appState.isAuthenticated) {
getIt.get<MyAppointmentsViewModel>().getPatientMyDoctors();
getIt.get<MyAppointmentsViewModel>().getPatientMyDoctors(isTop8: true);
getIt.get<MyAppointmentsViewModel>().getPatientFavouriteDoctors();
showUnKnownClinicBottomSheet();
}
@ -166,6 +166,7 @@ class _BookAppointmentPageState extends State<BookAppointmentPage> {
Icon(Icons.arrow_forward_ios, color: AppColors.primaryRedColor, size: 14.h),
],
).paddingSymmetrical(24.h, 0.h).onPress(() {
myAppointmentsVM.setIsMyDoctorsDataToBeLoaded(true);
Navigator.of(context).push(
CustomPageRoute(
page: MyDoctorsPage(),

File diff suppressed because one or more lines are too long

@ -181,10 +181,11 @@ class _ExpandableDescriptionText extends StatelessWidget {
static TextStyle get textStyle => TextStyle(
fontSize: 14.f,
color: AppColors.textColor, // or Colors.black87
fontFamily: 'Poppins',
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
color: AppColors.textColorLight,
// or Colors.black87
// fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontStyle: FontStyle.normal,
height: 1.4,
letterSpacing: 0.0,
decoration: TextDecoration.none,
@ -199,7 +200,7 @@ class _ExpandableDescriptionText extends StatelessWidget {
final readMoreStyle = TextStyle(
fontSize: 12.f,
color: AppColors.primaryRedColor,
fontFamily: 'Poppins',
// fontFamily: 'Poppins',
fontWeight: FontWeight.w500,
);

@ -110,7 +110,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
appState = getIt.get<AppState>();
scheduleMicrotask(() {
if (appState.isAuthenticated) {
myAppointmentsViewModel.getPatientMyDoctors();
myAppointmentsViewModel.getPatientMyDoctors(isTop8: true);
prescriptionsViewModel.initPrescriptionsViewModel();
insuranceViewModel.initInsuranceProvider();
medicalFileViewModel.setIsPatientSickLeaveListLoading(true);
@ -1046,6 +1046,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
],
).onPress(() {
// myAppointmentsViewModel.getPatientMyDoctors();
myAppointmentsViewModel.setIsMyDoctorsDataToBeLoaded(true);
Navigator.of(context).push(
CustomPageRoute(
page: MyDoctorsPage(),

Loading…
Cancel
Save