|
|
|
|
@ -6,7 +6,6 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
|
|
|
|
|
|
|
|
|
|
class PaymentDialog extends StatefulWidget {
|
|
|
|
|
AppoitmentAllHistoryResultList appo;
|
|
|
|
|
@ -23,96 +22,90 @@ class PaymentDialog extends StatefulWidget {
|
|
|
|
|
class _PaymentDialogState extends State<PaymentDialog> {
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Container(
|
|
|
|
|
child: Dialog(
|
|
|
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)),
|
|
|
|
|
child: Container(
|
|
|
|
|
height: 550.0,
|
|
|
|
|
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(TranslationBase.of(context).invoiceDetails, style: TextStyle(fontSize: 25.0, fontWeight: FontWeight.w600)),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 0.0),
|
|
|
|
|
child: Text(widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, style: TextStyle(color: Colors.black, fontSize: 15.0, fontWeight: FontWeight.w600)),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 0.0),
|
|
|
|
|
child: Text(getDate(widget.appo.appointmentDate), style: getTextStyle()),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 0.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(decoration: BoxDecoration(), 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())),
|
|
|
|
|
]),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Divider(
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 5.0),
|
|
|
|
|
child: Text(TranslationBase.of(context).YouCanPayByTheFollowingOptions, style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600)),
|
|
|
|
|
return Dialog(
|
|
|
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)),
|
|
|
|
|
child: Container(
|
|
|
|
|
//height: 550.0,
|
|
|
|
|
width: 450.0,
|
|
|
|
|
padding: EdgeInsets.all(21),
|
|
|
|
|
child: Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: <Widget>[
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).invoiceDetails,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 24.0,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
letterSpacing: -1.14,
|
|
|
|
|
color: Color(0xff2B353E),
|
|
|
|
|
),
|
|
|
|
|
Container(margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), child: getPaymentMethods()),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.fromLTRB(20.0, 30.0, 20.0, 15.0),
|
|
|
|
|
child: Text(TranslationBase.of(context).appoPaymentConfirm, style: TextStyle(fontSize: 14.0, color: CustomColors.accentColor, fontWeight: FontWeight.w600)),
|
|
|
|
|
),
|
|
|
|
|
Text(widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, style: TextStyle(color: Color(0xff2E303A), fontSize: 16.0, fontWeight: FontWeight.w600,letterSpacing: -0.64)),
|
|
|
|
|
Text(getDate(widget.appo.appointmentDate), style: getTextStyle()),
|
|
|
|
|
Text(widget.appo.projectName, style: getTextStyle()),
|
|
|
|
|
Divider(
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
),
|
|
|
|
|
Table(
|
|
|
|
|
children: [
|
|
|
|
|
TableRow(decoration: BoxDecoration(), 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())),
|
|
|
|
|
]),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Divider(color: Colors.grey),
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).YouCanPayByTheFollowingOptions,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
color: Color(0xff2E303A),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
height: 40.0,
|
|
|
|
|
margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 20.0),
|
|
|
|
|
child: Flex(
|
|
|
|
|
direction: Axis.horizontal,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
child: DefaultButton(
|
|
|
|
|
TranslationBase.of(context).cancel_nocaps,
|
|
|
|
|
() {
|
|
|
|
|
Navigator.pop(context, null);
|
|
|
|
|
},
|
|
|
|
|
color: CustomColors.accentColor,
|
|
|
|
|
textColor: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
getPaymentMethods(),
|
|
|
|
|
SizedBox(height: 12),
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).appoPaymentConfirm,
|
|
|
|
|
style: TextStyle(fontSize: 14.0, color: CustomColors.accentColor, fontWeight: FontWeight.w600, letterSpacing: -0.56),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 12),
|
|
|
|
|
Container(
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
child: Row(
|
|
|
|
|
// direction: Axis.horizontal,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
child: DefaultButton(
|
|
|
|
|
TranslationBase.of(context).cancel_nocaps,
|
|
|
|
|
() {
|
|
|
|
|
Navigator.pop(context, null);
|
|
|
|
|
},
|
|
|
|
|
color: CustomColors.accentColor,
|
|
|
|
|
textColor: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
mWidth(10.0),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: DefaultButton(
|
|
|
|
|
TranslationBase.of(context).confirm,
|
|
|
|
|
() {
|
|
|
|
|
Navigator.pop(context, widget.patientShareResponse);
|
|
|
|
|
},
|
|
|
|
|
color: CustomColors.green,
|
|
|
|
|
textColor: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
mWidth(10.0),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: DefaultButton(
|
|
|
|
|
TranslationBase.of(context).confirm,
|
|
|
|
|
() {
|
|
|
|
|
Navigator.pop(context, widget.patientShareResponse);
|
|
|
|
|
},
|
|
|
|
|
color: CustomColors.green,
|
|
|
|
|
textColor: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
@ -120,21 +113,17 @@ class _PaymentDialogState extends State<PaymentDialog> {
|
|
|
|
|
_getNormalText(text) {
|
|
|
|
|
return Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 10.0, right: 10.0),
|
|
|
|
|
child: Text(text, style: TextStyle(fontSize: 13, letterSpacing: 0.5, color: Colors.black)),
|
|
|
|
|
child: Text(text, style: TextStyle(fontSize: 13, letterSpacing: 0.5, color: Color(0xff2E303A))),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TextStyle getTextStyle() {
|
|
|
|
|
return TextStyle(color: Colors.grey[700], fontSize: 13.0, fontWeight: FontWeight.w600);
|
|
|
|
|
return TextStyle(color: Color(0xff575757), fontSize: 13.0, fontWeight: FontWeight.w600);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String getDate(String date) {
|
|
|
|
|
DateTime dateObj = DateUtil.convertStringToDate(date);
|
|
|
|
|
return DateUtil.getDayMonthYearDateFormatted(dateObj) +
|
|
|
|
|
" " +
|
|
|
|
|
dateObj.hour.toString() +
|
|
|
|
|
":" +
|
|
|
|
|
getMinute(dateObj);
|
|
|
|
|
return DateUtil.getDayMonthYearDateFormatted(dateObj) + " " + dateObj.hour.toString() + ":" + getMinute(dateObj);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String getMinute(DateTime dateObj) {
|
|
|
|
|
|