You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
PatientApp-KKUMC/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart

160 lines
6.0 KiB
Dart

import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER_RC.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.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:provider/provider.dart';
class Summary extends StatefulWidget {
final Function changeCurrentTab;
final PatientER patientER;
final PatientER_RC patientER_RC;
final AmRequestViewModel amRequestViewModel;
Summary({Key key, this.changeCurrentTab, this.patientER, this.patientER_RC, this.amRequestViewModel});
@override
_SummaryState createState() => _SummaryState();
}
class _SummaryState extends State<Summary> {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(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,
),
projectViewModel.isArabic
? Texts(
'${widget.patientER_RC.patientERTransportationMethod.textN}',
bold: true,
)
: Texts(
'${widget.patientER_RC.patientERTransportationMethod.text}',
bold: true,
),
SizedBox(
height: 8,
),
Texts(
TranslationBase.of(context).directions,
color: Colors.grey,
),
Texts(
widget.patientER_RC.transportationDetails.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_RC.transportationDetails.pickupLocationName}',
bold: true,
),
SizedBox(
height: 8,
),
Texts(
TranslationBase.of(context).dropoffLocation,
color: Colors.grey,
),
Texts(
'${widget.patientER_RC.transportationDetails.dropoffLocationName}',
bold: true,
),
SizedBox(
height: 8,
),
Texts(
TranslationBase.of(context).selectAmbulate,
color: Colors.grey,
),
Texts(
'${widget.patientER_RC.transportationDetails.ambulateTitle}',
bold: true,
),
SizedBox(
height: 8,
),
Texts(
TranslationBase.of(context).notes,
color: Colors.grey,
),
Texts(
'${widget.patientER_RC.transportationDetails.notes ?? '---'}',
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_RC.patientERTransportationMethod.priceTotal}')],
),
),
SizedBox(height: 130),
],
),
),
),
bottomSheet: Container(
color: Theme.of(context).scaffoldBackgroundColor,
padding: EdgeInsets.all(12.0),
child: DefaultButton(TranslationBase.of(context).send, () async {
await widget.amRequestViewModel.insertERPressOrder(patientER: widget.patientER_RC);
}),
),
);
}
}