|
|
|
@ -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/AppoimentAllHistoryResultList.dart';
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/appoDetailsButtons.dart';
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/appoDetailsButtons.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart';
|
|
|
|
@ -20,8 +21,7 @@ class AppointmentActions extends StatefulWidget {
|
|
|
|
TabController tabController;
|
|
|
|
TabController tabController;
|
|
|
|
final Function enableFooterButton;
|
|
|
|
final Function enableFooterButton;
|
|
|
|
|
|
|
|
|
|
|
|
AppointmentActions(
|
|
|
|
AppointmentActions({@required this.appo,
|
|
|
|
{@required this.appo,
|
|
|
|
|
|
|
|
@required this.tabController,
|
|
|
|
@required this.tabController,
|
|
|
|
@required this.enableFooterButton});
|
|
|
|
@required this.enableFooterButton});
|
|
|
|
|
|
|
|
|
|
|
|
@ -40,7 +40,9 @@ class _AppointmentActionsState extends State<AppointmentActions> {
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
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 itemHeight = ((size.height - kToolbarHeight - 24) * 0.42) / 2;
|
|
|
|
final double itemWidth = size.width / 2;
|
|
|
|
final double itemWidth = size.width / 2;
|
|
|
|
|
|
|
|
|
|
|
|
@ -56,7 +58,8 @@ class _AppointmentActionsState extends State<AppointmentActions> {
|
|
|
|
crossAxisCount: 2,
|
|
|
|
crossAxisCount: 2,
|
|
|
|
childAspectRatio: (itemWidth / itemHeight),
|
|
|
|
childAspectRatio: (itemWidth / itemHeight),
|
|
|
|
children: appoButtonsList
|
|
|
|
children: appoButtonsList
|
|
|
|
.map((e) => GestureDetector(
|
|
|
|
.map((e) =>
|
|
|
|
|
|
|
|
GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
_handleButtonClicks(e);
|
|
|
|
_handleButtonClicks(e);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
@ -130,9 +133,15 @@ class _AppointmentActionsState extends State<AppointmentActions> {
|
|
|
|
case "onCancelAppointment":
|
|
|
|
case "onCancelAppointment":
|
|
|
|
ConfirmDialog dialog = new ConfirmDialog(
|
|
|
|
ConfirmDialog dialog = new ConfirmDialog(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
confirmMessage: TranslationBase.of(context).cancelAppoMsg,
|
|
|
|
confirmMessage: TranslationBase
|
|
|
|
okText: TranslationBase.of(context).confirm,
|
|
|
|
.of(context)
|
|
|
|
cancelText: TranslationBase.of(context).cancel_nocaps,
|
|
|
|
.cancelAppoMsg,
|
|
|
|
|
|
|
|
okText: TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.confirm,
|
|
|
|
|
|
|
|
cancelText: TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.cancel_nocaps,
|
|
|
|
okFunction: () => {cancelAppointment()},
|
|
|
|
okFunction: () => {cancelAppointment()},
|
|
|
|
cancelFunction: () => {});
|
|
|
|
cancelFunction: () => {});
|
|
|
|
dialog.showAlertDialog(context);
|
|
|
|
dialog.showAlertDialog(context);
|
|
|
|
@ -158,6 +167,10 @@ class _AppointmentActionsState extends State<AppointmentActions> {
|
|
|
|
case "askDoc":
|
|
|
|
case "askDoc":
|
|
|
|
askYourDoc();
|
|
|
|
askYourDoc();
|
|
|
|
break;
|
|
|
|
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 {
|
|
|
|
static Future<void> openMap(double latitude, double longitude) async {
|
|
|
|
String googleUrl =
|
|
|
|
String googleUrl =
|
|
|
|
'https://www.google.com/maps/search/?api=1&query=$latitude,$longitude';
|
|
|
|
'https://www.google.com/maps/search/?api=1&query=$latitude,$longitude';
|
|
|
|
@ -368,7 +396,9 @@ class _AppointmentActionsState extends State<AppointmentActions> {
|
|
|
|
if (res['PatientDoctorAppointmentResultList'].length != 0) {
|
|
|
|
if (res['PatientDoctorAppointmentResultList'].length != 0) {
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
AppToast.showErrorToast(message: TranslationBase.of(context).askDocNotAllowed);
|
|
|
|
AppToast.showErrorToast(message: TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.askDocNotAllowed);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).catchError((err) {
|
|
|
|
}).catchError((err) {
|
|
|
|
print(err);
|
|
|
|
print(err);
|
|
|
|
|