@ -1,7 +1,9 @@
import ' package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart ' ;
import ' package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart ' ;
import ' package:diplomaticquarterapp/theme/colors.dart ' ;
import ' package:diplomaticquarterapp/uitl/date_uitl.dart ' ;
import ' package:diplomaticquarterapp/uitl/translations_delegate_base.dart ' ;
import ' package:diplomaticquarterapp/uitl/utils_new.dart ' ;
import ' package:flutter/material.dart ' ;
class PaymentDialog extends StatefulWidget {
@ -21,159 +23,106 @@ class _PaymentDialogState extends State<PaymentDialog> {
Widget build ( BuildContext context ) {
return Container (
child: Dialog (
shape:
RoundedRectangleBorder ( borderRadius: BorderRadius . circular ( 12.0 ) ) ,
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 ( " 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 . pop ( context , null ) ;
} ,
child: Container (
child: Text ( " Cancel " ,
textAlign: TextAlign . center ,
style: TextStyle (
fontSize: 18.0 , color: Colors . red [ 700 ] ) ) ,
) ,
) ,
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 . bold ) ) ,
) ,
Divider (
color: Colors . grey ,
) ,
Container (
margin: EdgeInsets . fromLTRB ( 20.0 , 5.0 , 20.0 , 5.0 ) ,
child: Text ( TranslationBase . of ( context ) . appoDetails , style: TextStyle ( fontSize: 15.0 , fontWeight: FontWeight . 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 ) ) ,
) ,
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 ( ) ) ) ,
] ) ,
] ,
) ,
) ,
Divider (
color: Colors . grey ,
) ,
Container (
margin: EdgeInsets . fromLTRB ( 20.0 , 10.0 , 20.0 , 5.0 ) ,
child: Text ( TranslationBase . of ( context ) . YouCanPayByTheFollowingOptions , style: TextStyle ( fontSize: 14.0 , fontWeight: FontWeight . bold ) ) ,
) ,
Container ( margin: EdgeInsets . fromLTRB ( 20.0 , 5.0 , 20.0 , 5.0 ) , child: getPaymentMethods ( ) ) ,
Container (
margin: EdgeInsets . fromLTRB ( 20.0 , 5.0 , 20.0 , 15.0 ) ,
child: Text ( TranslationBase . of ( context ) . appoPaymentConfirm , style: TextStyle ( fontSize: 14.0 , color: CustomColors . accentColor ) ) ,
) ,
Divider (
color: Colors . grey ,
) ,
Container (
alignment: Alignment . center ,
height: 40.0 ,
child: Flex (
direction: Axis . horizontal ,
children: < Widget > [
Expanded (
child: InkWell (
onTap: ( ) {
Navigator . pop ( context , null ) ;
} ,
child: Container (
child: Text ( TranslationBase . of ( context ) . cancel , textAlign: TextAlign . center , style: TextStyle ( fontSize: 18.0 , color: CustomColors . accentColor ) ) ,
) ,
Expanded (
child: InkWell (
onTap: ( ) {
Navigator . pop ( context , widget . patientShareResponse ) ;
) ,
) ,
Expanded (
child: InkWell (
onTap: ( ) {
Navigator . pop ( context , widget . patientShareResponse ) ;
/ / widget . onPaymentMethodSelected ( ) ;
} ,
child: Container (
child: Text ( " Ok " ,
textAlign: TextAlign . center ,
style: TextStyle (
fontSize: 18.0 ,
) ) ,
) ,
) ,
} ,
child: Container (
child: Text ( TranslationBase . of ( context ) . ok ,
textAlign: TextAlign . center ,
style: TextStyle (
fontSize: 18.0 ,
) ) ,
) ,
] ,
) ,
) ,
) ,
] ) ,
] ,
) ,
) ,
] ) ,
) ,
) ,
) ;
@ -182,19 +131,12 @@ class _PaymentDialogState extends State<PaymentDialog> {
_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 ] ) ) ,
child: Text ( text , style: TextStyle ( fontSize: 13 , letterSpacing: 0.5 , color: Colors . grey [ 700 ] ) ) ,
) ;
}
TextStyle getTextStyle ( ) {
return TextStyle (
color: Colors . grey [ 700 ] , fontSize: 15.0 , fontFamily: " Open-Sans-Bold " ) ;
return TextStyle ( color: Colors . grey [ 700 ] , fontSize: 13.0 ) ;
}
/ / Future navigateToPaymentMethod ( context ) async {