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,):
BottomSheetDialogButton(
label: TranslationBase.of(context)
.addMedication
.toUpperCase(),
label: (widget.isUpdate
? 'Update Assessment Details'
: 'Add Assessment Details'),
onTap: () async {
setState(() {
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/patient/patiant_info_model.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/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
@ -152,7 +153,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
mySelectedAssessmentList.map((assessment) {
return Container(
margin: EdgeInsets.only(
left: 5, right: 5, top: 15),
left: 5, right: 5, top: 15, bottom: 15),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
@ -166,11 +167,11 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 12,
fontSize: 10,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight:
FontWeight.w600),
fontWeight: FontWeight.w600,
letterSpacing: -0.4),
children: <TextSpan>[
new TextSpan(
text:
@ -194,11 +195,12 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 16,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight:
FontWeight.w600),
fontSize: 16,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
letterSpacing: -0.64,
),
children: <TextSpan>[
new TextSpan(
text: assessment
@ -213,17 +215,19 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 12,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight:
FontWeight.w600),
fontSize: 12,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(
context)
.appointmentNo,
style: new TextStyle(
fontSize: 10,
letterSpacing: -0.4,
color: Color(0xFF575757),
),
),
@ -234,6 +238,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
"",
style: new TextStyle(
fontSize: 14,
letterSpacing: -0.48,
color: Color(0xFF2B353E),
),
),
@ -255,6 +260,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
.condition +
" : ",
style: new TextStyle(
letterSpacing: -0.4,
color: Color(0xFF575757),
),
),
@ -268,7 +274,8 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
.selectedDiagnosisCondition
.nameEn,
style: new TextStyle(
fontSize: 14,
fontSize: 12,
letterSpacing: -0.48,
color: Color(0xFF2B353E),
),
),
@ -278,7 +285,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 12,
fontSize: 10,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight:
@ -290,6 +297,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
.dType +
' : ',
style: new TextStyle(
letterSpacing: -0.4,
color: Color(0xFF575757),
),
),
@ -303,7 +311,8 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
.selectedDiagnosisType
.nameEn,
style: new TextStyle(
fontSize: 14,
fontSize: 12,
letterSpacing: -0.48,
color: Color(0xFF2B353E),
),
),
@ -323,9 +332,10 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
new TextSpan(
text: TranslationBase.of(
context)
.doc +
.doctor +
' : ',
style: new TextStyle(
fontSize: 10,letterSpacing: -0.4,
color:
Color(0xFF575757),
),
@ -335,7 +345,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
.doctorName ??
'',
style: new TextStyle(
fontSize: 14,
fontSize: 12,letterSpacing: -0.48,
color:
Color(0xFF2B353E),
),
@ -370,17 +380,9 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
fontFamily: 'Poppins',
fontWeight:
FontWeight.w600),
Container(
width: MediaQuery.of(context)
.size
.width *
0.38,
child: AppText(
assessment.remark ?? "",
fontSize: 11,
color: Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
RemarkText(
remark:
assessment.remark ?? "",
),
],
),
@ -393,6 +395,8 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
Row(
children: [
Column(
crossAxisAlignment:
CrossAxisAlignment.end,
children: [
AppText(
assessment.createdOn !=
@ -408,7 +412,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
.now()),
fontWeight:
FontWeight.w600,
fontSize: 14,
fontSize: 12,
),
AppText(
assessment.createdOn !=
@ -422,7 +426,8 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
.now()),
fontWeight:
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/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/models/SOAP/master_key_model.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/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/util/translations_delegate_base.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 {
final List<MySelectedExamination> mySelectedExamination;
final Function addSelectedExamination;
final Function (List<MySelectedExamination>)addSelectedExamination;
final Function(MasterKeyModel) removeExamination;
AddExaminationPage(
@ -29,6 +31,14 @@ class AddExaminationPage extends StatefulWidget {
}
class _AddExaminationPageState extends State<AddExaminationPage> {
List<MySelectedExamination> mySelectedExaminationLocal;
@override
initState() {
super.initState();
mySelectedExaminationLocal = [...widget.mySelectedExamination];
}
@override
Widget build(BuildContext context) {
return BaseView<SOAPViewModel>(
@ -77,8 +87,9 @@ class _AddExaminationPageState extends State<AddExaminationPage> {
});
},
addExamination: (selectedExamination) {
widget.mySelectedExamination
.insert(0,selectedExamination);
mySelectedExaminationLocal
.insert(0, selectedExamination);
// setState(() {});
},
),
@ -91,48 +102,21 @@ class _AddExaminationPageState extends State<AddExaminationPage> {
),
],
),
bottomSheet: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(0.0),
),
border: Border.all(color: HexColor('#707070'), width: 0),
),
height: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
bottomSheet: model.state == ViewState.Busy
? Container(
height: 0,
)
: BottomSheetDialogButton(
label: "${TranslationBase.of(context).addExamination}",
onTap: () {
widget.addSelectedExamination(mySelectedExaminationLocal);
},
),
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) {
Iterable<MySelectedExamination> exam = widget.mySelectedExamination.where(
Iterable<MySelectedExamination> exam = mySelectedExaminationLocal.where(
(element) =>
masterKey.id == element.selectedExamination.id &&
masterKey.typeId == element.selectedExamination.typeId);

@ -1,6 +1,7 @@
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/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/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -76,13 +77,7 @@ class ExaminationItemCard extends StatelessWidget {
height: 4,
),
if (examination.remark.isNotEmpty)
AppText(
examination.remark,
fontWeight: FontWeight.normal,
fontFamily: 'Poppins',
color: Color(0xFF575757),
fontSize: SizeConfig.textMultiplier * 1.8,
),
RemarkText(remark: examination.remark),
],
),
);

@ -137,7 +137,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
"New",
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
color: Colors.blue,
color: Color(0xFFCC9B14),
),
],
),
@ -146,7 +146,11 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
.sublist(
0,
model.getFirstIndexForOldExamination(
mySelectedExamination))
mySelectedExamination) ==
-1
? 0
: model.getFirstIndexForOldExamination(
mySelectedExamination))
.map((examination) {
return ExaminationItemCard(examination, () {
removeExamination(
@ -154,24 +158,28 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
});
}).toList(),
),
if (mySelectedExamination.isNotEmpty &&
model.getFirstIndexForOldExamination(
mySelectedExamination)>-1)
Row(
children: [
AppText(
"old",
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
color: Colors.green,
),
],
),
mySelectedExamination) >
-1)
Row(
children: [
AppText(
"Verified",
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
color: Colors.green,
),
],
),
Column(
children: mySelectedExamination
.sublist(model.getFirstIndexForOldExamination(
mySelectedExamination))
mySelectedExamination) ==
-1
? 0
: model.getFirstIndexForOldExamination(
mySelectedExamination))
.map((examination) {
return ExaminationItemCard(examination, () {
removeExamination(
@ -336,9 +344,38 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
FadePage(
page: AddExaminationPage(
mySelectedExamination: mySelectedExamination,
addSelectedExamination: () {
addSelectedExamination: (List<MySelectedExamination> mySelectedExaminationLocal ) {
setState(() {
Navigator.of(context).pop();
{
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();
}
});
},
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,
fontSize: 12,
textAlign: TextAlign.end,
marginLeft: 25,
marginLeft: 30,
),
StatusLabel(
selectedStepId: index,

@ -45,32 +45,6 @@ class _AddAllergiesState extends State<AddAllergies> {
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
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
Widget build(BuildContext context) {
return FractionallySizedBox(

@ -1,5 +1,6 @@
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/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/util/helpers.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),
child: Row(
children: [
Container(
width: MediaQuery.of(context).size.width * 0.55,
child: AppText(
selectedAllergy.remark ?? '',
color: Color(0xFF575757),
fontSize: 10,
fontWeight: FontWeight.w700,
letterSpacing: -0.4,
),
),
RemarkText(remark: selectedAllergy.remark,),
],
),
),
@ -210,3 +202,4 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
}
}

Loading…
Cancel
Save