|
|
|
@ -2,12 +2,15 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class NewCMCStepOnePage extends StatefulWidget {
|
|
|
|
class NewCMCStepOnePage extends StatefulWidget {
|
|
|
|
final CMCInsertPresOrderRequestModel cMCInsertPresOrderRequestModel;
|
|
|
|
final CMCInsertPresOrderRequestModel cMCInsertPresOrderRequestModel;
|
|
|
|
@ -33,6 +36,8 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
|
|
|
|
|
|
|
|
return AppScaffold(
|
|
|
|
return AppScaffold(
|
|
|
|
isShowAppBar: false,
|
|
|
|
isShowAppBar: false,
|
|
|
|
baseViewModel: widget.model,
|
|
|
|
baseViewModel: widget.model,
|
|
|
|
@ -52,7 +57,7 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
|
|
|
|
height: 20,
|
|
|
|
height: 20,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Texts(
|
|
|
|
Texts(
|
|
|
|
"Select Home Health Care Services",
|
|
|
|
TranslationBase.of(context).selectService,
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
@ -82,7 +87,7 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
|
|
|
|
selectedServiceName:
|
|
|
|
selectedServiceName:
|
|
|
|
service.description,
|
|
|
|
service.description,
|
|
|
|
selectedServiceNameAR:
|
|
|
|
selectedServiceNameAR:
|
|
|
|
service.description,
|
|
|
|
service.descriptionN,
|
|
|
|
recordID: 1,
|
|
|
|
recordID: 1,
|
|
|
|
totalPrice:
|
|
|
|
totalPrice:
|
|
|
|
service.totalPrice,
|
|
|
|
service.totalPrice,
|
|
|
|
@ -90,7 +95,8 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
widget
|
|
|
|
widget
|
|
|
|
.cMCInsertPresOrderRequestModel
|
|
|
|
.cMCInsertPresOrderRequestModel
|
|
|
|
.patientERCMCInsertServicesList = [
|
|
|
|
.patientERCMCInsertServicesList =
|
|
|
|
|
|
|
|
[
|
|
|
|
patientERCMCInsertServicesList
|
|
|
|
patientERCMCInsertServicesList
|
|
|
|
];
|
|
|
|
];
|
|
|
|
});
|
|
|
|
});
|
|
|
|
@ -117,7 +123,9 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding: const EdgeInsets.all(20.0),
|
|
|
|
padding: const EdgeInsets.all(20.0),
|
|
|
|
child: Texts(
|
|
|
|
child: Texts(
|
|
|
|
service.description,
|
|
|
|
projectViewModel.isArabic ? service
|
|
|
|
|
|
|
|
.descriptionN : service
|
|
|
|
|
|
|
|
.description,
|
|
|
|
fontSize: 15,
|
|
|
|
fontSize: 15,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -139,6 +147,14 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
width: double.infinity,
|
|
|
|
width: double.infinity,
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Container(margin: EdgeInsets.only(
|
|
|
|
|
|
|
|
right: 10, left: 10), child: Texts(TranslationBase.of(context).coveredService, fontWeight: FontWeight.bold,))
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: widget.model.checkupItems.map((item) {
|
|
|
|
children: widget.model.checkupItems.map((item) {
|
|
|
|
return Center(
|
|
|
|
return Center(
|
|
|
|
@ -146,9 +162,11 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
|
|
|
|
widthFactor: 1,
|
|
|
|
widthFactor: 1,
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
margin: EdgeInsets.only(top: 15),
|
|
|
|
margin: EdgeInsets.only(top: 15),
|
|
|
|
decoration: BoxDecoration(color: Colors.white),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
|
|
color: Colors.white),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment
|
|
|
|
|
|
|
|
.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 12,
|
|
|
|
height: 12,
|
|
|
|
@ -169,9 +187,12 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
|
|
|
|
crossAxisAlignment:
|
|
|
|
crossAxisAlignment:
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Texts(
|
|
|
|
Container(margin: EdgeInsets.only(
|
|
|
|
|
|
|
|
right: 10, left: 10),
|
|
|
|
|
|
|
|
child: Texts(
|
|
|
|
item.itemName,
|
|
|
|
item.itemName,
|
|
|
|
fontSize: 15,
|
|
|
|
fontSize: 15, fontWeight: FontWeight.bold
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -185,6 +206,8 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}).toList()),
|
|
|
|
}).toList()),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -199,8 +222,12 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
width: MediaQuery.of(context).size.width * 0.9,
|
|
|
|
width: MediaQuery.of(context).size.width * 0.9,
|
|
|
|
child: SecondaryButton(
|
|
|
|
child: SecondaryButton(
|
|
|
|
label: "Next",
|
|
|
|
label: TranslationBase
|
|
|
|
textColor: Theme.of(context).backgroundColor,
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.next,
|
|
|
|
|
|
|
|
textColor: Theme
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.backgroundColor,
|
|
|
|
color: Colors.grey[800],
|
|
|
|
color: Colors.grey[800],
|
|
|
|
onTap: () async {
|
|
|
|
onTap: () async {
|
|
|
|
if (widget.cMCInsertPresOrderRequestModel
|
|
|
|
if (widget.cMCInsertPresOrderRequestModel
|
|
|
|
@ -221,18 +248,18 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
|
|
|
|
selectedServiceName: widget.model
|
|
|
|
selectedServiceName: widget.model
|
|
|
|
.cmcAllServicesList[index - 1].description,
|
|
|
|
.cmcAllServicesList[index - 1].description,
|
|
|
|
selectedServiceNameAR: widget.model
|
|
|
|
selectedServiceNameAR: widget.model
|
|
|
|
.cmcAllServicesList[index - 1].description,
|
|
|
|
.cmcAllServicesList[index - 1].descriptionN,
|
|
|
|
recordID: 1,
|
|
|
|
recordID: 1,
|
|
|
|
totalPrice: widget
|
|
|
|
totalPrice: widget
|
|
|
|
.model.cmcAllServicesList[index - 1].totalPrice,
|
|
|
|
.model.cmcAllServicesList[index - 1].totalPrice,
|
|
|
|
vAT: widget.model.cmcAllServicesList[index-1].vAT);
|
|
|
|
vAT: widget.model.cmcAllServicesList[index - 1].vAT);
|
|
|
|
|
|
|
|
|
|
|
|
widget.cMCInsertPresOrderRequestModel
|
|
|
|
widget.cMCInsertPresOrderRequestModel
|
|
|
|
.patientERCMCInsertServicesList = [
|
|
|
|
.patientERCMCInsertServicesList = [
|
|
|
|
patientERCMCInsertServicesList
|
|
|
|
patientERCMCInsertServicesList
|
|
|
|
];
|
|
|
|
];
|
|
|
|
await widget.model.getCustomerInfo();
|
|
|
|
await widget.model.getCustomerInfo();
|
|
|
|
if(widget.model.state == ViewState.ErrorLocal){
|
|
|
|
if (widget.model.state == ViewState.ErrorLocal) {
|
|
|
|
Utils.showErrorToast();
|
|
|
|
Utils.showErrorToast();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
widget.changePageViewIndex(1);
|
|
|
|
widget.changePageViewIndex(1);
|
|
|
|
|