Merge branch 'haroon_s' into 'master'
Haroon s See merge request Cloud_Solution/diplomatic-quarter!67merge-update-with-lab-changes
commit
ecde0b450d
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
@ -1,5 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict/>
|
||||
<dict>
|
||||
<key>aps-environment</key>
|
||||
<string>development</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@ -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<String, dynamic> 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<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
class DriveThroughTestingCenterModel {
|
||||
int rowID;
|
||||
int iD;
|
||||
int projectID;
|
||||
String setupID;
|
||||
double longitude;
|
||||
double latitude;
|
||||
int numberOfTracks;
|
||||
bool isActive;
|
||||
int createdBy;
|
||||
String createdOn;
|
||||
dynamic editedBy;
|
||||
dynamic editedON;
|
||||
dynamic projectName;
|
||||
dynamic projectNameN;
|
||||
|
||||
DriveThroughTestingCenterModel(
|
||||
{this.rowID,
|
||||
this.iD,
|
||||
this.projectID,
|
||||
this.setupID,
|
||||
this.longitude,
|
||||
this.latitude,
|
||||
this.numberOfTracks,
|
||||
this.isActive,
|
||||
this.createdBy,
|
||||
this.createdOn,
|
||||
this.editedBy,
|
||||
this.editedON,
|
||||
this.projectName,
|
||||
this.projectNameN});
|
||||
|
||||
DriveThroughTestingCenterModel.fromJson(Map<String, dynamic> json) {
|
||||
rowID = json['RowID'];
|
||||
iD = json['ID'];
|
||||
projectID = json['ProjectID'];
|
||||
setupID = json['SetupID'];
|
||||
longitude = json['Longitude'];
|
||||
latitude = json['Latitude'];
|
||||
numberOfTracks = json['NumberOfTracks'];
|
||||
isActive = json['IsActive'];
|
||||
createdBy = json['CreatedBy'];
|
||||
createdOn = json['CreatedOn'];
|
||||
editedBy = json['EditedBy'];
|
||||
editedON = json['EditedON'];
|
||||
projectName = json['ProjectName'];
|
||||
projectNameN = json['ProjectNameN'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['RowID'] = this.rowID;
|
||||
data['ID'] = this.iD;
|
||||
data['ProjectID'] = this.projectID;
|
||||
data['SetupID'] = this.setupID;
|
||||
data['Longitude'] = this.longitude;
|
||||
data['Latitude'] = this.latitude;
|
||||
data['NumberOfTracks'] = this.numberOfTracks;
|
||||
data['IsActive'] = this.isActive;
|
||||
data['CreatedBy'] = this.createdBy;
|
||||
data['CreatedOn'] = this.createdOn;
|
||||
data['EditedBy'] = this.editedBy;
|
||||
data['EditedON'] = this.editedON;
|
||||
data['ProjectName'] = this.projectName;
|
||||
data['ProjectNameN'] = this.projectNameN;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
class LiveCareScheduleClinicsListResponse {
|
||||
List<ClinicsHaveScheduleList> clinicsHaveScheduleList;
|
||||
|
||||
LiveCareScheduleClinicsListResponse({this.clinicsHaveScheduleList});
|
||||
|
||||
LiveCareScheduleClinicsListResponse.fromJson(Map<String, dynamic> json) {
|
||||
if (json['ClinicsHaveScheduleList'] != null) {
|
||||
clinicsHaveScheduleList = new List<ClinicsHaveScheduleList>();
|
||||
json['ClinicsHaveScheduleList'].forEach((v) {
|
||||
clinicsHaveScheduleList.add(new ClinicsHaveScheduleList.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
if (this.clinicsHaveScheduleList != null) {
|
||||
data['ClinicsHaveScheduleList'] =
|
||||
this.clinicsHaveScheduleList.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class ClinicsHaveScheduleList {
|
||||
int clinicID;
|
||||
int serviceID;
|
||||
int projectID;
|
||||
String clinicDesc;
|
||||
String clinicDescN;
|
||||
String projectDesc;
|
||||
String projectDescN;
|
||||
|
||||
ClinicsHaveScheduleList(
|
||||
{this.clinicID,
|
||||
this.serviceID,
|
||||
this.projectID,
|
||||
this.clinicDesc,
|
||||
this.clinicDescN,
|
||||
this.projectDesc,
|
||||
this.projectDescN});
|
||||
|
||||
ClinicsHaveScheduleList.fromJson(Map<String, dynamic> json) {
|
||||
clinicID = json['ClinicID'];
|
||||
serviceID = json['ServiceID'];
|
||||
projectID = json['ProjectID'];
|
||||
clinicDesc = json['ClinicDesc'];
|
||||
clinicDescN = json['ClinicDescN'];
|
||||
projectDesc = json['ProjectDesc'];
|
||||
projectDescN = json['ProjectDescN'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['ClinicID'] = this.clinicID;
|
||||
data['ServiceID'] = this.serviceID;
|
||||
data['ProjectID'] = this.projectID;
|
||||
data['ClinicDesc'] = this.clinicDesc;
|
||||
data['ClinicDescN'] = this.clinicDescN;
|
||||
data['ProjectDesc'] = this.projectDesc;
|
||||
data['ProjectDescN'] = this.projectDescN;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,92 @@
|
||||
class insertVIDARequest {
|
||||
int patientID;
|
||||
int acceptedBy;
|
||||
int appointmentNo;
|
||||
String deviceToken;
|
||||
double latitude;
|
||||
double longitude;
|
||||
int serviceID;
|
||||
int projectID;
|
||||
int clinicID;
|
||||
String deviceType;
|
||||
String voipToken;
|
||||
double versionID;
|
||||
int channel;
|
||||
int languageID;
|
||||
String iPAdress;
|
||||
String generalid;
|
||||
int patientOutSA;
|
||||
String sessionID;
|
||||
bool isDentalAllowedBackend;
|
||||
int deviceTypeID;
|
||||
|
||||
insertVIDARequest(
|
||||
{this.patientID,
|
||||
this.acceptedBy,
|
||||
this.appointmentNo,
|
||||
this.deviceToken,
|
||||
this.latitude,
|
||||
this.longitude,
|
||||
this.serviceID,
|
||||
this.projectID,
|
||||
this.clinicID,
|
||||
this.deviceType,
|
||||
this.voipToken,
|
||||
this.versionID,
|
||||
this.channel,
|
||||
this.languageID,
|
||||
this.iPAdress,
|
||||
this.generalid,
|
||||
this.patientOutSA,
|
||||
this.sessionID,
|
||||
this.isDentalAllowedBackend,
|
||||
this.deviceTypeID});
|
||||
|
||||
insertVIDARequest.fromJson(Map<String, dynamic> json) {
|
||||
patientID = json['PatientID'];
|
||||
acceptedBy = json['AcceptedBy'];
|
||||
appointmentNo = json['AppointmentNo'];
|
||||
deviceToken = json['DeviceToken'];
|
||||
latitude = json['Latitude'];
|
||||
longitude = json['Longitude'];
|
||||
serviceID = json['ServiceID'];
|
||||
projectID = json['ProjectID'];
|
||||
clinicID = json['ClinicID'];
|
||||
deviceType = json['DeviceType'];
|
||||
voipToken = json['VoipToken'];
|
||||
versionID = json['VersionID'];
|
||||
channel = json['Channel'];
|
||||
languageID = json['LanguageID'];
|
||||
iPAdress = json['IPAdress'];
|
||||
generalid = json['generalid'];
|
||||
patientOutSA = json['PatientOutSA'];
|
||||
sessionID = json['SessionID'];
|
||||
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||
deviceTypeID = json['DeviceTypeID'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['PatientID'] = this.patientID;
|
||||
data['AcceptedBy'] = this.acceptedBy;
|
||||
data['AppointmentNo'] = this.appointmentNo;
|
||||
data['DeviceToken'] = this.deviceToken;
|
||||
data['Latitude'] = this.latitude;
|
||||
data['Longitude'] = this.longitude;
|
||||
data['ServiceID'] = this.serviceID;
|
||||
data['ProjectID'] = this.projectID;
|
||||
data['ClinicID'] = this.clinicID;
|
||||
data['DeviceType'] = this.deviceType;
|
||||
data['VoipToken'] = this.voipToken;
|
||||
data['VersionID'] = this.versionID;
|
||||
data['Channel'] = this.channel;
|
||||
data['LanguageID'] = this.languageID;
|
||||
data['IPAdress'] = this.iPAdress;
|
||||
data['generalid'] = this.generalid;
|
||||
data['PatientOutSA'] = this.patientOutSA;
|
||||
data['SessionID'] = this.sessionID;
|
||||
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||
data['DeviceTypeID'] = this.deviceTypeID;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -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<CovidTimeSlots>
|
||||
with TickerProviderStateMixin {
|
||||
Map<DateTime, List> _events;
|
||||
AnimationController _animationController;
|
||||
CalendarController _calendarController;
|
||||
|
||||
AppSharedPreferences sharedPref = new AppSharedPreferences();
|
||||
|
||||
var selectedDate = "";
|
||||
dynamic selectedDateJSON;
|
||||
dynamic jsonFreeSlots;
|
||||
|
||||
List<TimeSlot> docFreeSlots = [];
|
||||
List<TimeSlot> 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: <Widget>[
|
||||
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: <Widget>[
|
||||
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: <Widget>[
|
||||
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: <Widget>[
|
||||
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: <Widget>[
|
||||
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 = <Widget>[];
|
||||
|
||||
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<TimeSlot> 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<Map<DateTime, List>> _getJSONSlots() async {
|
||||
Map<DateTime, List> _eventsParsed;
|
||||
List<FreeSlot> 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));
|
||||
}
|
||||
}
|
||||
@ -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<CovidPaymentDetails> {
|
||||
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: <Widget>[
|
||||
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: <Widget>[
|
||||
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: <Widget>[
|
||||
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: <Widget>[
|
||||
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: <Widget>[
|
||||
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])),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
import 'package:diplomaticquarterapp/models/LiveCare/LiveCareScheduleClinicsListResponse.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ScheduleClinicCard extends StatefulWidget {
|
||||
bool isSelected;
|
||||
final ClinicsHaveScheduleList clinicsHaveScheduleList;
|
||||
var languageID;
|
||||
|
||||
ScheduleClinicCard(
|
||||
{this.isSelected,
|
||||
this.languageID,
|
||||
@required this.clinicsHaveScheduleList});
|
||||
|
||||
@override
|
||||
_ScheduleClinicCardState createState() => _ScheduleClinicCardState();
|
||||
}
|
||||
|
||||
class _ScheduleClinicCardState extends State<ScheduleClinicCard> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
child: Card(
|
||||
margin: EdgeInsets.fromLTRB(15.0, 10.0, 15.0, 8.0),
|
||||
color: widget.isSelected ? Colors.blue : Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Container(
|
||||
width: MediaQuery.of(context).size.width * 0.8,
|
||||
padding: EdgeInsets.all(12.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
child: Text(
|
||||
widget.languageID == 'ar'
|
||||
? widget.clinicsHaveScheduleList.clinicDescN
|
||||
: widget.clinicsHaveScheduleList.clinicDesc,
|
||||
style: TextStyle(
|
||||
fontSize: 16.0,
|
||||
color:
|
||||
widget.isSelected ? Colors.white : Colors.black)),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,227 @@
|
||||
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
|
||||
class LiveCareTypeSelect extends StatefulWidget {
|
||||
@override
|
||||
_LiveCareTypeSelectState createState() => _LiveCareTypeSelectState();
|
||||
}
|
||||
|
||||
class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
|
||||
var languageID;
|
||||
AppSharedPreferences sharedPref = AppSharedPreferences();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
getLanguageID();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: InkWell(
|
||||
onTap: () {
|
||||
Navigator.pop(context, null);
|
||||
},
|
||||
child: Icon(
|
||||
Icons.close,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
title: Text(TranslationBase.of(context).bookAppo,
|
||||
style: TextStyle(color: Colors.white)),
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(left: 20.0, right: 20.0),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
margin: EdgeInsets.only(top: 15.0, bottom: 10.0),
|
||||
child: Image.asset(
|
||||
languageID == 'ar'
|
||||
? "assets/images/new-design/liveCare_ar_bg.png"
|
||||
: "assets/images/new-design/liveCare_en_bg.png",
|
||||
width: 120),
|
||||
),
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
child: Text("LiveCare Service",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 20.0))),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 10.0),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
"is to obtain medical advice with a specialist doctor Via a video call",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 18.0))),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 15.0),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text("WHY LIVECARE?",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 20.0))),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 20.0, left: 20.0),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
SvgPicture.asset("assets/images/new-design/check_icon.svg",
|
||||
width: 25),
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.72,
|
||||
margin: EdgeInsets.all(10.0),
|
||||
child: Text(
|
||||
"No need to wait, you will get Medical consultation immediately via Video call.",
|
||||
overflow: TextOverflow.clip,
|
||||
style: TextStyle(fontSize: 14.0)),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 5.0, left: 20.0),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
SvgPicture.asset("assets/images/new-design/check_icon.svg",
|
||||
width: 25),
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.72,
|
||||
margin: EdgeInsets.all(10.0),
|
||||
child: Text("The doctor will see your medical file.",
|
||||
overflow: TextOverflow.clip,
|
||||
style: TextStyle(fontSize: 14.0)),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 5.0, left: 20.0),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
SvgPicture.asset("assets/images/new-design/check_icon.svg",
|
||||
width: 25),
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.72,
|
||||
margin: EdgeInsets.all(10.0),
|
||||
child: Text("Free Prescription delivery service.",
|
||||
overflow: TextOverflow.clip,
|
||||
style: TextStyle(fontSize: 14.0)),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 20.0),
|
||||
child: Text(
|
||||
"** The service is included with some insurance companies according to the terms and conditions With our best wishes for health and wellness",
|
||||
style: TextStyle(fontSize: 16.0))),
|
||||
InkWell(
|
||||
onTap: (){
|
||||
Navigator.pop(context, "immediate");
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.red[900],
|
||||
borderRadius: BorderRadius.all(Radius.circular(10.0))),
|
||||
height: 120.0,
|
||||
margin: EdgeInsets.only(top: 20.0),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 20.0),
|
||||
child: SvgPicture.asset(
|
||||
"assets/images/new-design/liveCare_logo_icon_white.svg",
|
||||
width: 80),
|
||||
),
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.56,
|
||||
margin: EdgeInsets.fromLTRB(30.0, 20.0, 0.0, 0.0),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Text("Get Medical consultation immediately",
|
||||
overflow: TextOverflow.clip,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18.0,
|
||||
color: Colors.white)),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 10.0),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text("Instant video call",
|
||||
style: TextStyle(
|
||||
fontSize: 18.0, color: Colors.white)),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
)),
|
||||
),
|
||||
InkWell(
|
||||
onTap: (){
|
||||
Navigator.pop(context, "schedule");
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey[700],
|
||||
borderRadius: BorderRadius.all(Radius.circular(10.0))),
|
||||
height: 120.0,
|
||||
margin: EdgeInsets.only(top: 20.0),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 20.0),
|
||||
child: Image.asset(
|
||||
"assets/images/new-design/calendar.png",
|
||||
width: 70),
|
||||
),
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.58,
|
||||
margin: EdgeInsets.fromLTRB(30.0, 30.0, 0.0, 0.0),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text("Book Appointment",
|
||||
overflow: TextOverflow.clip,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18.0,
|
||||
color: Colors.white)),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 10.0),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text("Schedule Video Call",
|
||||
style: TextStyle(
|
||||
fontSize: 18.0, color: Colors.white)),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 40.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
getLanguageID() async {
|
||||
var languageID = await sharedPref.getString(APP_LANGUAGE);
|
||||
setState(() {
|
||||
this.languageID = languageID;
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,126 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||
import 'package:diplomaticquarterapp/core/service/base_service.dart';
|
||||
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
|
||||
import 'package:diplomaticquarterapp/models/Request.dart';
|
||||
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CovidDriveThruService extends BaseService {
|
||||
AppSharedPreferences sharedPref = AppSharedPreferences();
|
||||
AppGlobal appGlobal = new AppGlobal();
|
||||
|
||||
AuthenticatedUser authUser = new AuthenticatedUser();
|
||||
AuthProvider authProvider = new AuthProvider();
|
||||
|
||||
Future<Map> getCovidProjectsList(BuildContext context) async {
|
||||
Map<String, dynamic> 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",
|
||||
"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_PROJECT_LIST,
|
||||
onSuccess: (response, statusCode) async {
|
||||
localRes = response;
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
throw error;
|
||||
}, body: request);
|
||||
return Future.value(localRes);
|
||||
}
|
||||
|
||||
Future<Map> getCovidPaymentInformation(BuildContext context, int projectID) async {
|
||||
Map<String, dynamic> 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<Map> getCovidFreeSlots(BuildContext context, int projectID) async {
|
||||
Map<String, dynamic> 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);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue