|
|
|
|
@ -83,15 +83,11 @@ class _QRCodeState extends State<QRCode> {
|
|
|
|
|
border: Border.all(color: Colors.black),
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
),
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
"assets/images/nfc/ic_nfc.png"),
|
|
|
|
|
child: Image.asset("assets/images/nfc/ic_nfc.png"),
|
|
|
|
|
),
|
|
|
|
|
onTap: () {
|
|
|
|
|
showNfcReader(context,
|
|
|
|
|
onNcfScan: (String nfcId) {
|
|
|
|
|
Future.delayed(
|
|
|
|
|
const Duration(milliseconds: 100),
|
|
|
|
|
() {
|
|
|
|
|
showNfcReader(context, onNcfScan: (String nfcId) {
|
|
|
|
|
Future.delayed(const Duration(milliseconds: 100), () {
|
|
|
|
|
sendNfcCheckInRequest(nfcId);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
@ -125,23 +121,14 @@ class _QRCodeState extends State<QRCode> {
|
|
|
|
|
child: Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.only(top: 10.0, left: 40.0, bottom: 10.0),
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
"assets/images/new-design/device_icon.png",
|
|
|
|
|
width: MediaQuery.of(context).size.width / 3.4,
|
|
|
|
|
height: MediaQuery.of(context).size.width / 3.4),
|
|
|
|
|
margin: EdgeInsets.only(top: 10.0, left: 40.0, bottom: 10.0),
|
|
|
|
|
child: Image.asset("assets/images/new-design/device_icon.png", width: MediaQuery.of(context).size.width / 3.4, height: MediaQuery.of(context).size.width / 3.4),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
|
|
|
|
|
child: Text(TranslationBase.of(context).scanQRHospital,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.red[700],
|
|
|
|
|
fontSize: 18.0,
|
|
|
|
|
fontWeight: FontWeight.bold)),
|
|
|
|
|
margin: EdgeInsets.only(top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
|
|
|
|
|
child: Text(TranslationBase.of(context).scanQRHospital, style: TextStyle(color: Colors.red[700], fontSize: 18.0, fontWeight: FontWeight.bold)),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
@ -155,13 +142,8 @@ class _QRCodeState extends State<QRCode> {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
|
|
|
|
|
child: Text(TranslationBase.of(context).appoInfo,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 18.0,
|
|
|
|
|
color: Colors.grey[700],
|
|
|
|
|
fontWeight: FontWeight.bold)),
|
|
|
|
|
margin: EdgeInsets.only(top: 15.0, bottom: 10.0, left: 20.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: 20.0, bottom: 20.0),
|
|
|
|
|
@ -176,37 +158,20 @@ class _QRCodeState extends State<QRCode> {
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
|
|
|
|
|
child: Text(widget.patientShareResponse.doctorNameObj,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 18.0,
|
|
|
|
|
color: Colors.grey[700],
|
|
|
|
|
fontWeight: FontWeight.bold)),
|
|
|
|
|
margin: EdgeInsets.only(top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
|
|
|
|
|
child: Text(widget.patientShareResponse.doctorNameObj, style: TextStyle(fontSize: 18.0, color: Colors.grey[700], fontWeight: FontWeight.bold)),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
bottom: 10.0, left: 20.0, right: 20.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
getDoctorSpeciality(
|
|
|
|
|
widget.patientShareResponse.doctorSpeciality),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 18.0, color: Colors.grey[700])),
|
|
|
|
|
margin: EdgeInsets.only(bottom: 10.0, left: 20.0, right: 20.0),
|
|
|
|
|
child: Text(getDoctorSpeciality(widget.patientShareResponse.doctorSpeciality), style: TextStyle(fontSize: 18.0, color: Colors.grey[700])),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
top: 0.0, bottom: 10.0, left: 20.0, right: 20.0),
|
|
|
|
|
child: Text(widget.patientShareResponse.projectName,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 18.0, color: Colors.grey[700])),
|
|
|
|
|
margin: EdgeInsets.only(top: 0.0, bottom: 10.0, left: 20.0, right: 20.0),
|
|
|
|
|
child: Text(widget.patientShareResponse.projectName, style: TextStyle(fontSize: 18.0, color: Colors.grey[700])),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
top: 0.0, bottom: 10.0, left: 20.0, right: 20.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
getDate(widget.patientShareResponse.appointmentDate),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 18.0, color: Colors.grey[700])),
|
|
|
|
|
margin: EdgeInsets.only(top: 0.0, bottom: 10.0, left: 20.0, right: 20.0),
|
|
|
|
|
child: Text(getDate(widget.patientShareResponse.appointmentDate), style: TextStyle(fontSize: 18.0, color: Colors.grey[700])),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
@ -233,9 +198,7 @@ class _QRCodeState extends State<QRCode> {
|
|
|
|
|
// getAppoQR(context);
|
|
|
|
|
sendEmail();
|
|
|
|
|
},
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).sendEmail.toUpperCase(),
|
|
|
|
|
style: TextStyle(fontSize: 18.0)),
|
|
|
|
|
child: Text(TranslationBase.of(context).sendEmail.toUpperCase(), style: TextStyle(fontSize: 18.0)),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
@ -262,9 +225,7 @@ class _QRCodeState extends State<QRCode> {
|
|
|
|
|
onPressed: () {
|
|
|
|
|
navigateToHome(context);
|
|
|
|
|
},
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).close.toUpperCase(),
|
|
|
|
|
style: TextStyle(fontSize: 18.0)),
|
|
|
|
|
child: Text(TranslationBase.of(context).close.toUpperCase(), style: TextStyle(fontSize: 18.0)),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
@ -281,8 +242,7 @@ class _QRCodeState extends State<QRCode> {
|
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
|
|
|
|
|
|
if (await widget.sharedPref.getObject(USER_PROFILE) != null) {
|
|
|
|
|
var data = AuthenticatedUser.fromJson(
|
|
|
|
|
await widget.sharedPref.getObject(USER_PROFILE));
|
|
|
|
|
var data = AuthenticatedUser.fromJson(await widget.sharedPref.getObject(USER_PROFILE));
|
|
|
|
|
setState(() {
|
|
|
|
|
widget.authUser = data;
|
|
|
|
|
});
|
|
|
|
|
@ -290,24 +250,14 @@ class _QRCodeState extends State<QRCode> {
|
|
|
|
|
|
|
|
|
|
ConfirmDialog dialog = new ConfirmDialog(
|
|
|
|
|
context: context,
|
|
|
|
|
confirmMessage: "Send a copy of this QR to the email " +
|
|
|
|
|
widget.authUser.emailAddress +
|
|
|
|
|
"?",
|
|
|
|
|
confirmMessage: "Send a copy of this QR to the email " + widget.authUser.emailAddress + "?",
|
|
|
|
|
okText: TranslationBase.of(context).confirm,
|
|
|
|
|
cancelText: TranslationBase.of(context).cancel_nocaps,
|
|
|
|
|
okFunction: () {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
service
|
|
|
|
|
.sendAppointmentQREmail(
|
|
|
|
|
widget.authUser.emailAddress,
|
|
|
|
|
widget.patientShareResponse.appointmentDate,
|
|
|
|
|
widget.patientShareResponse.appointmentNo.toString(),
|
|
|
|
|
widget.patientShareResponse.doctorNameObj,
|
|
|
|
|
widget.patientShareResponse.projectName,
|
|
|
|
|
widget.appoQR,
|
|
|
|
|
getDoctorSpeciality(
|
|
|
|
|
widget.patientShareResponse.doctorSpeciality),
|
|
|
|
|
context)
|
|
|
|
|
.sendAppointmentQREmail(widget.authUser.emailAddress, widget.patientShareResponse.appointmentDate, widget.patientShareResponse.appointmentNo.toString(),
|
|
|
|
|
widget.patientShareResponse.doctorNameObj, widget.patientShareResponse.projectName, widget.appoQR, getDoctorSpeciality(widget.patientShareResponse.doctorSpeciality), context)
|
|
|
|
|
.then((res) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
ConfirmDialog.closeAlertDialog(context);
|
|
|
|
|
@ -326,8 +276,7 @@ class _QRCodeState extends State<QRCode> {
|
|
|
|
|
Navigator.of(context).pushNamed(HOME);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getPatientShare(context, String appointmentNo, int clinicID, int projectID,
|
|
|
|
|
DoctorList docObject) {}
|
|
|
|
|
getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) {}
|
|
|
|
|
|
|
|
|
|
String getDate(String appoDate) {
|
|
|
|
|
var appoDateFormatted = "";
|
|
|
|
|
@ -367,10 +316,7 @@ class _QRCodeState extends State<QRCode> {
|
|
|
|
|
|
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
|
|
|
|
|
|
service
|
|
|
|
|
.sendCheckinNfcRequest(widget.patientShareResponse.appointmentNo, nfcId,
|
|
|
|
|
widget.patientShareResponse.projectID, context)
|
|
|
|
|
.then((res) {
|
|
|
|
|
service.sendCheckinNfcRequest(widget.patientShareResponse.appointmentNo, nfcId, widget.patientShareResponse.projectID, context).then((res) {
|
|
|
|
|
print(res);
|
|
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
|