import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/Covid-TimeSlots.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; class CovidPaymentDetails extends StatefulWidget { CovidPaymentInfoResponse covidPaymentInfoResponse; int projectID; CovidPaymentDetails( {@required this.covidPaymentInfoResponse, @required this.projectID}); @override _CovidPaymentDetailsState createState() => _CovidPaymentDetailsState(); } class _CovidPaymentDetailsState extends State { bool isAgree = false; @override Widget build(BuildContext context) { return AppScaffold( appBarTitle: TranslationBase.of(context).covidTest, isShowAppBar: true, body: SingleChildScrollView( child: Container( margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( height: 150.0, decoration: BoxDecoration( image: DecorationImage( image: AssetImage( "assets/images/new-design/covid-19-big-banner-bg.png"), fit: BoxFit.fill, ), color: Colors.white.withOpacity(0.3), borderRadius: BorderRadius.all(Radius.circular(10))), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 30.0), child: SvgPicture.asset( 'assets/images/new-design/covid-19-car.svg', width: 90.0, height: 90.0), ), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( margin: EdgeInsets.only( left: 20.0, right: 20.0, top: 20.0), child: Text(TranslationBase.of(context).covidTest, style: TextStyle( color: Colors.white, fontWeight: FontWeight.bold, fontSize: 24.0)), ), Container( margin: EdgeInsets.only( left: 20.0, right: 20.0, top: 10.0), child: Text(TranslationBase.of(context).driveThru, style: TextStyle( color: Colors.white, fontSize: 24.0)), ), ], ), ], ), ), Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(10.0), color: Colors.white), margin: EdgeInsets.fromLTRB(0.0, 30.0, 0.0, 5.0), padding: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 20.0), child: Column( children: [ Container( alignment: Alignment.center, margin: EdgeInsets.only(left: 0.0, right: 20.0, top: 30.0), child: Text(TranslationBase.of(context).testFee, style: TextStyle( color: Colors.black, fontSize: 22.0, fontWeight: FontWeight.bold)), ), Table( children: [ TableRow(children: [ TableCell( child: _getNormalText(TranslationBase.of(context) .patientShareToDo)), TableCell( child: _getNormalText(widget .covidPaymentInfoResponse.patientShareField .toString())), ]), TableRow(children: [ TableCell( child: _getNormalText( TranslationBase.of(context).patientTaxToDo)), TableCell( child: _getNormalText(widget .covidPaymentInfoResponse .patientTaxAmountField .toString())), ]), TableRow(children: [ TableCell( child: _getNormalText(TranslationBase.of(context) .patientShareTotalToDo)), TableCell( child: _getNormalText(widget .covidPaymentInfoResponse .patientShareWithTaxField .toString())), ]), ], ), ], ), ), Container( margin: EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 5.0), child: Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.start, children: [ Checkbox( value: isAgree, onChanged: (value) { setState(() { isAgree = !isAgree; }); }, activeColor: Color(0xffB8382C), ), Texts(TranslationBase.of(context) .iAgreeToTheTermsAndConditions), ], ), ), Divider( color: Colors.grey, ), Container( alignment: Alignment.center, margin: EdgeInsets.fromLTRB(20.0, 15.0, 20.0, 5.0), child: Text(TranslationBase.of(context).payOptions, 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), ), ], ), ), ), bottomSheet: Container( margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 20.0), child: Flex( direction: Axis.horizontal, children: [ Expanded( flex: 1, child: Container( margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.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: Colors.grey[500], onPressed: () { cancel(); }, child: Text(TranslationBase.of(context).cancel, style: TextStyle(fontSize: 18.0)), ), ), ), ), Expanded( flex: 1, child: Container( margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.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: Colors.grey[500], onPressed: isAgree ? next : null, child: Text(TranslationBase.of(context).next, style: TextStyle(fontSize: 18.0)), ), ), ), ), ], ), ), ); } void next() { Navigator.push( context, FadePage( page: CovidTimeSlots( projectID: widget.projectID, ))); } cancel() { Navigator.pop(context); } _getNormalText(text) { return Container( margin: EdgeInsets.only(top: 20.0, right: 10.0), child: Text(text, textAlign: TextAlign.end, style: TextStyle( fontSize: 15, fontFamily: 'Open-Sans', letterSpacing: 0.5, color: Colors.grey[700])), ); } }