From d605084a910f9f4a6747a4882d0df61f383f3a7c Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Thu, 26 Aug 2021 17:06:10 +0300 Subject: [PATCH] appointment list and detail ui changed --- assets/images/new/services/add_reminder.svg | 6 + .../MyAppointments/AppointmentDetails.dart | 433 +++++++++++------- lib/pages/MyAppointments/MyAppointments.dart | 149 ++++-- .../MyAppointments/models/BookedButtons.dart | 40 +- .../models/BookedButtonsAllowCheckIn.dart | 2 +- .../models/ConfirmedButtons.dart | 35 +- .../widgets/AppointmentActions.dart | 128 +++--- lib/pages/medical/labs/labs_home_page.dart | 1 + .../radiology/radiology_home_page.dart | 1 + .../data_display/medical/doctor_card.dart | 56 ++- .../medical/medical_profile_item.dart | 10 +- .../medical/time_line_widget.dart | 20 +- lib/widgets/new_design/doctor_header.dart | 127 ++--- lib/widgets/new_design/my_tab_view.dart | 14 +- lib/widgets/others/app_scaffold_widget.dart | 115 +++-- 15 files changed, 682 insertions(+), 455 deletions(-) create mode 100644 assets/images/new/services/add_reminder.svg diff --git a/assets/images/new/services/add_reminder.svg b/assets/images/new/services/add_reminder.svg new file mode 100644 index 00000000..5866a81b --- /dev/null +++ b/assets/images/new/services/add_reminder.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index afadbd1c..f47076bb 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -2,14 +2,18 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorRateDetails.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/header_model.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/BookConfirm.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/DocAvailableAppointments.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -25,8 +29,9 @@ class AppointmentDetails extends StatefulWidget { static bool isLoading = false; static bool showFooterButton = false; + final int parentIndex; - AppointmentDetails({@required this.appo}); + AppointmentDetails({@required this.appo, this.parentIndex}); @override _AppointmentDetailsState createState() => _AppointmentDetailsState(); @@ -37,6 +42,8 @@ class _AppointmentDetailsState extends State with SingleTick List doctorDetailsList = List(); + ToDoCountProviderModel toDoProvider; + @override void initState() { _tabController = new TabController(length: 2, vsync: this); @@ -55,179 +62,235 @@ class _AppointmentDetailsState extends State with SingleTick @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); + + toDoProvider = Provider.of(context); + return AppScaffold( appBarTitle: widget.appo.doctorNameObj, isShowAppBar: true, showNewAppBar: true, - backgroundColor: Color(0xffF8F8F8), + backgroundColor: Colors.white, showNewAppBarTitle: true, - bottomSheet: AppointmentDetails.showFooterButton - ? Container( - width: MediaQuery.of(context).size.width, - height: 50.0, - margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF60686b), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: goToBookConfirm, - child: Text(TranslationBase.of(context).bookNow, style: TextStyle(fontSize: 18.0)), - ), - ), - ) - : null, - body: Container( - color: new Color(0xFFf8f8f8), - child: SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - color: Colors.white, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // Container( - // margin: EdgeInsets.only(top: 20.0), - // alignment: Alignment.center, - // child: ClipRRect( - // borderRadius: BorderRadius.circular(100.0), - // child: Image.network(widget.appo.doctorImageURL, fit: BoxFit.fill, height: 120.0, width: 120.0), - // ), - // ), - // Container( - // margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), - // alignment: Alignment.center, - // child: - // Text(widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, textAlign: TextAlign.center, style: TextStyle(fontSize: 20.0, color: Colors.grey[900], letterSpacing: 1.0)), - // ), - // Container( - // margin: EdgeInsets.only(top: 10.0), - // alignment: Alignment.center, - // child: Text(getDoctorSpeciality(widget.appo.doctorSpeciality), style: TextStyle(fontSize: 12.0, color: Colors.grey[900], letterSpacing: 1.0)), - // ), - // Container( - // margin: EdgeInsets.only(top: 5.0), - // alignment: Alignment.center, - // child: RatingBar.readOnly( - // initialRating: widget.appo.actualDoctorRate.toDouble(), - // size: 35.0, - // filledColor: Colors.yellow[700], - // emptyColor: Colors.grey[500], - // isHalfAllowed: true, - // halfFilledIcon: Icons.star_half, - // filledIcon: Icons.star, - // emptyIcon: Icons.star, - // ), - // ), - // InkWell( - // onTap: () { - // getDoctorRatingsDetails(); - // }, - // child: Container( - // margin: EdgeInsets.only(top: 5.0), - // alignment: Alignment.center, - // child: Text("(" + widget.appo.noOfPatientsRate.toString() + " " + TranslationBase.of(context).reviews + ")", - // style: TextStyle( - // fontSize: 14.0, - // color: Colors.blue[800], - // letterSpacing: 1.0, - // decoration: TextDecoration.underline, - // )), - // ), - // ), - // Container( - // alignment: Alignment.center, - // child: Text(DateUtil.getWeekDayMonthDayYearDateFormatted(DateUtil.convertStringToDate(widget.appo.appointmentDate), projectViewModel.isArabic ? "ar" : "en")), - // ), - // Container( - // alignment: Alignment.center, - // child: Text(widget.appo.startTime.substring(0, 5)), - // ), - // Container( - // margin: EdgeInsets.only(top: 10.0), - // child: Divider( - // color: Colors.grey[500], - // ), - // ), - DoctorHeader( - headerModel: HeaderModel( - widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, - widget.appo.doctorImageURL, - widget.appo.doctorSpeciality, - "", - widget.appo.projectName, - DateUtil.convertStringToDate(widget.appo.appointmentDate), - widget.appo.startTime.substring(0, 5), - null, - widget.appo.doctorRate, - widget.appo.actualDoctorRate, - widget.appo.noOfPatientsRate, - "", - //model.user.emailAddress, - ), - isNeedToShowButton: _tabController.index == 1, - buttonTitle: TranslationBase.of(context).schedule, - buttonIcon: 'assets/images/new/Boo_ Appointment.svg', - showConfirmMessageDialog: false, - onRatingAndReviewTap: getDoctorRatingsDetails, - onTap: () {}, + bottomSheet: _bottomButtons(), + body: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + color: Colors.white, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Container( + // margin: EdgeInsets.only(top: 20.0), + // alignment: Alignment.center, + // child: ClipRRect( + // borderRadius: BorderRadius.circular(100.0), + // child: Image.network(widget.appo.doctorImageURL, fit: BoxFit.fill, height: 120.0, width: 120.0), + // ), + // ), + // Container( + // margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), + // alignment: Alignment.center, + // child: + // Text(widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, textAlign: TextAlign.center, style: TextStyle(fontSize: 20.0, color: Colors.grey[900], letterSpacing: 1.0)), + // ), + // Container( + // margin: EdgeInsets.only(top: 10.0), + // alignment: Alignment.center, + // child: Text(getDoctorSpeciality(widget.appo.doctorSpeciality), style: TextStyle(fontSize: 12.0, color: Colors.grey[900], letterSpacing: 1.0)), + // ), + // Container( + // margin: EdgeInsets.only(top: 5.0), + // alignment: Alignment.center, + // child: RatingBar.readOnly( + // initialRating: widget.appo.actualDoctorRate.toDouble(), + // size: 35.0, + // filledColor: Colors.yellow[700], + // emptyColor: Colors.grey[500], + // isHalfAllowed: true, + // halfFilledIcon: Icons.star_half, + // filledIcon: Icons.star, + // emptyIcon: Icons.star, + // ), + // ), + // InkWell( + // onTap: () { + // getDoctorRatingsDetails(); + // }, + // child: Container( + // margin: EdgeInsets.only(top: 5.0), + // alignment: Alignment.center, + // child: Text("(" + widget.appo.noOfPatientsRate.toString() + " " + TranslationBase.of(context).reviews + ")", + // style: TextStyle( + // fontSize: 14.0, + // color: Colors.blue[800], + // letterSpacing: 1.0, + // decoration: TextDecoration.underline, + // )), + // ), + // ), + // Container( + // alignment: Alignment.center, + // child: Text(DateUtil.getWeekDayMonthDayYearDateFormatted(DateUtil.convertStringToDate(widget.appo.appointmentDate), projectViewModel.isArabic ? "ar" : "en")), + // ), + // Container( + // alignment: Alignment.center, + // child: Text(widget.appo.startTime.substring(0, 5)), + // ), + // Container( + // margin: EdgeInsets.only(top: 10.0), + // child: Divider( + // color: Colors.grey[500], + // ), + // ), + DoctorHeader( + headerModel: HeaderModel( + widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, + widget.appo.doctorImageURL, + widget.appo.doctorSpeciality, + "", + widget.appo.projectName, + DateUtil.convertStringToDate(widget.appo.appointmentDate), + widget.appo.startTime.substring(0, 5), + null, + widget.appo.doctorRate, + widget.appo.actualDoctorRate, + widget.appo.noOfPatientsRate, + "", + //model.user.emailAddress, ), - SizedBox(height: 10), - TabBar( - onTap: (index) { - setState(() { - if (index == 1) { - if (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.isExecludeDoctor) { - _tabController.index = _tabController.previousIndex; - AppointmentDetails.showFooterButton = false; - } else { - AppointmentDetails.showFooterButton = true; - } + isNeedToShowButton: _tabController.index == 1, + buttonTitle: TranslationBase.of(context).schedule, + buttonIcon: 'assets/images/new/Boo_ Appointment.svg', + showConfirmMessageDialog: false, + onRatingAndReviewTap: getDoctorRatingsDetails, + onTap: () {}, + ), + SizedBox(height: 10), + TabBar( + onTap: (index) { + setState(() { + if (index == 1) { + if (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.isExecludeDoctor) { + _tabController.index = _tabController.previousIndex; + AppointmentDetails.showFooterButton = false; + } else { + AppointmentDetails.showFooterButton = true; } - }); - }, - tabs: [ - Tab(child: Text(TranslationBase.of(context).appoActions, style: TextStyle(color: Colors.black))), - widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.isExecludeDoctor - ? Tab( - child: Text(TranslationBase.of(context).availableAppo, style: TextStyle(color: Colors.grey)), - ) - : Tab( - child: Text(TranslationBase.of(context).availableAppo, style: TextStyle(color: Colors.black)), - ) - ], - controller: _tabController, - ), - ], - ), + } + }); + }, + tabs: [ + Tab(child: Text(TranslationBase.of(context).appoActions, style: TextStyle(color: Colors.black))), + widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.isExecludeDoctor + ? Tab( + child: Text(TranslationBase.of(context).availableAppo, style: TextStyle(color: Colors.grey)), + ) + : Tab( + child: Text(TranslationBase.of(context).availableAppo, style: TextStyle(color: Colors.black)), + ) + ], + controller: _tabController, + ), + ], ), - Container( - height: MediaQuery.of(context).size.height * 0.87, - child: TabBarView( - physics: NeverScrollableScrollPhysics(), - children: [ - AppointmentActions(appo: widget.appo, tabController: _tabController, enableFooterButton: enableFooterButton), - DocAvailableAppointments(doctor: getDoctorObject(), isLiveCareAppointment: widget.appo.isLiveCareAppointment) - ], - controller: _tabController, - ), + ), + Container( + height: MediaQuery.of(context).size.height * 0.87, + color: Color(0xffF8F8F8), + child: TabBarView( + physics: NeverScrollableScrollPhysics(), + children: [ + AppointmentActions(appo: widget.appo, tabController: _tabController, enableFooterButton: enableFooterButton), + DocAvailableAppointments(doctor: getDoctorObject(), isLiveCareAppointment: widget.appo.isLiveCareAppointment) + ], + controller: _tabController, ), - ], - ), + ), + ], ), ), ); } + Widget _bottomButtons() { + if (widget.parentIndex == null) { + return null; + } else { + List list = []; + if (widget.parentIndex == 0 && _tabController.index == 0) { + list.add( + Expanded( + child: DefaultButton( + TranslationBase.of(context).cancel, + () { + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: TranslationBase.of(context).cancelAppoMsg, + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: cancelAppointment, + cancelFunction: () => {}); + dialog.showAlertDialog(context); + }, + color: Color(0xffEAEAEA), + textColor: Color(0xff000000), + ), + ), + ); + list.add( + SizedBox(width: 8), + ); + list.add( + Expanded( + child: DefaultButton( + TranslationBase.of(context).confirm, + confirmAppointment, + color: Color(0xff359846), + ), + ), + ); + } else if (widget.parentIndex == 1 && _tabController.index == 0) { + list.add( + Expanded( + child: DefaultButton( + TranslationBase.of(context).cancel, + () => { + // Navigator.of(context).push(FadePage(page: Register())), + }, + color: Color(0xffEAEAEA), + textColor: Color(0xff000000), + ), + ), + ); + } else if (_tabController.index == 1) { + list.add( + Expanded( + child: DefaultButton( + TranslationBase.of(context).bookNow, + DocAvailableAppointments.areSlotsAvailable ? goToBookConfirm : null, + color: Color(0xFFD02127), + disabledColor: Color(0xff28323A).withOpacity(0.3), + ), + ), + ); + } + if (list.isEmpty) { + return null; + } else + return Container( + color: Colors.white, + padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), + child: Row( + mainAxisSize: MainAxisSize.min, + children: list, + ), + ); + } + } + void enableFooterButton() { setState(() { AppointmentDetails.showFooterButton = true; @@ -498,4 +561,54 @@ class _AppointmentDetailsState extends State with SingleTick void openSchedule() { Navigator.push(context, FadePage(page: SchedulePage(getDoctorObject()))); } + + confirmAppointment() { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + service.confirmAppointment(widget.appo.appointmentNo, widget.appo.clinicID, widget.appo.projectID, widget.appo.isLiveCareAppointment, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); + Navigator.of(context).pop(); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); + } + + cancelAppointment() { + ConfirmDialog.closeAlertDialog(context); + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + service.cancelAppointment(widget.appo, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + print(res); + if (res['MessageStatus'] == 1) { + getToDoCount(); + AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); + Navigator.of(context).pop(); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); + } + + getToDoCount() { + toDoProvider.setState(0, true); + ClinicListService service = new ClinicListService(); + service.getActiveAppointmentNo(context).then((res) { + print(res['AppointmentActiveNumber']); + if (res['MessageStatus'] == 1) { + toDoProvider.setState(res['AppointmentActiveNumber'], true); + } else {} + }).catchError((err) { + print(err); + }); + } } diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 0daba2ac..73f26e82 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -44,8 +44,6 @@ class MyAppointments extends StatefulWidget { } class _MyAppointmentsState extends State with SingleTickerProviderStateMixin { - TabController _tabController; - bool isDataLoaded = false; var sharedPref = new AppSharedPreferences(); AuthenticatedUserObject authenticatedUserObject = locator(); @@ -54,9 +52,10 @@ class _MyAppointmentsState extends State with SingleTickerProvid FilterType filterType; + int _currentPage = 0; + @override void initState() { - _tabController = new TabController(length: 3, vsync: this); filterType = FilterType.Clinic; WidgetsBinding.instance.addPostFrameCallback((_) { if (Provider.of(context, listen: false).isLogin) getPatientAppointmentHistory(); @@ -68,6 +67,11 @@ class _MyAppointmentsState extends State with SingleTickerProvid super.initState(); } + @override + void dispose() { + super.dispose(); + } + @override Widget build(BuildContext context) { return AppScaffold( @@ -77,25 +81,21 @@ class _MyAppointmentsState extends State with SingleTickerProvid showNewAppBar: true, backgroundColor: Color(0xffF8F8F8), showNewAppBarTitle: true, + showDropDown: true, + dropdownIndexValue: _currentPage, + dropDownIndexChange: (index) { + setState(() { + _currentPage = index; + }); + }, + dropDownList: [ + TranslationBase.of(context).booked, + TranslationBase.of(context).confirmed, + TranslationBase.of(context).arrived, + ], description: TranslationBase.of(context).infoMyAppointments, body: Container( child: Column(children: [ - TabBar( - tabs: [ - Tab(child: Text(TranslationBase.of(context).booked, style: TextStyle(color: Colors.black))), - Tab( - child: Text(TranslationBase.of(context).confirmed, style: TextStyle(color: Colors.black)), - ), - Tab( - child: Text(TranslationBase.of(context).arrived, style: TextStyle(color: Colors.black)), - ) - ], - controller: _tabController, - ), - Divider( - color: Colors.grey[600], - thickness: 0.5, - ), Row( children: [ MyTabView(TranslationBase.of(context).byClinic, FilterType.Clinic, filterType, () { @@ -106,12 +106,23 @@ class _MyAppointmentsState extends State with SingleTickerProvid }), ], ), + SizedBox(height: 20), + Padding( + padding: EdgeInsets.only(left: 21, right: 21), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + myRadioButton(TranslationBase.of(context).booked, 0), + myRadioButton(TranslationBase.of(context).confirmed, 1), + myRadioButton(TranslationBase.of(context).arrived, 2), + ], + ), + ), isDataLoaded ? Expanded( - child: new TabBarView( - physics: NeverScrollableScrollPhysics(), + child: IndexedStack( + index: _currentPage, children: [getBookedAppointments(), getConfirmedAppointments(), getArrivedAppointments()], - controller: _tabController, ), ) : Container(), @@ -273,23 +284,25 @@ class _MyAppointmentsState extends State with SingleTickerProvid openAppointmentsTab() async { var flag = await this.sharedPref.getInt(IS_SEARCH_APPO); - + int index; if (flag == 1) { - _tabController.index = 0; + index = 0; } else if (flag == 2) { - _tabController.index = 1; + index = 1; } else if (flag == 3) { - _tabController.index = 2; + index = 2; } else { if (widget._patientBookedAppointmentListClinic.length != 0) { - _tabController.index = 0; + index = 0; } else if (widget._patientConfirmedAppointmentListClinic.length != 0) { - _tabController.index = 1; + index = 1; } else if (widget._patientArrivedAppointmentListClinic.length != 0) { - _tabController.index = 2; - return; + index = 2; + // return; } } + + _currentPage = index; } Widget getBookedAppointments() { @@ -328,7 +341,7 @@ class _MyAppointmentsState extends State with SingleTickerProvid Widget _appointmentExpandableList(List _patientAppointmentList) { return ListView.separated( physics: BouncingScrollPhysics(), - // padding: EdgeInsets.only(left: 21, right: 21), + padding: EdgeInsets.only(top: 12), separatorBuilder: (context, index) { return Container( height: 1, @@ -347,22 +360,33 @@ class _MyAppointmentsState extends State with SingleTickerProvid itemBuilder: (context, _index) { AppoitmentAllHistoryResultList _appointmentResult = _appointmentAllHistoryResultList[_index]; bool _isSortByClinic = filterType == FilterType.Clinic; + return DoctorCard( - onTap: () => Navigator.push(context, FadePage(page: AppointmentDetails(appo: _appointmentResult))).then((value) { - getPatientAppointmentHistory(); - }), - isInOutPatient: _appointmentResult.isInOutPatient, - name: _appointmentResult.doctorTitle + " " + _appointmentResult.doctorNameObj, - // billNo: _appointmentResult.invoiceNo, - profileUrl: _appointmentResult.doctorImageURL, - subName: _isSortByClinic ? _appointmentResult.projectName : _appointmentResult.clinicName, - isLiveCareAppointment: _appointmentResult.isLiveCareAppointment, - date: DateUtil.convertStringToDate(_appointmentResult.appointmentDate), - isSortByClinic: _isSortByClinic, - rating: _appointmentResult.actualDoctorRate + 0.0, - appointmentTime: _appointmentResult.startTime.substring(0, 5), - //projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(labOrder.orderDate) : DateUtil.getMonthDayYearDateFormatted(labOrder.orderDate), - ); + onTap: () => Navigator.push( + context, + FadePage( + page: AppointmentDetails( + appo: _appointmentResult, + parentIndex: _currentPage, + ))).then((value) { + getPatientAppointmentHistory(); + }), + isInOutPatient: _appointmentResult.isInOutPatient, + name: _appointmentResult.doctorTitle + " " + _appointmentResult.doctorNameObj, + // billNo: _appointmentResult.invoiceNo, + profileUrl: _appointmentResult.doctorImageURL, + subName: _isSortByClinic ? _appointmentResult.projectName : _appointmentResult.clinicName, + isLiveCareAppointment: _appointmentResult.isLiveCareAppointment, + date: DateUtil.convertStringToDate(_appointmentResult.appointmentDate), + isSortByClinic: _isSortByClinic, + rating: _appointmentResult.actualDoctorRate + 0.0, + appointmentTime: _appointmentResult.startTime.substring(0, 5), + remainingTimeInMinutes: (_appointmentResult.patientStatusType == AppointmentType.BOOKED || _appointmentResult.patientStatusType == AppointmentType.CONFIRMED) + ? _appointmentResult.remaniningHoursTocanPay + : null + + //projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(labOrder.orderDate) : DateUtil.getMonthDayYearDateFormatted(labOrder.orderDate), + ); }, separatorBuilder: (context, index) => SizedBox(height: 14), itemCount: _appointmentAllHistoryResultList.length), @@ -385,4 +409,37 @@ class _MyAppointmentsState extends State with SingleTickerProvid this.filterType = filterType; }); } + + Widget myRadioButton(String _label, int _value) { + return Row( + mainAxisSize: MainAxisSize.min, + children: [ + SizedBox( + width: 22, + height: 22, + child: Radio( + value: _value, + activeColor: _value == _currentPage ? Color(0xffD02127) : Color(0xffE8E8E8), + groupValue: _currentPage, + onChanged: (index) { + setState(() { + _currentPage = index; + }); + //_pageController.animateToPage(index, duration: Duration(milliseconds: 250), curve: Curves.easeInOut); + }, + ), + ), + SizedBox(width: 10), + Text( + _label, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + color: Color(0xff575757), + letterSpacing: -0.56, + ), + ), + ], + ); + } } diff --git a/lib/pages/MyAppointments/models/BookedButtons.dart b/lib/pages/MyAppointments/models/BookedButtons.dart index 709b3b1f..bec7f39c 100644 --- a/lib/pages/MyAppointments/models/BookedButtons.dart +++ b/lib/pages/MyAppointments/models/BookedButtons.dart @@ -3,41 +3,41 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; class BookedButtons { var buttons = [ - { - "title": TranslationBase.of(AppGlobal.context).confirm, - "subtitle": TranslationBase.of(AppGlobal.context).appointment, - "icon": "assets/images/new-design/confirm_icon.png", - "caller": "confirmAppointment" - }, + // { + // "title": TranslationBase.of(AppGlobal.context).confirm, + // "subtitle": TranslationBase.of(AppGlobal.context).appointment, + // "icon": "assets/images/new-design/confirm_icon.png", + // "caller": "confirmAppointment", + // }, { "title": TranslationBase.of(AppGlobal.context).reschedule, "subtitle": TranslationBase.of(AppGlobal.context).appointment, - "icon": "assets/images/new-design/reschedule_icon.png", - "caller": "openReschedule" - }, - { - "title": TranslationBase.of(AppGlobal.context).cancel_nocaps, - "subtitle": TranslationBase.of(AppGlobal.context).appointment, - "icon": "assets/images/new-design/cancel_icon.png", - "caller": "onCancelAppointment" + "icon": "reschedule.svg", + "caller": "openReschedule", }, + // { + // "title": TranslationBase.of(AppGlobal.context).cancel_nocaps, + // "subtitle": TranslationBase.of(AppGlobal.context).appointment, + // "icon": "assets/images/new-design/cancel_icon.png", + // "caller": "onCancelAppointment", + // }, { "title": TranslationBase.of(AppGlobal.context).raise, "subtitle": TranslationBase.of(AppGlobal.context).complaint, - "icon": "assets/images/new-design/Complaint_icon.png", - "caller": "insertComplaint" + "icon": "raise_comp.svg", + "caller": "insertComplaint", }, { "title": TranslationBase.of(AppGlobal.context).add, "subtitle": TranslationBase.of(AppGlobal.context).reminder, - "icon": "assets/images/new-design/reminder_icon.png", - "caller": "addReminder" + "icon": "add_reminder.svg", + "caller": "addReminder", }, { "title": TranslationBase.of(AppGlobal.context).hospital, "subtitle": TranslationBase.of(AppGlobal.context).location, - "icon": "assets/images/new-design/location_icon.png", - "caller": "navigateToProject" + "icon": "hosp_location.svg", + "caller": "navigateToProject", } ]; } diff --git a/lib/pages/MyAppointments/models/BookedButtonsAllowCheckIn.dart b/lib/pages/MyAppointments/models/BookedButtonsAllowCheckIn.dart index a5334f9e..1062eaf3 100644 --- a/lib/pages/MyAppointments/models/BookedButtonsAllowCheckIn.dart +++ b/lib/pages/MyAppointments/models/BookedButtonsAllowCheckIn.dart @@ -24,7 +24,7 @@ class BookedButtonsAllowCheckIn { { "title": TranslationBase.of(AppGlobal.context).raise, "subtitle": TranslationBase.of(AppGlobal.context).complaint, - "icon": "assets/images/new-design/Complaint_icon.png", + "icon": "raise_comp.svg", "caller": "insertComplaint", }, { diff --git a/lib/pages/MyAppointments/models/ConfirmedButtons.dart b/lib/pages/MyAppointments/models/ConfirmedButtons.dart index b02021c7..a684781f 100644 --- a/lib/pages/MyAppointments/models/ConfirmedButtons.dart +++ b/lib/pages/MyAppointments/models/ConfirmedButtons.dart @@ -3,47 +3,22 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; class ConfirmedButtons { var buttons = [ - { - "title": TranslationBase.of(AppGlobal.context).reschedule, - "subtitle": TranslationBase.of(AppGlobal.context).appointment, - "icon": "assets/images/new-design/reschedule_icon.png", - "caller": "openReschedule" - }, + {"title": TranslationBase.of(AppGlobal.context).reschedule, "subtitle": TranslationBase.of(AppGlobal.context).appointment, "icon": "reschedule.svg", "caller": "openReschedule"}, { "title": TranslationBase.of(AppGlobal.context).cancel_nocaps, "subtitle": TranslationBase.of(AppGlobal.context).appointment, "icon": "assets/images/new-design/cancel_icon.png", "caller": "onCancelAppointment" }, - { - "title": TranslationBase.of(AppGlobal.context).raise, - "subtitle": TranslationBase.of(AppGlobal.context).complaint, - "icon": "assets/images/new-design/Complaint_icon.png", - "caller": "insertComplaint" - }, - { - "title": TranslationBase.of(AppGlobal.context).add, - "subtitle": TranslationBase.of(AppGlobal.context).reminder, - "icon": "assets/images/new-design/reminder_icon.png", - "caller": "addReminder" - }, - { - "title": TranslationBase.of(AppGlobal.context).hospital, - "subtitle": TranslationBase.of(AppGlobal.context).location, - "icon": "assets/images/new-design/location_icon.png", - "caller": "navigateToProject" - }, + {"title": TranslationBase.of(AppGlobal.context).raise, "subtitle": TranslationBase.of(AppGlobal.context).complaint, "icon": "raise_comp.svg", "caller": "insertComplaint"}, + {"title": TranslationBase.of(AppGlobal.context).add, "subtitle": TranslationBase.of(AppGlobal.context).reminder, "icon": "add_reminder.svg", "caller": "addReminder"}, + {"title": TranslationBase.of(AppGlobal.context).hospital, "subtitle": TranslationBase.of(AppGlobal.context).location, "icon": "hosp_location.svg", "caller": "navigateToProject"}, // { // "title": "Generate", // "subtitle": "Visit Ticket", // "icon": "assets/images/new-design/generate_visit_ticket.png", // "caller": "visitTicket" // }, - { - "title": TranslationBase.of(AppGlobal.context).online, - "subtitle": TranslationBase.of(AppGlobal.context).payment, - "icon": "assets/images/new-design/check-in.png", - "caller": "goToTodoList" - } + {"title": TranslationBase.of(AppGlobal.context).online, "subtitle": TranslationBase.of(AppGlobal.context).payment, "icon": "online_payment.svg", "caller": "goToTodoList"} ]; } diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 2a929f93..fd1c4f7a 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -51,8 +51,6 @@ class AppointmentActions extends StatefulWidget { class _AppointmentActionsState extends State { List appoButtonsList = []; - ToDoCountProviderModel toDoProvider; - @override void initState() { _getAppointmentActionButtons(); @@ -62,7 +60,6 @@ class _AppointmentActionsState extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - toDoProvider = Provider.of(context); var size = MediaQuery.of(context).size; final double itemHeight = projectViewModel.isArabic ? ((size.height - kToolbarHeight - 24) * 0.5) / 2 : ((size.height - kToolbarHeight - 24) * 0.45) / 2; final double itemWidth = size.width / 2; @@ -83,6 +80,7 @@ class _AppointmentActionsState extends State { subTitle: appoButtonsList[index].subtitle, hasBadge: true, isEnable: projectViewModel.havePrivilege(5), + imgColor: Color(0xff28323A), ), ); }, @@ -166,20 +164,20 @@ class _AppointmentActionsState extends State { }); break; - case "onCancelAppointment": - ConfirmDialog dialog = new ConfirmDialog( - context: context, - confirmMessage: TranslationBase.of(context).cancelAppoMsg, - okText: TranslationBase.of(context).confirm, - cancelText: TranslationBase.of(context).cancel_nocaps, - okFunction: () => {cancelAppointment()}, - cancelFunction: () => {}); - dialog.showAlertDialog(context); - break; - - case "confirmAppointment": - confirmAppointment(); - break; + // case "onCancelAppointment": + // ConfirmDialog dialog = new ConfirmDialog( + // context: context, + // confirmMessage: TranslationBase.of(context).cancelAppoMsg, + // okText: TranslationBase.of(context).confirm, + // cancelText: TranslationBase.of(context).cancel_nocaps, + // okFunction: () => {cancelAppointment()}, + // cancelFunction: () => {}); + // dialog.showAlertDialog(context); + // break; + + // case "confirmAppointment": + // confirmAppointment(); + // break; case "navigateToProject": openMap(double.parse(widget.appo.latitude), double.parse(widget.appo.longitude)); @@ -384,38 +382,38 @@ class _AppointmentActionsState extends State { }); } - cancelAppointment() { - ConfirmDialog.closeAlertDialog(context); - GifLoaderDialogUtils.showMyDialog(context); - DoctorsListService service = new DoctorsListService(); - service.cancelAppointment(widget.appo, context).then((res) { - GifLoaderDialogUtils.hideDialog(context); - print(res); - if (res['MessageStatus'] == 1) { - getToDoCount(); - AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); - Navigator.of(context).pop(); - } else { - AppToast.showErrorToast(message: res['ErrorEndUserMessage']); - } - }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - print(err); - }); - } - - getToDoCount() { - toDoProvider.setState(0, true); - ClinicListService service = new ClinicListService(); - service.getActiveAppointmentNo(context).then((res) { - print(res['AppointmentActiveNumber']); - if (res['MessageStatus'] == 1) { - toDoProvider.setState(res['AppointmentActiveNumber'], true); - } else {} - }).catchError((err) { - print(err); - }); - } + // cancelAppointment() { + // ConfirmDialog.closeAlertDialog(context); + // GifLoaderDialogUtils.showMyDialog(context); + // DoctorsListService service = new DoctorsListService(); + // service.cancelAppointment(widget.appo, context).then((res) { + // GifLoaderDialogUtils.hideDialog(context); + // print(res); + // if (res['MessageStatus'] == 1) { + // getToDoCount(); + // AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); + // Navigator.of(context).pop(); + // } else { + // AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + // } + // }).catchError((err) { + // GifLoaderDialogUtils.hideDialog(context); + // print(err); + // }); + // } + + // getToDoCount() { + // toDoProvider.setState(0, true); + // ClinicListService service = new ClinicListService(); + // service.getActiveAppointmentNo(context).then((res) { + // print(res['AppointmentActiveNumber']); + // if (res['MessageStatus'] == 1) { + // toDoProvider.setState(res['AppointmentActiveNumber'], true); + // } else {} + // }).catchError((err) { + // print(err); + // }); + // } openAppointmentLabResults() { GifLoaderDialogUtils.showMyDialog(context); @@ -613,22 +611,22 @@ class _AppointmentActionsState extends State { }); } - confirmAppointment() { - GifLoaderDialogUtils.showMyDialog(context); - DoctorsListService service = new DoctorsListService(); - service.confirmAppointment(widget.appo.appointmentNo, widget.appo.clinicID, widget.appo.projectID, widget.appo.isLiveCareAppointment, context).then((res) { - GifLoaderDialogUtils.hideDialog(context); - if (res['MessageStatus'] == 1) { - AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); - Navigator.of(context).pop(); - } else { - AppToast.showErrorToast(message: res['ErrorEndUserMessage']); - } - }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - print(err); - }); - } + // confirmAppointment() { + // GifLoaderDialogUtils.showMyDialog(context); + // DoctorsListService service = new DoctorsListService(); + // service.confirmAppointment(widget.appo.appointmentNo, widget.appo.clinicID, widget.appo.projectID, widget.appo.isLiveCareAppointment, context).then((res) { + // GifLoaderDialogUtils.hideDialog(context); + // if (res['MessageStatus'] == 1) { + // AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); + // Navigator.of(context).pop(); + // } else { + // AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + // } + // }).catchError((err) { + // GifLoaderDialogUtils.hideDialog(context); + // print(err); + // }); + // } navigateToInsuranceApprovals(int appoNo) { Navigator.push(context, FadePage(page: InsuranceApproval(appointmentNo: appoNo))); diff --git a/lib/pages/medical/labs/labs_home_page.dart b/lib/pages/medical/labs/labs_home_page.dart index 8e0747de..471c2d10 100644 --- a/lib/pages/medical/labs/labs_home_page.dart +++ b/lib/pages/medical/labs/labs_home_page.dart @@ -52,6 +52,7 @@ class LabsHomePage extends StatelessWidget { widthFactor: 1.0, child: ListView.separated( physics: BouncingScrollPhysics(), + padding: EdgeInsets.only(top: 12), separatorBuilder: (context, index) { return Container( height: 1, diff --git a/lib/pages/medical/radiology/radiology_home_page.dart b/lib/pages/medical/radiology/radiology_home_page.dart index d4f34e01..ae2ded5b 100644 --- a/lib/pages/medical/radiology/radiology_home_page.dart +++ b/lib/pages/medical/radiology/radiology_home_page.dart @@ -55,6 +55,7 @@ class RadiologyHomePage extends StatelessWidget { widthFactor: 1.0, child: ListView.separated( physics: BouncingScrollPhysics(), + padding: EdgeInsets.only(top: 12), separatorBuilder: (context, index) { return Container( height: 1, diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index b2ae961c..5605f29d 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -8,6 +8,9 @@ import 'package:diplomaticquarterapp/widgets/others/rounded_container_widget.dar import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; +import 'package:flutter_countdown_timer/countdown_timer_controller.dart'; +import 'package:flutter_countdown_timer/current_remaining_time.dart'; +import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; import 'package:provider/provider.dart'; import 'package:rating_bar/rating_bar.dart'; @@ -25,6 +28,7 @@ class DoctorCard extends StatelessWidget { final bool isSortByClinic; final String appointmentTime; final bool isParentAppointment; + final int remainingTimeInMinutes; DoctorCard( {this.name, @@ -39,6 +43,7 @@ class DoctorCard extends StatelessWidget { this.isInOutPatient, this.isLiveCareAppointment = false, this.appointmentTime, + this.remainingTimeInMinutes, this.isParentAppointment = false}); @override @@ -146,24 +151,41 @@ class DoctorCard extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ myRichText(isSortByClinic ? TranslationBase.of(context).hospital : TranslationBase.of(context).clinic + ":", subName), - if (rating == null) myRichText(TranslationBase.of(context).invoiceNo, billNo ?? ""), - if (rating != null) - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - mainAxisSize: MainAxisSize.max, - children: [ - RatingBar.readOnly( - initialRating: rating, - size: 16.0, - filledColor: Color(0XFFD02127), - emptyColor: Color(0XFFD02127), - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star_border, + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + if (rating == null) myRichText(TranslationBase.of(context).invoiceNo, billNo ?? ""), + if (rating != null) + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + children: [ + RatingBar.readOnly( + initialRating: rating, + size: 16.0, + filledColor: Color(0XFFD02127), + emptyColor: Color(0XFFD02127), + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star_border, + ), + ], ), - ], - ), + if (remainingTimeInMinutes != null) + CountdownTimer( + controller: CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + (remainingTimeInMinutes * 1000) * 60), + widgetBuilder: (_, CurrentRemainingTime time) { + return time != null + ? Text( + "${time.days ?? 0}:${time.hours ?? 0}:${time.min}:${time.sec}", + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xffD02127), letterSpacing: -0.48, height: 18 / 12), + ) + : Container(); + }, + ), + ], + ), ], ), ), diff --git a/lib/widgets/data_display/medical/medical_profile_item.dart b/lib/widgets/data_display/medical/medical_profile_item.dart index 99dd937a..e4655a30 100644 --- a/lib/widgets/data_display/medical/medical_profile_item.dart +++ b/lib/widgets/data_display/medical/medical_profile_item.dart @@ -17,14 +17,9 @@ class MedicalProfileItem extends StatelessWidget { final String subTitle; final bool hasBadge = false; bool isEnable; + Color imgColor; - MedicalProfileItem({ - @required this.imagePath, - @required this.title, - @required this.subTitle, - hasBadge, - this.isEnable = true, - }); + MedicalProfileItem({@required this.imagePath, @required this.title, @required this.subTitle, hasBadge, this.isEnable = true, this.imgColor}); @override Widget build(BuildContext context) { @@ -55,6 +50,7 @@ class MedicalProfileItem extends StatelessWidget { "assets/images/new/services/$imagePath", height: SizeConfig.widthMultiplier * 7, width: SizeConfig.widthMultiplier * 7, + color: imgColor, ), mFlex(2), Text( diff --git a/lib/widgets/data_display/medical/time_line_widget.dart b/lib/widgets/data_display/medical/time_line_widget.dart index 810fc0d8..b2d7ca56 100644 --- a/lib/widgets/data_display/medical/time_line_widget.dart +++ b/lib/widgets/data_display/medical/time_line_widget.dart @@ -52,11 +52,13 @@ class TimeLineWidget extends StatelessWidget { onTap: () { //AppointmentDetails Navigator.push( - context, - FadePage( - page: AppointmentDetails( + context, + FadePage( + page: AppointmentDetails( appo: appoitmentAllHistoryResul, - ))); + ), + ), + ); }, name: appoitmentAllHistoryResul.doctorNameObj, url: appoitmentAllHistoryResul.doctorImageURL, @@ -84,10 +86,7 @@ class TimeLineWidget extends StatelessWidget { height: 4, ), Texts( - DateUtil.getMonthDayYearLangDateFormatted( - DateUtil.convertStringToDate( - appoitmentAllHistoryResul.appointmentDate), - projectViewModel.isArabic ? "ar" : "en"), + DateUtil.getMonthDayYearLangDateFormatted(DateUtil.convertStringToDate(appoitmentAllHistoryResul.appointmentDate), projectViewModel.isArabic ? "ar" : "en"), color: Colors.white, fontSize: 12.5, fontWeight: FontWeight.normal, @@ -116,10 +115,7 @@ class TimeLineWidget extends StatelessWidget { fontWeight: FontWeight.normal, ), Texts( - DateUtil.getMonthDayYearLangDateFormatted( - DateUtil.convertStringToDate( - appoitmentAllHistoryResul.appointmentDate), - projectViewModel.isArabic ? "ar" : "en"), + DateUtil.getMonthDayYearLangDateFormatted(DateUtil.convertStringToDate(appoitmentAllHistoryResul.appointmentDate), projectViewModel.isArabic ? "ar" : "en"), color: Colors.white, fontSize: 12.5, fontWeight: FontWeight.normal, diff --git a/lib/widgets/new_design/doctor_header.dart b/lib/widgets/new_design/doctor_header.dart index bb4a06f9..c7017fe6 100644 --- a/lib/widgets/new_design/doctor_header.dart +++ b/lib/widgets/new_design/doctor_header.dart @@ -78,76 +78,79 @@ class DoctorHeader extends StatelessWidget { headerModel.time ?? DateUtil.formatDateToTime(headerModel.date), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), ), - // Padding( - // padding: const EdgeInsets.only(top: 8.0), - // child: Image.network(headerModel.nationalityFlagURL ?? "", height: 16), - // ), + Padding( + padding: const EdgeInsets.only(top: 8.0), + child: Image.network(headerModel.nationalityFlagURL ?? "", height: 16), + ), ], ) ], ), ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - InkWell( - onTap: onRatingAndReviewTap, - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - SizedBox(width: 21), - RatingBar.readOnly( - initialRating: headerModel.actualDoctorRate + 0.0, - size: 15.0, - filledColor: Color(0XFFD02127), - emptyColor: Color(0XFFD02127), - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star_border, - ), - SizedBox(width: 6), - Text( - "${headerModel.totalReviews} ${TranslationBase.of(context).reviews}", - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.w600, - color: Color(0xff2B353E), - letterSpacing: -0.48, - height: 18 / 12, - decoration: onRatingAndReviewTap != null ? TextDecoration.underline : null, + SizedBox( + height: 43, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + InkWell( + onTap: onRatingAndReviewTap, + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox(width: 21), + RatingBar.readOnly( + initialRating: headerModel.actualDoctorRate + 0.0, + size: 15.0, + filledColor: Color(0XFFD02127), + emptyColor: Color(0XFFD02127), + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star_border, ), - ), - ], - ), - ), - isNeedToShowButton - ? InkWell( - onTap: () { - if (showConfirmMessageDialog) - showConfirmMessage(context, onTap, headerModel.email); - else - onTap(); - }, - child: Container( - padding: EdgeInsets.only(top: 10, bottom: 10, right: 21, left: 15), - decoration: BoxDecoration(color: Color(0XFFD02127), borderRadius: BorderRadius.only(topLeft: Radius.circular(10))), - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - SvgPicture.asset(buttonIcon ?? 'assets/images/new/email.svg', width: 19.0), - SizedBox(width: 6), - Text( - buttonTitle == null ? TranslationBase.of(context).sendEmail : buttonTitle, - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.64, height: 25 / 16), - ), - ], + SizedBox(width: 6), + Text( + "${headerModel.totalReviews} ${TranslationBase.of(context).reviews}", + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.48, + height: 18 / 12, + decoration: onRatingAndReviewTap != null ? TextDecoration.underline : null, ), ), - ) - : Container(), - ], + ], + ), + ), + isNeedToShowButton + ? InkWell( + onTap: () { + if (showConfirmMessageDialog) + showConfirmMessage(context, onTap, headerModel.email); + else + onTap(); + }, + child: Container( + padding: EdgeInsets.only(top: 10, bottom: 10, right: 21, left: 15), + decoration: BoxDecoration(color: Color(0XFFD02127), borderRadius: BorderRadius.only(topLeft: Radius.circular(10))), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + SvgPicture.asset(buttonIcon ?? 'assets/images/new/email.svg', width: 19.0), + SizedBox(width: 6), + Text( + buttonTitle == null ? TranslationBase.of(context).sendEmail : buttonTitle, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.64, height: 25 / 16), + ), + ], + ), + ), + ) + : Container(), + ], + ), ) ], ), diff --git a/lib/widgets/new_design/my_tab_view.dart b/lib/widgets/new_design/my_tab_view.dart index 91d77039..11adfd57 100644 --- a/lib/widgets/new_design/my_tab_view.dart +++ b/lib/widgets/new_design/my_tab_view.dart @@ -1,17 +1,18 @@ import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; + class MyTabView extends StatelessWidget { final String title; final FilterType value; final FilterType groupValue; final VoidCallback onPressed; MyTabView( - this.title, - this.value, - this.groupValue, - this.onPressed, { - Key key, - }) : super(key: key); + this.title, + this.value, + this.groupValue, + this.onPressed, { + Key key, + }) : super(key: key); @override Widget build(BuildContext context) { @@ -27,7 +28,6 @@ class MyTabView extends StatelessWidget { title, style: TextStyle( fontSize: 16, - fontWeight: FontWeight.w600, color: value == groupValue ? Color(0xff2B353E) : Color(0xff575757), letterSpacing: -0.48, diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 0873b65a..91f246ea 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -1,3 +1,4 @@ +import 'package:auto_size_text/auto_size_text.dart'; import 'package:badges/badges.dart'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; @@ -11,7 +12,9 @@ import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_loader_widget.dart'; @@ -61,36 +64,46 @@ class AppScaffold extends StatelessWidget { final List imagesInfo; final bool isHelp; final String icon; + final bool showDropDown; + final int dropdownIndexValue; + List dropDownList; + final Function(int) dropDownIndexChange; + AuthenticatedUserObject authenticatedUserObject = locator(); AppBarWidget appBar; - AppScaffold( - {@required this.body, - this.appBarTitle = '', - this.isLoading = false, - this.isShowAppBar = false, - this.showNewAppBar = false, - this.showNewAppBarTitle = false, - this.hasAppBarParam, - this.bottomSheet, - this.baseViewModel, - this.floatingActionButton, - this.isPharmacy = false, - this.showPharmacyCart = true, - this.isOfferPackages = false, - this.showOfferPackagesCart = false, - this.title, - this.description, - this.isShowDecPage = true, - this.isBottomBar, - this.backgroundColor, - this.preferredSize = 0.0, - this.appBarIcons, - this.infoList, - this.isHelp = false, - this.icon, - this.showHomeAppBarIcon = true, - this.imagesInfo}); + AppScaffold({ + @required this.body, + this.appBarTitle = '', + this.isLoading = false, + this.isShowAppBar = false, + this.showNewAppBar = false, + this.showNewAppBarTitle = false, + this.hasAppBarParam, + this.bottomSheet, + this.baseViewModel, + this.floatingActionButton, + this.isPharmacy = false, + this.showPharmacyCart = true, + this.isOfferPackages = false, + this.showOfferPackagesCart = false, + this.title, + this.description, + this.isShowDecPage = true, + this.isBottomBar, + this.backgroundColor, + this.preferredSize = 0.0, + this.appBarIcons, + this.infoList, + this.isHelp = false, + this.icon, + this.showHomeAppBarIcon = true, + this.imagesInfo, + this.showDropDown = false, + this.dropDownList, + this.dropdownIndexValue, + this.dropDownIndexChange, + }); AppScaffold setOnAppBarCartClick(VoidCallback onClick) { _onCartClick = onClick; @@ -106,6 +119,10 @@ class AppScaffold extends StatelessWidget { ? NewAppBarWidget( title: appBarTitle, showTitle: showNewAppBarTitle, + showDropDown: showDropDown, + dropdownIndexValue: dropdownIndexValue, + dropDownList: dropDownList ?? [], + dropDownIndexChange: dropDownIndexChange, ) : (isShowAppBar ? appBar = AppBarWidget( @@ -154,11 +171,16 @@ class AppScaffold extends StatelessWidget { class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget { final bool showTitle; final String title; - NewAppBarWidget({Key key, this.showTitle = false, this.title = ""}) : super(key: key); + final bool showDropDown; + final int dropdownIndexValue; + List dropDownList; + final Function(int) dropDownIndexChange; + NewAppBarWidget({Key key, this.showTitle = false, this.showDropDown = false, this.title = "", this.dropDownList, this.dropdownIndexValue, this.dropDownIndexChange}) : super(key: key); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); + return AppBar( elevation: 0, backgroundColor: showTitle ? Colors.white : Colors.transparent, @@ -174,6 +196,43 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget { style: TextStyle( fontSize: 24, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24), ), + ), + if (showDropDown) + Container( + decoration: containerRadius(Color(0xFFF7F7F7), 30), + height: 30, + child: DropdownButtonHideUnderline( + child: ButtonTheme( + alignedDropdown: true, + child: DropdownButton( + iconEnabledColor: CustomColors.grey2, + style: TextStyle(color: CustomColors.lightGreyColor, fontSize: 12), + dropdownColor: CustomColors.lightGreyColor, + value: dropdownIndexValue, + items: [ + for (int i = 0; i < dropDownList.length; i++) + DropdownMenuItem( + value: i, + child: AutoSizeText( + dropDownList[i], + style: TextStyle( + fontSize: 12, + fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), + fontWeight: FontWeight.w600, + color: Color(0xff2B2E31), + letterSpacing: -.48, + // height: 12 / 18 + ), + ), + ) + ], + onChanged: dropDownIndexChange, + underline: Container( + height: 0, + ), + ), + ), + ), ) ], ),