diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart index 73cb287f..5fb73a37 100644 --- a/lib/core/api_consts.dart +++ b/lib/core/api_consts.dart @@ -4,7 +4,7 @@ import 'package:hmg_patient_app_new/core/enums.dart'; class ApiConsts { static const maxSmallScreen = 660; - static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.preProd; + static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.prod; // static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT diff --git a/lib/features/book_appointments/book_appointments_view_model.dart b/lib/features/book_appointments/book_appointments_view_model.dart index afc9b568..f1de3201 100644 --- a/lib/features/book_appointments/book_appointments_view_model.dart +++ b/lib/features/book_appointments/book_appointments_view_model.dart @@ -652,12 +652,14 @@ class BookAppointmentsViewModel extends ChangeNotifier { notifyListeners(); // Check if doctor is favorite after getting profile - checkIsFavouriteDoctor( - patientID: _appState.getAuthenticatedUser()!.patientId!, - projectID: doctorsProfileResponseModel.projectID ?? 0, - clinicID: doctorsProfileResponseModel.clinicID ?? 0, - doctorID: doctorsProfileResponseModel.doctorID ?? 0, - ); + if(_appState.isAuthenticated) { + checkIsFavouriteDoctor( + patientID: _appState.getAuthenticatedUser()!.patientId!, + projectID: doctorsProfileResponseModel.projectID ?? 0, + clinicID: doctorsProfileResponseModel.clinicID ?? 0, + doctorID: doctorsProfileResponseModel.doctorID ?? 0, + ); + } if (onSuccess != null) { onSuccess(apiResponse); diff --git a/lib/presentation/book_appointment/doctor_profile_page.dart b/lib/presentation/book_appointment/doctor_profile_page.dart index 2bfde02e..fe09cade 100644 --- a/lib/presentation/book_appointment/doctor_profile_page.dart +++ b/lib/presentation/book_appointment/doctor_profile_page.dart @@ -34,16 +34,15 @@ class DoctorProfilePage extends StatelessWidget { Expanded( child: CollapsingListView( title: LocaleKeys.doctorProfile.tr(), - trailing: Consumer( + trailing: appState.isAuthenticated ? Consumer( builder: (context, viewModel, child) { return SizedBox( width: 24.h, height: 24.h, - child: Utils.buildSvgWithAssets( - icon: viewModel.isFavouriteDoctor ? AppAssets.bookmark_filled_icon : AppAssets.bookmark_icon, - width: 24.h, - height: 24.h, - iconColor: viewModel.isFavouriteDoctor ? AppColors.primaryRedColor : AppColors.textColor, + child: Icon( + viewModel.isFavouriteDoctor ? Icons.bookmark : Icons.bookmark_border_outlined, + size: 36.h, + color: viewModel.isFavouriteDoctor ? AppColors.primaryRedColor : AppColors.textColor, ).onPress(() async { viewModel.toggleFavouriteDoctor(); await viewModel.insertFavouriteDoctor( @@ -68,7 +67,7 @@ class DoctorProfilePage extends StatelessWidget { }), ); }, - ), + ) : SizedBox.shrink(), child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start,