From 41d50e23e3df837e9a17bbe58e01472325a9e7d7 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 6 Oct 2020 14:06:28 +0300 Subject: [PATCH] covid drivethru implemented --- .../new-design/covid-19-big-banner-bg.png | Bin 0 -> 10233 bytes ios/Runner/Runner.entitlements | 5 +- .../Appointments/PatientShareResposne.dart | 34 +- .../CovidPaymentInfoResponse.dart | 96 +++ .../health_converter/blood_cholesterol.dart | 2 +- .../health_converter/blood_sugar.dart | 2 +- .../health_converter/triglycerides.dart | 2 +- .../components/DocAvailableAppointments.dart | 4 +- .../Covid-DriveThru/Covid-TimeSlots.dart | 599 ++++++++++++++++++ .../covid-drivethru-location.dart | 77 ++- .../Covid-DriveThru/covid-payment-alert.dart | 288 +++++++++ .../covid-payment-details.dart | 257 ++++++++ lib/pages/ToDoList/ToDo.dart | 2 +- lib/pages/landing/home_page.dart | 6 +- lib/pages/landing/landing_page.dart | 3 - .../covid-drivethru/covid-drivethru.dart | 74 +++ 16 files changed, 1406 insertions(+), 45 deletions(-) create mode 100644 assets/images/new-design/covid-19-big-banner-bg.png create mode 100644 lib/models/CovidDriveThru/CovidPaymentInfoResponse.dart create mode 100644 lib/pages/Covid-DriveThru/Covid-TimeSlots.dart create mode 100644 lib/pages/Covid-DriveThru/covid-payment-alert.dart create mode 100644 lib/pages/Covid-DriveThru/covid-payment-details.dart diff --git a/assets/images/new-design/covid-19-big-banner-bg.png b/assets/images/new-design/covid-19-big-banner-bg.png new file mode 100644 index 0000000000000000000000000000000000000000..a66d681553e9014c80c6452df934b6900d599f32 GIT binary patch literal 10233 zcmX|nbwE>X8~1_@B&0=}7Zs2Yq#q=GMmdlk4SPg#Ac%t0U;}*wQHD~ILpnz@L}Di0 zjNz0}x^r}V^ZmZ}`{SH*-zV<8;`h6*6K8(ckd0Y@82|vV85_YY0RW&Ky^LXk($9B; zA2!l2z(T=F9%vaXS=Ow-JBdaypQn%o(ua z0hcRX4pqOZC;RO0Uw?BJDB~jz=hCKH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iDJ zwnUEoA%lr0+0Ygl6YS&qJk(oQFWsN!$=WptDlZDOyrPX0F)mB(7T(YCZNPp2q&$ho&%>`4 zNKr~N7pOk9qA+LWV)!KC7G-A1IY&dgPj9qRrCU}VUs$#ZIW-5r5~Kg?^2*1#i1#uN z$JelMJfF#pn6i%9hQ;8LA~U=$kh7xQbQ<-dWw7?~v^!E8b*twUbk+V&u$I3I7C`G` m*#a?e6i&|Yv3w((i-I3M3YFD*h5z#lp0WO27~wWD`u_kT#KTko literal 0 HcmV?d00001 diff --git a/ios/Runner/Runner.entitlements b/ios/Runner/Runner.entitlements index 0c67376e..903def2a 100644 --- a/ios/Runner/Runner.entitlements +++ b/ios/Runner/Runner.entitlements @@ -1,5 +1,8 @@ - + + aps-environment + development + diff --git a/lib/models/Appointments/PatientShareResposne.dart b/lib/models/Appointments/PatientShareResposne.dart index 2e22ed60..40670990 100644 --- a/lib/models/Appointments/PatientShareResposne.dart +++ b/lib/models/Appointments/PatientShareResposne.dart @@ -1,19 +1,19 @@ class PatientShareResponse { int advanceNumber; - String appointmentDate; + dynamic appointmentDate; int appointmentNo; int cashPrice; int cashPriceTax; int cashPriceWithTax; int clinicID; - String clinicName; + dynamic clinicName; int companyId; - String companyName; + dynamic companyName; int companyShareWithTax; - String doctorImageURL; - String doctorNameObj; + dynamic doctorImageURL; + dynamic doctorNameObj; int doctorID; - List doctorSpeciality; + List doctorSpeciality; dynamic errCode; int groupID; bool iSAllowOnlineCheckedIN; @@ -22,7 +22,7 @@ class PatientShareResponse { int isFollowup; bool isLiveCareAppointment; bool isOnlineCheckedIN; - String message; + dynamic message; int nextAction; dynamic patientCardID; int patientID; @@ -30,19 +30,19 @@ class PatientShareResponse { dynamic patientShareWithTax; int patientStatusType; dynamic patientTaxAmount; - String patientType; + dynamic patientType; int paymentAmount; - String paymentDate; + dynamic paymentDate; dynamic paymentMethodName; dynamic paymentReferenceNumber; int policyId; - String policyName; - String procedureName; + dynamic policyName; + dynamic procedureName; int projectID; - String projectName; + dynamic projectName; dynamic setupID; int sourceType; - String startTime; + dynamic startTime; int status; int statusCode; dynamic statusDesc; @@ -102,7 +102,7 @@ class PatientShareResponse { this.userID, this.serviceID}); - PatientShareResponse.fromJson(Map json) { + PatientShareResponse.fromJson(Map json) { advanceNumber = json['AdvanceNumber']; appointmentDate = json['AppointmentDate']; appointmentNo = json['AppointmentNo']; @@ -117,7 +117,7 @@ class PatientShareResponse { doctorID = json['DoctorID']; doctorImageURL = json['DoctorImageURL']; doctorNameObj = json['DoctorNameObj']; - doctorSpeciality = json['DoctorSpeciality'].cast(); +// doctorSpeciality = json['DoctorSpeciality'].cast(); errCode = json['ErrCode']; groupID = json['GroupID']; iSAllowOnlineCheckedIN = json['ISAllowOnlineCheckedIN']; @@ -155,8 +155,8 @@ class PatientShareResponse { serviceID = json['ServiceID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['AdvanceNumber'] = this.advanceNumber; data['AppointmentDate'] = this.appointmentDate; data['AppointmentNo'] = this.appointmentNo; diff --git a/lib/models/CovidDriveThru/CovidPaymentInfoResponse.dart b/lib/models/CovidDriveThru/CovidPaymentInfoResponse.dart new file mode 100644 index 00000000..a1290e4d --- /dev/null +++ b/lib/models/CovidDriveThru/CovidPaymentInfoResponse.dart @@ -0,0 +1,96 @@ +class CovidPaymentInfoResponse { + dynamic propertyChanged; + dynamic cashPriceField; + dynamic cashPriceTaxField; + dynamic cashPriceWithTaxField; + dynamic companyIdField; + String companyNameField; + dynamic companyShareWithTaxField; + dynamic errCodeField; + dynamic groupIDField; + dynamic insurancePolicyNoField; + String messageField; + dynamic patientCardIDField; + dynamic patientShareField; + dynamic patientShareWithTaxField; + dynamic patientTaxAmountField; + dynamic policyIdField; + dynamic policyNameField; + String procedureNameField; + dynamic setupIDField; + dynamic statusCodeField; + dynamic subPolicyNoField; + + CovidPaymentInfoResponse( + {this.propertyChanged, + this.cashPriceField, + this.cashPriceTaxField, + this.cashPriceWithTaxField, + this.companyIdField, + this.companyNameField, + this.companyShareWithTaxField, + this.errCodeField, + this.groupIDField, + this.insurancePolicyNoField, + this.messageField, + this.patientCardIDField, + this.patientShareField, + this.patientShareWithTaxField, + this.patientTaxAmountField, + this.policyIdField, + this.policyNameField, + this.procedureNameField, + this.setupIDField, + this.statusCodeField, + this.subPolicyNoField}); + + CovidPaymentInfoResponse.fromJson(Map json) { + propertyChanged = json['PropertyChanged']; + cashPriceField = json['cashPriceField']; + cashPriceTaxField = json['cashPriceTaxField']; + cashPriceWithTaxField = json['cashPriceWithTaxField']; + companyIdField = json['companyIdField']; + companyNameField = json['companyNameField']; + companyShareWithTaxField = json['companyShareWithTaxField']; + errCodeField = json['errCodeField']; + groupIDField = json['groupIDField']; + insurancePolicyNoField = json['insurancePolicyNoField']; + messageField = json['messageField']; + patientCardIDField = json['patientCardIDField']; + patientShareField = json['patientShareField']; + patientShareWithTaxField = json['patientShareWithTaxField']; + patientTaxAmountField = json['patientTaxAmountField']; + policyIdField = json['policyIdField']; + policyNameField = json['policyNameField']; + procedureNameField = json['procedureNameField']; + setupIDField = json['setupIDField']; + statusCodeField = json['statusCodeField']; + subPolicyNoField = json['subPolicyNoField']; + } + + Map toJson() { + final Map data = new Map(); + data['PropertyChanged'] = this.propertyChanged; + data['cashPriceField'] = this.cashPriceField; + data['cashPriceTaxField'] = this.cashPriceTaxField; + data['cashPriceWithTaxField'] = this.cashPriceWithTaxField; + data['companyIdField'] = this.companyIdField; + data['companyNameField'] = this.companyNameField; + data['companyShareWithTaxField'] = this.companyShareWithTaxField; + data['errCodeField'] = this.errCodeField; + data['groupIDField'] = this.groupIDField; + data['insurancePolicyNoField'] = this.insurancePolicyNoField; + data['messageField'] = this.messageField; + data['patientCardIDField'] = this.patientCardIDField; + data['patientShareField'] = this.patientShareField; + data['patientShareWithTaxField'] = this.patientShareWithTaxField; + data['patientTaxAmountField'] = this.patientTaxAmountField; + data['policyIdField'] = this.policyIdField; + data['policyNameField'] = this.policyNameField; + data['procedureNameField'] = this.procedureNameField; + data['setupIDField'] = this.setupIDField; + data['statusCodeField'] = this.statusCodeField; + data['subPolicyNoField'] = this.subPolicyNoField; + return data; + } +} diff --git a/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart b/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart index 9a2f08df..58caee36 100644 --- a/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart +++ b/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart @@ -190,7 +190,7 @@ class _BloodCholesterolState extends State { child: TextFormField( controller: textController, inputFormatters: [ - FilteringTextInputFormatter.digitsOnly +// FilteringTextInputFormatter.digitsOnly ], keyboardType: TextInputType.number, decoration: InputDecoration( diff --git a/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart b/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart index a90a5bbb..f5d66ccf 100644 --- a/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart +++ b/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart @@ -192,7 +192,7 @@ class _BloodSugarState extends State { child: TextFormField( controller: textController, inputFormatters: [ - FilteringTextInputFormatter.digitsOnly +// FilteringTextInputFormatter.digitsOnly ], keyboardType: TextInputType.number, decoration: InputDecoration( diff --git a/lib/pages/AlHabibMedicalService/health_converter/triglycerides.dart b/lib/pages/AlHabibMedicalService/health_converter/triglycerides.dart index fdf8d191..a86fdb88 100644 --- a/lib/pages/AlHabibMedicalService/health_converter/triglycerides.dart +++ b/lib/pages/AlHabibMedicalService/health_converter/triglycerides.dart @@ -188,7 +188,7 @@ class _TriglyceridesState extends State { child: TextFormField( controller: textController, inputFormatters: [ - FilteringTextInputFormatter.digitsOnly +// FilteringTextInputFormatter.digitsOnly ], keyboardType: TextInputType.number, decoration: InputDecoration( diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart index aca0884f..88116cd9 100644 --- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart +++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart @@ -385,8 +385,8 @@ class _DocAvailableAppointmentsState extends State color: _calendarController.isSelected(date) ? Colors.green[400] : _calendarController.isToday(date) - ? Colors.brown[300] - : Colors.blue[400], + ? Colors.brown[300] + : Colors.blue[400], ), width: 40.0, height: 40.0, diff --git a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart new file mode 100644 index 00000000..060a8132 --- /dev/null +++ b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart @@ -0,0 +1,599 @@ +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart'; +import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; +import 'package:diplomaticquarterapp/models/Appointments/timeSlot.dart'; +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/uitl/app_shared_preferences.dart'; +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/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:intl/intl.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; +import 'package:table_calendar/table_calendar.dart'; + +class CovidTimeSlots extends StatefulWidget { + int projectID; + static bool areSlotsAvailable = false; + static DateTime selectedAppoDateTime; + static String selectedDate; + static String selectedTime; + + int selectedClinicID; + int selectedDoctorID; + + PatientShareResponse patientShareResponse; + + CovidTimeSlots({@required this.projectID}); + + @override + _CovidTimeSlotsState createState() => _CovidTimeSlotsState(); +} + +class _CovidTimeSlotsState extends State + with TickerProviderStateMixin { + Map _events; + AnimationController _animationController; + CalendarController _calendarController; + + AppSharedPreferences sharedPref = new AppSharedPreferences(); + + var selectedDate = ""; + dynamic selectedDateJSON; + dynamic jsonFreeSlots; + + List docFreeSlots = []; + List dayEvents = []; + + int selectedButtonIndex = 0; + + dynamic freeSlotsResponse; + + ScrollController _scrollController; + + @override + void initState() { + final _selectedDay = DateTime.now(); + + widget.patientShareResponse = new PatientShareResponse(); + + _scrollController = new ScrollController(); + + _events = { + _selectedDay: ['Event A0'] + }; + + WidgetsBinding.instance.addPostFrameCallback( + (_) => getCovidFreeSlots(context, widget.projectID)); + + _calendarController = CalendarController(); + _animationController = AnimationController( + vsync: this, + duration: const Duration(milliseconds: 50), + ); + + _animationController.forward(); + super.initState(); + } + + @override + void dispose() { + _animationController.dispose(); + _calendarController.dispose(); + super.dispose(); + } + + void _onDaySelected(DateTime day, List events) { + final DateFormat formatter = DateFormat('yyyy-MM-dd'); + setState(() { + this.selectedDate = DateUtil.getMonthDayYearDateFormatted(day); + openTimeSlotsPickerForDate(day, docFreeSlots); + CovidTimeSlots.selectedDate = formatter.format(day); + print(CovidTimeSlots.selectedDate); + }); + } + + void _onVisibleDaysChanged( + DateTime first, DateTime last, CalendarFormat format) { + print('CALLBACK: _onVisibleDaysChanged'); + } + + void _onCalendarCreated( + DateTime first, DateTime last, CalendarFormat format) { + print('CALLBACK: _onCalendarCreated'); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: "COVID-19 TEST", + 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: 40.0), + child: Text("COVID-19 TEST", + 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("Drive-Thru", + 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(20.0, 0.0, 20.0, 20.0), + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height * 0.65, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "Kindly select one of the available appointments from below: ", + 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)), + ); + }, + ), + ), + _buildTableCalendarWithBuilders(), + ], + ), + ), + 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("BOOK", style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ), + ], + ), + ), + ); + } + + Widget _buildTableCalendarWithBuilders() { + return TableCalendar( + locale: 'en_US', + calendarController: _calendarController, + events: _events, + initialCalendarFormat: CalendarFormat.month, + startDay: DateTime.now(), + formatAnimation: FormatAnimation.slide, + startingDayOfWeek: StartingDayOfWeek.sunday, + weekendDays: [DateTime.friday, DateTime.saturday], + availableGestures: AvailableGestures.horizontalSwipe, + availableCalendarFormats: const { + CalendarFormat.month: '', + CalendarFormat.week: '', + }, + calendarStyle: CalendarStyle( + outsideDaysVisible: false, + weekendStyle: TextStyle().copyWith(color: Colors.blue[800]), + holidayStyle: TextStyle().copyWith(color: Colors.blue[800]), + ), + daysOfWeekStyle: DaysOfWeekStyle( + weekendStyle: TextStyle().copyWith(color: Colors.blue[600]), + ), + headerStyle: HeaderStyle( + centerHeaderTitle: true, + formatButtonVisible: false, + ), + builders: CalendarBuilders( + selectedDayBuilder: (context, date, _) { + return FadeTransition( + opacity: Tween(begin: 0.0, end: 1.0).animate(_animationController), + child: Container( + margin: const EdgeInsets.all(4.0), + padding: const EdgeInsets.only(top: 5.0, left: 6.0), + color: Colors.transparent, + width: 0, + height: 0, + child: Text( + '${date.day}', + style: TextStyle().copyWith(fontSize: 16.0), + ), + ), + ); + }, + todayDayBuilder: (context, date, _) { + return Container( + decoration: BoxDecoration( + shape: BoxShape.circle, + color: _calendarController.isSelected(date) + ? Colors.green[400] + : _calendarController.isToday(date) + ? Colors.brown[300] + : Colors.blue[400], + ), + width: 40.0, + height: 40.0, + child: Center( + child: Text( + '${date.day}', + style: TextStyle().copyWith( + color: Colors.white, + fontSize: 14.0, + ), + ), + ), + ); + }, + markersBuilder: (context, date, events, holidays) { + final children = []; + + if (events.isNotEmpty) { + children.add( + Positioned( + right: 4, + bottom: 4, + child: _buildEventsMarker(date, events), + ), + ); + } + + return children; + }, + ), + onDaySelected: (date, events) { + _onDaySelected(date, events); + _animationController.forward(from: 0.0); + }, + onVisibleDaysChanged: _onVisibleDaysChanged, + onCalendarCreated: _onCalendarCreated, + ); + } + + openTimeSlotsPickerForDate(DateTime dateStart, List freeSlots) { + dayEvents.clear(); + 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); + }); + + setState(() { + if (dayEvents.length != 0) + CovidTimeSlots.areSlotsAvailable = true; + else + CovidTimeSlots.areSlotsAvailable = false; + + selectedButtonIndex = 0; + + CovidTimeSlots.selectedTime = dayEvents[selectedButtonIndex].isoTime; + }); + } + + Future> _getJSONSlots() async { + Map _eventsParsed; + List slotsList = []; + DateTime date; + 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']); + 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)); + } + _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'])); + selectedDateJSON = freeSlotsResponse[0]['FreeTimeSlots']; + }); + 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], + ), + width: 40.0, + height: 40.0, + child: Center( + child: Text( + '${date.day}', + style: TextStyle().copyWith( + color: Colors.white, + fontSize: 14.0, + ), + ), + ), + ); + } + + Widget getNormalButton(int index) { + return RaisedButton( + color: Colors.white, + textColor: new Color(0xFF60686b), + onPressed: () { + setState(() { + selectedButtonIndex = index; + CovidTimeSlots.selectedTime = dayEvents[index].isoTime; + print(CovidTimeSlots.selectedTime); + }); + }, + child: Text(dayEvents[index].isoTime, + style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)), + ); + } + + Widget getSelectedButton(int index) { + return RaisedButton( + color: Colors.blue[400], + textColor: Colors.white, + onPressed: () { + setState(() { + selectedButtonIndex = index; + CovidTimeSlots.selectedTime = dayEvents[index].isoTime; + print(CovidTimeSlots.selectedTime); + }); + }, + child: Text(dayEvents[index].isoTime, + style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)), + ); + } + + bookCovidTestAppointment() { +// Navigator.push(context, +// MaterialPageRoute(builder: (context) => CovidPaymentAlert())); + + DoctorList docObject = new DoctorList(); + docObject.doctorID = widget.selectedDoctorID; + docObject.clinicID = widget.selectedClinicID; + docObject.projectID = widget.projectID; + insertAppointmentCovidTest(context, docObject); + } + + insertAppointmentCovidTest(context, DoctorList docObject) { + DoctorsListService service = new DoctorsListService(); + AppoitmentAllHistoryResultList appo; + service + .insertAppointment( + docObject.doctorID, + docObject.clinicID, + docObject.projectID, + CovidTimeSlots.selectedTime, + CovidTimeSlots.selectedDate, + context) + .then((res) { + print(res); + if (res['MessageStatus'] == 1) { + AppToast.showSuccessToast(message: "Appointment Booked Successfully"); + Future.delayed(new Duration(milliseconds: 1800), () { + getPatientShare(context, res['AppointmentNo'], docObject.clinicID, + docObject.projectID, docObject); + }); + } else { + appo = new AppoitmentAllHistoryResultList(); + appo.appointmentNo = res['SameClinicApptList'][0]['AppointmentNo']; + appo.clinicID = res['SameClinicApptList'][0]['DoctorID']; + appo.projectID = res['SameClinicApptList'][0]['ProjectID']; + appo.endTime = res['SameClinicApptList'][0]['EndTime']; + appo.startTime = res['SameClinicApptList'][0]['StartTime']; + appo.doctorID = res['SameClinicApptList'][0]['DoctorID']; + appo.isLiveCareAppointment = false; + appo.originalClinicID = 0; + appo.originalProjectID = 0; + appo.appointmentDate = res['SameClinicApptList'][0]['AppointmentDate']; + + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: res['ErrorEndUserMessage'], + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () => {cancelAppointment(docObject, appo, context)}, + cancelFunction: () => {}); + dialog.showAlertDialog(context); + } + }).catchError((err) { + AppToast.showErrorToast(message: err); + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + + cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, + BuildContext context) { + ConfirmDialog.closeAlertDialog(context); + DoctorsListService service = new DoctorsListService(); + service.cancelAppointment(appo, context).then((res) { + if (res['MessageStatus'] == 1) { + Future.delayed(new Duration(milliseconds: 1500), () { + insertAppointmentCovidTest(context, docObject); + }); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + + getPatientShare(context, String appointmentNo, int clinicID, int projectID, + DoctorList docObject) { + DoctorsListService service = new DoctorsListService(); + service + .getPatientShare(appointmentNo, clinicID, projectID, context) + .then((res) { + print(res); + widget.patientShareResponse = new PatientShareResponse.fromJson(res); + }) + .catchError((err) { + print(err); + }) + .showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) + .then((value) { + navigateToPaymentAlert(); + }); + } + + navigateToPaymentAlert() { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CovidPaymentAlert( + patientShareResponse: widget.patientShareResponse))); + } + + getCovidFreeSlots(BuildContext context, int projectID) { + CovidDriveThruService service = new CovidDriveThruService(); + service.getCovidFreeSlots(context, projectID).then((res) { + print(res['COVID19_FreeTimeSlots']); + if (res['MessageStatus'] == 1) { + if (res['COVID19_FreeTimeSlots'].length != 0) { + freeSlotsResponse = res['COVID19_FreeTimeSlots']; + print(res['COVID19_FreeTimeSlots'].length); + _getJSONSlots().then((value) => { + setState(() => { + widget.selectedClinicID = + freeSlotsResponse[0]['ClinicID'], + widget.selectedDoctorID = + freeSlotsResponse[0]['DoctorID'], + _events.clear(), + _events = value + }) + }); + } else {} + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } +} diff --git a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart index 6b1c5f2b..0563c4bd 100644 --- a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart +++ b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart @@ -1,11 +1,13 @@ +import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/DriveThroughTestingCenterModel.dart'; +import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-details.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:maps_launcher/maps_launcher.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; class CovidDrivethruLocation extends StatefulWidget { @override @@ -19,6 +21,7 @@ class _CovidDrivethruLocationState extends State { String projectLat = ""; String projectLong = ""; String projectName = ""; + String projectID = ""; @override void initState() { @@ -94,15 +97,16 @@ class _CovidDrivethruLocationState extends State { )), isLocationSelected ? Container( - margin: EdgeInsets.only(top: 15.0), - alignment: Alignment.centerLeft, - child: Text("Selected Location", - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 18.0, - letterSpacing: 0.8, - color: Colors.black)), - ) : Container(), + margin: EdgeInsets.only(top: 15.0), + alignment: Alignment.centerLeft, + child: Text("Selected Location", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 18.0, + letterSpacing: 0.8, + color: Colors.black)), + ) + : Container(), isLocationSelected ? Container( margin: EdgeInsets.only(top: 5.0), @@ -212,15 +216,22 @@ class _CovidDrivethruLocationState extends State { } getDirections() { - if(isLocationSelected) { - MapsLauncher.launchCoordinates(double.parse(projectLat),double.parse(projectLong), this.projectName); + if (isLocationSelected) { + MapsLauncher.launchCoordinates(double.parse(projectLat), + double.parse(projectLong), this.projectName); } else { - Utils.showErrorToast("Please select address from the dropdown menu to get directions"); + Utils.showErrorToast( + "Please select address from the dropdown menu to get directions"); } } next() { - + if (isLocationSelected) { + getPaymentInfo(context, projectID); + } else { + Utils.showErrorToast( + "Please select address from the dropdown menu to continue"); + } } back() { @@ -229,21 +240,57 @@ class _CovidDrivethruLocationState extends State { setProjectLocation(newValue) { print(newValue); - print(projectsList[(int.parse(newValue) - 1)].projectName); setState(() { this.projectLat = projectsList[(int.parse(newValue) - 1)].latitude.toString(); this.projectLong = projectsList[(int.parse(newValue) - 1)].longitude.toString(); this.projectName = projectsList[(int.parse(newValue) - 1)].projectName; + this.projectID = + projectsList[(int.parse(newValue) - 1)].projectID.toString(); isLocationSelected = true; }); } + getPaymentInfo(BuildContext context, String projectID) { + CovidDriveThruService service = new CovidDriveThruService(); + + CovidPaymentInfoResponse covidPaymentInfoResponse = + new CovidPaymentInfoResponse(); + + service + .getCovidPaymentInformation(context, int.parse(projectID)) + .then((res) { + if (res['MessageStatus'] == 1) { + setState(() { + covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson( + res['COVID19_PatientShare']); + print(covidPaymentInfoResponse.procedureNameField); + }); + } else {} + }) + .catchError((err) { + print(err); + }) + .showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) + .then((value) { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CovidPaymentDetails( + covidPaymentInfoResponse: covidPaymentInfoResponse, + projectID: int.parse(projectID), + ))); + }); + } + getProjectsList(BuildContext context) { CovidDriveThruService service = new CovidDriveThruService(); service.getCovidProjectsList(context).then((res) { + print(res); if (res['MessageStatus'] == 1) { + print(res); setState(() { res['List_COVID19_ProjectDriveThroughTestingCenter'].forEach((v) { projectsList.add(new DriveThroughTestingCenterModel.fromJson(v)); diff --git a/lib/pages/Covid-DriveThru/covid-payment-alert.dart b/lib/pages/Covid-DriveThru/covid-payment-alert.dart new file mode 100644 index 00000000..ac5f45fc --- /dev/null +++ b/lib/pages/Covid-DriveThru/covid-payment-alert.dart @@ -0,0 +1,288 @@ +import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +class CovidPaymentAlert extends StatefulWidget { + PatientShareResponse patientShareResponse; + + CovidPaymentAlert({@required this.patientShareResponse}); + + @override + _CovidPaymentAlertState createState() => _CovidPaymentAlertState(); +} + +class _CovidPaymentAlertState extends State { + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: "COVID-19 TEST", + isShowAppBar: true, + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + height: 200.0, + color: new Color(0xFFc5272d), + child: Row( + 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, + children: [ + Container( + margin: EdgeInsets.only(left: 30.0, right: 20.0), + child: Text("Alert", + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 24.0)), + ), + Container( + width: MediaQuery.of(context).size.width * 0.55, + margin: EdgeInsets.only( + left: 30.0, right: 20.0, top: 5.0), + child: Text( + "Pay With-in 15 mins to confirm the appointment", + overflow: TextOverflow.clip, + style: TextStyle( + color: Colors.white, fontSize: 20.0)), + ), + ], + ), + ), + ], + ), + ), + 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("Pay With-in 15 mins", + 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( + "Payment for Covid-19 Test should Be made with-in 15 mins otherwise The system will Cancel the Scheduled appointment automatically​.", + 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), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only( + top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), + child: Text("COVID-19 TEST", + 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])), + ), + ], + ), + ), + 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])), + ), + ], + ), + ), + 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", + style: TextStyle( + fontSize: 18.0, color: Colors.grey[700])), + ), + ], + ), + ), + ], + ), + ), + ], + ), + ), + ], + ), + ), + 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("NEXT", style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ), + ], + ), + ), + ); + } + + String getDate(String appoDate) { + var appoDateFormatted = ""; + + var dateObj = DateUtil.convertStringToDate(appoDate); + + setState(() { + appoDateFormatted = DateUtil.getWeekDay(dateObj.weekday) + + ", " + + dateObj.day.toString() + + " " + + DateUtil.getMonth(dateObj.month) + + " " + + dateObj.year.toString() + + " " + + dateObj.hour.toString() + + ":" + + dateObj.minute.toString() + + ":00"; + }); + return appoDateFormatted; + } +} diff --git a/lib/pages/Covid-DriveThru/covid-payment-details.dart b/lib/pages/Covid-DriveThru/covid-payment-details.dart new file mode 100644 index 00000000..1254997d --- /dev/null +++ b/lib/pages/Covid-DriveThru/covid-payment-details.dart @@ -0,0 +1,257 @@ +import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart'; +import 'package:diplomaticquarterapp/pages/Covid-DriveThru/Covid-TimeSlots.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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:flutter_svg/flutter_svg.dart'; + +class CovidPaymentDetails extends StatefulWidget { + CovidPaymentInfoResponse covidPaymentInfoResponse; + int projectID; + + CovidPaymentDetails( + {@required this.covidPaymentInfoResponse, @required this.projectID}); + + @override + _CovidPaymentDetailsState createState() => _CovidPaymentDetailsState(); +} + +class _CovidPaymentDetailsState extends State { + bool isAgree = false; + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: "COVID-19 TEST", + 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: 40.0), + child: Text("COVID-19 TEST", + 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("Drive-Thru", + 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(20.0, 0.0, 20.0, 20.0), + child: Column( + children: [ + Container( + alignment: Alignment.center, + margin: + EdgeInsets.only(left: 0.0, right: 20.0, top: 30.0), + child: Text("Test Fees", + style: TextStyle( + color: Colors.black, + fontSize: 22.0, + fontWeight: FontWeight.bold)), + ), + 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())), + ]), + ], + ), + ], + ), + ), + 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: Colors.blue, + ), + 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("You can pay by following options: ", + 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("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("NEXT", style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ), + ], + ), + ), + ); + } + + void next() { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CovidTimeSlots( + projectID: widget.projectID, + ))); + } + + cancel() { + Navigator.pop(context); + } + + _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])), + ); + } +} diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 796794b2..7c20b53d 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -107,7 +107,7 @@ class _ToDoState extends State { .liveCareAppo, style: TextStyle(fontSize: 12.0)) : Text(widget.appoList[index].projectName != null ? widget.appoList[index].projectName : "-", - style: TextStyle(fontSize: 12.0)), + style: TextStyle(fontSize: 11.0)), ), ], ), diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index d427c2f1..79671682 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -94,11 +94,11 @@ class _HomePageState extends State { children: [ Container( margin: EdgeInsets.only( - top: 15.0), + top: 15.0, left: 3.5, right: 3.5), child: SvgPicture.asset( 'assets/images/new-design/covid-19-car.svg', - width: 50.0, - height: 50.0), + width: 45.0, + height: 45.0), ), Container( margin: EdgeInsets.only( diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index a545f8a7..0c6a2144 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -29,9 +29,6 @@ import 'package:rxdart/rxdart.dart'; import 'home_page.dart'; - - - class LandingPage extends StatefulWidget { static bool isOpenCallPage = false; diff --git a/lib/services/covid-drivethru/covid-drivethru.dart b/lib/services/covid-drivethru/covid-drivethru.dart index a9ebbecd..2681783b 100644 --- a/lib/services/covid-drivethru/covid-drivethru.dart +++ b/lib/services/covid-drivethru/covid-drivethru.dart @@ -49,4 +49,78 @@ class CovidDriveThruService extends BaseService { }, body: request); return Future.value(localRes); } + + Future getCovidPaymentInformation(BuildContext context, int projectID) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getString(APP_LANGUAGE); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "ProjectID": projectID, + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": authUser.outSA, + "TokenID": "", + "DeviceTypeID": req.DeviceTypeID, + "SessionID": "YckwoXhUmWBsnHKEKig", + "PatientID": authUser.patientID != null ? authUser.patientID : 0, + "License": true + }; + + dynamic localRes; + + await baseAppClient.post(GET_COVID_DRIVETHRU_PAYMENT_INFO, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getCovidFreeSlots(BuildContext context, int projectID) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getString(APP_LANGUAGE); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "ProjectID": projectID, + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": authUser.outSA, + "TokenID": "", + "DeviceTypeID": req.DeviceTypeID, + "SessionID": "YckwoXhUmWBsnHKEKig", + "PatientID": authUser.patientID != null ? authUser.patientID : 0, + "License": true + }; + + dynamic localRes; + + await baseAppClient.post(GET_COVID_DRIVETHRU_FREE_SLOTS, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } }