remove unnecessary step for inpatient

merge-requests/787/head
Elham Rababh 5 years ago
parent 42ecf9a0fb
commit 74a6ebebdc

@ -266,8 +266,14 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
widget.changeLoadingState(false); widget.changeLoadingState(false);
Helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
} else { } else {
widget.changeLoadingState(true); if(widget.patientInfo.admissionNo != null &&
widget.changePageViewIndex(2); widget.patientInfo.admissionNo.isNotEmpty) {
Navigator.of(context).pop();
} else {
widget.changeLoadingState(true);
widget.changePageViewIndex(2);
}
} }
} else { } else {
Helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg); Helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg);
@ -310,7 +316,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
element.selectedExamination.id, element.selectedExamination.id,
orElse: () => null)) == orElse: () => null)) ==
null) { null) {
mySelectedExamination.add(element); mySelectedExamination.insert(0,element);
} }
}); });

@ -15,14 +15,28 @@ class StepsWidget extends StatelessWidget {
final double height; final double height;
final PatiantInformtion patientInfo; final PatiantInformtion patientInfo;
StepsWidget({Key key, this.index, this.changeCurrentTab, this.height = 0.0, this.patientInfo}); StepsWidget(
{Key key,
this.index,
this.changeCurrentTab,
this.height = 0.0,
this.patientInfo});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
double circleHeight = (SizeConfig.isHeightVeryShort ?30:SizeConfig.isHeightShort?38:38); double circleHeight = (SizeConfig.isHeightVeryShort
double circleTop = (SizeConfig.isHeightVeryShort ?12:SizeConfig.isHeightShort?10:10); ? 30
double containerHeight = SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort?16:15); : SizeConfig.isHeightShort
? 38
: 38);
double circleTop = (SizeConfig.isHeightVeryShort
? 12
: SizeConfig.isHeightShort
? 10
: 10);
double containerHeight =
SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 16 : 15);
return !projectViewModel.isArabic return !projectViewModel.isArabic
? Stack( ? Stack(
@ -33,21 +47,22 @@ class StepsWidget extends StatelessWidget {
color: Colors.transparent, color: Colors.transparent,
), ),
Positioned( Positioned(
top: 30 top: 30,
,
child: Center( child: Center(
child: Container( child: Container(
width: MediaQuery width: MediaQuery.of(context).size.width *
.of(context) (patientInfo.admissionNo == null &&
.size patientInfo.admissionNo.isEmpty
.width * 0.9, ? 0.9
: 0.85),
child: Divider( child: Divider(
color: Colors.grey, color: Colors.grey,
height: 0.75, height: 0.75,
thickness: 0.75, thickness: 0.75,
), ),
), ),
),), ),
),
Positioned( Positioned(
top: circleTop, top: circleTop,
left: 0, left: 0,
@ -57,8 +72,8 @@ class StepsWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
width:circleHeight, width: circleHeight,
height: circleHeight, height: circleHeight,
decoration: BoxDecoration( decoration: BoxDecoration(
border: index == 0 border: index == 0
? Border.all(color: Color(0xFFCC9B14), width: 2) ? Border.all(color: Color(0xFFCC9B14), width: 2)
@ -84,7 +99,9 @@ class StepsWidget extends StatelessWidget {
Column( Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
StepDetailsWidget(stepLabel: "Subjective",), StepDetailsWidget(
stepLabel: "Subjective",
),
StatusLabel( StatusLabel(
selectedStepId: index, selectedStepId: index,
stepId: 0, stepId: 0,
@ -97,10 +114,10 @@ class StepsWidget extends StatelessWidget {
), ),
Positioned( Positioned(
top: circleTop, top: circleTop,
left: MediaQuery left: patientInfo.admissionNo == null &&
.of(context) patientInfo.admissionNo.isEmpty
.size ? MediaQuery.of(context).size.width * 0.25
.width * 0.25, : MediaQuery.of(context).size.width * 0.71,
child: InkWell( child: InkWell(
onTap: () => index >= 1 ? changeCurrentTab(1) : null, onTap: () => index >= 1 ? changeCurrentTab(1) : null,
child: Column( child: Column(
@ -108,7 +125,7 @@ class StepsWidget extends StatelessWidget {
children: [ children: [
Container( Container(
width: circleHeight, width: circleHeight,
height: circleHeight, height: circleHeight,
decoration: BoxDecoration( decoration: BoxDecoration(
border: index == 1 border: index == 1
? Border.all(color: Color(0xFFCC9B14), width: 2) ? Border.all(color: Color(0xFFCC9B14), width: 2)
@ -136,7 +153,9 @@ class StepsWidget extends StatelessWidget {
Column( Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
StepDetailsWidget(stepLabel: "Objective",), StepDetailsWidget(
stepLabel: "Objective",
),
StatusLabel( StatusLabel(
selectedStepId: index, selectedStepId: index,
stepId: 1, stepId: 1,
@ -147,109 +166,115 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
), ),
Positioned( if (patientInfo.admissionNo == null &&
top: circleTop, patientInfo.admissionNo.isEmpty)
left: MediaQuery Positioned(
.of(context) top: circleTop,
.size left: MediaQuery.of(context).size.width * 0.47,
.width * 0.47, child: InkWell(
child: InkWell( onTap: () {
onTap: () { if (index >= 3) changeCurrentTab(2);
if (index >= 3) changeCurrentTab(2); },
}, child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, children: [
children: [ Container(
Container( width: circleHeight,
width:circleHeight, height: circleHeight,
height: circleHeight, decoration: BoxDecoration(
decoration: BoxDecoration( border: index == 2
border: index == 2 ? Border.all(color: Color(0xFFCC9B14), width: 2)
? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 2
: index > 2 ? null
? null : Border.all(
: Border.all( color: Color(0xFFCCCCCC), width: 0.75),
color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle,
shape: BoxShape.circle, color: index == 2
color: index == 2 ? Color(0xFFCC9B14)
? Color(0xFFCC9B14) : index > 2
: index > 2 ? Color(0xFF359846)
? Color(0xFF359846) : Color(0xFFCCCCCC),
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
),
SizedBox(
height: 5,
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
StepDetailsWidget(stepLabel: "Assessment",),
StatusLabel(
selectedStepId: index,
stepId: 2,
), ),
], child: Center(
), child: Icon(
], FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
),
SizedBox(
height: 5,
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
StepDetailsWidget(
stepLabel: "Assessment",
),
StatusLabel(
selectedStepId: index,
stepId: 2,
),
],
),
],
),
), ),
), ),
), if (patientInfo.admissionNo == null &&
Positioned( patientInfo.admissionNo.isEmpty)
top: circleTop, Positioned(
right: 0, top: circleTop,
child: InkWell( right: 0,
onTap: () => index >= 3 ? changeCurrentTab(4) : null, child: InkWell(
child: Column( onTap: () => index >= 3 ? changeCurrentTab(4) : null,
crossAxisAlignment: CrossAxisAlignment.end, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.end,
Container( children: [
width:circleHeight, Container(
height: circleHeight, width: circleHeight,
decoration: BoxDecoration( height: circleHeight,
border: index == 3 decoration: BoxDecoration(
? Border.all(color: Color(0xFFCC9B14), width: 2) border: index == 3
: index > 3 ? Border.all(color: Color(0xFFCC9B14), width: 2)
? null : index > 3
: Border.all( ? null
color: Color(0xFFCCCCCC), width: 0.75), : Border.all(
shape: BoxShape.circle, color: Color(0xFFCCCCCC), width: 0.75),
color: index == 3 shape: BoxShape.circle,
? Color(0xFFCC9B14) color: index == 3
: index > 3 ? Color(0xFFCC9B14)
? Color(0xFF359846) : index > 3
: Color(0xFFCCCCCC), ? Color(0xFF359846)
), : Color(0xFFCCCCCC),
child: Center(
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
),
SizedBox(
height: 5,
),
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
StepDetailsWidget(stepLabel: "Plan",marginLeft: 30,),
StatusLabel(
selectedStepId: index,
stepId: 3,
), ),
], child: Center(
), child: Icon(
], FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
),
SizedBox(
height: 5,
),
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
StepDetailsWidget(
stepLabel: "Plan",
marginLeft: 30,
),
StatusLabel(
selectedStepId: index,
stepId: 3,
),
],
),
],
),
), ),
), ),
),
], ],
) )
: Stack( : Stack(
@ -260,21 +285,19 @@ class StepsWidget extends StatelessWidget {
color: Colors.transparent, color: Colors.transparent,
), ),
Positioned( Positioned(
top: 30 top: 30,
,
child: Center( child: Center(
child: Container( child: Container(
width: MediaQuery width: MediaQuery.of(context).size.width * (patientInfo.admissionNo == null &&
.of(context) patientInfo.admissionNo.isEmpty?0.9:0.85),
.size
.width * 0.9,
child: Divider( child: Divider(
color: Colors.grey, color: Colors.grey,
height: 0.75, height: 0.75,
thickness: 0.75, thickness: 0.75,
), ),
), ),
),), ),
),
Positioned( Positioned(
top: circleTop, top: circleTop,
right: 0, right: 0,
@ -284,8 +307,8 @@ class StepsWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
width:circleHeight, width: circleHeight,
height: circleHeight, height: circleHeight,
decoration: BoxDecoration( decoration: BoxDecoration(
border: index == 0 border: index == 0
? Border.all(color: Color(0xFFCC9B14), width: 2) ? Border.all(color: Color(0xFFCC9B14), width: 2)
@ -298,19 +321,21 @@ class StepsWidget extends StatelessWidget {
? Color(0xFFCC9B14) ? Color(0xFFCC9B14)
: index > 0 : index > 0
? Color(0xFF359846) ? Color(0xFF359846)
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon( child: Icon(
FontAwesomeIcons.check, FontAwesomeIcons.check,
size: 20, size: 20,
color: Colors.white, color: Colors.white,
)), )),
), ),
SizedBox(height: 3), SizedBox(height: 3),
Column( Column(
children: [ children: [
StepDetailsWidget(stepLabel: "شخصي",), StepDetailsWidget(
stepLabel: "شخصي",
),
StatusLabel( StatusLabel(
selectedStepId: index, selectedStepId: index,
stepId: 0, stepId: 0,
@ -323,18 +348,16 @@ class StepsWidget extends StatelessWidget {
), ),
Positioned( Positioned(
top: circleTop, top: circleTop,
right: MediaQuery right: MediaQuery.of(context).size.width * (patientInfo.admissionNo == null &&
.of(context) patientInfo.admissionNo.isEmpty?0.25:0.71),
.size
.width * 0.25,
child: InkWell( child: InkWell(
onTap: () => index >= 2 ? changeCurrentTab(1) : null, onTap: () => index >= 2 ? changeCurrentTab(1) : null,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container( Container(
width:circleHeight, width: circleHeight,
height: circleHeight, height: circleHeight,
decoration: BoxDecoration( decoration: BoxDecoration(
border: index == 1 border: index == 1
? Border.all(color: Color(0xFFCC9B14), width: 2) ? Border.all(color: Color(0xFFCC9B14), width: 2)
@ -347,19 +370,21 @@ class StepsWidget extends StatelessWidget {
? Color(0xFFCC9B14) ? Color(0xFFCC9B14)
: index > 1 : index > 1
? Color(0xFF359846) ? Color(0xFF359846)
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon( child: Icon(
FontAwesomeIcons.check, FontAwesomeIcons.check,
size: 20, size: 20,
color: Colors.white, color: Colors.white,
)), )),
), ),
SizedBox(height: 5), SizedBox(height: 5),
Column( Column(
children: [ children: [
StepDetailsWidget(stepLabel: "هدف",), StepDetailsWidget(
stepLabel: "هدف",
),
StatusLabel( StatusLabel(
selectedStepId: index, selectedStepId: index,
stepId: 1, stepId: 1,
@ -370,111 +395,116 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
), ),
Positioned( if (patientInfo.admissionNo == null &&
top: circleTop, patientInfo.admissionNo.isEmpty)
right: MediaQuery Positioned(
.of(context) top: circleTop,
.size right: MediaQuery.of(context).size.width * 0.50,
.width * 0.50, child: InkWell(
child: InkWell( onTap: () => index >= 3 ? changeCurrentTab(2) : null,
onTap: () => index >= 3 ? changeCurrentTab(2) : null, child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, children: [
children: [ Container(
Container( width: circleHeight,
width:circleHeight, height: circleHeight,
height: circleHeight, decoration: BoxDecoration(
decoration: BoxDecoration( border: index == 2
border: index == 2 ? Border.all(color: Color(0xFFCC9B14), width: 2)
? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 2
: index > 2 ? null
? null : Border.all(
: Border.all( color: Color(0xFFCCCCCC), width: 0.75),
color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle,
shape: BoxShape.circle, color: index == 2
color: index == 2 ? Color(0xFFCC9B14)
? Color(0xFFCC9B14) : index > 2
: index > 2 ? Color(0xFFCC9B14)
? Color(0xFFCC9B14) : Color(0xFFCCCCCC),
: Color(0xFFCCCCCC), ),
child: Center(
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
), ),
child: Center( SizedBox(
child: Icon( height: 5,
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
),
SizedBox(
height: 5,
),
Padding(
padding: const EdgeInsets.only(right: 2),
child: Column(
children: [
StepDetailsWidget(stepLabel: "تقدير",),
StatusLabel(
selectedStepId: index,
stepId: 2,
),
],
), ),
), Padding(
], padding: const EdgeInsets.only(right: 2),
child: Column(
children: [
StepDetailsWidget(
stepLabel: "تقدير",
),
StatusLabel(
selectedStepId: index,
stepId: 2,
),
],
),
),
],
),
), ),
), ),
), if (patientInfo.admissionNo == null &&
Positioned( patientInfo.admissionNo.isEmpty)
top: circleTop, Positioned(
left: 0, top: circleTop,
child: InkWell( left: 0,
onTap: () => index >= 3 ? changeCurrentTab(4) : null, child: InkWell(
child: Column( onTap: () => index >= 3 ? changeCurrentTab(4) : null,
crossAxisAlignment: CrossAxisAlignment.end, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.end,
Container( children: [
width:circleHeight, Container(
height: circleHeight, width: circleHeight,
decoration: BoxDecoration( height: circleHeight,
border: index == 3 decoration: BoxDecoration(
? Border.all(color: Color(0xFFCC9B14), width: 2) border: index == 3
: index > 3 ? Border.all(color: Color(0xFFCC9B14), width: 2)
? null : index > 3
: Border.all( ? null
color: Color(0xFFCCCCCC), width: 0.75), : Border.all(
shape: BoxShape.circle, color: Color(0xFFCCCCCC), width: 0.75),
color: index == 3 shape: BoxShape.circle,
? Color(0xFFCC9B14) color: index == 3
: index > 3 ? Color(0xFFCC9B14)
? Color(0xFFCC9B14) : index > 3
: Color(0xFFCCCCCC), ? Color(0xFFCC9B14)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
), ),
child: Center( SizedBox(
child: Icon( height: 5,
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
),
SizedBox(
height: 5,
),
Container(
margin: EdgeInsets.only(right: index == 3 ? 15 : 0),
child: Column(
children: [
StepDetailsWidget(stepLabel: "خطة",),
StatusLabel(
selectedStepId: index,
stepId: 3,
),
],
), ),
), Container(
], margin: EdgeInsets.only(right: index == 3 ? 15 : 0),
child: Column(
children: [
StepDetailsWidget(
stepLabel: "خطة",
),
StatusLabel(
selectedStepId: index,
stepId: 3,
),
],
),
),
],
),
), ),
), ),
),
], ],
); );
} }

@ -149,7 +149,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
Container( Container(
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: .80, widthFactor: .80,
child: getBottomSheet(model) child: getBottomSheet(model, patient)
), ),
), ),
SizedBox( SizedBox(
@ -163,7 +163,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
); );
} }
Widget getBottomSheet(SOAPViewModel model) { Widget getBottomSheet(SOAPViewModel model, PatiantInformtion patient) {
switch (_currentIndex) { switch (_currentIndex) {
case 0: case 0:
{ {
@ -206,7 +206,8 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
), ),
Expanded( Expanded(
child: AppButton( child: AppButton(
title: TranslationBase.of(context).next, title: patient.admissionNo != null &&
patient.admissionNo.isNotEmpty?TranslationBase.of(context).finish: TranslationBase.of(context).next,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Colors.red[700], color: Colors.red[700],
height: SizeConfig.heightMultiplier * height: SizeConfig.heightMultiplier *

Loading…
Cancel
Save