import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/core/enum/Ambulate.dart'; class Summary extends StatefulWidget { final Function changeCurrentTab; final PatientER patientER; final AmRequestViewModel amRequestViewModel; Summary({Key key, this.changeCurrentTab, this.patientER, this.amRequestViewModel}); @override _SummaryState createState() => _SummaryState(); } class _SummaryState extends State { @override Widget build(BuildContext context) { return AppScaffold( isShowDecPage: false, isShowAppBar: false, body: SingleChildScrollView( child: Container( margin: EdgeInsets.only(left: 12, right: 12), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts(TranslationBase.of(context).RRTSummary), SizedBox(height: 5,), Container( width: double.infinity, padding: EdgeInsets.all(10), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(12), ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts(TranslationBase.of(context).transportMethod,color: Colors.grey,), Texts('${widget.patientER.patientERTransportationMethod.title}',bold: true,), SizedBox(height: 8,), Texts(TranslationBase.of(context).directions,color: Colors.grey,), Texts(widget.patientER.direction ==0? TranslationBase.of(context).toHospital:TranslationBase.of(context).fromHospital,bold: true,), SizedBox(height: 8,), Texts(TranslationBase.of(context).pickupLocation,color: Colors.grey,), Texts('${widget.patientER.pickupLocationName}',bold: true,), SizedBox(height: 8,), Texts(TranslationBase.of(context).dropoffLocation,color: Colors.grey,), Texts('${widget.patientER.dropoffLocationName}',bold: true,), SizedBox(height: 8,), Texts(TranslationBase.of(context).selectAmbulate,color: Colors.grey,), Texts('${widget.patientER.ambulate.getAmbulateTitle(context)}',bold: true,), SizedBox(height: 8,), Texts(TranslationBase.of(context).notes,color: Colors.grey,), Texts('${widget.patientER.requesterNote?? '---'}',bold: true,), SizedBox(height: 8,), ], ), ), SizedBox(height: 20,), Texts(TranslationBase.of(context).billAmount,textAlign: TextAlign.start,), SizedBox(height: 5,), Container( height: 55, padding: EdgeInsets.all(10), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(8) ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Texts(TranslationBase.of(context).patientShareTotal+':'), Texts(TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.totalPrice}') ], ), ), SizedBox(height: 45,), ], ), ), ), bottomSheet: Container( padding: EdgeInsets.all(15), width: double.maxFinite, height: 90, child:SecondaryButton( color: Colors.grey[800], textColor: Colors.white, label: TranslationBase.of(context).send, onTap: () async { await widget.amRequestViewModel.insertERPressOrder(patientER: widget.patientER); } ), ), ); } }