diff --git a/lib/config/size_config.dart b/lib/config/size_config.dart index 6b996b3f..6ba584c6 100644 --- a/lib/config/size_config.dart +++ b/lib/config/size_config.dart @@ -59,5 +59,32 @@ class SizeConfig { print('widthMultiplier $widthMultiplier'); print('isPortrait $isPortrait'); print('isMobilePortrait $isMobilePortrait'); + + + } + + static getTextMultiplierBasedOnWidth({double width}) { + // TODO handel LandScape case + if (width != null) { + return width / 100; + } + return widthMultiplier; + } + + static getWidthMultiplier({double width}) { + // TODO handel LandScape case + if (width != null) { + return width / 100; + } + return widthMultiplier; + } + + static getHeightMultiplier({double height}) { + // TODO handel LandScape case + if (height != null) { + return height / 100; + } + return heightMultiplier; } + } diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart index 07343bb7..f1966130 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart @@ -81,9 +81,9 @@ class _AddExaminationPageState extends State { masterList: model.physicalExaminationList, isServiceSelected: (master) => isServiceSelected(master), - removeExamination: (exam) { + removeExamination: (selectedExamination) { setState(() { - widget.removeExamination(exam); + mySelectedExaminationLocal.remove(selectedExamination); }); }, addExamination: (selectedExamination) { diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart index 2bb9b943..82d26dc9 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart @@ -14,7 +14,7 @@ import 'package:provider/provider.dart'; // ignore: must_be_immutable class AddExaminationWidget extends StatefulWidget { MasterKeyModel item; - final Function(MasterKeyModel) removeExamination; + final Function(MySelectedExamination) removeExamination; final Function(MySelectedExamination) addExamination; final bool Function(MasterKeyModel) isServiceSelected; bool isExpand; @@ -83,7 +83,7 @@ class _AddExaminationWidgetState extends State { setState(() { if (widget.isServiceSelected(widget.item)) { if (examination.isLocal) - widget.removeExamination(widget.item); + widget.removeExamination(examination); widget.expandClick(); } else { examination.isNormal = status == 1; diff --git a/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart b/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart index 497bafa8..bab2d647 100644 --- a/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart @@ -8,7 +8,7 @@ import 'package:flutter/material.dart'; import 'add_examination_widget.dart'; class ExaminationsListSearchWidget extends StatefulWidget { - final Function(MasterKeyModel) removeExamination; + final Function(MySelectedExamination) removeExamination; final Function(MySelectedExamination) addExamination; final bool Function(MasterKeyModel) isServiceSelected; final List masterList; diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart index 31524295..c998bceb 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -76,11 +77,7 @@ class StepsWidget extends StatelessWidget { Column( mainAxisAlignment: MainAxisAlignment.start, children: [ - AppText( - "Subjective", - fontWeight: FontWeight.bold, - fontSize: 12, - ), + StepWidget(stepLabel: "Subjective",), StatusLabel( selectedStepId: index, stepId: 0, @@ -132,11 +129,7 @@ class StepsWidget extends StatelessWidget { Column( mainAxisAlignment: MainAxisAlignment.start, children: [ - AppText( - "Objective", - fontWeight: FontWeight.bold, - fontSize: 12, - ), + StepWidget(stepLabel: "Objective",), StatusLabel( selectedStepId: index, stepId: 1, @@ -152,7 +145,7 @@ class StepsWidget extends StatelessWidget { left: MediaQuery .of(context) .size - .width * 0.50, + .width * 0.47, child: InkWell( onTap: () { if (index >= 3) changeCurrentTab(2); @@ -190,11 +183,7 @@ class StepsWidget extends StatelessWidget { Column( mainAxisAlignment: MainAxisAlignment.start, children: [ - AppText( - "Assessment", - fontWeight: FontWeight.bold, - fontSize: 12, - ), + StepWidget(stepLabel: "Assessment",), StatusLabel( selectedStepId: index, stepId: 2, @@ -243,13 +232,7 @@ class StepsWidget extends StatelessWidget { Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - AppText( - "Plan", - fontWeight: FontWeight.bold, - fontSize: 12, - textAlign: TextAlign.end, - marginLeft: 30, - ), + StepWidget(stepLabel: "Plan",marginLeft: 30,), StatusLabel( selectedStepId: index, stepId: 3, @@ -506,6 +489,25 @@ class StepsWidget extends StatelessWidget { } } +class StepWidget extends StatelessWidget { + final String stepLabel; + final double marginLeft; + + const StepWidget({ + Key key, this.stepLabel, this.marginLeft = 0, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return AppText( + stepLabel, + fontWeight: FontWeight.bold, + marginLeft: marginLeft, + fontSize:SizeConfig.getTextMultiplierBasedOnWidth() * 3.5 //12, + ); + } +} + class StatusLabel extends StatelessWidget { const StatusLabel({ Key key, @@ -519,7 +521,7 @@ class StatusLabel extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - width: 65, + width: SizeConfig.getTextMultiplierBasedOnWidth() * 18.5, padding: EdgeInsets.symmetric(horizontal: 2, vertical: 3), decoration: BoxDecoration( color: stepId == selectedStepId @@ -541,7 +543,7 @@ class StatusLabel extends StatelessWidget { : "Locked", fontWeight: FontWeight.bold, textAlign: TextAlign.center, - fontSize: 10, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, color: stepId == selectedStepId ? Color(0xFFCC9B14) : stepId < selectedStepId