Bookmark icons added

haroon_dev
haroon amjad 14 hours ago
parent bd65d05e9e
commit 7e73741d08

@ -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

@ -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);

@ -34,16 +34,15 @@ class DoctorProfilePage extends StatelessWidget {
Expanded(
child: CollapsingListView(
title: LocaleKeys.doctorProfile.tr(),
trailing: Consumer<BookAppointmentsViewModel>(
trailing: appState.isAuthenticated ? Consumer<BookAppointmentsViewModel>(
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,

Loading…
Cancel
Save