Payment method selection page created, Appointment details functions implemented
parent
06f95c5379
commit
b3e5047820
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 |
@ -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;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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: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
|
@override
|
||||||
Widget build(BuildContext context) {
|
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();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue