@ -3,20 +3,24 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import ' package:diplomaticquarterapp/locator.dart ' ;
import ' package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart ' ;
import ' package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart ' ;
import ' package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart ' ;
import ' package:diplomaticquarterapp/pages/landing/landing_page.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:diplomaticquarterapp/widgets/buttons/defaultButton.dart ' ;
import ' package:diplomaticquarterapp/widgets/transitions/fade_page.dart ' ;
import ' package:flutter/material.dart ' ;
class PaymentDialog extends StatefulWidget {
AppoitmentAllHistoryResultList appo ;
PatientShareResponse patientShareResponse ;
bool isCashPatient ;
final Function onPaymentMethodSelected ;
PaymentDialog ( { @ required this . appo , @ required this . onPaymentMethodSelected , this . patientShareResponse }) ;
PaymentDialog ( { @ required this . appo , @ required this . onPaymentMethodSelected , this . patientShareResponse , this . isCashPatient = false }) ;
@ override
_PaymentDialogState createState ( ) = > _PaymentDialogState ( ) ;
@ -31,84 +35,118 @@ class _PaymentDialogState extends State<PaymentDialog> {
/ / 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 ) ,
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 ) ,
) ,
) ,
) ,
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 ) ,
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 ,
) ,
) ,
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 ,
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 ) ,
) ,
) ,
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 ,
) ,
) ,
) ,
] ,
] ,
) ,
) ,
) ,
] ) ,
widget . isCashPatient
? Column (
children: [
mHeight ( 10.0 ) ,
Text (
TranslationBase . of ( context ) . cashAmountUpdateInsurance ,
style: TextStyle (
fontSize: 14.0 ,
fontWeight: FontWeight . w600 ,
color: Color ( 0xff2E303A ) ,
) ,
) ,
mHeight ( 5.0 ) ,
DefaultButton (
TranslationBase . of ( context ) . updateInsuranceText ,
( ) {
Navigator . pop ( context , null ) ;
Navigator . pushAndRemoveUntil (
context ,
MaterialPageRoute ( builder: ( context ) = > LandingPage ( ) ) ,
( Route < dynamic > route ) = > false ,
) ;
Navigator . push ( context , FadePage ( page: InsuranceUpdate ( ) ) ) ;
} ,
color: CustomColors . accentColor ,
textColor: Colors . white ,
) ,
] ,
)
: Container ( ) ,
] ,
) ,
) ,
) ;
}