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 00000000..a66d6815
Binary files /dev/null and b/assets/images/new-design/covid-19-big-banner-bg.png differ
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