Merge pull request 'dental routing fixed and laser exception removed' (#82) from laser_appointment into master

Reviewed-on: #82
pull/85/head
Haroon6138 3 weeks ago
commit 5505f549fc

@ -734,7 +734,7 @@ class BookAppointmentsRepoImp implements BookAppointmentsRepo {
body: mapDevice, body: mapDevice,
onFailure: (error, statusCode, {messageStatus, failureType}) { onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType; failure = failureType;
onError!(error); onError?.call(error);
}, },
onSuccess: (response, statusCode, {messageStatus, errorMessage}) { onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try { try {

@ -1009,7 +1009,7 @@ class BookAppointmentsViewModel extends ChangeNotifier {
(failure) async => await errorHandlerService.handleError(failure: failure), (failure) async => await errorHandlerService.handleError(failure: failure),
(apiResponse) { (apiResponse) {
if (apiResponse.messageStatus == 2) { if (apiResponse.messageStatus == 2) {
onError!(apiResponse.errorMessage!); onError?.call(apiResponse.errorMessage!);
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
} else if (apiResponse.messageStatus == 1) { } else if (apiResponse.messageStatus == 1) {
dentalChiefComplaintsList = apiResponse.data!; dentalChiefComplaintsList = apiResponse.data!;

@ -110,7 +110,6 @@ class AppointmentViaRegionViewmodel extends ChangeNotifier {
); );
} }
} }
if (clinicId == 253) { if (clinicId == 253) {
{ {

@ -43,85 +43,88 @@ class BodyPartsListing extends StatelessWidget {
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return SizedBox( height: 80, width: 80,).toShimmer2(isShow: isLoading); return SizedBox( height: 80, width: 80,).toShimmer2(isShow: isLoading);
})), })),
GridView.builder( Visibility(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( visible: !isLoading,
crossAxisCount: 3, child: GridView.builder(
childAspectRatio: 85 / 107, gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisSpacing: 4.h, crossAxisCount: 3,
mainAxisSpacing: 21.h), childAspectRatio: 85 / 107,
physics: NeverScrollableScrollPhysics(), crossAxisSpacing: 4.h,
shrinkWrap: true, mainAxisSpacing: 21.h),
itemCount: parts.length, physics: NeverScrollableScrollPhysics(),
// padding: fullBody != null ? EdgeInsets.only(top: 16) : EdgeInsets.zero, shrinkWrap: true,
padding: EdgeInsets.zero, itemCount: parts.length,
itemBuilder: (BuildContext context, int index) { // padding: fullBody != null ? EdgeInsets.only(top: 16) : EdgeInsets.zero,
bool _isSelected = padding: EdgeInsets.zero,
selectedPart.any((file) => file.id == parts[index].id); itemBuilder: (BuildContext context, int index) {
return InkWell( bool _isSelected =
onTap: () { selectedPart.any((file) => file.id == parts[index].id);
onPartSelected(parts[index]); return InkWell(
}, onTap: () {
child: AnimatedOpacity( onPartSelected(parts[index]);
opacity: 1.0, },
duration: Duration(milliseconds: 200), child: AnimatedOpacity(
child: Column( opacity: 1.0,
crossAxisAlignment: CrossAxisAlignment.start, duration: Duration(milliseconds: 200),
children: [ child: Column(
AspectRatio( crossAxisAlignment: CrossAxisAlignment.start,
aspectRatio: 97 / 97, children: [
child: FittedBox( AspectRatio(
fit: BoxFit.fitWidth, aspectRatio: 97 / 97,
child: Stack( child: FittedBox(
alignment: Alignment.topRight, fit: BoxFit.fitWidth,
children: [ child: Stack(
Container( alignment: Alignment.topRight,
margin: EdgeInsets.only(top: 5.h, right: 5.h), children: [
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15.0),
border: Border.all(
color: _isSelected
? AppColors.primaryRedColor
: AppColors.borderGrayColor,
width: 2.h),
),
child: LaserBodyParts().getCategoryImage(isMale,
laserCategoryID, parts[index].mappingCode!),
),
if (_isSelected)
Container( Container(
width: 18.h, margin: EdgeInsets.only(top: 5.h, right: 5.h),
height: 18.h,
child: Icon(Icons.done,
color: Colors.white, size: 12.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.primaryRedColor, borderRadius: BorderRadius.circular(15.0),
borderRadius: BorderRadius.circular(30.h), border: Border.all(
color: _isSelected
? AppColors.primaryRedColor
: AppColors.borderGrayColor,
width: 2.h),
), ),
child: LaserBodyParts().getCategoryImage(isMale,
laserCategoryID, parts[index].mappingCode!),
), ),
], if (_isSelected)
Container(
width: 18.h,
height: 18.h,
child: Icon(Icons.done,
color: Colors.white, size: 12.h),
decoration: BoxDecoration(
color: AppColors.primaryRedColor,
borderRadius: BorderRadius.circular(30.h),
),
),
],
),
), ),
), ),
), SizedBox(height: 6.h),
SizedBox(height: 6.h), Expanded(
Expanded( child: Text(
child: Text( context
context .read<BookAppointmentsViewModel>()
.read<BookAppointmentsViewModel>() .getLaserProcedureNameWRTLanguage(parts[index]),
.getLaserProcedureNameWRTLanguage(parts[index]), style: TextStyle(
style: TextStyle( fontSize: 12.fSize,
fontSize: 12.fSize, fontWeight: FontWeight.w600,
fontWeight: FontWeight.w600, color: Color(0xff2B353E),
color: Color(0xff2B353E), letterSpacing: -0.48,
letterSpacing: -0.48, ),
maxLines: 1,
), ),
maxLines: 1,
), ),
), ],
], ),
), ),
), );
); },
}, ),
), ),
], ],
); );

@ -281,7 +281,7 @@ class _SelectClinicPageState extends State<SelectClinicPage> {
}); });
} }
Widget getRegionalSelectionWidget(AppointmentViaRegionViewmodel data) { Widget getRegionalSelectionWidget(AppointmentViaRegionViewmodel data) {
if (data.bottomSheetState == AppointmentViaRegionState.REGION_SELECTION) { if (data.bottomSheetState == AppointmentViaRegionState.REGION_SELECTION) {
return RegionBottomSheetBody(); return RegionBottomSheetBody();
} }
@ -303,11 +303,9 @@ class _SelectClinicPageState extends State<SelectClinicPage> {
id = regionalViewModel.selectedHospital?.patientDoctorAppointmentList?.first.projectID?.toString() ?? ""; id = regionalViewModel.selectedHospital?.patientDoctorAppointmentList?.first.projectID?.toString() ?? "";
} }
if (bookAppointmentsViewModel.selectedClinic.clinicID == 17) { if (bookAppointmentsViewModel.selectedClinic.clinicID == 17) {
if (appState.isAuthenticated) { if (appState.isAuthenticated) {
initDentalAppointmentBookingFlow(int.parse(bookAppointmentsViewModel initDentalAppointment();
.currentlySelectedHospitalFromRegionFlow ?? return SizedBox.shrink();
"0"));
}else { }else {
bookAppointmentsViewModel.setIsChiefComplaintsListLoading(true); bookAppointmentsViewModel.setIsChiefComplaintsListLoading(true);
} }
@ -464,6 +462,7 @@ class _SelectClinicPageState extends State<SelectClinicPage> {
isCloseButtonVisible: true, isCloseButtonVisible: true,
); );
} else { } else {
bookAppointmentsViewModel.setIsChiefComplaintsListLoading(true);
Navigator.of(context).push( Navigator.of(context).push(
CustomPageRoute( CustomPageRoute(
page: DentalChiefComplaintsPage(), page: DentalChiefComplaintsPage(),
@ -472,4 +471,12 @@ class _SelectClinicPageState extends State<SelectClinicPage> {
} }
}); });
} }
void initDentalAppointment() async {
await Future.delayed(Duration(milliseconds: 300));
initDentalAppointmentBookingFlow(int.parse(bookAppointmentsViewModel
.currentlySelectedHospitalFromRegionFlow ??
"0"));
return;
}
} }

@ -59,15 +59,14 @@ class DialogServiceImp implements DialogService {
onOkPressed: () { onOkPressed: () {
if (onOkPressed != null) { if (onOkPressed != null) {
onOkPressed(); onOkPressed();
} else {
context.pop();
} }
context.pop(); context.pop();
}, },
onCancelPressed: () { onCancelPressed: () {
if (onCancelPressed != null) { if (onCancelPressed != null) {
context.pop(); onCancelPressed();
} }
context.pop();
}, },
), ),
); );

@ -60,7 +60,7 @@ class CustomButton extends StatelessWidget {
color: isDisabled ? backgroundColor.withOpacity(.5) : backgroundColor, color: isDisabled ? backgroundColor.withOpacity(.5) : backgroundColor,
borderRadius: borderRadius, borderRadius: borderRadius,
customBorder: BorderRadius.circular(borderRadius), customBorder: BorderRadius.circular(borderRadius),
side: borderSide ?? BorderSide(width: borderWidth.h, color: isDisabled ? borderColor.withValues(alpha: 0.5) : borderColor)), side: borderSide ?? BorderSide(width: borderWidth.h, color: isDisabled ? Colors.transparent : borderColor)),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,

Loading…
Cancel
Save