fix design issues on create episode and prevent exam from keep it state

episode_fixes
Elham Rababh 5 years ago
parent 7e57882349
commit 3b1a493d76

@ -376,9 +376,9 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
bottomSheet: model.state == ViewState.Busy?Container(height: 0,): bottomSheet: model.state == ViewState.Busy?Container(height: 0,):
BottomSheetDialogButton( BottomSheetDialogButton(
label: TranslationBase.of(context) label: (widget.isUpdate
.addMedication ? 'Update Assessment Details'
.toUpperCase(), : 'Add Assessment Details'),
onTap: () async { onTap: () async {
setState(() { setState(() {
isFormSubmitted = true; isFormSubmitted = true;

@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_assement.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_assement.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
@ -152,7 +153,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
mySelectedAssessmentList.map((assessment) { mySelectedAssessmentList.map((assessment) {
return Container( return Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: 5, right: 5, top: 15), left: 5, right: 5, top: 15, bottom: 15),
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceBetween,
@ -166,11 +167,11 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
RichText( RichText(
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: 12, fontSize: 10,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: fontWeight: FontWeight.w600,
FontWeight.w600), letterSpacing: -0.4),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: text:
@ -197,8 +198,9 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
fontSize: 16, fontSize: 16,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: fontWeight: FontWeight.w600,
FontWeight.w600), letterSpacing: -0.64,
),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: assessment text: assessment
@ -216,14 +218,16 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
fontSize: 12, fontSize: 12,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: fontWeight: FontWeight.w600,
FontWeight.w600), ),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: TranslationBase.of( text: TranslationBase.of(
context) context)
.appointmentNo, .appointmentNo,
style: new TextStyle( style: new TextStyle(
fontSize: 10,
letterSpacing: -0.4,
color: Color(0xFF575757), color: Color(0xFF575757),
), ),
), ),
@ -234,6 +238,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
"", "",
style: new TextStyle( style: new TextStyle(
fontSize: 14, fontSize: 14,
letterSpacing: -0.48,
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
), ),
), ),
@ -255,6 +260,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
.condition + .condition +
" : ", " : ",
style: new TextStyle( style: new TextStyle(
letterSpacing: -0.4,
color: Color(0xFF575757), color: Color(0xFF575757),
), ),
), ),
@ -268,7 +274,8 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
.selectedDiagnosisCondition .selectedDiagnosisCondition
.nameEn, .nameEn,
style: new TextStyle( style: new TextStyle(
fontSize: 14, fontSize: 12,
letterSpacing: -0.48,
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
), ),
), ),
@ -278,7 +285,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
RichText( RichText(
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: 12, fontSize: 10,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: fontWeight:
@ -290,6 +297,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
.dType + .dType +
' : ', ' : ',
style: new TextStyle( style: new TextStyle(
letterSpacing: -0.4,
color: Color(0xFF575757), color: Color(0xFF575757),
), ),
), ),
@ -303,7 +311,8 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
.selectedDiagnosisType .selectedDiagnosisType
.nameEn, .nameEn,
style: new TextStyle( style: new TextStyle(
fontSize: 14, fontSize: 12,
letterSpacing: -0.48,
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
), ),
), ),
@ -323,9 +332,10 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
new TextSpan( new TextSpan(
text: TranslationBase.of( text: TranslationBase.of(
context) context)
.doc + .doctor +
' : ', ' : ',
style: new TextStyle( style: new TextStyle(
fontSize: 10,letterSpacing: -0.4,
color: color:
Color(0xFF575757), Color(0xFF575757),
), ),
@ -335,7 +345,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
.doctorName ?? .doctorName ??
'', '',
style: new TextStyle( style: new TextStyle(
fontSize: 14, fontSize: 12,letterSpacing: -0.48,
color: color:
Color(0xFF2B353E), Color(0xFF2B353E),
), ),
@ -370,17 +380,9 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: fontWeight:
FontWeight.w600), FontWeight.w600),
Container( RemarkText(
width: MediaQuery.of(context) remark:
.size
.width *
0.38,
child: AppText(
assessment.remark ?? "", assessment.remark ?? "",
fontSize: 11,
color: Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
), ),
], ],
), ),
@ -393,6 +395,8 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
Row( Row(
children: [ children: [
Column( Column(
crossAxisAlignment:
CrossAxisAlignment.end,
children: [ children: [
AppText( AppText(
assessment.createdOn != assessment.createdOn !=
@ -408,7 +412,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
.now()), .now()),
fontWeight: fontWeight:
FontWeight.w600, FontWeight.w600,
fontSize: 14, fontSize: 12,
), ),
AppText( AppText(
assessment.createdOn != assessment.createdOn !=
@ -422,7 +426,8 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
.now()), .now()),
fontWeight: fontWeight:
FontWeight.w600, FontWeight.w600,
fontSize: 14, color: Color(0xFF575757),
fontSize: 12,
), ),
], ],
), ),

@ -1,9 +1,11 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -16,7 +18,7 @@ import 'examinations_list_search_widget.dart';
class AddExaminationPage extends StatefulWidget { class AddExaminationPage extends StatefulWidget {
final List<MySelectedExamination> mySelectedExamination; final List<MySelectedExamination> mySelectedExamination;
final Function addSelectedExamination; final Function (List<MySelectedExamination>)addSelectedExamination;
final Function(MasterKeyModel) removeExamination; final Function(MasterKeyModel) removeExamination;
AddExaminationPage( AddExaminationPage(
@ -29,6 +31,14 @@ class AddExaminationPage extends StatefulWidget {
} }
class _AddExaminationPageState extends State<AddExaminationPage> { class _AddExaminationPageState extends State<AddExaminationPage> {
List<MySelectedExamination> mySelectedExaminationLocal;
@override
initState() {
super.initState();
mySelectedExaminationLocal = [...widget.mySelectedExamination];
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
@ -77,7 +87,8 @@ class _AddExaminationPageState extends State<AddExaminationPage> {
}); });
}, },
addExamination: (selectedExamination) { addExamination: (selectedExamination) {
widget.mySelectedExamination
mySelectedExaminationLocal
.insert(0, selectedExamination); .insert(0, selectedExamination);
// setState(() {}); // setState(() {});
}, },
@ -91,48 +102,21 @@ class _AddExaminationPageState extends State<AddExaminationPage> {
), ),
], ],
), ),
bottomSheet: Container( bottomSheet: model.state == ViewState.Busy
decoration: BoxDecoration( ? Container(
color: Colors.white, height: 0,
borderRadius: BorderRadius.all( )
Radius.circular(0.0), : BottomSheetDialogButton(
), label: "${TranslationBase.of(context).addExamination}",
border: Border.all(color: HexColor('#707070'), width: 0), onTap: () {
), widget.addSelectedExamination(mySelectedExaminationLocal);
height: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: Center(
child: AppButton(
title:
"${TranslationBase.of(context).addExamination}",
padding: 10,
color: Color(0xFF359846),
onPressed: () {
widget.addSelectedExamination();
}, },
), ),
),
),
),
SizedBox(
height: 5,
),
],
),
),
)); ));
} }
isServiceSelected(MasterKeyModel masterKey) { isServiceSelected(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> exam = widget.mySelectedExamination.where( Iterable<MySelectedExamination> exam = mySelectedExaminationLocal.where(
(element) => (element) =>
masterKey.id == element.selectedExamination.id && masterKey.id == element.selectedExamination.id &&
masterKey.typeId == element.selectedExamination.typeId); masterKey.typeId == element.selectedExamination.typeId);

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/config/size_config.dart'; 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/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -76,13 +77,7 @@ class ExaminationItemCard extends StatelessWidget {
height: 4, height: 4,
), ),
if (examination.remark.isNotEmpty) if (examination.remark.isNotEmpty)
AppText( RemarkText(remark: examination.remark),
examination.remark,
fontWeight: FontWeight.normal,
fontFamily: 'Poppins',
color: Color(0xFF575757),
fontSize: SizeConfig.textMultiplier * 1.8,
),
], ],
), ),
); );

@ -137,7 +137,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
"New", "New",
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: Colors.blue, color: Color(0xFFCC9B14),
), ),
], ],
), ),
@ -146,6 +146,10 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
.sublist( .sublist(
0, 0,
model.getFirstIndexForOldExamination( model.getFirstIndexForOldExamination(
mySelectedExamination) ==
-1
? 0
: model.getFirstIndexForOldExamination(
mySelectedExamination)) mySelectedExamination))
.map((examination) { .map((examination) {
return ExaminationItemCard(examination, () { return ExaminationItemCard(examination, () {
@ -154,14 +158,14 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
}); });
}).toList(), }).toList(),
), ),
if (mySelectedExamination.isNotEmpty && if (mySelectedExamination.isNotEmpty &&
model.getFirstIndexForOldExamination( model.getFirstIndexForOldExamination(
mySelectedExamination)>-1) mySelectedExamination) >
-1)
Row( Row(
children: [ children: [
AppText( AppText(
"old", "Verified",
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: Colors.green, color: Colors.green,
@ -171,6 +175,10 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
Column( Column(
children: mySelectedExamination children: mySelectedExamination
.sublist(model.getFirstIndexForOldExamination( .sublist(model.getFirstIndexForOldExamination(
mySelectedExamination) ==
-1
? 0
: model.getFirstIndexForOldExamination(
mySelectedExamination)) mySelectedExamination))
.map((examination) { .map((examination) {
return ExaminationItemCard(examination, () { return ExaminationItemCard(examination, () {
@ -336,9 +344,38 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
FadePage( FadePage(
page: AddExaminationPage( page: AddExaminationPage(
mySelectedExamination: mySelectedExamination, mySelectedExamination: mySelectedExamination,
addSelectedExamination: () { addSelectedExamination: (List<MySelectedExamination> mySelectedExaminationLocal ) {
setState(() { setState(() {
{
mySelectedExaminationLocal.forEach((element) {
if ((mySelectedExamination.singleWhere(
(it) =>
it.selectedExamination.id ==
element.selectedExamination.id,
orElse: () => null)) ==
null) {
mySelectedExamination.add(element);
}
});
/// remove items.
List<MySelectedExamination> removedList = [];
mySelectedExamination.forEach((element) {
if ((mySelectedExaminationLocal.singleWhere(
(it) =>
it.selectedExamination.id ==
element.selectedExamination.id,
orElse: () => null)) ==
null) {
removedList.add(element);
}
});
removedList.forEach((element) {
removeExamination(element.selectedExamination);
});
Navigator.of(context).pop(); Navigator.of(context).pop();
}
}); });
}, },
removeExamination: (masterKey) => removeExamination(masterKey)), removeExamination: (masterKey) => removeExamination(masterKey)),

@ -0,0 +1,24 @@
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
class RemarkText extends StatelessWidget {
final String remark;
const RemarkText({
Key key, this.remark,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
width: MediaQuery.of(context).size.width * 0.55,
child: AppText(
remark ?? '',
color: Color(0xFF575757),
fontSize: 10,
fontWeight: FontWeight.w700,
letterSpacing: -0.4,
),
);
}
}

@ -248,7 +248,7 @@ class StepsWidget extends StatelessWidget {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,
textAlign: TextAlign.end, textAlign: TextAlign.end,
marginLeft: 25, marginLeft: 30,
), ),
StatusLabel( StatusLabel(
selectedStepId: index, selectedStepId: index,

@ -45,32 +45,6 @@ class _AddAllergiesState extends State<AddAllergies> {
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>(); GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
bool isFormSubmitted = false; bool isFormSubmitted = false;
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{IconData icon}) {
return InputDecoration(
contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey, width: 1.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey, width: 1.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey, width: 1.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null,
hintStyle: TextStyle(
fontSize: 10,
color: Theme.of(context).hintColor,
fontWeight: FontWeight.w700),
);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return FractionallySizedBox( return FractionallySizedBox(

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -103,16 +104,7 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
padding: const EdgeInsets.symmetric(vertical: 8), padding: const EdgeInsets.symmetric(vertical: 8),
child: Row( child: Row(
children: [ children: [
Container( RemarkText(remark: selectedAllergy.remark,),
width: MediaQuery.of(context).size.width * 0.55,
child: AppText(
selectedAllergy.remark ?? '',
color: Color(0xFF575757),
fontSize: 10,
fontWeight: FontWeight.w700,
letterSpacing: -0.4,
),
),
], ],
), ),
), ),
@ -210,3 +202,4 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
} }
} }

Loading…
Cancel
Save