Payment method selection page created, Appointment details functions implemented

merge-update-with-lab-changes
haroon amjad 6 years ago
parent 06f95c5379
commit b3e5047820

@ -7,14 +7,14 @@
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="diplomaticquarterapp"
android:icon="@mipmap/ic_launcher">
android:icon="@mipmap/ic_launcher"
android:label="diplomaticquarterapp">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
@ -22,8 +22,7 @@
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
android:resource="@style/NormalTheme" />
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
@ -31,12 +30,11 @@
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
android:resource="@drawable/launch_background" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
@ -50,6 +48,9 @@
android:value="2" />
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.USE_FINGERPRINT"/>
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
</manifest>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

@ -39,6 +39,6 @@
"title": "online",
"subtitle": "payment",
"icon": "assets/images/new-design/check-in.png",
"caller": "goToTodoList(31)"
"caller": "goToTodoList"
}
]

@ -45,6 +45,10 @@ const GET_PATIENT_SHARE =
const GET_PATIENT_APPOINTMENT_HISTORY =
"/Doctors.svc/REST/PateintHasAppoimentHistory";
//URL to get patient appointment curfew history
const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY =
"/Doctors.svc/REST/AppoimentHistoryForCurfew";
//URL to confirm appointment
const CONFIRM_APPOINTMENT = "/MobileNotifications.svc/REST/ConfirmAppointment";

@ -77,6 +77,7 @@ const Map<String, Map<String, String>> localizedValues = {
'online': {'en': 'Online', 'ar': 'الالكترونية'},
'payment': {'en': 'Payment', 'ar': 'الدفع'},
'cancel-nocaps': {'en': 'Cancel', 'ar': 'الغاء'},
'set-reminder': {'en': 'Set Reminder', 'ar': 'تعيين تذكير'},
'login': {'en': 'Login', 'ar': 'تسجيل الدخول'},
'loginregister': {'en': 'Login / Register', 'ar': 'دخولتسجيل'},
@ -156,5 +157,13 @@ const Map<String, Map<String, String>> localizedValues = {
"arabic-change": {"en": "عربي", "ar": "English"},
"notification": {"en": "Notifications", "ar": "إشعارات"},
"app-settings": {"en": "App Settings", "ar": "إعدادات التطبيق"},
"rate-app": {"en": "Rate Our App", "ar": "قيم التطبيق"}
"rate-app": {"en": "Rate Our App", "ar": "قيم التطبيق"},
"before": {"en": "Before", "ar": "قبل"},
"minute": {"en": "Minutes", "ar": "دقيقة"},
"hour": {"en": "Hour", "ar": "ساعة"},
"reminderSuccess": {"en": "The reminder has been added successfully", "ar": "يضاف التذكير بنجاح"},
"patientShareToDo": {"en": "Amount before tax: ", "ar": "المبلغ قبل الضريبة:"},
"patientTaxToDo": {"en": "Tax amount: ", "ar": "قيمة الضريبة:"},
"patientShareTotalToDo": {"en": "Total amount Due: ", "ar": "المبلغ الإجمالي المستحق:"},
'paymentMethod': {'en': 'Payment Method', 'ar': 'طريقة الدفع او السداد'},
};

@ -0,0 +1,79 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
import 'package:flutter/material.dart';
class VisitTicket extends StatefulWidget {
List<DoctorList> appoList = [];
@override
_VisitTicketState createState() => _VisitTicketState();
}
class _VisitTicketState extends State<VisitTicket> {
bool isLoading = false;
@override
void initState() {
getPatientAppointmentCurfewHistory();
super.initState();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).todoList,
body: isLoading == false
? SingleChildScrollView(
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0),
itemCount: widget.appoList.length,
itemBuilder: (context, index) {
return DoctorView(
doctor: widget.appoList[index],
);
},
),
)
: AppCircularProgressIndicator(),
);
}
getPatientAppointmentCurfewHistory() {
loading(true);
DoctorsListService service = new DoctorsListService();
service.getPatientAppointmentHistory(true).then((res) {
print(res['AppoimentAllHistoryResultList']);
if (res['MessageStatus'] == 1) {
setState(() {
if (res['AppoimentAllHistoryResultList'].length != 0) {
widget.appoList.clear();
res['AppoimentAllHistoryResultList'].forEach((v) {
widget.appoList.add(new DoctorList.fromJson(v));
});
} else {}
});
loading(false);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
loading(false);
}
}).catchError((err) {
print(err);
loading(false);
});
}
loading(bool flag) {
setState(() {
isLoading = flag;
});
}
}

@ -43,19 +43,19 @@ class ArrivedButtons {
"title": "Insurance",
"subtitle": "Approvals",
"icon": "assets/images/new-design/insurance_approvals_icon-in.png",
"caller": "goToTodoList(31)"
"caller": "goToTodoList"
},
{
"title": "Ask Your",
"subtitle": "Doctor",
"icon": "assets/images/new-design/ask_doctor_icon.png",
"caller": "goToTodoList(31)"
"caller": "goToTodoList"
},
{
"title": "Survey",
"subtitle": "Service",
"icon": "assets/images/new-design/survey.png",
"caller": "goToTodoList(31)"
"caller": "goToTodoList"
}
];
}

@ -43,19 +43,19 @@ class ArrivedButtons {
"title": "Insurance",
"subtitle": "Approvals",
"icon": "assets/images/new-design/insurance_approvals_icon-in.png",
"caller": "goToTodoList(31)"
"caller": "goToTodoList"
},
{
"title": "Ask Your",
"subtitle": "Doctor",
"icon": "assets/images/new-design/ask_doctor_icon.png",
"caller": "goToTodoList(31)"
"caller": "goToTodoList"
},
{
"title": "Survey",
"subtitle": "Service",
"icon": "assets/images/new-design/survey.png",
"caller": "goToTodoList(31)"
"caller": "goToTodoList"
}
];
}

@ -43,7 +43,7 @@ class BookedButtonsAllowCheckIn {
"title": TranslationBase.of(AppGlobal.context).online,
"subtitle": TranslationBase.of(AppGlobal.context).payment,
"icon": "assets/images/new-design/check-in.png",
"caller": "goToTodoList(31)"
"caller": "goToTodoList"
}
];
}

@ -33,17 +33,17 @@ class ConfirmedButtons {
"icon": "assets/images/new-design/location_icon.png",
"caller": "navigateToProject"
},
{
"title": "Generate",
"subtitle": "Visit Ticket",
"icon": "assets/images/new-design/generate_visit_ticket.png",
"caller": "visitTicket"
},
// {
// "title": "Generate",
// "subtitle": "Visit Ticket",
// "icon": "assets/images/new-design/generate_visit_ticket.png",
// "caller": "visitTicket"
// },
{
"title": TranslationBase.of(AppGlobal.context).online,
"subtitle": TranslationBase.of(AppGlobal.context).payment,
"icon": "assets/images/new-design/check-in.png",
"caller": "goToTodoList(31)"
"caller": "goToTodoList"
}
];
}

@ -37,7 +37,7 @@ class ConfirmedButtonsAllowCheckIn {
"title": TranslationBase.of(AppGlobal.context).online,
"subtitle": TranslationBase.of(AppGlobal.context).payment,
"icon": "assets/images/new-design/check-in.png",
"caller": "goToTodoList(31)"
"caller": "goToTodoList"
}
];
}

@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/models/BookedButtons.d
import 'package:diplomaticquarterapp/pages/MyAppointments/models/BookedButtonsAllowCheckIn.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButtons.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButtonsAllowCheckIn.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -137,6 +138,14 @@ class _AppointmentActionsState extends State<AppointmentActions> {
openMap(double.parse(widget.appo.latitude),
double.parse(widget.appo.longitude));
break;
case "addReminder":
showReminderDialog(widget.appo);
break;
case "goToTodoList":
Navigator.of(context).pop();
break;
}
}
@ -321,8 +330,24 @@ class _AppointmentActionsState extends State<AppointmentActions> {
}
}
showReminderDialog() {
showReminderDialog(AppoitmentAllHistoryResultList appo) {
showGeneralDialog(
barrierColor: Colors.black.withOpacity(0.5),
transitionBuilder: (context, a1, a2, widget) {
final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0;
return Transform(
transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
child: Opacity(
opacity: a1.value,
child: ReminderDialog(appo: appo),
),
);
},
transitionDuration: Duration(milliseconds: 500),
barrierDismissible: true,
barrierLabel: '',
context: context,
pageBuilder: (context, animation1, animation2) {});
}
confirmAppointment() {

@ -0,0 +1,94 @@
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog.dart';
import 'package:flutter/material.dart';
class CustomRadio extends StatefulWidget {
@override
createState() {
return new CustomRadioState();
}
}
class CustomRadioState extends State<CustomRadio> {
List<RadioModel> sampleData = new List<RadioModel>();
@override
void initState() {
super.initState();
sampleData.add(new RadioModel(false, "Before 30 Mins", 30));
sampleData.add(new RadioModel(false, 'Before 1 Hour', 60));
sampleData.add(new RadioModel(false, 'Before 2 Hours', 120));
sampleData.add(new RadioModel(false, 'Before 4 Hours', 240));
}
@override
Widget build(BuildContext context) {
return Column(
children: <Widget>[
ListView.builder(
shrinkWrap: true,
itemCount: sampleData.length,
itemBuilder: (BuildContext context, int index) {
return new InkWell(
//highlightColor: Colors.red,
splashColor: Colors.transparent,
onTap: () {
setState(() {
sampleData.forEach((element) => element.isSelected = false);
sampleData[index].isSelected = true;
ReminderDialog.selectedDuration =
sampleData[index].duration * 60000;
});
},
child: new RadioItem(sampleData[index]),
);
},
),
],
);
}
}
class RadioItem extends StatelessWidget {
final RadioModel _item;
RadioItem(this._item);
@override
Widget build(BuildContext context) {
return new Container(
margin: new EdgeInsets.all(15.0),
child: new Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
new Container(
height: 30.0,
width: 30.0,
child: new Center(
child: Image.asset("assets/images/new-design/check_icon.png",
width: 15.0, height: 15.0),
),
decoration: new BoxDecoration(
color: _item.isSelected ? Colors.blue : Colors.transparent,
border: new Border.all(
width: 1.0,
color: _item.isSelected ? Colors.blue : Colors.grey),
borderRadius: const BorderRadius.all(const Radius.circular(50.0)),
),
),
new Container(
margin: new EdgeInsets.only(left: 15.0),
child: new Text(_item.text, style: TextStyle(fontSize: 16.0)),
),
],
),
);
}
}
class RadioModel {
bool isSelected;
final String text;
final int duration;
RadioModel(this.isSelected, this.text, this.duration);
}

@ -1,8 +1,134 @@
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/custom_radio.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:flutter/material.dart';
import 'package:manage_calendar_events/manage_calendar_events.dart';
class ReminderDialog extends StatefulWidget {
static var selectedDuration;
AppoitmentAllHistoryResultList appo;
ReminderDialog({@required this.appo});
@override
_ReminderDialogState createState() => _ReminderDialogState();
}
class _ReminderDialogState extends State<ReminderDialog> {
final CalendarPlugin _myPlugin = CalendarPlugin();
class ReminderDialog extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container();
return Container(
child: Dialog(
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)),
child: Container(
height: MediaQuery.of(context).size.height * 0.55,
width: 450.0,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
margin: EdgeInsets.all(20.0),
child: Text(TranslationBase.of(context).setReminder,
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.bold,
fontFamily: "Open-Sans-Bold")),
),
Container(
transform: Matrix4.translationValues(0.0, -30.0, 0.0),
child: CustomRadio(),
),
Container(
width: MediaQuery.of(context).size.width,
height: 40.0,
margin: EdgeInsets.only(left: 30.0, top: 0.0, right: 30.0),
child: RaisedButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
side: BorderSide(color: Colors.blue)),
color: Colors.blue,
onPressed: () {
print(ReminderDialog.selectedDuration);
createCalendarEvent();
},
child: Text(TranslationBase.of(context).confirm,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontFamily: 'Open-Sans-Bold')),
),
),
Container(
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.only(left: 100.0, top: 20.0, right: 100.0),
child: OutlineButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0)),
color: Colors.red,
borderSide: BorderSide(color: Colors.red),
highlightColor: Colors.red,
highlightedBorderColor: Colors.red,
onPressed: () {
Navigator.of(context).pop();
},
child: Text(TranslationBase.of(context).cancel_nocaps,
style: TextStyle(
color: Colors.red,
fontWeight: FontWeight.bold,
fontFamily: 'Open-Sans-Bold')),
),
),
]),
),
),
);
}
createCalendarEvent() {
_myPlugin.hasPermissions().then((value) {
if (!value) {
_myPlugin.requestPermissions();
} else {
_myPlugin.getCalendars().then((value) => {print(value.length)});
}
});
CalendarEvent calendarEvent = new CalendarEvent(
eventId: widget.appo.appointmentNo.toString(),
title: "Doctor Appointment",
description: "You have an appointment with " +
widget.appo.doctorTitle +
" " +
widget.appo.doctorNameObj,
startDate: DateUtil.convertStringToDate(widget.appo.appointmentDate)
.subtract(
new Duration(microseconds: ReminderDialog.selectedDuration)),
endDate: DateUtil.convertStringToDate(widget.appo.appointmentDate),
location: widget.appo.projectName,
duration: new Duration(minutes: 15).inMinutes,
isAllDay: false,
hasAlarm: true);
_myPlugin
.createEvent(calendarId: "207749556", event: calendarEvent)
.then((value) {
print("Cal event");
print(value);
if (int.parse(value) == widget.appo.appointmentNo) {
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess);
}
Navigator.of(context).pop();
}).catchError((err) {
print("Cal Error");
print(err);
Navigator.of(context).pop();
});
}
}

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/widgets/paymentDialog.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
@ -12,7 +14,7 @@ import 'package:flutter/material.dart';
import 'package:rating_bar/rating_bar.dart';
class ToDo extends StatefulWidget {
DoctorsListService service;
PatientShareResponse patientShareResponse;
List<AppoitmentAllHistoryResultList> appoList = [];
var languageID;
@ -28,7 +30,7 @@ class _ToDoState extends State<ToDo> {
@override
void initState() {
print("initState!!!!!");
widget.service = new DoctorsListService();
widget.patientShareResponse = new PatientShareResponse();
getPatientAppointmentHistory();
super.initState();
}
@ -299,6 +301,10 @@ class _ToDoState extends State<ToDo> {
case 10:
confirmAppointment(appo);
break;
case 20:
getPatientShare(context, appo);
break;
}
}
@ -444,9 +450,53 @@ class _ToDoState extends State<ToDo> {
});
}
getPatientShare(context, AppoitmentAllHistoryResultList appo) {
loading(true);
DoctorsListService service = new DoctorsListService();
service
.getPatientShare(
appo.appointmentNo.toString(), appo.clinicID, appo.projectID)
.then((res) {
loading(false);
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
openPaymentDialog(appo, widget.patientShareResponse);
}).catchError((err) {
loading(false);
print(err);
});
}
openPaymentDialog(AppoitmentAllHistoryResultList appo,
PatientShareResponse patientShareResponse) {
showGeneralDialog(
barrierColor: Colors.black.withOpacity(0.5),
transitionBuilder: (context, a1, a2, widget) {
final curvedValue =
Curves.easeInOutBack.transform(a1.value) - 1.0;
return Transform(
transform:
Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
child: Opacity(
opacity: a1.value,
child: PaymentDialog(
appo: appo, patientShareResponse: patientShareResponse),
),
);
},
transitionDuration: Duration(milliseconds: 500),
barrierDismissible: false,
barrierLabel: '',
context: context,
pageBuilder: (context, animation1, animation2) {})
.then((value) {
getPatientAppointmentHistory();
});
}
confirmAppointment(AppoitmentAllHistoryResultList appo) {
loading(true);
widget.service
DoctorsListService service = new DoctorsListService();
service
.confirmAppointment(appo.appointmentNo, appo.clinicID, appo.projectID)
.then((res) {
if (res['MessageStatus'] == 1) {

@ -0,0 +1,239 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
class PaymentMethod extends StatefulWidget {
@override
_PaymentMethodState createState() => _PaymentMethodState();
}
class _PaymentMethodState extends State<PaymentMethod> {
String selectedPaymentMethod = "mada";
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).paymentMethod,
isShowAppBar: true,
body: Container(
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
child: SingleChildScrollView(
child: Container(
child: Column(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
margin: EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 0.0),
alignment: Alignment.center,
child: Text("Select Payment Method",
style: TextStyle(
fontSize: 26.0, fontWeight: FontWeight.bold)),
),
Container(
margin: EdgeInsets.only(top: 25.0),
child: Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
child: Container(
child: InkWell(
onTap: () {
updateSelectedPaymentMethod("mada");
},
child: Card(
elevation: 3.0,
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: selectedPaymentMethod == "mada"
? BorderSide(
color: Colors.green, width: 5.0)
: BorderSide(
color: Colors.transparent, width: 0.0),
),
child: Container(
height: 120.0,
padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45,
child: Image.asset(
"assets/images/new-design/mada.png"),
),
),
),
),
),
Expanded(
child: Container(
child: InkWell(
onTap: () {
updateSelectedPaymentMethod("sadad");
},
child: Card(
elevation: 3.0,
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: selectedPaymentMethod == "sadad"
? BorderSide(
color: Colors.green, width: 5.0)
: BorderSide(
color: Colors.transparent, width: 0.0),
),
child: Container(
height: 120.0,
padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45,
child: Image.asset(
"assets/images/new-design/sadad.png"),
),
),
),
),
),
],
),
),
Container(
margin: EdgeInsets.only(top: 25.0),
child: Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
child: Container(
child: InkWell(
onTap: () {
updateSelectedPaymentMethod("visa");
},
child: Card(
elevation: 3.0,
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: selectedPaymentMethod == "visa"
? BorderSide(
color: Colors.green, width: 5.0)
: BorderSide(
color: Colors.transparent, width: 0.0),
),
child: Container(
height: 120.0,
padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45,
child: Image.asset(
"assets/images/new-design/visa.png"),
),
),
),
),
),
Expanded(
child: Container(
child: InkWell(
onTap: () {
updateSelectedPaymentMethod("mastercard");
},
child: Card(
elevation: 3.0,
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: selectedPaymentMethod == "mastercard"
? BorderSide(
color: Colors.green, width: 5.0)
: BorderSide(
color: Colors.transparent, width: 0.0),
),
child: Container(
height: 120.0,
padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45,
child: Image.asset(
"assets/images/new-design/mastercard.png"),
),
),
),
),
),
],
),
),
Container(
margin: EdgeInsets.only(top: 25.0),
child: Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
child: Container(
child: InkWell(
onTap: () {
updateSelectedPaymentMethod("installment");
},
child: Card(
elevation: 3.0,
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: selectedPaymentMethod == "installment"
? BorderSide(
color: Colors.green, width: 5.0)
: BorderSide(
color: Colors.transparent, width: 0.0),
),
child: Container(
height: 120.0,
padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45,
child: Image.asset(
"assets/images/new-design/installment.png"),
),
),
),
),
),
],
),
),
],
),
),
),
),
bottomSheet: Container(
width: MediaQuery.of(context).size.width,
height: 50.0,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 20.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: new Color(0xFFbcc2c4),
onPressed: () {
// navigateToBookSuccess(context);
// insertAppointment(context, widget.doctor);
},
child: Text(TranslationBase.of(context).confirm,
style: TextStyle(fontSize: 18.0)),
),
),
),
);
}
updateSelectedPaymentMethod(String selectedMethod) {
setState(() {
selectedPaymentMethod = selectedMethod;
});
}
}

@ -0,0 +1,226 @@
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
class PaymentDialog extends StatefulWidget {
AppoitmentAllHistoryResultList appo;
PatientShareResponse patientShareResponse;
PaymentDialog({@required this.appo, this.patientShareResponse});
@override
_PaymentDialogState createState() => _PaymentDialogState();
}
class _PaymentDialogState extends State<PaymentDialog> {
@override
Widget build(BuildContext context) {
return Container(
child: Dialog(
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)),
child: Container(
height: MediaQuery.of(context).size.height * 0.62,
width: 450.0,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 5.0),
child: Text("Invoice Detail",
style: TextStyle(
fontSize: 25.0,
fontWeight: FontWeight.bold,
fontFamily: "Open-Sans-Bold")),
),
Divider(
color: Colors.grey,
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0),
child: Text("Appointment Details",
style: TextStyle(
fontSize: 15.0,
fontWeight: FontWeight.bold,
fontFamily: "Open-Sans-Bold")),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0),
child: Text(
widget.appo.doctorTitle + " " + widget.appo.doctorNameObj,
style: TextStyle(
color: Colors.grey[700],
fontSize: 15.0,
fontWeight: FontWeight.bold,
fontFamily: "Open-Sans-Bold")),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0),
child: Text(getDate(widget.appo.appointmentDate),
style: getTextStyle()),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0),
child: Text(widget.appo.projectName, style: getTextStyle()),
),
Divider(
color: Colors.grey,
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 5.0),
child: Table(
children: [
TableRow(children: [
TableCell(
child: _getNormalText(
TranslationBase.of(context).patientShareToDo)),
TableCell(
child: _getNormalText(widget
.patientShareResponse.patientShare
.toString())),
]),
TableRow(children: [
TableCell(
child: _getNormalText(
TranslationBase.of(context).patientTaxToDo)),
TableCell(
child: _getNormalText(widget
.patientShareResponse.patientTaxAmount
.toString())),
]),
TableRow(children: [
TableCell(
child: _getNormalText(TranslationBase.of(context)
.patientShareTotalToDo)),
TableCell(
child: _getNormalText(widget
.patientShareResponse.patientShareWithTax
.toString())),
]),
],
),
),
Container(
alignment: Alignment.center,
margin: EdgeInsets.fromLTRB(20.0, 20.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),
),
Container(
alignment: Alignment.center,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 15.0),
child: Text(
"Are You Sure You Want To Make payment for this Appointment?",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 14.0,
color: Colors.red[700],
fontFamily: "Open-Sans")),
),
Divider(
color: Colors.grey,
),
Container(
alignment: Alignment.center,
height: 40.0,
child: Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
child: InkWell(
onTap: () {
Navigator.of(context).pop();
},
child: Container(
child: Text("Cancel",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 18.0, color: Colors.red[700])),
),
),
),
Expanded(
child: InkWell(
onTap: () {
Navigator.of(context).pop();
naviagetToPaymentMethod(context);
},
child: Container(
child: Text("Ok",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 18.0,
)),
),
),
),
],
),
),
]),
),
),
);
}
_getNormalText(text) {
return Container(
margin: EdgeInsets.only(top: 10.0, right: 10.0),
child: Text(text,
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 15,
fontFamily: 'Open-Sans',
letterSpacing: 0.5,
color: Colors.grey[700])),
);
}
TextStyle getTextStyle() {
return TextStyle(
color: Colors.grey[700], fontSize: 15.0, fontFamily: "Open-Sans-Bold");
}
Future naviagetToPaymentMethod(context) async {
Navigator.push(
context, MaterialPageRoute(builder: (context) => PaymentMethod()));
}
String getDate(String date) {
DateTime dateObj = DateUtil.convertStringToDate(date);
return DateUtil.getWeekDay(dateObj.weekday) +
", " +
dateObj.day.toString() +
" " +
DateUtil.getMonth(dateObj.month) +
" " +
dateObj.year.toString() +
" " +
dateObj.hour.toString() +
":" +
getMinute(dateObj);
}
String getMinute(DateTime dateObj) {
if (dateObj.minute == 0) {
return dateObj.minute.toString() + "0";
} else {
return dateObj.minute.toString();
}
}
}

@ -271,6 +271,39 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> getPatientAppointmentCurfewHistory(bool isActiveAppointment) async {
Map<String, dynamic> request;
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"IsActiveAppointment": isActiveAppointment,
"VersionID": req.VersionID,
"Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": 0,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"DeviceTypeID": 1,
"PatientID": 1231755,
"TokenID": "@dm!n",
"PatientTypeID": 1,
"PatientType": 1
};
dynamic localRes;
await baseAppClient.post(GET_PATIENT_APPOINTMENT_CURFEW_HISTORY,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> confirmAppointment(int appoNo, int clinicID, int projectID) async {
Map<String, dynamic> request;
var languageID = await sharedPref.getString(APP_LANGUAGE);

@ -259,6 +259,18 @@ class TranslationBase {
localizedValues['notification'][locale.languageCode];
String get appsetting => localizedValues['app-settings'][locale.languageCode];
String get rateApp => localizedValues['rate-app'][locale.languageCode];
String get setReminder => localizedValues['set-reminder'][locale.languageCode];
String get before => localizedValues['before'][locale.languageCode];
String get minute => localizedValues['minute'][locale.languageCode];
String get hour => localizedValues['hour'][locale.languageCode];
String get reminderSuccess => localizedValues['reminderSuccess'][locale.languageCode];
String get patientShareToDo => localizedValues['patientShareToDo'][locale.languageCode];
String get patientTaxToDo => localizedValues['patientTaxToDo'][locale.languageCode];
String get patientShareTotalToDo => localizedValues['patientShareTotalToDo'][locale.languageCode];
String get paymentMethod => localizedValues['paymentMethod'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -81,6 +81,8 @@ dependencies:
# Location Helper
map_launcher: ^0.8.1
manage_calendar_events: ^1.0.2

Loading…
Cancel
Save