|
|
|
|
@ -1,3 +1,4 @@
|
|
|
|
|
import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/appoDetailsButtons.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart';
|
|
|
|
|
@ -20,10 +21,9 @@ class AppointmentActions extends StatefulWidget {
|
|
|
|
|
TabController tabController;
|
|
|
|
|
final Function enableFooterButton;
|
|
|
|
|
|
|
|
|
|
AppointmentActions(
|
|
|
|
|
{@required this.appo,
|
|
|
|
|
@required this.tabController,
|
|
|
|
|
@required this.enableFooterButton});
|
|
|
|
|
AppointmentActions({@required this.appo,
|
|
|
|
|
@required this.tabController,
|
|
|
|
|
@required this.enableFooterButton});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_AppointmentActionsState createState() => _AppointmentActionsState();
|
|
|
|
|
@ -40,7 +40,9 @@ class _AppointmentActionsState extends State<AppointmentActions> {
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
var size = MediaQuery.of(context).size;
|
|
|
|
|
var size = MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.size;
|
|
|
|
|
final double itemHeight = ((size.height - kToolbarHeight - 24) * 0.42) / 2;
|
|
|
|
|
final double itemWidth = size.width / 2;
|
|
|
|
|
|
|
|
|
|
@ -56,57 +58,58 @@ class _AppointmentActionsState extends State<AppointmentActions> {
|
|
|
|
|
crossAxisCount: 2,
|
|
|
|
|
childAspectRatio: (itemWidth / itemHeight),
|
|
|
|
|
children: appoButtonsList
|
|
|
|
|
.map((e) => GestureDetector(
|
|
|
|
|
onTap: () {
|
|
|
|
|
_handleButtonClicks(e);
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
height: 100.0,
|
|
|
|
|
margin: EdgeInsets.all(9.0),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(
|
|
|
|
|
color: Colors.grey[400],
|
|
|
|
|
blurRadius: 2.0,
|
|
|
|
|
spreadRadius: 0.0)
|
|
|
|
|
],
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
color: Colors.white),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0),
|
|
|
|
|
child: Text(e.title,
|
|
|
|
|
overflow: TextOverflow.clip,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: new Color(0xFFc5272d),
|
|
|
|
|
letterSpacing: 1.0,
|
|
|
|
|
fontSize: 20.0)),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0),
|
|
|
|
|
child: Text(e.subtitle,
|
|
|
|
|
overflow: TextOverflow.clip,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
letterSpacing: 1.0,
|
|
|
|
|
fontSize: 15.0)),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
alignment: Alignment.bottomRight,
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.fromLTRB(0.0, 10.0, 10.0, 7.0),
|
|
|
|
|
child: Image.asset(e.icon,
|
|
|
|
|
width: 45.0, height: 45.0),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
.map((e) =>
|
|
|
|
|
GestureDetector(
|
|
|
|
|
onTap: () {
|
|
|
|
|
_handleButtonClicks(e);
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
height: 100.0,
|
|
|
|
|
margin: EdgeInsets.all(9.0),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(
|
|
|
|
|
color: Colors.grey[400],
|
|
|
|
|
blurRadius: 2.0,
|
|
|
|
|
spreadRadius: 0.0)
|
|
|
|
|
],
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
color: Colors.white),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0),
|
|
|
|
|
child: Text(e.title,
|
|
|
|
|
overflow: TextOverflow.clip,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: new Color(0xFFc5272d),
|
|
|
|
|
letterSpacing: 1.0,
|
|
|
|
|
fontSize: 20.0)),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
))
|
|
|
|
|
Container(
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0),
|
|
|
|
|
child: Text(e.subtitle,
|
|
|
|
|
overflow: TextOverflow.clip,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
letterSpacing: 1.0,
|
|
|
|
|
fontSize: 15.0)),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
alignment: Alignment.bottomRight,
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.fromLTRB(0.0, 10.0, 10.0, 7.0),
|
|
|
|
|
child: Image.asset(e.icon,
|
|
|
|
|
width: 45.0, height: 45.0),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
))
|
|
|
|
|
.toList(),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -130,9 +133,15 @@ class _AppointmentActionsState extends State<AppointmentActions> {
|
|
|
|
|
case "onCancelAppointment":
|
|
|
|
|
ConfirmDialog dialog = new ConfirmDialog(
|
|
|
|
|
context: context,
|
|
|
|
|
confirmMessage: TranslationBase.of(context).cancelAppoMsg,
|
|
|
|
|
okText: TranslationBase.of(context).confirm,
|
|
|
|
|
cancelText: TranslationBase.of(context).cancel_nocaps,
|
|
|
|
|
confirmMessage: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.cancelAppoMsg,
|
|
|
|
|
okText: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.confirm,
|
|
|
|
|
cancelText: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.cancel_nocaps,
|
|
|
|
|
okFunction: () => {cancelAppointment()},
|
|
|
|
|
cancelFunction: () => {});
|
|
|
|
|
dialog.showAlertDialog(context);
|
|
|
|
|
@ -158,6 +167,10 @@ class _AppointmentActionsState extends State<AppointmentActions> {
|
|
|
|
|
case "askDoc":
|
|
|
|
|
askYourDoc();
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "radiology":
|
|
|
|
|
openAppointmentRadiology();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -329,6 +342,21 @@ class _AppointmentActionsState extends State<AppointmentActions> {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
openAppointmentRadiology() {
|
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
|
FinalRadiology finalRadiology = new FinalRadiology();
|
|
|
|
|
service.getPatientRadOrders(widget.appo.appointmentNo.toString(), context)
|
|
|
|
|
.then((res) {
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
print(res['FinalRadiologyList']);
|
|
|
|
|
} else {
|
|
|
|
|
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
|
|
|
|
|
}
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
print(err);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static Future<void> openMap(double latitude, double longitude) async {
|
|
|
|
|
String googleUrl =
|
|
|
|
|
'https://www.google.com/maps/search/?api=1&query=$latitude,$longitude';
|
|
|
|
|
@ -364,11 +392,13 @@ class _AppointmentActionsState extends State<AppointmentActions> {
|
|
|
|
|
service
|
|
|
|
|
.isAllowedToAskDoctor(widget.appo.doctorID, context)
|
|
|
|
|
.then((res) {
|
|
|
|
|
print(res['PatientDoctorAppointmentResultList']);
|
|
|
|
|
print(res['PatientDoctorAppointmentResultList']);
|
|
|
|
|
if (res['PatientDoctorAppointmentResultList'].length != 0) {
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
AppToast.showErrorToast(message: TranslationBase.of(context).askDocNotAllowed);
|
|
|
|
|
AppToast.showErrorToast(message: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.askDocNotAllowed);
|
|
|
|
|
}
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
print(err);
|
|
|
|
|
@ -379,7 +409,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
|
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
|
service
|
|
|
|
|
.confirmAppointment(widget.appo.appointmentNo, widget.appo.clinicID,
|
|
|
|
|
widget.appo.projectID, context)
|
|
|
|
|
widget.appo.projectID, context)
|
|
|
|
|
.then((res) {
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
|
|
|
|
|
|