From e36e0ce0b7b07d413a72232e09c8ef6630e5d36e Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Sun, 3 Oct 2021 14:50:39 +0300 Subject: [PATCH 1/5] h20 bottom nav bar bug fix (happen in release mode) --- .../bottom_navigation/bottom_nav_bar.dart | 33 ++++++------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/lib/widgets/bottom_navigation/bottom_nav_bar.dart b/lib/widgets/bottom_navigation/bottom_nav_bar.dart index d2ff467e..7f2785ad 100644 --- a/lib/widgets/bottom_navigation/bottom_nav_bar.dart +++ b/lib/widgets/bottom_navigation/bottom_nav_bar.dart @@ -70,29 +70,16 @@ class _BottomNavBarState extends State { name: TranslationBase.of(context).myFamily, ), if (widget.index == 0) - Expanded( - child: (widget.showHomeIcon) - ? SizedBox( - child: BottomNavigationItem( - icon: Icons.home_outlined, - activeIcon: Icons.home_outlined, - changeIndex: _changeIndex, - index: widget.index, - currentIndex: 2, - name: TranslationBase.of(context).home, - ), - ) - : SizedBox( - height: 50, - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - SizedBox(height: 22), - ], - ), - ), - ), + (widget.showHomeIcon) + ? BottomNavigationItem( + icon: Icons.home_outlined, + activeIcon: Icons.home_outlined, + changeIndex: _changeIndex, + index: widget.index, + currentIndex: 2, + name: TranslationBase.of(context).home, + ) + : Expanded(child: SizedBox()), if (widget.index != 0 && projectViewModel.havePrivilege(34)) BottomNavigationItem( icon: Icons.home_outlined, From 4ce941e01e9f6037817f8b91f8cb6cecb7abe6d6 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Sun, 3 Oct 2021 15:48:02 +0300 Subject: [PATCH 2/5] prescription order log detail view change on arabic --- .../prescriptions/prescriptions_history_details_page.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/pages/medical/prescriptions/prescriptions_history_details_page.dart b/lib/pages/medical/prescriptions/prescriptions_history_details_page.dart index e451c317..ccc37fdf 100644 --- a/lib/pages/medical/prescriptions/prescriptions_history_details_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_history_details_page.dart @@ -69,14 +69,16 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget { ], ), child: Container( - margin: EdgeInsets.only(left: 6), + margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0), padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12), decoration: BoxDecoration( color: Colors.white, border: Border.all(color: Colors.white, width: 1), borderRadius: BorderRadius.only( - bottomRight: Radius.circular(10.0), - topRight: Radius.circular(10.0), + bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0), + topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0), + bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0), + topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0), ), ), child: Column( From 5b330b2a25632b426c8cb9f11e7952ac40d2487b Mon Sep 17 00:00:00 2001 From: "Mirza.Shafique" Date: Sun, 3 Oct 2021 16:14:03 +0300 Subject: [PATCH 3/5] Covid New Design --- assets/images/new/direction.svg | 8 + assets/images/new/passport.svg | 14 + lib/config/config.dart | 4 +- lib/config/localized_values.dart | 4 +- .../Covid-DriveThru/Covid-TimeSlots.dart | 361 ++++++------- .../covid-dirvethru-questions.dart | 250 ++++++--- .../covid-drivethru-location.dart | 67 +-- .../Covid-DriveThru/covid-payment-alert.dart | 407 ++++++-------- .../covid-payment-details.dart | 496 ++++++++++-------- .../covid-payment-summary.dart | 114 ++-- lib/pages/ToDoList/payment_method_select.dart | 64 +-- .../medical/labs/passport_update_page.dart | 256 +++++++-- lib/uitl/translations_delegate_base.dart | 31 ++ lib/widgets/dragable_sheet.dart | 26 + 14 files changed, 1220 insertions(+), 882 deletions(-) create mode 100644 assets/images/new/direction.svg create mode 100644 assets/images/new/passport.svg create mode 100644 lib/widgets/dragable_sheet.dart diff --git a/assets/images/new/direction.svg b/assets/images/new/direction.svg new file mode 100644 index 00000000..05d10bc2 --- /dev/null +++ b/assets/images/new/direction.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/images/new/passport.svg b/assets/images/new/passport.svg new file mode 100644 index 00000000..883287fb --- /dev/null +++ b/assets/images/new/passport.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/lib/config/config.dart b/lib/config/config.dart index 0b3fc7ea..6bf726ac 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -12,8 +12,8 @@ const PACKAGES_PRODUCTS = '/api/products'; const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; -const BASE_URL = 'https://uat.hmgwebservices.com/'; -// const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 0a34fd9f..5c0aab81 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -86,8 +86,10 @@ const Map localizedValues = { 'instruction': {'en': 'Instructions', 'ar': 'تعليمات'}, 'livecare': {'en': 'LiveCare', 'ar': 'لايف كير'}, 'livecareAppo': {'en': 'LiveCare Appointment', 'ar': 'الموعد لايف كير'}, + 'agreeTo': {'en': 'I agree the', 'ar': 'أوافق على'}, + 'termsConditoins': {'en': 'Terms and Conditions', 'ar': 'الأحكام والشروط'}, 'cancelAppoMsg': {'en': 'Are you sure you want to cancel this appointment?', 'ar': 'هل أنت متأكد أنك تريد إلغاء هذا الموعد؟'}, - + 'changePayment': {'en': 'Change Payment Method', 'ar': 'قم بتغيير آلية الدفع'}, 'upcoming-noAction': {'en': 'No Action Required', 'ar': 'لا يوجد إجراء مطلوب'}, 'upcoming-confirm': {'en': 'Please confirm the appointment to avoid cancellation', 'ar': 'يرجى تأكيد الموعد لتفادي الإلغاء'}, "book-success-confirm-more-24-1-2": {"en": "The online payment process will be available 24 hours before the appointment.", "ar": "- عملية الدفع الالكتروني ستكون متاحة قبل الموعد ب 24 ساعة."}, diff --git a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart index c12dd877..a7b84e39 100644 --- a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart +++ b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart @@ -8,11 +8,13 @@ import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresRe import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-alert.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.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/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -43,8 +45,7 @@ class CovidTimeSlots extends StatefulWidget { _CovidTimeSlotsState createState() => _CovidTimeSlotsState(); } -class _CovidTimeSlotsState extends State - with TickerProviderStateMixin { +class _CovidTimeSlotsState extends State with TickerProviderStateMixin { Map _events; AnimationController _animationController; CalendarController _calendarController; @@ -76,8 +77,7 @@ class _CovidTimeSlotsState extends State _selectedDay: ['Event A0'] }; - WidgetsBinding.instance.addPostFrameCallback( - (_) => getCovidFreeSlots(context, widget.projectID)); + WidgetsBinding.instance.addPostFrameCallback((_) => getCovidFreeSlots(context, widget.projectID)); _calendarController = CalendarController(); _animationController = AnimationController( @@ -96,25 +96,21 @@ class _CovidTimeSlotsState extends State super.dispose(); } - void _onDaySelected( - DateTime day, List events, ProjectViewModel projectViewModel) { + void _onDaySelected(DateTime day, List events, ProjectViewModel projectViewModel) { final DateFormat formatter = DateFormat('yyyy-MM-dd'); setState(() { - this.selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted( - day, projectViewModel.isArabic ? "ar" : "en"); + this.selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(day, projectViewModel.isArabic ? "ar" : "en"); openTimeSlotsPickerForDate(day, docFreeSlots); CovidTimeSlots.selectedDate = formatter.format(day); print(CovidTimeSlots.selectedDate); }); } - void _onVisibleDaysChanged( - DateTime first, DateTime last, CalendarFormat format) { + void _onVisibleDaysChanged(DateTime first, DateTime last, CalendarFormat format) { print('CALLBACK: _onVisibleDaysChanged'); } - void _onCalendarCreated( - DateTime first, DateTime last, CalendarFormat format) { + void _onCalendarCreated(DateTime first, DateTime last, CalendarFormat format) { print('CALLBACK: _onCalendarCreated'); } @@ -124,154 +120,114 @@ class _CovidTimeSlotsState extends State return AppScaffold( appBarTitle: TranslationBase.of(context).covidTest, isShowAppBar: true, - body: SingleChildScrollView( - child: Container( - margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - height: 150.0, - decoration: BoxDecoration( - image: DecorationImage( - image: AssetImage( - "assets/images/new-design/covid-19-big-banner-bg.png"), - fit: BoxFit.fill, - ), - color: Colors.white.withOpacity(0.3), - borderRadius: BorderRadius.all(Radius.circular(10))), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: - EdgeInsets.only(left: 15.0, right: 15.0, top: 30.0), - child: SvgPicture.asset( - 'assets/images/new-design/covid-19-car.svg', - width: 90.0, - height: 90.0), - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.only( - left: 20.0, right: 20.0, top: 20.0), - child: Text(TranslationBase.of(context).covidTest, - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 24.0)), - ), - Container( - margin: EdgeInsets.only( - left: 20.0, right: 20.0, top: 10.0), - child: Text(TranslationBase.of(context).driveThru, - style: TextStyle( - color: Colors.white, fontSize: 24.0)), - ), - ], - ), - ], - ), - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10.0), - color: Colors.white), - margin: EdgeInsets.fromLTRB(0.0, 20.0, 0.0, 5.0), - padding: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 20.0), - width: MediaQuery.of(context).size.width, - // height: MediaQuery.of(context).size.height * 0.65, + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: CustomColors.appBackgroudGrey2Color, + body: Column( + children: [ + Expanded( + child: SingleChildScrollView( + child: Container( + margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, children: [ Container( - margin: EdgeInsets.all(10.0), - child: Text(TranslationBase.of(context).selectAppo, - style: - TextStyle(color: Colors.black, fontSize: 16.0)), - ), - Container( - margin: EdgeInsets.only(top: 10.0), - alignment: Alignment.center, - child: Text(selectedDate, - style: TextStyle( - fontSize: 18.0, fontWeight: FontWeight.bold)), - ), - Container( - height: 50, - margin: EdgeInsets.all(20.0), - child: ListView.builder( - controller: _scrollController, - scrollDirection: Axis.horizontal, - itemCount: dayEvents.length, - itemBuilder: (context, index) { - return Container( - margin: EdgeInsets.only(right: 10.0), - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(5.0), - side: BorderSide( - color: Colors.blue[400], - //Color of the border - style: BorderStyle.solid, - //Style of the border - width: 1.5, //width of the border - ), - ), - minWidth: - MediaQuery.of(context).size.width * 0.2, - child: index == selectedButtonIndex - ? getSelectedButton(index) - : getNormalButton(index)), - ); - }, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Text( + TranslationBase.of(context).selectAppo, + style: TextStyle( + color: Colors.black, + fontSize: 16.0, + letterSpacing: -0.64, + fontWeight: FontWeight.w600, + ), + ), + Card( + shape: cardRadius(12), + child: _buildTableCalendarWithBuilders(projectViewModel), + ), + mHeight(12), + Text( + selectedDate, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + letterSpacing: -0.64, + ), + ), + mHeight(8), + Container( + height: 40, + child: ListView.builder( + controller: _scrollController, + scrollDirection: Axis.horizontal, + itemCount: dayEvents.length, + itemBuilder: (context, index) { + return Container( + margin: EdgeInsets.only(right: (index == dayEvents.length - 1) ? 0 : 5.0, left: index == 0 ? 0 : 5), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(5.0), + side: BorderSide( + color: index == selectedButtonIndex ? CustomColors.green : Colors.black, //Color of the border + style: BorderStyle.solid, //Style of the border + width: 1.5, //width of the border + ), + ), + minWidth: MediaQuery.of(context).size.width * 0.2, + child: index == selectedButtonIndex ? getSelectedButton(index) : getNormalButton(index)), + ); + }, + ), + ), + ], ), ), - _buildTableCalendarWithBuilders(projectViewModel), + SizedBox( + height: 100.0, + ), ], ), ), - SizedBox( - height: 100.0, - ), - ], + ), ), - ), - ), - bottomSheet: Container( - margin: EdgeInsets.all(10.0), - child: Flex( - direction: Axis.horizontal, - children: [ - Expanded( - flex: 1, - child: Container( - margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.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: Colors.grey[500], - onPressed: () { - bookCovidTestAppointment(); - }, - child: Text(TranslationBase.of(context).bookNow, - style: TextStyle(fontSize: 18.0)), + Card( + elevation: 20, + margin: EdgeInsets.zero, + shape: cardRadius(0), + child: Container( + width: double.infinity, + padding: EdgeInsets.all(12), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: CustomColors.green, + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: Colors.grey[500], + onPressed: () { + bookCovidTestAppointment(); + }, + child: Text( + TranslationBase.of(context).bookAppo, + style: TextStyle( + fontSize: 16.0, + letterSpacing: -0.64, + ), ), ), ), ), - ], - ), + ) + ], ), ); } @@ -297,12 +253,10 @@ class _CovidTimeSlotsState extends State holidayStyle: TextStyle().copyWith(color: Colors.blue[800]), ), daysOfWeekStyle: DaysOfWeekStyle( - weekendStyle: TextStyle().copyWith(color: Colors.blue[600]), - ), - headerStyle: HeaderStyle( - centerHeaderTitle: true, - formatButtonVisible: false, + weekendStyle: TextStyle().copyWith(color: Colors.black, fontSize: 11.0, fontWeight: FontWeight.w600), + weekdayStyle: TextStyle().copyWith(color: Colors.black, fontSize: 11.0, fontWeight: FontWeight.w600), ), + headerStyle: HeaderStyle(centerHeaderTitle: true, formatButtonVisible: false, titleTextStyle: TextStyle(fontSize: 16, letterSpacing: -0.64, fontWeight: FontWeight.w600)), builders: CalendarBuilders( selectedDayBuilder: (context, date, _) { return FadeTransition( @@ -315,7 +269,7 @@ class _CovidTimeSlotsState extends State height: 0, child: Text( '${date.day}', - style: TextStyle().copyWith(fontSize: 16.0), + style: TextStyle().copyWith(fontSize: 14.0), ), ), ); @@ -327,8 +281,8 @@ class _CovidTimeSlotsState extends State color: _calendarController.isSelected(date) ? Colors.green[400] : _calendarController.isToday(date) - ? Colors.brown[300] - : Colors.blue[400], + ? Colors.transparent + : Color(0xff76cfb7), ), width: 40.0, height: 40.0, @@ -370,8 +324,7 @@ class _CovidTimeSlotsState extends State openTimeSlotsPickerForDate(DateTime dateStart, List freeSlots) { dayEvents.clear(); - DateTime dateStartObj = new DateTime( - dateStart.year, dateStart.month, dateStart.day, 0, 0, 0, 0, 0); + DateTime dateStartObj = new DateTime(dateStart.year, dateStart.month, dateStart.day, 0, 0, 0, 0, 0); freeSlots.forEach((v) { if (v.start == dateStartObj) dayEvents.add(v); @@ -396,48 +349,49 @@ class _CovidTimeSlotsState extends State final DateFormat formatter = DateFormat('HH:mm'); final DateFormat dateFormatter = DateFormat('yyyy-MM-dd'); for (var i = 0; i < freeSlotsResponse.length; i++) { - date = - DateUtil.convertStringToDate(freeSlotsResponse[i]['FreeTimeSlots']); + date = DateUtil.convertStringToDate(freeSlotsResponse[i]['FreeTimeSlots']); slotsList.add(FreeSlot(date, ['slot'])); - docFreeSlots.add(TimeSlot( - isoTime: formatter.format(date), - start: new DateTime(date.year, date.month, date.day, 0, 0, 0, 0), - end: date)); + docFreeSlots.add(TimeSlot(isoTime: formatter.format(date), start: new DateTime(date.year, date.month, date.day, 0, 0, 0, 0), end: date)); } - _eventsParsed = - Map.fromIterable(slotsList, key: (e) => e.slot, value: (e) => e.event); + _eventsParsed = Map.fromIterable(slotsList, key: (e) => e.slot, value: (e) => e.event); setState(() { - CovidTimeSlots.selectedDate = dateFormatter.format( - DateUtil.convertStringToDate(freeSlotsResponse[0]['FreeTimeSlots'])); - selectedDate = DateUtil.getMonthDayYearDateFormatted( - DateUtil.convertStringToDate(freeSlotsResponse[0]['FreeTimeSlots'])); + CovidTimeSlots.selectedDate = dateFormatter.format(DateUtil.convertStringToDate(freeSlotsResponse[0]['FreeTimeSlots'])); + selectedDate = DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(freeSlotsResponse[0]['FreeTimeSlots'])); selectedDateJSON = freeSlotsResponse[0]['FreeTimeSlots']; }); - openTimeSlotsPickerForDate( - DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots); - _calendarController - .setFocusedDay(DateUtil.convertStringToDate(selectedDateJSON)); + openTimeSlotsPickerForDate(DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots); + _calendarController.setFocusedDay(DateUtil.convertStringToDate(selectedDateJSON)); return _eventsParsed; } Widget _buildEventsMarker(DateTime date, List events) { return Container( - decoration: BoxDecoration( - shape: BoxShape.circle, - color: _calendarController.isSelected(date) - ? Colors.green[400] - : _calendarController.isToday(date) - ? Colors.brown[300] - : Colors.blue[400], - ), + // decoration: BoxDecoration( + // shape: BoxShape.circle, + // color: _calendarController.isSelected(date) + // ? Colors.green[400] + // : _calendarController.isToday(date) + // ? Colors.brown[300] + // : Colors.blue[400], + // ), + + decoration: containerColorRadiusBorderWidth( + _calendarController.isSelected(date) + ? CustomColors.green + : _calendarController.isToday(date) + ? CustomColors.green.withOpacity(0.5) + : Colors.white, + 200, + _calendarController.isSelected(date) ? CustomColors.green : Colors.black, + 2), width: 40.0, height: 40.0, child: Center( child: Text( '${date.day}', style: TextStyle().copyWith( - color: Colors.white, - fontSize: 14.0, + color: _calendarController.isSelected(date) ? Colors.white : Colors.black, + fontSize: 13.0, ), ), ), @@ -447,6 +401,7 @@ class _CovidTimeSlotsState extends State Widget getNormalButton(int index) { return RaisedButton( color: Colors.white, + elevation: 0, textColor: new Color(0xFF60686b), onPressed: () { setState(() { @@ -455,14 +410,13 @@ class _CovidTimeSlotsState extends State print(CovidTimeSlots.selectedTime); }); }, - child: Text(dayEvents[index].isoTime, - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)), + child: Text(dayEvents[index].isoTime, style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold)), ); } Widget getSelectedButton(int index) { return RaisedButton( - color: Colors.blue[400], + color: CustomColors.green, //Color of the border textColor: Colors.white, onPressed: () { setState(() { @@ -471,8 +425,7 @@ class _CovidTimeSlotsState extends State print(CovidTimeSlots.selectedTime); }); }, - child: Text(dayEvents[index].isoTime, - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)), + child: Text(dayEvents[index].isoTime, style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold)), ); } @@ -489,19 +442,11 @@ class _CovidTimeSlotsState extends State DoctorsListService service = new DoctorsListService(); AppoitmentAllHistoryResultList appo; service - .insertAppointment( - docObject.doctorID, - docObject.clinicID, - docObject.projectID, - CovidTimeSlots.selectedTime, - CovidTimeSlots.selectedDate, - context, - widget.selectedProcedure.procedureID) + .insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, CovidTimeSlots.selectedTime, CovidTimeSlots.selectedDate, context, widget.selectedProcedure.procedureID) .then((res) { if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: "Appointment Booked Successfully"); - getPatientShare(context, res['AppointmentNo'], docObject.clinicID, - docObject.projectID, docObject); + getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject); } else { GifLoaderDialogUtils.hideDialog(context); appo = new AppoitmentAllHistoryResultList(); @@ -532,8 +477,7 @@ class _CovidTimeSlotsState extends State }); } - cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, - BuildContext context) { + cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context) { ConfirmDialog.closeAlertDialog(context); GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); @@ -551,12 +495,9 @@ class _CovidTimeSlotsState extends State }); } - getPatientShare(context, String appointmentNo, int clinicID, int projectID, - DoctorList docObject) { + getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) { DoctorsListService service = new DoctorsListService(); - service - .getPatientShare(appointmentNo, clinicID, projectID, context) - .then((res) { + service.getPatientShare(appointmentNo, clinicID, projectID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); print(res); widget.patientShareResponse = new PatientShareResponse.fromJson(res); @@ -571,8 +512,7 @@ class _CovidTimeSlotsState extends State Navigator.push( context, FadePage( - page: CovidPaymentAlert( - patientShareResponse: widget.patientShareResponse), + page: CovidPaymentAlert(patientShareResponse: widget.patientShareResponse), ), ); } @@ -586,14 +526,7 @@ class _CovidTimeSlotsState extends State if (res['COVID19_FreeTimeSlots'].length != 0) { freeSlotsResponse = res['COVID19_FreeTimeSlots']; _getJSONSlots().then((value) => { - setState(() => { - widget.selectedClinicID = - freeSlotsResponse[0]['ClinicID'], - widget.selectedDoctorID = - freeSlotsResponse[0]['DoctorID'], - _events.clear(), - _events = value - }) + setState(() => {widget.selectedClinicID = freeSlotsResponse[0]['ClinicID'], widget.selectedDoctorID = freeSlotsResponse[0]['DoctorID'], _events.clear(), _events = value}) }); } else {} } else { diff --git a/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart b/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart index 0f07081f..c4126218 100644 --- a/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart +++ b/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart @@ -1,16 +1,20 @@ import 'dart:convert'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart'; import 'package:diplomaticquarterapp/pages/medical/labs/passport_update_page.dart'; import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'covid-payment-details.dart'; @@ -34,81 +38,209 @@ class CovidDirveThruQuestionsState extends State { } TranslationBase localize; + ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { localize = TranslationBase.of(context); var isArabic = localize.isArabic(); + projectViewModel = Provider.of(context); return AppScaffold( appBarTitle: TranslationBase.of(context).covidTest, isShowAppBar: true, + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: CustomColors.appBackgroudGrey2Color, body: Column( - crossAxisAlignment: CrossAxisAlignment.start, children: [ - Padding( - padding: const EdgeInsets.all(20), - child: Text(localize.covidSelectProcedure, style: TextStyle(fontSize: 17, letterSpacing: 1, fontWeight: FontWeight.bold)), - ), Expanded( - child: ListView.separated( - padding: EdgeInsets.symmetric(horizontal: 20), - itemCount: qa.length, - itemBuilder: (ctx, idx) { - var obj = qa[idx]; - var qtext = isArabic ? obj["questionAR"] : obj["questionEN"]; - - return Padding( - padding: const EdgeInsets.symmetric(vertical: 10), + child: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.all(16.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text(qtext, style: TextStyle(fontSize: 15, letterSpacing: 1.5)), - Row( - children: [ - Radio( - value: 1, - groupValue: obj["ans"], - onChanged: (newValue) { - setState(() { - obj["ans"] = newValue; - }); - }), - Text(localize.yes), - ], + Container( + width: double.infinity, + child: Card( + shape: cardRadius(12), + margin: EdgeInsets.zero, + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "Booking appointment for:", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + letterSpacing: -0.64, + ), + ), + mHeight(6), + Row( + children: [ + Text( + TranslationBase.of(context).patientName + ":", + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 10, + letterSpacing: -0.6, + color: CustomColors.grey, + ), + ), + mWidth(3), + Text( + projectViewModel.user.firstName + " " + projectViewModel.user.lastName, + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 12, + letterSpacing: -0.48, + ), + ), + ], + ), + Row( + children: [ + Text( + TranslationBase.of(context).fileNo + ":", + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 10, + letterSpacing: -0.6, + color: CustomColors.grey, + ), + ), + mWidth(3), + Text( + projectViewModel.user.patientIdentificationNo, + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 12, + letterSpacing: -0.48, + ), + ), + ], + ), + ], + ), + ), + ), + ), + mHeight(12), + Text( + "Please answer below questionnaire", + style: TextStyle( + fontSize: 16, + letterSpacing: -0.64, + fontWeight: FontWeight.bold, + ), + ), + mHeight(12), + ListView.separated( + itemCount: qa.length, + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemBuilder: (ctx, idx) { + var obj = qa[idx]; + var qtext = isArabic ? obj["questionAR"] : obj["questionEN"]; + + return Padding( + padding: const EdgeInsets.symmetric(vertical: 10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + qtext, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, + ), + ), + Row( + children: [ + Expanded( + child: Row( + children: [ + Radio( + value: 1, + groupValue: obj["ans"], + onChanged: (newValue) { + setState(() { + obj["ans"] = newValue; + }); + }), + Text( + localize.yes, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + ), + Expanded( + child: Row( + children: [ + Radio( + value: 0, + groupValue: obj["ans"], + onChanged: (newValue) { + setState(() { + obj["ans"] = newValue; + }); + }), + Text( + localize.no, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + ) + ], + ), + ], + ), + ); + }, + separatorBuilder: (ctx, idx) => Container(), ), - Row( - children: [ - Radio( - value: 0, - groupValue: obj["ans"], - onChanged: (newValue) { - setState(() { - obj["ans"] = newValue; - }); - }), - Text(localize.no), - ], - ) ], ), - ); - }, - separatorBuilder: (ctx, idx) => Divider(height: 0.25, color: Colors.grey.withOpacity(0.5)), - )), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), - child: FractionallySizedBox( - widthFactor: 1, - child: MaterialButton( - height: 50, - color: Theme.of(context).appBarTheme.color, - disabledColor: Theme.of(context).appBarTheme.color.withOpacity(0.25), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), - child: Text( - localize.next, - style: TextStyle(color: Colors.white, fontSize: 13, letterSpacing: 1), - ), - onPressed: next), + ), + ), + ), + Card( + margin: EdgeInsets.zero, + elevation: 20, + child: Container( + padding: EdgeInsets.all(12), + child: FractionallySizedBox( + widthFactor: 1, + child: MaterialButton( + height: 50, + color: CustomColors.accentColor, + disabledColor: Theme.of(context).appBarTheme.color.withOpacity(0.25), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), + child: Text( + localize.next, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + letterSpacing: -0.44, + color: Colors.white, + ), + ), + onPressed: next), + ), ), ), ], @@ -132,7 +264,7 @@ class CovidDirveThruQuestionsState extends State { openPassportUpdatePage() { Navigator.push(context, FadePage(page: PassportUpdatePage())).then((value) { print(value); - if(value != null && value == true) { + if (value != null && value == true) { getPaymentInfo(context, widget.projectId); } }); diff --git a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart index 8f38290e..b397b228 100644 --- a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart +++ b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart @@ -67,7 +67,7 @@ class _CovidDrivethruLocationState extends State { isShowDecPage: true, showNewAppBarTitle: true, showNewAppBar: true, - backgroundColor: CustomColors.appBackgroudGreyColor, + backgroundColor: CustomColors.appBackgroudGrey2Color, body: Column( children: [ Expanded( @@ -185,10 +185,13 @@ class _CovidDrivethruLocationState extends State { padding: const EdgeInsets.only(left: 12, right: 12, top: 6, bottom: 6), child: Row( children: [ - SvgPicture.asset( - "assets/images/new/blood_pressure.svg", - width: 18, - height: 18, + Padding( + padding: const EdgeInsets.all(3.0), + child: SvgPicture.asset( + "assets/images/new/direction.svg", + width: 13, + height: 13, + ), ), mWidth(6), Text( @@ -218,33 +221,37 @@ class _CovidDrivethruLocationState extends State { ), ), ), - Container( - width: double.infinity, - padding: EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12), - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: RaisedButton( - color: CustomColors.accentColor, - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: CustomColors.accentColor, - onPressed: () { - next(); - }, - child: Text( - TranslationBase.of(context).next, - style: TextStyle( - fontSize: 16.0, - fontWeight: FontWeight.bold, - letterSpacing: -0.44, + Card( + elevation: 20, + margin: EdgeInsets.zero, + child: Container( + width: double.infinity, + padding: EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: CustomColors.accentColor, + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: CustomColors.accentColor, + onPressed: () { + next(); + }, + child: Text( + TranslationBase.of(context).next, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + letterSpacing: -0.44, + ), ), ), - ), - )), + )), + ), ], ), ); diff --git a/lib/pages/Covid-DriveThru/covid-payment-alert.dart b/lib/pages/Covid-DriveThru/covid-payment-alert.dart index ca6640c0..8dc7e64f 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-alert.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-alert.dart @@ -3,9 +3,11 @@ import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.da import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-summary.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; @@ -29,213 +31,135 @@ class _CovidPaymentAlertState extends State { return AppScaffold( appBarTitle: TranslationBase.of(context).covidTest, isShowAppBar: true, - body: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - height: 200.0, - color: new Color(0xFFc5272d), - child: Row( + showNewAppBarTitle: true, + showNewAppBar: true, + backgroundColor: CustomColors.appBackgroudGrey2Color, + body: Column( + children: [ + Expanded( + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(left: 50.0), - child: SvgPicture.asset( - 'assets/images/new-design/alert_icon.svg', - width: 80.0, - height: 80.0), - ), - Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, + color: new Color(0xFFc5272d), + padding: EdgeInsets.all(20), + child: Row( children: [ - Container( - margin: EdgeInsets.only(left: 30.0, right: 20.0), - child: Text(TranslationBase.of(context).covidAlert, - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 24.0)), + Icon( + Icons.warning_outlined, + color: Colors.white, ), - Container( - width: MediaQuery.of(context).size.width * 0.55, - margin: EdgeInsets.only( - left: 30.0, right: 20.0, top: 5.0), + mWidth(12), + Expanded( child: Text( - TranslationBase.of(context).covidAlertHeader, - // "Pay With-in 15 mins to confirm the appointment", - overflow: TextOverflow.clip, - style: TextStyle( - color: Colors.white, fontSize: 20.0)), - ), + TranslationBase.of(context).covidAlertHeader, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.w600, + fontSize: 16.0, + letterSpacing: -0.64, + ), + ), + ) ], ), ), - ], - ), - ), - Container( - margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 30.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - alignment: Alignment.center, - child: Text(TranslationBase.of(context).covidAlertMins, - overflow: TextOverflow.clip, - style: TextStyle( - color: new Color(0xFFc5272d), - fontSize: 24.0, - fontWeight: FontWeight.bold)), - ), - Container( - alignment: Alignment.center, - margin: EdgeInsets.only(top: 15.0), - child: Text( - TranslationBase.of(context).covidAlertInfo, - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.grey[700], - fontSize: 18.0, - letterSpacing: 0.8)), - ), Container( - margin: EdgeInsets.only( - top: 40.0, bottom: 10.0, left: 0.0, right: 20.0), - child: Text(TranslationBase.of(context).appoInfo, - style: TextStyle( - fontSize: 18.0, - color: Colors.grey[700], - fontWeight: FontWeight.bold)), - ), - Container( - margin: EdgeInsets.only(left: 0.0, bottom: 20.0), - width: MediaQuery.of(context).size.width, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.grey[200], - boxShadow: [ - BoxShadow(color: Colors.grey, spreadRadius: 2), - ], - ), + margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 30.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - margin: EdgeInsets.only( - top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), - child: Text(TranslationBase.of(context).covidTest, - style: TextStyle( - fontSize: 18.0, - color: Colors.black, - fontWeight: FontWeight.bold)), - ), - Container( - margin: EdgeInsets.only(bottom: 10.0), - child: Row( - children: [ - Container( - margin: - EdgeInsets.only(left: 20.0, right: 20.0), - child: Icon( - Icons.local_hospital, - size: 24, - color: Colors.grey[700], - )), - Container( - child: Text( - widget.patientShareResponse.projectName != - null - ? widget - .patientShareResponse.projectName - : "NULL", - style: TextStyle( - fontSize: 18.0, - color: Colors.grey[700])), - ), - ], - ), - ), - Container( - margin: EdgeInsets.only(bottom: 10.0), - child: Row( - children: [ - Container( - margin: - EdgeInsets.only(left: 20.0, right: 20.0), - child: Icon( - Icons.date_range, - size: 24, - color: Colors.grey[700], - )), - Container( - child: Text( - widget.patientShareResponse - .appointmentDate != - null - ? getDate(widget.patientShareResponse - .appointmentDate) - .split(" ")[0] - : "NULL", - style: TextStyle( - fontSize: 18.0, - color: Colors.grey[700])), - ), - ], + Text( + TranslationBase.of(context).covidAlertMins, + style: TextStyle( + fontSize: 19.0, + letterSpacing: -1.6, + fontWeight: FontWeight.bold, ), ), - Container( - margin: EdgeInsets.only(bottom: 10.0), - child: Row( - children: [ - Container( - margin: - EdgeInsets.only(left: 20.0, right: 20.0), - child: Icon( - Icons.access_time, - size: 24, - color: Colors.grey[700], - )), - Container( - child: Text( - widget.patientShareResponse - .appointmentDate != - null - ? getDate(widget.patientShareResponse - .appointmentDate) - .split(" ")[1] - : "NULL", - style: TextStyle( - fontSize: 18.0, - color: Colors.grey[700])), - ), - ], + Text( + TranslationBase.of(context).covidAlertInfo, + style: TextStyle( + color: Colors.grey[700], + fontSize: 14.0, + letterSpacing: -0.56, ), ), + mHeight(20), Container( - margin: EdgeInsets.only(bottom: 10.0), - child: Row( - children: [ - Container( - margin: - EdgeInsets.only(left: 20.0, right: 20.0), - child: SvgPicture.asset( - "assets/images/new-design/track_icon.svg", - width: 20.0, - height: 20.0)), - Container( - child: Text( - widget.patientShareResponse.doctorNameObj != - null - ? widget - .patientShareResponse.doctorNameObj - : "NULL", + width: double.infinity, + child: Card( + margin: EdgeInsets.zero, + shape: cardRadius(12), + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).appoInfo, style: TextStyle( - fontSize: 18.0, - color: Colors.grey[700])), + fontSize: 16.0, + letterSpacing: -0.64, + fontWeight: FontWeight.bold, + ), + ), + mHeight(16), + Row( + children: [ + _getNormalText( + TranslationBase.of(context).hospital + ":", + ), + mWidth(6), + _getNormalText( + widget.patientShareResponse.projectName != null ? widget.patientShareResponse.projectName : "NULL", + isBold: true, + ), + ], + ), + mHeight(4), + Row( + children: [ + _getNormalText( + TranslationBase.of(context).date + ":", + ), + mWidth(6), + _getNormalText( + widget.patientShareResponse.appointmentDate != null ? getDate(widget.patientShareResponse.appointmentDate).split(" ")[0] : "NULL", + isBold: true, + ), + ], + ), + mHeight(4), + Row( + children: [ + _getNormalText( + TranslationBase.of(context).time + ":", + ), + mWidth(6), + _getNormalText( + widget.patientShareResponse.appointmentDate != null ? getDate(widget.patientShareResponse.appointmentDate).split(" ")[1] : "NULL", + isBold: true, + ), + ], + ), + mHeight(4), + Row( + children: [ + _getNormalText( + TranslationBase.of(context).route + ":", + ), + mWidth(6), + _getNormalText( + widget.patientShareResponse.doctorNameObj != null ? widget.patientShareResponse.doctorNameObj : "NULL", + isBold: true, + ), + ], + ), + ], ), - ], + ), ), ), ], @@ -244,39 +168,51 @@ class _CovidPaymentAlertState extends State { ], ), ), - ], - ), - ), - bottomSheet: Container( - margin: EdgeInsets.all(10.0), - child: Flex( - direction: Axis.horizontal, - children: [ - Expanded( - flex: 1, - child: Container( - margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.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: Colors.grey[500], - onPressed: () { - startPaymentProcess(); - }, - child: Text(TranslationBase.of(context).next, style: TextStyle(fontSize: 18.0)), + ), + Card( + margin: EdgeInsets.zero, + elevation: 20, + child: Container( + margin: EdgeInsets.all(12), + width: double.infinity, + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: CustomColors.accentColor, + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: Colors.grey[500], + onPressed: () { + startPaymentProcess(); + }, + child: Text( + TranslationBase.of(context).next, + style: TextStyle( + fontSize: 16.0, + letterSpacing: -0.48, + ), ), ), ), ), - ], - ), + ), + ], + ), + ); + } + + _getNormalText(text, {bool isBold = false}) { + return Text( + text, + style: TextStyle( + fontSize: isBold ? 12 : 10, + letterSpacing: -0.5, + color: isBold ? Colors.black : Colors.grey[700], + fontWeight: FontWeight.w600, ), ); } @@ -285,31 +221,32 @@ class _CovidPaymentAlertState extends State { navigateToPaymentMethod(context, widget.patientShareResponse); } - Future navigateToPaymentMethod( - context, PatientShareResponse patientShareResponse) async { + Future navigateToPaymentMethod(context, PatientShareResponse patientShareResponse) async { if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); setState(() { authUser = data; }); } + Navigator.push( - context, FadePage(page: PaymentMethod())) - .then((value) { - print(value); - if (value != null) { - Navigator.push( - context, - FadePage( - page: CovidPaymentSummary( - patientShareResponse: widget.patientShareResponse, - selectedPaymentMethod: value.toString()), - ), - ); - } - }); + context, + FadePage( + page: CovidPaymentSummary(patientShareResponse: widget.patientShareResponse, selectedPaymentMethod: "MADA"), + ), + ); + // Navigator.push(context, FadePage(page: PaymentMethod())).then((value) { + // print(value); + // if (value != null) { + // Navigator.push( + // context, + // FadePage( + // page: CovidPaymentSummary(patientShareResponse: widget.patientShareResponse, selectedPaymentMethod: value.toString()), + // ), + // ); + // } + // }); } String getDate(String appoDate) { diff --git a/lib/pages/Covid-DriveThru/covid-payment-details.dart b/lib/pages/Covid-DriveThru/covid-payment-details.dart index 67b973fe..84f991e0 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-details.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-details.dart @@ -2,8 +2,10 @@ import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoRespo import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/Covid-TimeSlots.dart'; import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.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/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -16,10 +18,7 @@ class CovidPaymentDetails extends StatefulWidget { List proceduresList; CovidTestProceduresResponse selectedProcedure; - CovidPaymentDetails( - {@required this.covidPaymentInfoResponse, - @required this.projectID, - @required this.proceduresList}); + CovidPaymentDetails({@required this.covidPaymentInfoResponse, @required this.projectID, @required this.proceduresList}); @override _CovidPaymentDetailsState createState() => _CovidPaymentDetailsState(); @@ -39,76 +38,66 @@ class _CovidPaymentDetailsState extends State { return AppScaffold( appBarTitle: TranslationBase.of(context).covidTest, isShowAppBar: true, - body: SingleChildScrollView( - child: Container( - margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 100.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - height: 150.0, - decoration: BoxDecoration( - image: DecorationImage( - image: AssetImage( - "assets/images/new-design/covid-19-big-banner-bg.png"), - fit: BoxFit.fill, - ), - color: Colors.white.withOpacity(0.3), - borderRadius: BorderRadius.all(Radius.circular(10))), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: - EdgeInsets.only(left: 15.0, right: 15.0, top: 30.0), - child: SvgPicture.asset( - 'assets/images/new-design/covid-19-car.svg', - width: 90.0, - height: 90.0), - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.only( - left: 20.0, right: 20.0, top: 20.0), - child: Text(TranslationBase.of(context).covidTest, - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 24.0)), - ), - Container( - margin: EdgeInsets.only( - left: 20.0, right: 20.0, top: 10.0), - child: Text(TranslationBase.of(context).driveThru, - style: TextStyle( - color: Colors.white, fontSize: 24.0)), - ), - ], - ), - ], - ), - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10.0), - color: Colors.white), - margin: EdgeInsets.fromLTRB(0.0, 30.0, 0.0, 5.0), - padding: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 20.0), + showNewAppBarTitle: true, + showNewAppBar: true, + backgroundColor: CustomColors.appBackgroudGrey2Color, + body: Container( + // margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 100.0), + + child: Column( + children: [ + Expanded( + child: Padding( + padding: EdgeInsets.all(16), child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - alignment: Alignment.center, - margin: - EdgeInsets.only(left: 0.0, right: 20.0, top: 10.0), - child: Text( - TranslationBase.of(context).covidSelectProcedure, - style: TextStyle( - color: Colors.black, - fontSize: 20.0, - fontWeight: FontWeight.bold)), - ), + // Container( + // height: 150.0, + // decoration: BoxDecoration( + // image: DecorationImage( + // image: AssetImage( + // "assets/images/new-design/covid-19-big-banner-bg.png"), + // fit: BoxFit.fill, + // ), + // color: Colors.white.withOpacity(0.3), + // borderRadius: BorderRadius.all(Radius.circular(10))), + // child: Row( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Container( + // margin: + // EdgeInsets.only(left: 15.0, right: 15.0, top: 30.0), + // child: SvgPicture.asset( + // 'assets/images/new-design/covid-19-car.svg', + // width: 90.0, + // height: 90.0), + // ), + // Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Container( + // margin: EdgeInsets.only( + // left: 20.0, right: 20.0, top: 20.0), + // child: Text(TranslationBase.of(context).covidTest, + // style: TextStyle( + // color: Colors.white, + // fontWeight: FontWeight.bold, + // fontSize: 24.0)), + // ), + // Container( + // margin: EdgeInsets.only( + // left: 20.0, right: 20.0, top: 10.0), + // child: Text(TranslationBase.of(context).driveThru, + // style: TextStyle( + // color: Colors.white, fontSize: 24.0)), + // ), + // ], + // ), + // ], + // ), + // ), + Text(TranslationBase.of(context).covidSelectProcedure, style: TextStyle(color: Colors.black, fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.bold)), ...List.generate( widget.proceduresList.length, (index) => Column( @@ -124,15 +113,18 @@ class _CovidPaymentDetailsState extends State { child: InkWell( onTap: () { setState(() { - widget.selectedProcedure = - widget.proceduresList[index]; + widget.selectedProcedure = widget.proceduresList[index]; }); }, child: ListTile( title: Text( - widget.proceduresList[index] - .procedureName, - style: TextStyle(fontSize: 14.0)), + widget.proceduresList[index].procedureName, + style: TextStyle( + fontSize: 12.0, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, + ), + ), leading: Radio( value: widget.proceduresList[index], groupValue: widget.selectedProcedure, @@ -141,13 +133,8 @@ class _CovidPaymentDetailsState extends State { onChanged: (value) { setState(() { widget.selectedProcedure = value; - print(widget - .selectedProcedure.procedureName); - getPaymentInfo( - context, - widget.projectID.toString(), - widget.selectedProcedure - .procedureID); + print(widget.selectedProcedure.procedureName); + getPaymentInfo(context, widget.projectID.toString(), widget.selectedProcedure.procedureID); }); }, ), @@ -159,148 +146,197 @@ class _CovidPaymentDetailsState extends State { ], ), ), - Divider(), + + Card( + shape: cardRadius(12), + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(TranslationBase.of(context).testFee, + style: TextStyle( + color: Colors.black, + fontSize: 16.0, + fontWeight: FontWeight.w600, + letterSpacing: -0.64, + )), + Container( + width: double.infinity, + padding: EdgeInsets.only(top: 10, bottom: 3), + child: Row( + children: [ + Expanded( + child: _getNormalText(TranslationBase.of(context).patientShareToDo), + ), + Expanded( + child: _getNormalText(widget.covidPaymentInfoResponse.patientShareField.toString(), isBold: true), + ) + ], + ), + ), + mDivider(Colors.grey[100]), + Container( + width: double.infinity, + padding: EdgeInsets.only(top: 3, bottom: 3), + child: Row( + children: [ + Expanded( + child: _getNormalText(TranslationBase.of(context).patientTaxToDo), + ), + Expanded( + child: _getNormalText(widget.covidPaymentInfoResponse.patientTaxAmountField.toString(), isBold: true), + ) + ], + ), + ), + mDivider(Colors.grey[100]), + Container( + width: double.infinity, + padding: EdgeInsets.only(top: 3, bottom: 3), + child: Row( + children: [ + Expanded( + child: _getNormalText(TranslationBase.of(context).patientShareTotalToDo), + ), + Expanded( + child: _getNormalText(widget.covidPaymentInfoResponse.patientShareWithTaxField.toString(), isBold: true), + ) + ], + ), + ), + ], + ), + ), + ), + Container( - alignment: Alignment.center, - margin: - EdgeInsets.only(left: 0.0, right: 20.0, top: 10.0), - child: Text(TranslationBase.of(context).testFee, - style: TextStyle( - color: Colors.black, - fontSize: 22.0, - fontWeight: FontWeight.bold)), + margin: EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 0.0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Checkbox( + value: isAgree, + onChanged: (value) { + setState(() { + isAgree = !isAgree; + }); + }, + activeColor: Color(0xffB8382C), + ), + Text( + TranslationBase.of(context).agreeTo, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, + ), + ), + mWidth(3), + Text( + TranslationBase.of(context).termsConditoins, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + color: CustomColors.accentColor, + fontWeight: FontWeight.w600, + decoration: TextDecoration.underline, + ), + ), + ], + ), ), - Table( - children: [ - TableRow(children: [ - TableCell( - child: _getNormalText(TranslationBase.of(context) - .patientShareToDo)), - TableCell( - child: _getNormalText(widget - .covidPaymentInfoResponse.patientShareField - .toString())), - ]), - TableRow(children: [ - TableCell( - child: _getNormalText( - TranslationBase.of(context).patientTaxToDo)), - TableCell( - child: _getNormalText(widget - .covidPaymentInfoResponse - .patientTaxAmountField - .toString())), - ]), - TableRow(children: [ - TableCell( - child: _getNormalText(TranslationBase.of(context) - .patientShareTotalToDo)), - TableCell( - child: _getNormalText(widget - .covidPaymentInfoResponse - .patientShareWithTaxField - .toString())), - ]), - ], + mFlex(1), + + Text( + TranslationBase.of(context).payOptions, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 12.0, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, + ), ), - ], - ), - ), - Container( - margin: EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 5.0), - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Checkbox( - value: isAgree, - onChanged: (value) { - setState(() { - isAgree = !isAgree; - }); - }, - activeColor: Color(0xffB8382C), + Container( + margin: EdgeInsets.only(top: 12, bottom: 12), + child: Image.asset("assets/images/new-design/payment_options_invoice_confirmation.png", width: 300), ), - Texts(TranslationBase.of(context) - .iAgreeToTheTermsAndConditions), ], ), ), - Divider( - color: Colors.grey, - ), - Container( - alignment: Alignment.center, - margin: EdgeInsets.fromLTRB(20.0, 15.0, 20.0, 5.0), - child: Text(TranslationBase.of(context).payOptions, - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 16.0, - fontWeight: FontWeight.bold, - fontFamily: "Open-Sans")), - ), - Container( - alignment: Alignment.center, - margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 5.0), - child: Image.asset( - "assets/images/new-design/payment_options_invoice_confirmation.png", - width: 300), - ), - ], - ), - ), - ), - bottomSheet: Container( - margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 20.0), - child: Flex( - direction: Axis.horizontal, - children: [ - Expanded( - flex: 1, - child: Container( - margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.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: Colors.grey[500], - onPressed: () { - cancel(); - }, - child: Text(TranslationBase.of(context).cancel, - style: TextStyle(fontSize: 18.0)), - ), - ), - ), ), - Expanded( - flex: 1, - child: Container( - margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.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: Colors.grey[500], - onPressed: isAgree ? next : null, - child: Text(TranslationBase.of(context).next, - style: TextStyle(fontSize: 18.0)), + Container( + width: double.infinity, + child: Card( + elevation: 20, + margin: EdgeInsets.zero, + child: Padding( + padding: const EdgeInsets.only(top: 12, bottom: 12, left: 12, right: 12), + child: Row( + children: [ + Expanded( + flex: 1, + child: Container( + 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: Colors.grey[500], + onPressed: () { + cancel(); + }, + child: Text( + TranslationBase.of(context).cancel, + style: TextStyle( + fontSize: 16.0, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, + ), + ), + ), + ), + ), + ), + mWidth(12), + Expanded( + flex: 1, + child: Container( + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: CustomColors.accentColor, + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: Colors.grey[500], + onPressed: isAgree ? next : null, + child: Text( + TranslationBase.of(context).next, + style: TextStyle( + fontSize: 16.0, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, + ), + ), + ), + ), + ), + ), + ], ), ), ), - ), + ) ], ), ), @@ -321,19 +357,14 @@ class _CovidPaymentDetailsState extends State { Navigator.pop(context); } - getPaymentInfo( - BuildContext context, String projectID, String selectedProcedureID) { + getPaymentInfo(BuildContext context, String projectID, String selectedProcedureID) { CovidDriveThruService service = new CovidDriveThruService(); GifLoaderDialogUtils.showMyDialog(context); - service - .getCovidPaymentInformation( - context, int.parse(projectID), selectedProcedureID) - .then((res) { + service.getCovidPaymentInformation(context, int.parse(projectID), selectedProcedureID).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { - widget.covidPaymentInfoResponse = - CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']); + widget.covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']); }); } else {} }).catchError((err) { @@ -341,16 +372,15 @@ class _CovidPaymentDetailsState extends State { }); } - _getNormalText(text) { - return Container( - margin: EdgeInsets.only(top: 20.0, right: 10.0), - child: Text(text, - textAlign: TextAlign.end, - style: TextStyle( - fontSize: 15, - fontFamily: 'Open-Sans', - letterSpacing: 0.5, - color: Colors.grey[700])), + _getNormalText(text, {bool isBold = false}) { + return Text( + text, + style: TextStyle( + fontSize: isBold ? 12 : 10, + letterSpacing: -0.5, + color: isBold ? Colors.black : Colors.grey[700], + fontWeight: FontWeight.w600, + ), ); } } diff --git a/lib/pages/Covid-DriveThru/covid-payment-summary.dart b/lib/pages/Covid-DriveThru/covid-payment-summary.dart index 2f403991..89ce1086 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-summary.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-summary.dart @@ -4,14 +4,18 @@ import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.da import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/QRCode.dart'; +import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dragable_sheet.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -41,6 +45,9 @@ class _CovidPaymentSummaryState extends State { return AppScaffold( appBarTitle: TranslationBase.of(context).covidTest, isShowAppBar: true, + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: CustomColors.appBackgroudGrey2Color, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( @@ -48,11 +55,13 @@ class _CovidPaymentSummaryState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts( + Text( TranslationBase.of(context).confirmThePayment, - textAlign: TextAlign.center, - fontWeight: FontWeight.w500, - fontSize: 24, + style: TextStyle( + fontSize: 19, + fontWeight: FontWeight.bold, + letterSpacing: -1.46, + ), ), SizedBox( height: 12, @@ -61,14 +70,14 @@ class _CovidPaymentSummaryState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( - height: 100.0, + height: 80.0, padding: EdgeInsets.all(7.0), width: MediaQuery.of(context).size.width * 0.45, child: widget.selectedPaymentMethod == "ApplePay" ? SvgPicture.asset(getImagePath(widget.selectedPaymentMethod)) : Image.asset(getImagePath(widget.selectedPaymentMethod)), ), Texts( '${widget.patientShareResponse.patientShareWithTax} ' + TranslationBase.of(context).sar, - fontSize: 26, + fontSize: 20, bold: true, ) ], @@ -76,57 +85,70 @@ class _CovidPaymentSummaryState extends State { SizedBox( height: 12, ), + Row( + children: [ + Container( + width: 14, + height: 14, + decoration: containerRadius(CustomColors.accentColor, 200), + ), + mFlex(1), + InkWell( + onTap: () { + showDraggableDialog(context, PaymentMethod()); + }, + child: Text( + TranslationBase.of(context).changePayment, + style: TextStyle(fontWeight: FontWeight.w600, fontSize: 12, letterSpacing: -0.48, decoration: TextDecoration.underline, color: CustomColors.accentColor), + ), + ) + ], + ), + SizedBox( + height: 12, + ), Row( children: [ Expanded( - child: Container( - margin: EdgeInsets.all(3), - child: NewTextFields( - hintText: TranslationBase.of(context).fileNumber, - initialValue: projectViewModel.user.patientID.toString(), - isEnabled: false, - ), + flex: 1, + child: showDetail( + TranslationBase.of(context).fileNumber, + projectViewModel.user.patientID.toString(), ), ), + mWidth(6), Expanded( - child: Container( - margin: EdgeInsets.all(3), - child: NewTextFields( - hintText: TranslationBase.of(context).name, - initialValue: projectViewModel.user.firstName, - isEnabled: false, - ), + flex: 1, + child: showDetail( + TranslationBase.of(context).name, + projectViewModel.user.firstName.toString(), ), ), ], ), SizedBox( - height: 12, - ), - NewTextFields( - hintText: TranslationBase.of(context).mobileNumber, - initialValue: projectViewModel.user.mobileNumber, - isEnabled: false, + height: 6, ), + showDetail(TranslationBase.of(context).mobileNumber, projectViewModel.user.mobileNumber), SizedBox( - height: 12, - ), - NewTextFields( - hintText: TranslationBase.of(context).depositorName, - initialValue: projectViewModel.user.firstName + " " + projectViewModel.user.middleName + " " + projectViewModel.user.lastName, - isEnabled: false, + height: 6, ), + showDetail( + TranslationBase.of(context).depositorName, + projectViewModel.user.firstName + " " + projectViewModel.user.middleName + " " + projectViewModel.user.lastName, + ) ], ), ), ), bottomSheet: Container( + color: Colors.white, height: MediaQuery.of(context).size.height * 0.1, width: double.infinity, padding: EdgeInsets.all(12), child: SecondaryButton( textColor: Colors.white, - color: Theme.of(context).primaryColor, + color: CustomColors.green, label: TranslationBase.of(context).confirm.toUpperCase(), onTap: () { startPaymentProcess(projectViewModel.user); @@ -136,6 +158,32 @@ class _CovidPaymentSummaryState extends State { ); } + Widget showDetail(String title, String value) { + return Container( + width: double.infinity, + child: Card( + shape: cardRadius(12), + margin: EdgeInsets.zero, + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: TextStyle(fontSize: 11, fontWeight: FontWeight.w600, letterSpacing: -0.64), + ), + Text( + value, + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, letterSpacing: -0.64, color: Colors.grey), + ), + ], + ), + ), + ), + ); + } + startPaymentProcess(AuthenticatedUser authenticatedUser) { AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); appo.projectID = widget.patientShareResponse.projectID; diff --git a/lib/pages/ToDoList/payment_method_select.dart b/lib/pages/ToDoList/payment_method_select.dart index 30b0dd47..b3ada181 100644 --- a/lib/pages/ToDoList/payment_method_select.dart +++ b/lib/pages/ToDoList/payment_method_select.dart @@ -33,7 +33,7 @@ class _PaymentMethodState extends State { Container( margin: EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 0.0), alignment: Alignment.center, - child: Text(TranslationBase.of(context).selectPaymentOption, style: TextStyle(fontSize: 26.0, fontWeight: FontWeight.bold)), + child: Text(TranslationBase.of(context).selectPaymentOption, style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold)), ), Container( margin: EdgeInsets.only(top: 25.0), @@ -147,40 +147,42 @@ class _PaymentMethodState extends State { ], ), ), - Platform.isIOS ? Container( - margin: EdgeInsets.only(top: 25.0), - child: Flex( - direction: Axis.horizontal, - children: [ - Expanded( - child: Container( - child: InkWell( - onTap: () { - updateSelectedPaymentMethod("ApplePay"); - }, - child: Card( - elevation: 3.0, - margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - side: selectedPaymentMethod == "ApplePay" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0), - ), + Platform.isIOS + ? Container( + margin: EdgeInsets.only(top: 25.0), + child: Flex( + direction: Axis.horizontal, + children: [ + Expanded( child: Container( - height: 120.0, - padding: EdgeInsets.all(20.0), - child: SvgPicture.asset("assets/images/new-design/applepay.svg"), + child: InkWell( + onTap: () { + updateSelectedPaymentMethod("ApplePay"); + }, + child: Card( + elevation: 3.0, + margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + side: selectedPaymentMethod == "ApplePay" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0), + ), + child: Container( + height: 120.0, + padding: EdgeInsets.all(20.0), + child: SvgPicture.asset("assets/images/new-design/applepay.svg"), + ), + ), + ), ), ), - ), + Expanded( + child: Container(), + ), + ], ), - ), - Expanded( - child: Container(), - ), - ], - ), - ) : Container(), + ) + : Container(), SizedBox( height: 150.0, ), diff --git a/lib/pages/medical/labs/passport_update_page.dart b/lib/pages/medical/labs/passport_update_page.dart index ad77320f..06fdbd3a 100644 --- a/lib/pages/medical/labs/passport_update_page.dart +++ b/lib/pages/medical/labs/passport_update_page.dart @@ -1,11 +1,15 @@ import 'package:diplomaticquarterapp/core/service/medical/labs_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:provider/provider.dart'; class PassportUpdatePage extends StatefulWidget { @override @@ -15,6 +19,7 @@ class PassportUpdatePage extends StatefulWidget { class _PassportUpdatePageState extends State { TextEditingController passportNumber = new TextEditingController(); bool _isButtonDisabled; + ProjectViewModel projectViewModel; @override void initState() { @@ -24,60 +29,223 @@ class _PassportUpdatePageState extends State { @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); return AppScaffold( appBarTitle: TranslationBase.of(context).passportNumber, isShowAppBar: true, isBottomBar: true, showNewAppBar: true, - showNewAppBarTitle: true, + showNewAppBarTitle: true,backgroundColor: CustomColors.appBackgroudGrey2Color, body: Container( - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - margin: EdgeInsets.all(45.0), - child: Text(TranslationBase.of(context).enterPassportNumber, textAlign: TextAlign.center, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold, color: Colors.black)), + child: Column( + children: [ + Expanded( + child: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: double.infinity, + child: Card( + shape: cardRadius(12), + margin: EdgeInsets.zero, + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "Booking appointment for:", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + letterSpacing: -0.64, + ), + ), + mHeight(6), + Row( + children: [ + Text( + TranslationBase.of(context).patientName + ":", + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 10, + letterSpacing: -0.6, + color: CustomColors.grey, + ), + ), + mWidth(3), + Text( + projectViewModel.user.firstName + " " + projectViewModel.user.lastName, + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 12, + letterSpacing: -0.48, + ), + ), + ], + ), + Row( + children: [ + Text( + TranslationBase.of(context).fileNo + ":", + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 10, + letterSpacing: -0.6, + color: CustomColors.grey, + ), + ), + mWidth(3), + Text( + projectViewModel.user.patientIdentificationNo, + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 12, + letterSpacing: -0.48, + ), + ), + ], + ), + ], + ), + ), + ), + ), + mHeight(40), + SvgPicture.asset("assets/images/new/passport.svg", width: 40.0, fit: BoxFit.fill), + mHeight(12), + Text( + TranslationBase.of(context).enterPassportNumber, + textAlign: TextAlign.start, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + color: Colors.black, + letterSpacing: -0.64, + ), + ), + mHeight(8), + inputWidget(TranslationBase.of(context).passportNumber, "", passportNumber), + ], + ), + ), ), - Container( - margin: EdgeInsets.only(top: 5.0, bottom: 5.0), - child: SvgPicture.asset("assets/images/new-design/passport.svg", width: 250.0, fit: BoxFit.fill), + ), + Container( + margin: EdgeInsets.only(top: 12.0, left: 12.0, right: 12.0, bottom: 10.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width, + height: 45.0, + child: RaisedButton( + color: new Color(0xFFc5272d), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: Colors.red[300], + onPressed: () { + if (_isButtonDisabled == false) + updatePassportNumber(); + else + AppToast.showErrorToast(message: TranslationBase.of(context).validPassportNumber); + }, + child: Text( + TranslationBase.of(context).submit, + style: TextStyle( + fontSize: 16.0, + letterSpacing: -0.64, + ), + ), + ), ), - Container( - margin: EdgeInsets.only(left: 50.0, right: 50.0, top: 25.0), - child: TextFields( - keyboardType: TextInputType.text, - fontWeight: FontWeight.normal, - controller: passportNumber, - onChanged: (value) => {_onPassportTextChanged(value)}, - padding: EdgeInsets.only(top: 20, bottom: 20, left: 10, right: 10), - hintText: TranslationBase.of(context).passportNumber, - )), - Container( - margin: EdgeInsets.only(top: 30.0, left: 45.0, right: 45.0, bottom: 10.0), - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), + ), + ], + ), + ), + ); + } + + Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) { + return Container( + padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + border: Border.all( + color: Color(0xffefefef), + width: 1, + ), + ), + child: InkWell( + onTap: hasSelection ? () {} : null, + child: Row( + children: [ + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + _labelText, + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), ), - minWidth: MediaQuery.of(context).size.width, - height: 45.0, - child: RaisedButton( - color: new Color(0xFFc5272d), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: Colors.red[300], - onPressed: () { - if (_isButtonDisabled == false) - updatePassportNumber(); - else - AppToast.showErrorToast(message: TranslationBase.of(context).validPassportNumber); - }, - child: Text(TranslationBase.of(context).submit, style: TextStyle(fontSize: 18.0)), + TextField( + enabled: isEnable, + scrollPadding: EdgeInsets.zero, + keyboardType: TextInputType.number, + controller: _controller, + onChanged: (value) => {_onPassportTextChanged(value)}, + style: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + decoration: InputDecoration( + isDense: true, + hintText: _hintText, + hintStyle: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff575757), + letterSpacing: -0.56, + ), + prefixIconConstraints: BoxConstraints(minWidth: 50), + prefixIcon: prefix == null + ? null + : Text( + "+" + prefix, + style: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w500, + color: Color(0xff2E303A), + letterSpacing: -0.56, + ), + ), + contentPadding: EdgeInsets.zero, + border: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + ), ), - ), + ], ), - ], - ), + ), + if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined), + ], ), ), ); @@ -116,7 +284,7 @@ class _PassportUpdatePageState extends State { GifLoaderDialogUtils.hideDialog(context); print(res['Covid19_Certificate_GetPassportList'][0]['PassportNo']); passportNumber.text = res['Covid19_Certificate_GetPassportList'][0]['PassportNo']; - if(res['Covid19_Certificate_GetPassportList'][0]['PassportNo'] != "") { + if (res['Covid19_Certificate_GetPassportList'][0]['PassportNo'] != "") { _isButtonDisabled = false; } }).catchError((err) { diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index cd16c74b..ac61ee9d 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -69,7 +69,9 @@ class TranslationBase { String get enterDocName => localizedValues['enterDocName'][locale.languageCode]; String get search => localizedValues['search'][locale.languageCode]; + String get noResultFound => localizedValues['noResultFound'][locale.languageCode]; + String get pleaseEnterProductName => localizedValues['pleaseEnterProductName'][locale.languageCode]; String get bookNow => localizedValues['bookNow'][locale.languageCode]; @@ -415,7 +417,9 @@ class TranslationBase { String get sendEmail => localizedValues['sendEmail'][locale.languageCode]; String get close => localizedValues['close'][locale.languageCode]; + String get closeIt => localizedValues['closeIt'][locale.languageCode]; + String get booked => localizedValues['booked'][locale.languageCode]; String get confirmed => localizedValues['confirmed'][locale.languageCode]; @@ -754,6 +758,10 @@ class TranslationBase { String get save => localizedValues['Save'][locale.languageCode]; + String get agreeTo => localizedValues['agreeTo'][locale.languageCode]; + + String get termsConditoins => localizedValues['termsConditoins'][locale.languageCode]; + String get userAgreement => localizedValues['UserAgreement'][locale.languageCode]; String get updateSuccessfully => localizedValues['UpdateSuccessfully'][locale.languageCode]; @@ -810,6 +818,8 @@ class TranslationBase { String get confirmThePayment => localizedValues['ConfirmThePayment'][locale.languageCode]; + String get changePayment => localizedValues['changePayment'][locale.languageCode]; + String get depositorName => localizedValues['DepositorName'][locale.languageCode]; String get mobileNumber => localizedValues['MobileNumber'][locale.languageCode]; @@ -907,16 +917,27 @@ class TranslationBase { String get lakum => localizedValues['lakum'][locale.languageCode]; String get wishlist => localizedValues['wishlist'][locale.languageCode]; + String get brands => localizedValues['brands'][locale.languageCode]; + String get products => localizedValues['products'][locale.languageCode]; + String get reviews => localizedValues['reviews'][locale.languageCode]; + String get productDetails => localizedValues['productDetails'][locale.languageCode]; + String get noReviewsAvailable => localizedValues['noReviewsAvailable'][locale.languageCode]; + String get noLocationAvailable => localizedValues['noLocationAvailable'][locale.languageCode]; + String get myPrescriptions => localizedValues['myPrescriptions'][locale.languageCode]; + String get medicationRefill => localizedValues['medicationRefill'][locale.languageCode]; + String get pillReminder => localizedValues['pillReminder'][locale.languageCode]; + String get shippingAddresses => localizedValues['shippingAddresses'][locale.languageCode]; + String get reachUs => localizedValues['reachUs'][locale.languageCode]; String get ourLocations => localizedValues['ourLocations'][locale.languageCode]; @@ -1133,10 +1154,15 @@ class TranslationBase { String get yearOld => localizedValues['years-old'][locale.languageCode]; String get categorise => localizedValues['categorise'][locale.languageCode]; + String get refine => localizedValues['refine'][locale.languageCode]; + String get apply => localizedValues['apply'][locale.languageCode]; + String get reset => localizedValues['reset'][locale.languageCode]; + String get viewCategorise => localizedValues['viewCategorise'][locale.languageCode]; + String get cart => localizedValues['cart'][locale.languageCode]; String get wishList => localizedValues['wishList'][locale.languageCode]; @@ -1744,10 +1770,15 @@ class TranslationBase { String get quantitySize => localizedValues['quantitySize'][locale.languageCode]; String get addToCart => localizedValues['addToCart'][locale.languageCode]; + String get addToWishlist => localizedValues['addToWishlist'][locale.languageCode]; + String get buyNow => localizedValues['buyNow'][locale.languageCode]; + String get quantityShortcut => localizedValues['quantityShortcut'][locale.languageCode]; + String get noData => localizedValues['noData'][locale.languageCode]; + String get no_data => localizedValues['no_data'][locale.languageCode]; String get year => localizedValues['Year'][locale.languageCode]; diff --git a/lib/widgets/dragable_sheet.dart b/lib/widgets/dragable_sheet.dart new file mode 100644 index 00000000..4d91118b --- /dev/null +++ b/lib/widgets/dragable_sheet.dart @@ -0,0 +1,26 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +showDraggableDialog(BuildContext context, Widget child) { + showGeneralDialog( + barrierLabel: "Label", + barrierDismissible: false, + barrierColor: Colors.black.withOpacity(0.2), + transitionDuration: Duration(milliseconds: 200), + context: context, + pageBuilder: (context, anim1, anim2) { + return Dismissible( + direction: DismissDirection.vertical, + key: const Key('key'), + onDismissed: (_) => Navigator.of(context).pop(), + child: child, + ); + }, + transitionBuilder: (context, anim1, anim2, child) { + return SlideTransition( + position: Tween(begin: Offset(0, 1), end: Offset(0, 0)).animate(anim1), + child: child, + ); + }, + ); +} From 74432b6bbb220327d3c1be7a8c37dafa8b551600 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Sun, 3 Oct 2021 17:51:31 +0300 Subject: [PATCH 4/5] cmc order log ui changes --- lib/config/config.dart | 4 +- .../NewCMC/new_cmc_step_one_page.dart | 274 ++++---- .../ComprehensiveMedicalCheckup/cmc_page.dart | 71 +- .../orders_log_details_page.dart | 608 ++++++++++++------ .../fragments/home_page_fragment2.dart | 2 +- 5 files changed, 582 insertions(+), 377 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 6bf726ac..41d54fd5 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -12,8 +12,8 @@ const PACKAGES_PRODUCTS = '/api/products'; const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; -const BASE_URL = 'https://hmgwebservices.com/'; + const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart index d4e2ee02..3c1ceea4 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart @@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -22,7 +23,7 @@ class NewCMCStepOnePage extends StatefulWidget { final double latitude; final double longitude; - const NewCMCStepOnePage({Key key, this.cMCInsertPresOrderRequestModel, this.model, this.changePageViewIndex,this.latitude,this.longitude}) : super(key: key); + const NewCMCStepOnePage({Key key, this.cMCInsertPresOrderRequestModel, this.model, this.changePageViewIndex, this.latitude, this.longitude}) : super(key: key); @override _NewCMCStepOnePageState createState() => _NewCMCStepOnePageState(); @@ -41,160 +42,151 @@ class _NewCMCStepOnePageState extends State { return AppScaffold( isShowAppBar: false, baseViewModel: widget.model, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Container( - margin: EdgeInsets.only(left: 12, right: 12), - child: Center( - child: Column( - children: [ - ListView.separated( - physics: NeverScrollableScrollPhysics(), - shrinkWrap: true, - itemBuilder: (context, index) { - return Row( - children: [ - Radio( - value: widget.model.cmcAllServicesList[index].serviceID, - activeColor: Colors.red[800], - onChanged: (newValue) async { - PatientERCMCInsertServicesList patientERCMCInsertServicesList = new PatientERCMCInsertServicesList( - price: widget.model.cmcAllServicesList[index].price, - serviceID: widget.model.cmcAllServicesList[index].serviceID.toString(), - selectedServiceName: widget.model.cmcAllServicesList[index].description, - selectedServiceNameAR: widget.model.cmcAllServicesList[index].descriptionN, - recordID: 1, - totalPrice: widget.model.cmcAllServicesList[index].totalPrice, - vAT: widget.model.cmcAllServicesList[index].vAT); - setState(() { - widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList = [patientERCMCInsertServicesList]; - }); - CMCGetItemsRequestModel cMCGetItemsRequestModel = new CMCGetItemsRequestModel(checkupType: newValue); - await widget.model.getCheckupItems(cMCGetItemsRequestModel: cMCGetItemsRequestModel); - }, - groupValue: widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList.length > 0 - ? int.parse(widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList[0].serviceID) - : 1), - Expanded( - child: Padding( - padding: const EdgeInsets.only( - left: 10, - right: 10, - top: 20, - bottom: 20, - ), - child: Text( - projectViewModel.isArabic ? widget.model.cmcAllServicesList[index].descriptionN : widget.model.cmcAllServicesList[index].description, - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w600, - letterSpacing: -0.45, + body: Column( + children: [ + Expanded( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + padding: EdgeInsets.all(21), + child: Column( + children: [ + ListView.separated( + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, index) { + return Row( + children: [ + Radio( + value: widget.model.cmcAllServicesList[index].serviceID, + activeColor: Colors.red[800], + onChanged: (newValue) async { + PatientERCMCInsertServicesList patientERCMCInsertServicesList = new PatientERCMCInsertServicesList( + price: widget.model.cmcAllServicesList[index].price, + serviceID: widget.model.cmcAllServicesList[index].serviceID.toString(), + selectedServiceName: widget.model.cmcAllServicesList[index].description, + selectedServiceNameAR: widget.model.cmcAllServicesList[index].descriptionN, + recordID: 1, + totalPrice: widget.model.cmcAllServicesList[index].totalPrice, + vAT: widget.model.cmcAllServicesList[index].vAT); + setState(() { + widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList = [patientERCMCInsertServicesList]; + }); + CMCGetItemsRequestModel cMCGetItemsRequestModel = new CMCGetItemsRequestModel(checkupType: newValue); + await widget.model.getCheckupItems(cMCGetItemsRequestModel: cMCGetItemsRequestModel); + }, + groupValue: widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList.length > 0 + ? int.parse(widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList[0].serviceID) + : 1), + Expanded( + child: Padding( + padding: const EdgeInsets.only( + left: 10, + right: 10, + top: 20, + bottom: 20, + ), + child: Text( + projectViewModel.isArabic ? widget.model.cmcAllServicesList[index].descriptionN : widget.model.cmcAllServicesList[index].description, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.45, + ), ), ), ), - ), - ], - ); - }, - separatorBuilder: (context, index) { - return mDivider(Colors.grey); - }, - itemCount: widget.model.cmcAllServicesList.length), - Card( - shape: cardRadius(12), - elevation: 4, - child: Container( - width: double.infinity, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.only(left: 12,right: 12,top: 12), - child: Text( - TranslationBase.of(context).coveredService, - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w600, - letterSpacing: -0.45, + ], + ); + }, + separatorBuilder: (context, index) { + return mDivider(Colors.grey); + }, + itemCount: widget.model.cmcAllServicesList.length), + Card( + shape: cardRadius(12), + elevation: 4, + child: Container( + width: double.infinity, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only(left: 12, right: 12, top: 12), + child: Text( + TranslationBase.of(context).coveredService, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.45, + ), ), ), - ), - ListView.separated( - itemBuilder: (context, index) { - return Padding( - padding: const EdgeInsets.all(12.0), - child: Text( - widget.model.checkupItems[index].itemName, - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.w600, - letterSpacing: -0.45, + ListView.separated( + itemBuilder: (context, index) { + return Padding( + padding: const EdgeInsets.all(12.0), + child: Text( + widget.model.checkupItems[index].itemName, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + letterSpacing: -0.45, + ), ), - ), - ); - }, - separatorBuilder: (context, index) { - return mDivider(Colors.grey); - }, - physics: NeverScrollableScrollPhysics(), - shrinkWrap: true, - itemCount: widget.model.checkupItems.length, - ), - ], + ); + }, + separatorBuilder: (context, index) { + return mDivider(Colors.grey); + }, + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: widget.model.checkupItems.length, + ), + ], + ), ), ), - ), - mHeight(MediaQuery.of(context).size.height * 0.12), - ], + ], + ), ), ), - ), - ), - bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.10, - width: double.infinity, - color: CustomColors.appBackgroudGreyColor, - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - width: MediaQuery.of(context).size.width * 0.9, - child: SecondaryButton( - label: TranslationBase.of(context).next, - textColor: Theme.of(context).backgroundColor, - color: CustomColors.accentColor, - onTap: () async { - if (widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList.length != 0 || widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList == null) { - int index = widget.model.cmcAllServicesList.length; - PatientERCMCInsertServicesList patientERCMCInsertServicesList = new PatientERCMCInsertServicesList( - price: widget.model.cmcAllServicesList[index - 1].price, - serviceID: widget.model.cmcAllServicesList[index - 1].serviceID.toString(), - selectedServiceName: widget.model.cmcAllServicesList[index - 1].description, - selectedServiceNameAR: widget.model.cmcAllServicesList[index - 1].descriptionN, - recordID: 1, - totalPrice: widget.model.cmcAllServicesList[index - 1].totalPrice, - vAT: widget.model.cmcAllServicesList[index - 1].vAT); + Container( + color: Colors.white, + padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), + child: DefaultButton( + TranslationBase.of(context).next, + () async { + if (widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList.length != 0 || widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList == null) { + int index = widget.model.cmcAllServicesList.length; + PatientERCMCInsertServicesList patientERCMCInsertServicesList = new PatientERCMCInsertServicesList( + price: widget.model.cmcAllServicesList[index - 1].price, + serviceID: widget.model.cmcAllServicesList[index - 1].serviceID.toString(), + selectedServiceName: widget.model.cmcAllServicesList[index - 1].description, + selectedServiceNameAR: widget.model.cmcAllServicesList[index - 1].descriptionN, + recordID: 1, + totalPrice: widget.model.cmcAllServicesList[index - 1].totalPrice, + vAT: widget.model.cmcAllServicesList[index - 1].vAT); - widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList = [patientERCMCInsertServicesList]; - await widget.model.getCustomerInfo(); - if (widget.model.state == ViewState.ErrorLocal) { - Utils.showErrorToast(); - } else { - navigateTo(context,NewCMCStepTowPage( - longitude: widget.longitude, - latitude: widget.latitude, - cmcInsertPresOrderRequestModel: widget.cMCInsertPresOrderRequestModel, - model: widget.model, - )); + widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList = [patientERCMCInsertServicesList]; + await widget.model.getCustomerInfo(); + if (widget.model.state == ViewState.ErrorLocal) { + Utils.showErrorToast(); + } else { + navigateTo( + context, + NewCMCStepTowPage( + longitude: widget.longitude, + latitude: widget.latitude, + cmcInsertPresOrderRequestModel: widget.cMCInsertPresOrderRequestModel, + model: widget.model, + )); // widget.changePageViewIndex(1); - } } - }, - ), + } + }, ), - ], - ), + ), + ], ), ); } diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart index 652f9b48..42212c40 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart @@ -2,12 +2,14 @@ import 'dart:ui'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'NewCMC/new_cmc_page.dart'; import 'orders_log_details_page.dart'; @@ -34,6 +36,7 @@ class _CMCPageState extends State with SingleTickerProviderStateMixin { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) async { await model.getCmcAllPresOrders(); @@ -47,61 +50,35 @@ class _CMCPageState extends State with SingleTickerProviderStateMixin { appBarTitle: TranslationBase.of(context).comprehensiveMedicalCheckup, showNewAppBar: true, showNewAppBarTitle: true, - backgroundColor: CustomColors.appBackgroudGreyColor, + backgroundColor: CustomColors.appBackgroudGrey2Color, body: Column( children: [ - Container( - height: 60.0, - width: double.infinity, - child: Center( - child: TabBar( - isScrollable: false, - controller: _tabController, - indicatorWeight: 3.0, - indicatorSize: TabBarIndicatorSize.tab, - indicatorColor: CustomColors.accentColor, - labelColor: Colors.black, - labelPadding: EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), - unselectedLabelColor: Colors.grey[800], - tabs: [ - Center( - child: Text( - TranslationBase.of(context).comprehensiveMedicalCheckup, - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 13, - fontWeight: FontWeight.w600, - letterSpacing: -0.34, - ), - ), - ), - Center( - child: Text( - TranslationBase.of(context).orderLog, - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 13, - fontWeight: FontWeight.w600, - letterSpacing: -0.34, - ), - ), - ), - ], - ), + TabBar( + controller: _tabController, + indicatorWeight: 3.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Color(0xff2B353E), + unselectedLabelColor: Color(0xff575757), + labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), + labelStyle: TextStyle( + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, ), + unselectedLabelStyle: TextStyle( + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + tabs: [Text(TranslationBase.of(context).cmcHeading), Text(TranslationBase.of(context).orderLog)], ), Expanded( child: TabBarView( physics: BouncingScrollPhysics(), controller: _tabController, - children: [ - NewCMCPage( - model: model, - ), - OrdersLogDetailsPage( - model: model, - ) - ], + children: [NewCMCPage(model: model), OrdersLogDetailsPage(model: model)], ), ) ], diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart index 2cbfcd42..e18b54db 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart @@ -7,7 +7,9 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -44,10 +46,128 @@ class OrdersLogDetailsPage extends StatelessWidget { return AppScaffold( isShowAppBar: false, baseViewModel: model, - body: SingleChildScrollView( + body: + + // ListView.separated( + // physics: BouncingScrollPhysics(), + // padding: EdgeInsets.all(21), + // separatorBuilder: (context, index) { + // return SizedBox(height: 12); + // }, + // itemBuilder: (context, index) { + // int status = model.cmcAllPresOrders[index].status; + // String _statusDisp = projectViewModel.isArabic ? model.cmcAllPresOrders[index].descriptionN : model.cmcAllPresOrders[index].description; + // Color _color; + // if (status == 1) { + // //pending + // _color = Color(0xffCC9B14); + // } else if (status == 2) { + // //processing + // _color = Color(0xff2E303A); + // } else if (status == 3) { + // //completed + // _color = Color(0xff359846); + // } else if (status == 4) { + // //cancel // Rejected + // _color = Color(0xffD02127); + // } + // + // return InkWell( + // // onTap: () => Navigator.push( + // // context, + // // FadePage( + // // page: PrescriptionsHistoryDetailsPage( + // // prescriptionsOrder: prescriptionsViewModel.prescriptionsHistory[index], + // // ), + // // ), + // // ), + // child: Container( + // height: 65, + // decoration: BoxDecoration( + // color: Colors.white, + // borderRadius: BorderRadius.all( + // Radius.circular(10.0), + // ), + // boxShadow: [ + // BoxShadow( + // color: Color(0xff000000).withOpacity(.05), + // blurRadius: 27, + // offset: Offset(0, -3), + // ), + // ], + // ), + // child: Row( + // mainAxisSize: MainAxisSize.min, + // children: [ + // Container( + // width: 6, + // decoration: BoxDecoration( + // color: _color, + // borderRadius: BorderRadius.only( + // topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0), + // bottomLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0), + // topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0), + // bottomRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0), + // ), + // ), + // ), + // Expanded( + // child: Padding( + // padding: EdgeInsets.only(left: projectViewModel.isArabic ? 6 : 12, right: projectViewModel.isArabic ? 12 : 6), + // child: Row( + // crossAxisAlignment: CrossAxisAlignment.start, + // mainAxisSize: MainAxisSize.min, + // children: [ + // Expanded( + // child: Column( + // mainAxisSize: MainAxisSize.min, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Text( + // _statusDisp, + // style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: _color, letterSpacing: -0.4, height: 16 / 10), + // ), + // Text( + // '${TranslationBase.of(context).orderNo}. ${model.cmcAllPresOrders[index].iD}', + // style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), + // ), + // ], + // ), + // ), + // Column( + // mainAxisSize: MainAxisSize.min, + // crossAxisAlignment: CrossAxisAlignment.end, + // children: [ + // Text( + // DateUtil.formatDateToDate(DateUtil.convertStringToDate(model.cmcAllPresOrders[index].createdOn), projectViewModel.isArabic), + // style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10), + // ), + // Text( + // DateUtil.formatDateToTime(DateUtil.convertStringToDate(model.cmcAllPresOrders[index].createdOn)), + // style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), + // ), + // ], + // ) + // ], + // ), + // ), + // ), + // Icon( + // Icons.arrow_forward_ios, + // size: 16, + // ), + // mWidth(6), + // ], + // ), + // )); + // }, + // itemCount: model.cmcAllPresOrders.length, + // ), + + SingleChildScrollView( physics: ScrollPhysics(), child: Container( - margin: EdgeInsets.all(12), + margin: EdgeInsets.all(10), child: Center( child: FractionallySizedBox( widthFactor: 0.94, @@ -58,194 +178,100 @@ class OrdersLogDetailsPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: model.cmcAllPresOrders.map((order) { return Container( + // margin: EdgeInsets.all(10), + child: Container( width: double.infinity, - margin: EdgeInsets.only(top: 12), - clipBehavior: Clip.antiAlias, - decoration: BoxDecoration(border: Border.all(color: Colors.grey, width: 1), borderRadius: BorderRadius.circular(12), color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 6, - ), - Container( - width: double.infinity, - padding: EdgeInsets.only(left: 15, bottom: 15, top: 8, right: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, - ), - ), - // borderRadius: BorderRadius.circular(12), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - TranslationBase.of(context).requestID, - style: TextStyle( - fontSize: 13, - fontWeight: FontWeight.w600, - letterSpacing: -0.45, - ), - ), - SizedBox( - height: 4, - ), - Text( - order.iD.toString(), - style: TextStyle( - fontSize: 18, - fontWeight: FontWeight.w600, - letterSpacing: -0.45, - ), - ), - ], - ), - ), - Container( - width: double.infinity, - padding: EdgeInsets.only(left: 15, bottom: 15, top: 15, right: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, - ), - ), - // borderRadius: BorderRadius.circular(12), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - TranslationBase.of(context).OrderStatus, - style: TextStyle( - fontSize: 13, - fontWeight: FontWeight.w600, - letterSpacing: -0.45, - ), - ), - SizedBox( - height: 4, - ), - Text( - projectViewModel.isArabic ? order.descriptionN : order.description, - style: TextStyle( - fontSize: 18, - fontWeight: FontWeight.w600, - letterSpacing: -0.45, - ), + padding: EdgeInsets.only(left: 12, right: 12, top: 12), + child: Card( + shape: cardRadius(12), + elevation: 2, + margin: EdgeInsets.zero, + color: order.status == 4 + ? Colors.red[900] + : order.status == 3 + ? Colors.green[400] + : Color(0xffcd9e1b), + clipBehavior: Clip.antiAlias, + child: Container( + // decoration: containerColorRadiusLeft(Colors.white, 12), + margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 8, right: projectViewModel.isArabic ? 8 : 0), + padding: EdgeInsets.all(12), + // color: Colors.white, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: projectViewModel.isArabic ? Radius.zero : Radius.circular(12.0), + topRight: projectViewModel.isArabic ? Radius.circular(12.0) : Radius.zero, + bottomLeft: projectViewModel.isArabic ? Radius.zero : Radius.circular(12.0), + bottomRight: projectViewModel.isArabic ? Radius.circular(12.0) : Radius.zero, ), - ], - ), - ), - Container( - width: double.infinity, - padding: EdgeInsets.only(left: 15, bottom: 15, top: 15, right: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, - ), - ), - // borderRadius: BorderRadius.circular(12), ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - TranslationBase.of(context).pickupDate, - style: TextStyle( - fontSize: 13, - fontWeight: FontWeight.w600, - letterSpacing: -0.45, - ), - ), - SizedBox( - height: 4, - ), - Text( - DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(order.createdOn)), - style: TextStyle( - fontSize: 18, - fontWeight: FontWeight.w600, - letterSpacing: -0.45, - ), - ), - ], - ), - ), - Container( - width: double.infinity, - clipBehavior: Clip.antiAlias, - padding: EdgeInsets.only(left: 15, bottom: 15, top: 15, right: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: (order.status == 1 || order.status == 2) ? Colors.grey : Colors.transparent, - width: (order.status == 1 || order.status == 2) ? 1.0 : 0, - ), - ), - // borderRadius: BorderRadius.circular(12), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - TranslationBase.of(context).orderLocation, - style: TextStyle( - fontSize: 13, - fontWeight: FontWeight.w600, - letterSpacing: -0.45, - ), - ), - SizedBox( - height: 4, - ), - Text( - !projectViewModel.isArabic ? order.projectDescription.toString() : order.projectDescriptionN.toString(), - style: TextStyle( - fontSize: 13, - fontWeight: FontWeight.w600, - letterSpacing: -0.45, + // clipBehavior: Clip.antiAlias, + child: Row( + children: [ + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).OrderStatus + ' ' + (projectViewModel.isArabic ? order.descriptionN : order.description), + bold: false, + fontSize: 12, + color: order.status == 4 + ? Colors.red[900] + : order.status == 3 + ? Colors.green[400] + : Color(0xffcd9e1b), + fontWeight: FontWeight.bold, + ), + Texts( + TranslationBase.of(context).requestID + ' ' + order.iD.toString(), + fontWeight: FontWeight.w600, + fontSize: 18, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).orderLocation, + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + !projectViewModel.isArabic ? order.nearestProjectDescription.toString() : order.nearestProjectDescriptionN.toString(), + fontSize: 13, + ), + ], + ) + ], + )), + Column( + children: [ + Texts( + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(order.createdOn)), + fontSize: 14, + ), + SizedBox(height: 8), + (order.status == 1 || order.status == 2) + ? SecondaryButton( + onTap: () { + showConfirmMessage(model, order); + }, + label: TranslationBase.of(context).cancel, + color: Colors.red[900], + small: true, + ) + : SizedBox() + ], ), - ), - ], - ), - ), - (order.status == 1 || order.status == 2) - ? SizedBox( - height: 12, - ) - : Container(), - if (order.status == 1 || order.status == 2) - Center( - child: Container( - width: MediaQuery.of(context).size.width * 0.85, - child: SecondaryButton( - label: TranslationBase.of(context).cancel.toUpperCase(), - onTap: () { - showConfirmMessage(model, order); - }, - color: Colors.red[800], - disabled: false, - textColor: Theme.of(context).backgroundColor), - ), - ), - (order.status == 1 || order.status == 2) - ? SizedBox( - height: 12, - ) - : SizedBox( - height: 2, - ), - ], - ), - ); + ], + ))), + )); }).toList()) ], ), @@ -253,6 +279,216 @@ class OrdersLogDetailsPage extends StatelessWidget { ), ), ), + + // SingleChildScrollView( + // physics: ScrollPhysics(), + // child: Container( + // margin: EdgeInsets.all(12), + // child: Center( + // child: FractionallySizedBox( + // widthFactor: 0.94, + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: model.cmcAllPresOrders.map((order) { + // return Container( + // width: double.infinity, + // margin: EdgeInsets.only(top: 12), + // clipBehavior: Clip.antiAlias, + // decoration: BoxDecoration(border: Border.all(color: Colors.grey, width: 1), borderRadius: BorderRadius.circular(12), color: Colors.white), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // SizedBox( + // height: 6, + // ), + // Container( + // width: double.infinity, + // padding: EdgeInsets.only(left: 15, bottom: 15, top: 8, right: 15), + // decoration: BoxDecoration( + // border: Border( + // bottom: BorderSide( + // color: Colors.grey, + // width: 1.0, + // ), + // ), + // // borderRadius: BorderRadius.circular(12), + // ), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Text( + // TranslationBase.of(context).requestID, + // style: TextStyle( + // fontSize: 13, + // fontWeight: FontWeight.w600, + // letterSpacing: -0.45, + // ), + // ), + // SizedBox( + // height: 4, + // ), + // Text( + // order.iD.toString(), + // style: TextStyle( + // fontSize: 18, + // fontWeight: FontWeight.w600, + // letterSpacing: -0.45, + // ), + // ), + // ], + // ), + // ), + // Container( + // width: double.infinity, + // padding: EdgeInsets.only(left: 15, bottom: 15, top: 15, right: 15), + // decoration: BoxDecoration( + // border: Border( + // bottom: BorderSide( + // color: Colors.grey, + // width: 1.0, + // ), + // ), + // // borderRadius: BorderRadius.circular(12), + // ), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Text( + // TranslationBase.of(context).OrderStatus, + // style: TextStyle( + // fontSize: 13, + // fontWeight: FontWeight.w600, + // letterSpacing: -0.45, + // ), + // ), + // SizedBox( + // height: 4, + // ), + // Text( + // projectViewModel.isArabic ? order.descriptionN : order.description, + // style: TextStyle( + // fontSize: 18, + // fontWeight: FontWeight.w600, + // letterSpacing: -0.45, + // ), + // ), + // ], + // ), + // ), + // Container( + // width: double.infinity, + // padding: EdgeInsets.only(left: 15, bottom: 15, top: 15, right: 15), + // decoration: BoxDecoration( + // border: Border( + // bottom: BorderSide( + // color: Colors.grey, + // width: 1.0, + // ), + // ), + // // borderRadius: BorderRadius.circular(12), + // ), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Text( + // TranslationBase.of(context).pickupDate, + // style: TextStyle( + // fontSize: 13, + // fontWeight: FontWeight.w600, + // letterSpacing: -0.45, + // ), + // ), + // SizedBox( + // height: 4, + // ), + // Text( + // DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(order.createdOn)), + // style: TextStyle( + // fontSize: 18, + // fontWeight: FontWeight.w600, + // letterSpacing: -0.45, + // ), + // ), + // ], + // ), + // ), + // Container( + // width: double.infinity, + // clipBehavior: Clip.antiAlias, + // padding: EdgeInsets.only(left: 15, bottom: 15, top: 15, right: 15), + // decoration: BoxDecoration( + // border: Border( + // bottom: BorderSide( + // color: (order.status == 1 || order.status == 2) ? Colors.grey : Colors.transparent, + // width: (order.status == 1 || order.status == 2) ? 1.0 : 0, + // ), + // ), + // // borderRadius: BorderRadius.circular(12), + // ), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Text( + // TranslationBase.of(context).orderLocation, + // style: TextStyle( + // fontSize: 13, + // fontWeight: FontWeight.w600, + // letterSpacing: -0.45, + // ), + // ), + // SizedBox( + // height: 4, + // ), + // Text( + // !projectViewModel.isArabic ? order.projectDescription.toString() : order.projectDescriptionN.toString(), + // style: TextStyle( + // fontSize: 13, + // fontWeight: FontWeight.w600, + // letterSpacing: -0.45, + // ), + // ), + // ], + // ), + // ), + // (order.status == 1 || order.status == 2) + // ? SizedBox( + // height: 12, + // ) + // : Container(), + // if (order.status == 1 || order.status == 2) + // Center( + // child: Container( + // width: MediaQuery.of(context).size.width * 0.85, + // child: SecondaryButton( + // label: TranslationBase.of(context).cancel.toUpperCase(), + // onTap: () { + // showConfirmMessage(model, order); + // }, + // color: Colors.red[800], + // disabled: false, + // textColor: Theme.of(context).backgroundColor), + // ), + // ), + // (order.status == 1 || order.status == 2) + // ? SizedBox( + // height: 12, + // ) + // : SizedBox( + // height: 2, + // ), + // ], + // ), + // ); + // }).toList()) + // ], + // ), + // ), + // ), + // ), + // ), ); } } diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart index b56ea43f..669e14f9 100644 --- a/lib/pages/landing/fragments/home_page_fragment2.dart +++ b/lib/pages/landing/fragments/home_page_fragment2.dart @@ -79,7 +79,7 @@ class _HomePageFragment2State extends State { padding: const EdgeInsets.only(left: 20, right: 20, top: 8, bottom: 6), child: InkWell( onTap: () { - navigateTo(context, MedicalProfilePageNew()); + widget.onMedicalFileClick(); }, child: LoggedSliderView( projectViewModel, From b80e2ea16e90bfdd0c8e90deeaf763ff2830e898 Mon Sep 17 00:00:00 2001 From: "Mirza.Shafique" Date: Sun, 3 Oct 2021 17:51:41 +0300 Subject: [PATCH 5/5] Covid New Design 2 --- lib/pages/ToDoList/payment_method_select.dart | 228 ++++++++++-------- 1 file changed, 130 insertions(+), 98 deletions(-) diff --git a/lib/pages/ToDoList/payment_method_select.dart b/lib/pages/ToDoList/payment_method_select.dart index b3ada181..39dc7624 100644 --- a/lib/pages/ToDoList/payment_method_select.dart +++ b/lib/pages/ToDoList/payment_method_select.dart @@ -2,6 +2,7 @@ import 'dart:io'; 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/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; @@ -36,115 +37,146 @@ class _PaymentMethodState extends State { child: Text(TranslationBase.of(context).selectPaymentOption, style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold)), ), Container( - margin: EdgeInsets.only(top: 25.0), - child: Flex( - direction: Axis.horizontal, - children: [ - Expanded( - child: Container( - child: InkWell( - onTap: () { - updateSelectedPaymentMethod("MADA"); - }, - child: Card( - elevation: 3.0, - margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - side: selectedPaymentMethod == "MADA" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0), - ), - child: Container( - height: 120.0, - padding: EdgeInsets.all(7.0), - width: MediaQuery.of(context).size.width * 0.45, - child: Image.asset("assets/images/new-design/mada.png"), - ), - ), - ), - ), + width: double.infinity, + child: InkWell( + onTap: () { + updateSelectedPaymentMethod("MADA"); + }, + child: Card( + elevation: 3.0, + margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + side: selectedPaymentMethod == "MADA" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0), ), - Expanded( - child: Container( - child: InkWell( - onTap: () { - updateSelectedPaymentMethod("VISA"); - }, - child: Card( - elevation: 3.0, - margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - side: selectedPaymentMethod == "VISA" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0), - ), - child: Container( - height: 120.0, - padding: EdgeInsets.all(7.0), - width: MediaQuery.of(context).size.width * 0.45, - child: Image.asset("assets/images/new-design/visa.png"), - ), - ), + child: Row( + children: [ + Container( + height: 60.0, + width:60, + padding: EdgeInsets.all(7.0), + child: Image.asset("assets/images/new-design/mada.png"), ), - ), + mWidth(12), + Text( + "MADA", + style: TextStyle( + color: Colors.black, + fontSize: 14, + fontWeight: FontWeight.bold, + ), + ) + ], ), - ], + ), ), ), Container( - margin: EdgeInsets.only(top: 25.0), - child: Flex( - direction: Axis.horizontal, - children: [ - Expanded( - child: Container( - child: InkWell( - onTap: () { - updateSelectedPaymentMethod("MASTERCARD"); - }, - child: Card( - elevation: 3.0, - margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - side: selectedPaymentMethod == "MASTERCARD" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0), - ), - child: Container( - height: 120.0, - padding: EdgeInsets.all(7.0), - width: MediaQuery.of(context).size.width * 0.45, - child: Image.asset("assets/images/new-design/mastercard.png"), - ), - ), + width: double.infinity, + child: InkWell( + onTap: () { + updateSelectedPaymentMethod("VISA"); + }, + child: Card( + elevation: 3.0, + margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + side: selectedPaymentMethod == "VISA" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0), + ), + child: Row( + children: [ + Container( + height: 60.0, + padding: EdgeInsets.all(7.0), + width: 60, + child: Image.asset("assets/images/new-design/visa.png"), ), - ), + mWidth(12),Text( + "VISA", + style: TextStyle( + color: Colors.black, + fontSize: 14, + fontWeight: FontWeight.bold, + ), + ) + ], ), - Expanded( - child: Container( - child: InkWell( - onTap: () { - updateSelectedPaymentMethod("Installment"); - }, - child: Card( - elevation: 3.0, - margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - side: selectedPaymentMethod == "Installment" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0), - ), - child: Container( - height: 120.0, - padding: EdgeInsets.all(7.0), - width: MediaQuery.of(context).size.width * 0.45, - child: Image.asset("assets/images/new-design/installment.png"), - ), + ), + ), + ), + Container( + width: double.infinity, + child: InkWell( + onTap: () { + updateSelectedPaymentMethod("MASTERCARD"); + }, + child: Card( + elevation: 3.0, + margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + side: selectedPaymentMethod == "MASTERCARD" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0), + ), + child: Row( + children: [ + Container( + height: 60.0, + padding: EdgeInsets.all(7.0), + width: 60, + child: Image.asset("assets/images/new-design/mastercard.png"), + ), + mWidth(12), + Text( + "MATER CARD", + style: TextStyle( + color: Colors.black, + fontSize: 14, + fontWeight: FontWeight.bold, ), + ) + ], + ), + ), + ), + ), + Container( + width: double.infinity, + child: InkWell( + onTap: () { + updateSelectedPaymentMethod("Installment"); + }, + child: Card( + elevation: 3.0, + margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + side: selectedPaymentMethod == "Installment" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0), + ), + child: Row( + children: [ + Container( + height: 60.0, + padding: EdgeInsets.all(7.0), + width: 60, + child: Image.asset("assets/images/new-design/installment.png"), ), - ), + mWidth(12), + Text( + "INSTALLMENT", + style: TextStyle( + color: Colors.black, + fontSize: 14, + fontWeight: FontWeight.bold, + ), + ) + ], ), - ], + ), ), ), Platform.isIOS