fix design issues on first step form create episode

episode_fixes
Elham Rababh 5 years ago
parent 25d0a08105
commit 7e57882349

@ -11,6 +11,7 @@ import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_asseme
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.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/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/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';
@ -372,63 +373,34 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
), ),
), ),
), ),
bottomSheet: model.state == ViewState.Busy?Container(height: 0,):Container( bottomSheet: model.state == ViewState.Busy?Container(height: 0,):
decoration: BoxDecoration(
color: Colors.white, BottomSheetDialogButton(
borderRadius: BorderRadius.all( label: TranslationBase.of(context)
Radius.circular(0.0), .addMedication
), .toUpperCase(),
border: Border.all(color: HexColor('#707070'), width: 0), onTap: () async {
), setState(() {
height: MediaQuery.of(context).size.height * 0.1, isFormSubmitted = true;
width: double.infinity, });
child: Column( widget.mySelectedAssessment.remark =
children: [ remarkController.text;
SizedBox( widget.mySelectedAssessment.appointmentId =
height: 10, int.parse(appointmentIdController.text);
), if (widget.mySelectedAssessment
Container( .selectedDiagnosisCondition !=
child: FractionallySizedBox( null &&
widthFactor: .80, widget.mySelectedAssessment
child: Center( .selectedDiagnosisType !=
child: AppButton( null &&
fontWeight: FontWeight.w700, widget.mySelectedAssessment.selectedICD != null) {
color: Colors.green, await submitAssessment(
title: (widget.isUpdate isUpdate: widget.isUpdate,
? 'Update Assessment Details' model: model,
: 'Add Assessment Details'), mySelectedAssessment:
loading: model.state == ViewState.BusyLocal, widget.mySelectedAssessment);
onPressed: () async { }
setState(() { },
isFormSubmitted = true;
});
widget.mySelectedAssessment.remark =
remarkController.text;
widget.mySelectedAssessment.appointmentId =
int.parse(appointmentIdController.text);
if (widget.mySelectedAssessment
.selectedDiagnosisCondition !=
null &&
widget.mySelectedAssessment
.selectedDiagnosisType !=
null &&
widget.mySelectedAssessment.selectedICD != null) {
await submitAssessment(
isUpdate: widget.isUpdate,
model: model,
mySelectedAssessment:
widget.mySelectedAssessment);
}
},
),
),
),
),
SizedBox(
height: 5,
),
],
),
), ),
), ),
), ),

@ -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/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';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -62,45 +63,26 @@ class ExaminationItemCard extends StatelessWidget {
: Colors.green.shade800, : Colors.green.shade800,
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier * 1.8,
), ),
if(!examination.notExamined) if (!examination.notExamined)
InkWell( RemoveButton(
child: Row( label: examination.isLocal
children: [Container( ? TranslationBase.of(context).remove
child: AppText( : TranslationBase.of(context).notExamined,
examination.isLocal ?TranslationBase onTap: removeExamination,
.of(context)
.remove :TranslationBase
.of(context)
.notExamined,
fontSize: 15,
variant: "bodyText",
color: HexColor("#B8382C"),),
),
Icon(
FontAwesomeIcons.times,
color: HexColor("#B8382C"),
size: 20,
),
],
), ),
onTap: removeExamination,
),
], ],
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
if(examination.remark.isNotEmpty) if (examination.remark.isNotEmpty)
AppText( AppText(
examination.remark, examination.remark,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: Color(0xFF575757), color: Color(0xFF575757),
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier * 1.8,
), ),
], ],
), ),
); );

@ -36,19 +36,23 @@ class SOAPOpenItems extends StatelessWidget {
AppText( AppText(
"$label", "$label",
fontSize:15, fontSize:15,
color: Colors.black, fontWeight: FontWeight.w700,
fontWeight: FontWeight.w600, color: Color(0xFF2E303A),
letterSpacing:-0.44 ,
), ),
AppText( AppText(
"${TranslationBase.of(context).searchHere}", "${TranslationBase.of(context).searchHere}",
fontSize:13, fontSize:14,
color: Colors.grey.shade700, fontWeight: FontWeight.w500,
color: Color(0xFF575757),
letterSpacing:-0.56 ,
), ),
], ],
)), )),
Icon( Icon(
Icons.add_box_rounded, Icons.add_box_rounded,
size: 25, size: 28,
color: Color(0xFF2E303A),
) )
], ],
), ),

@ -21,12 +21,17 @@ class SOAPStepHeader extends StatelessWidget {
SizedBox(height: 15,), SizedBox(height: 15,),
AppText( AppText(
TranslationBase.of(context).createNew, TranslationBase.of(context).createNew,
fontSize: 14, fontSize: 12,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w700,
letterSpacing:-0.72,
color: Color(0xFF2E303A),
), ),
AppText(TranslationBase.of(context).episode, AppText(TranslationBase.of(context).episode,
fontSize: 26, fontSize: 24,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
letterSpacing:-1.44,
color: Color(0xFF2E303A),
), ),
Container( Container(
color: Theme.of(context).scaffoldBackgroundColor, color: Theme.of(context).scaffoldBackgroundColor,

@ -0,0 +1,49 @@
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class BottomSheetDialogButton extends StatelessWidget {
final Function onTap;
final String label;
const BottomSheetDialogButton({Key key, this.onTap, this.label})
: super(key: key);
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(0.0),
),
border: Border.all(color: HexColor('#EFEFEF'), width: 1),
),
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: label,
padding: 10,
color: Color(0xFF359846),
onPressed: onTap,
),
),
),
),
SizedBox(
height: 5,
),
],
),
);
}
}

@ -41,8 +41,10 @@ class ExpandableSOAPWidget extends StatelessWidget {
children: [ children: [
AppText(headerTitle, AppText(headerTitle,
variant: isExpanded ? "bodyText" : '', variant: isExpanded ? "bodyText" : '',
fontSize: 15, fontSize: 16,
color: Colors.black), letterSpacing:-0.64,
fontWeight: FontWeight.w700,
color: Color(0xFF2E303A),),
if(isRequired) if(isRequired)
Icon( Icon(
FontAwesomeIcons.asterisk, FontAwesomeIcons.asterisk,

@ -0,0 +1,38 @@
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart';
class RemoveButton extends StatelessWidget {
final Function onTap;
final String label;
const RemoveButton({Key key, this.onTap, this.label}) : super(key: key);
@override
Widget build(BuildContext context) {
return InkWell(
child: Row(
children: [
Container(
child: AppText(
label??TranslationBase.of(context).remove,
fontSize: 12,
fontWeight: FontWeight.w700,
color: HexColor("#D02127"),
letterSpacing:-0.48,
),
),
Icon(
FontAwesomeIcons.times,
color: HexColor("#D02127"),
size: 16,
),
],
),
onTap: onTap,
);
}
}

@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_histor
class SoapUtils { class SoapUtils {
static MySelectedHistory generateMySelectedHistory( static MySelectedHistory generateMySelectedHistory(
{history, isChecked, remark, isLocal}) { {history, isChecked, remark, isLocal = true}) {
MySelectedHistory mySelectedHistory = MySelectedHistory( MySelectedHistory mySelectedHistory = MySelectedHistory(
selectedHistory: history, selectedHistory: history,
isChecked: isChecked, isChecked: isChecked,
@ -19,7 +19,7 @@ class SoapUtils {
allergySeverity, allergySeverity,
isChecked, isChecked,
remark, remark,
isLocal, isLocal = true,
int createdBy, int createdBy,
bool isExpanded}) { bool isExpanded}) {
MySelectedAllergy mySelectedAllergy = MySelectedAllergy( MySelectedAllergy mySelectedAllergy = MySelectedAllergy(
@ -38,7 +38,7 @@ class SoapUtils {
allergySeverity, allergySeverity,
isChecked, isChecked,
remark, remark,
isLocal, isLocal = true,
isNormal, isNormal,
createdBy, createdBy,
createdOn, createdOn,

@ -5,6 +5,7 @@ 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_allergy.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.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/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';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -120,7 +121,6 @@ class _AddAllergiesState extends State<AddAllergies> {
addAllergyLocally(mySelectedAllergy); addAllergyLocally(mySelectedAllergy);
}, },
addSelectedAllergy: () { addSelectedAllergy: () {
setState(() { setState(() {
widget widget
.addAllergiesFun(myAllergiesListLocal); .addAllergiesFun(myAllergiesListLocal);
@ -146,43 +146,13 @@ class _AddAllergiesState extends State<AddAllergies> {
? Container( ? Container(
height: 0, height: 0,
) )
: Container( : BottomSheetDialogButton(
decoration: BoxDecoration( label: TranslationBase.of(context).addAllergies,
color: Colors.white, onTap: () {
borderRadius: BorderRadius.all( setState(() {
Radius.circular(0.0), widget.addAllergiesFun(myAllergiesListLocal);
), });
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,
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: Center(
child: AppButton(
title: TranslationBase.of(context).addAllergies,
padding: 10,
color: Color(0xFF359846),
onPressed: () {
setState(() {
widget.addAllergiesFun(myAllergiesListLocal);
});
},
),
),
),
),
SizedBox(
height: 5,
),
],
),
), ),
), ),
), ),
@ -244,3 +214,4 @@ class _AddAllergiesState extends State<AddAllergies> {
} }
} }
} }

@ -74,22 +74,19 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
}), }),
InkWell( InkWell(
onTap:onTapItem, onTap:onTapItem,
child: Padding( child: Container(
padding: child: AppText(
const EdgeInsets.symmetric(horizontal: 10, vertical: 0), projectViewModel.isArabic
child: Container( ? widget.item.nameAr != ""
child: AppText( ? widget.item.nameAr
projectViewModel.isArabic : widget.item.nameEn
? widget.item.nameAr != "" : widget.item.nameEn,
? widget.item.nameAr color: Color(0xFF575757),
: widget.item.nameEn fontSize: 14,
: widget.item.nameEn, fontWeight: FontWeight.w600,
color: Color(0xFF575757), letterSpacing: -0.56,
fontSize: 16,
fontWeight: FontWeight.w600,
),
width: MediaQuery.of(context).size.width * 0.55,
), ),
width: MediaQuery.of(context).size.width * 0.55,
), ),
), ),
], ],
@ -106,8 +103,11 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
child: Icon((mySelectedAllergy != null child: Icon((mySelectedAllergy != null
? mySelectedAllergy.isExpanded ? mySelectedAllergy.isExpanded
: false) : false)
? EvaIcons.arrowIosUpwardOutline ? EvaIcons.arrowIosUpwardOutline
: EvaIcons.arrowIosDownwardOutline)) : EvaIcons.arrowIosDownwardOutline,
color: Color(0xFF575757) ,
),)
], ],
), ),
bodyWidget: Center( bodyWidget: Center(

@ -43,7 +43,7 @@ class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget {
class _MasterKeyCheckboxSearchAllergiesWidgetState class _MasterKeyCheckboxSearchAllergiesWidgetState
extends State<MasterKeyCheckboxSearchAllergiesWidget> { extends State<MasterKeyCheckboxSearchAllergiesWidget> {
List<MasterKeyModel> items = List(); List<MasterKeyModel> items = List();
TextEditingController filteredSearchController = TextEditingController();
@override @override
void initState() { void initState() {
@ -67,13 +67,11 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
child: Column( child: Column(
children: [ children: [
AppTextFieldCustom( AppTextFieldCustom(
// height:
// MediaQuery.of(context).size.height * 0.070,
hintText: hintText:
TranslationBase.of(context).selectAllergy, TranslationBase.of(context).selectAllergy,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
hasBorder: false, hasBorder: false,
// controller: filteredSearchController, controller: filteredSearchController,
onChanged: (value) { onChanged: (value) {
filterSearchResults(value); filterSearchResults(value);
}, },

@ -1,12 +1,11 @@
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/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';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../shared_soap_widgets/SOAP_open_items.dart'; import '../../shared_soap_widgets/SOAP_open_items.dart';
@ -14,7 +13,7 @@ import 'add_allergies.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class UpdateAllergiesWidget extends StatefulWidget { class UpdateAllergiesWidget extends StatefulWidget {
List<MySelectedAllergy> myAllergiesList; List<MySelectedAllergy> myAllergiesList;
UpdateAllergiesWidget({Key key, this.myAllergiesList}); UpdateAllergiesWidget({Key key, this.myAllergiesList});
@ -27,28 +26,28 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
changeAllState() { changeAllState() {
setState(() { setState(() {});
});
} }
return Column( return Column(
children: [ children: [
SOAPOpenItems(label: "${TranslationBase.of(context).addAllergies}",onTap: () { SOAPOpenItems(
openAllergiesList(context, changeAllState, removeAllergy); label: "${TranslationBase.of(context).addAllergies}",
},), onTap: () {
openAllergiesList(context, changeAllState, removeAllergy);
},
),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Container( Container(
margin: margin: EdgeInsets.only(left: 15, right: 15, top: 15),
EdgeInsets.only(left: 15, right: 15, top: 15),
child: Column( child: Column(
children: widget.myAllergiesList.map((selectedAllergy) { children: widget.myAllergiesList.map((selectedAllergy) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -61,53 +60,41 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
projectViewModel.isArabic projectViewModel.isArabic
? selectedAllergy.selectedAllergy.nameAr ? selectedAllergy.selectedAllergy.nameAr
: selectedAllergy.selectedAllergy.nameEn : selectedAllergy.selectedAllergy.nameEn
.toUpperCase(), .toUpperCase(),
textDecoration: selectedAllergy.isChecked textDecoration: selectedAllergy.isChecked
? null ? null
: TextDecoration.lineThrough, : TextDecoration.lineThrough,
bold: true, bold: true,
color: Color(0xFF2B353E)), color: Color(0xFF2B353E),
fontSize: 12,
fontWeight: FontWeight.w700,
letterSpacing: -0.48,
// fontHeight:0.18 ,
),
AppText( AppText(
projectViewModel.isArabic projectViewModel.isArabic
? selectedAllergy.selectedAllergySeverity ? selectedAllergy
.nameAr .selectedAllergySeverity.nameAr
: selectedAllergy.selectedAllergySeverity : selectedAllergy
.nameEn .selectedAllergySeverity.nameEn
.toUpperCase(), .toUpperCase(),
textDecoration: selectedAllergy.isChecked textDecoration: selectedAllergy.isChecked
? null ? null
: TextDecoration.lineThrough, : TextDecoration.lineThrough,
color: Color(0xFFCC9B14)), color: Color(0xFFCC9B14),
fontSize: 10,
fontWeight: FontWeight.w700,
letterSpacing: -0.48,
),
], ],
), ),
width: MediaQuery width: MediaQuery.of(context).size.width * 0.5,
.of(context)
.size
.width * 0.5,
), ),
if (selectedAllergy.isChecked) if (selectedAllergy.isChecked)
InkWell( RemoveButton(
child: Row(
children: [Container(
child: AppText(
TranslationBase
.of(context)
.remove,
fontSize: 15,
variant: "bodyText",
color: HexColor("#B8382C"),),
),
Icon(
FontAwesomeIcons.times,
color: HexColor("#B8382C"),
size: 20,
),
],
),
onTap: () => removeAllergy(selectedAllergy), onTap: () => removeAllergy(selectedAllergy),
) )
], ],
@ -120,8 +107,10 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
width: MediaQuery.of(context).size.width * 0.55, width: MediaQuery.of(context).size.width * 0.55,
child: AppText( child: AppText(
selectedAllergy.remark ?? '', selectedAllergy.remark ?? '',
color: Color(0xFF575757),
fontSize: 10, fontSize: 10,
color: Colors.grey, fontWeight: FontWeight.w700,
letterSpacing: -0.4,
), ),
), ),
], ],
@ -143,15 +132,17 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
removeAllergy(MySelectedAllergy mySelectedAllergy) { removeAllergy(MySelectedAllergy mySelectedAllergy) {
List<MySelectedAllergy> allergy = List<MySelectedAllergy> allergy =
// ignore: missing_return // ignore: missing_return
widget.myAllergiesList.where((element) => widget.myAllergiesList
mySelectedAllergy.selectedAllergySeverity.id == .where((element) =>
element.selectedAllergySeverity.id && mySelectedAllergy.selectedAllergySeverity.id ==
mySelectedAllergy.selectedAllergy.id == element.selectedAllergy.id element.selectedAllergySeverity.id &&
).toList(); mySelectedAllergy.selectedAllergy.id ==
element.selectedAllergy.id)
.toList();
if (allergy.length > 0) { if (allergy.length > 0) {
if(allergy.first.isLocal) { if (allergy.first.isLocal) {
setState(() { setState(() {
widget.myAllergiesList.remove(allergy.first); widget.myAllergiesList.remove(allergy.first);
}); });
@ -162,7 +153,8 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
} }
} }
openAllergiesList(BuildContext context, Function changeParentState, removeAllergy) { openAllergiesList(
BuildContext context, Function changeParentState, removeAllergy) {
showModalBottomSheet( showModalBottomSheet(
backgroundColor: Colors.white, backgroundColor: Colors.white,
isScrollControlled: true, isScrollControlled: true,
@ -170,7 +162,7 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
context: context, context: context,
builder: (context) { builder: (context) {
return AddAllergies( return AddAllergies(
myAllergiesList: widget.myAllergiesList, myAllergiesList: widget.myAllergiesList,
addAllergiesFun: (List<MySelectedAllergy> mySelectedAllergy) { addAllergiesFun: (List<MySelectedAllergy> mySelectedAllergy) {
bool isAllDataFilled = true; bool isAllDataFilled = true;
mySelectedAllergy.forEach((element) { mySelectedAllergy.forEach((element) {
@ -181,19 +173,28 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
}); });
if (isAllDataFilled) { if (isAllDataFilled) {
mySelectedAllergy.forEach((element) { mySelectedAllergy.forEach((element) {
if ((widget.myAllergiesList.singleWhere((it) => it.selectedAllergy.id == element.selectedAllergy.id, if ((widget.myAllergiesList.singleWhere(
orElse: () => null)) == null) { (it) =>
it.selectedAllergy.id ==
element.selectedAllergy.id,
orElse: () => null)) ==
null) {
widget.myAllergiesList.add(element); widget.myAllergiesList.add(element);
} }
}); });
/// remove items. /// remove items.
List<MySelectedAllergy> removedList= []; List<MySelectedAllergy> removedList = [];
widget.myAllergiesList.forEach((element) { widget.myAllergiesList.forEach((element) {
if ((mySelectedAllergy.singleWhere((it) => it.selectedAllergy.id == element.selectedAllergy.id, if ((mySelectedAllergy.singleWhere(
orElse: () => null)) == null) { (it) =>
it.selectedAllergy.id ==
element.selectedAllergy.id,
orElse: () => null)) ==
null) {
removedList.add(element); removedList.add(element);
}}); }
});
removedList.forEach((element) { removedList.forEach((element) {
removeAllergy(element); removeAllergy(element);
@ -201,18 +202,11 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
changeParentState(); changeParentState();
Navigator.of(context).pop(); Navigator.of(context).pop();
} else { } else {
Helpers.showErrorToast(TranslationBase Helpers.showErrorToast(
.of(context) TranslationBase.of(context).requiredMsg);
.requiredMsg);
} }
}); });
}); });
} }
} }

@ -4,6 +4,7 @@ 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_history.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.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/soap_utils.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.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';
@ -59,8 +60,8 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
appBar: BottomSheetTitle( appBar:
title: TranslationBase.of(context).addHistory), BottomSheetTitle(title: TranslationBase.of(context).addHistory),
body: Center( body: Center(
child: Container( child: Container(
child: Column( child: Column(
@ -166,42 +167,11 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
? Container( ? Container(
height: 0, height: 0,
) )
: Container( : BottomSheetDialogButton(
decoration: BoxDecoration( label: TranslationBase.of(context).addSelectedHistories,
color: Colors.white, onTap: () {
borderRadius: BorderRadius.all( widget.addSelectedHistories();
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,
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: Center(
child: AppButton(
title: TranslationBase.of(context)
.addSelectedHistories,
padding: 10,
color: Color(0xFF359846),
onPressed: () {
widget.addSelectedHistories();
},
),
),
),
),
SizedBox(
height: 5,
),
],
),
), ),
), ),
)); ));
@ -216,9 +186,11 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
if (myhistory.isEmpty) { if (myhistory.isEmpty) {
setState(() { setState(() {
MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory(remark: history.remarks ?? "", MySelectedHistory mySelectedHistory =
history: history, SoapUtils.generateMySelectedHistory(
isChecked: true); remark: history.remarks ?? "",
history: history,
isChecked: true);
widget.myHistoryList.add(mySelectedHistory); widget.myHistoryList.add(mySelectedHistory);
}); });

@ -1,6 +1,7 @@
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/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_history.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.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';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -40,17 +41,17 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return Column( return Column(
children: [ children: [
SOAPOpenItems(
SOAPOpenItems(label: "${TranslationBase.of(context).addHistory}",onTap: () { label: "${TranslationBase.of(context).addHistory}",
openHistoryList(context); onTap: () {
openHistoryList(context);
},), },
),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Container( Container(
margin: margin: EdgeInsets.only(left: 15, right: 15, top: 15),
EdgeInsets.only(left: 15, right: 15, top: 15),
child: Column( child: Column(
children: widget.myHistoryList.map((myHistory) { children: widget.myHistoryList.map((myHistory) {
return Column( return Column(
@ -60,42 +61,21 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
children: [ children: [
Container( Container(
child: AppText( child: AppText(
projectViewModel.isArabic projectViewModel.isArabic
? myHistory.selectedHistory.nameAr ? myHistory.selectedHistory.nameAr
: myHistory.selectedHistory.nameEn, : myHistory.selectedHistory.nameEn,
fontSize: 15, textDecoration: myHistory.isChecked
textDecoration: myHistory.isChecked ? null
? null : TextDecoration.lineThrough,
: TextDecoration.lineThrough, color: Color(0xFF2B353E),
color: Colors.black), fontSize: 12,
width: MediaQuery fontWeight: FontWeight.w700,
.of(context) letterSpacing: -0.48,
.size ),
.width * 0.5, width: MediaQuery.of(context).size.width * 0.5,
), ),
if (myHistory.isChecked) if (myHistory.isChecked)
InkWell( RemoveButton(
child: Row(
children: [
Container(
child: AppText(
TranslationBase
.of(context)
.remove,
fontSize: 15,
variant: "bodyText",
textDecoration: myHistory.isChecked
? null
: TextDecoration.lineThrough,
color: HexColor("#B8382C"),),
),
Icon(
FontAwesomeIcons.times,
color: HexColor("#B8382C"),
size: 17,
),
],
),
onTap: () => removeHistory(myHistory.selectedHistory), onTap: () => removeHistory(myHistory.selectedHistory),
) )
], ],
@ -114,17 +94,15 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
removeHistory(MasterKeyModel historyKey) { removeHistory(MasterKeyModel historyKey) {
List<MySelectedHistory> history = List<MySelectedHistory> history =
// ignore: missing_return // ignore: missing_return
widget.myHistoryList.where((element) => widget.myHistoryList
historyKey.id == .where((element) =>
element.selectedHistory.id && historyKey.id == element.selectedHistory.id &&
historyKey.typeId == historyKey.typeId == element.selectedHistory.typeId)
element.selectedHistory.typeId .toList();
).toList();
if (history.length > 0) { if (history.length > 0) {
if(history.first.isLocal) { if (history.first.isLocal) {
setState(() { setState(() {
widget.myHistoryList.remove(history.first); widget.myHistoryList.remove(history.first);
}); });
@ -133,9 +111,7 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
history[0].isChecked = false; history[0].isChecked = false;
}); });
} }
} }
} }
openHistoryList(BuildContext context) { openHistoryList(BuildContext context) {
@ -162,6 +138,3 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
}); });
} }
} }

@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.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/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_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/bottom_sheet_dialog_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_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -386,55 +387,27 @@ class _AddMedicationState extends State<AddMedication> {
]), ]),
), ),
), ),
bottomSheet:model.state == ViewState.Busy?Container(height: 0,): Container( bottomSheet:model.state == ViewState.Busy?Container(height: 0,):
decoration: BoxDecoration( BottomSheetDialogButton(
color: Colors.white, label: TranslationBase.of(context)
borderRadius: BorderRadius.all( .addMedication
Radius.circular(10.0), .toUpperCase(),
), onTap: () {
border: Border.all(color: HexColor('#707070'), width: 0.30), setState(() {
), isFormSubmitted = true;
height: MediaQuery.of(context).size.height * 0.1, });
width: double.infinity, if (_selectedMedication != null &&
child: Column( _selectedMedicationDose != null &&
children: [ _selectedMedicationStrength != null &&
SizedBox( _selectedMedicationRoute != null &&
height: 10, _selectedMedicationFrequency != null) {
), widget.medicationController.text = widget
Container( .medicationController.text +
child: FractionallySizedBox( '${_selectedMedication.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n';
widthFactor: .80, Navigator.of(context).pop();
child: Center( }
child: AppButton( },
title: TranslationBase.of(context) )
.addMedication
.toUpperCase(),
color: Color(0xFF359846),
onPressed: () {
setState(() {
isFormSubmitted = true;
});
if (_selectedMedication != null &&
_selectedMedicationDose != null &&
_selectedMedicationStrength != null &&
_selectedMedicationRoute != null &&
_selectedMedicationFrequency != null) {
widget.medicationController.text = widget
.medicationController.text +
'${_selectedMedication.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n';
Navigator.of(context).pop();
}
},
),
),
),
),
SizedBox(
height: 5,
),
],
),
),
), ),
), ),
); );

@ -18,6 +18,7 @@ class AppText extends StatefulWidget {
final double marginRight; final double marginRight;
final double marginBottom; final double marginBottom;
final double marginLeft; final double marginLeft;
final double letterSpacing;
final TextAlign textAlign; final TextAlign textAlign;
final bool bold; final bool bold;
final bool regular; final bool regular;
@ -55,7 +56,7 @@ class AppText extends StatefulWidget {
this.allowExpand = true, this.allowExpand = true,
this.visibility = true, this.visibility = true,
this.textOverflow, this.textOverflow,
this.textDecoration, this.textDecoration, this.letterSpacing,
}); });
@override @override
@ -132,7 +133,7 @@ class _AppTextState extends State<AppText> {
widget.color != null ? widget.color : Colors.black, widget.color != null ? widget.color : Colors.black,
fontSize: widget.fontSize ?? _getFontSize(), fontSize: widget.fontSize ?? _getFontSize(),
letterSpacing: letterSpacing:
widget.variant == "overline" ? 1.5 : null, widget.letterSpacing??(widget.variant == "overline" ? 1.5 : null),
fontWeight: widget.fontWeight ?? _getFontWeight(), fontWeight: widget.fontWeight ?? _getFontWeight(),
fontFamily: widget.fontFamily ?? 'Poppins', fontFamily: widget.fontFamily ?? 'Poppins',
decoration: widget.textDecoration, decoration: widget.textDecoration,

@ -40,6 +40,8 @@ class MasterKeyCheckboxSearchWidget extends StatefulWidget {
class _MasterKeyCheckboxSearchWidgetState class _MasterKeyCheckboxSearchWidgetState
extends State<MasterKeyCheckboxSearchWidget> { extends State<MasterKeyCheckboxSearchWidget> {
List<MasterKeyModel> items = List(); List<MasterKeyModel> items = List();
TextEditingController filteredSearchController = TextEditingController();
@override @override
void initState() { void initState() {
@ -77,7 +79,7 @@ class _MasterKeyCheckboxSearchWidgetState
hintText: TranslationBase.of(context).searchHistory, hintText: TranslationBase.of(context).searchHistory,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
hasBorder: false, hasBorder: false,
// controller: filteredSearchController, controller: filteredSearchController,
onChanged: (value) { onChanged: (value) {
filterSearchResults(value); filterSearchResults(value);
}, },
@ -123,19 +125,17 @@ class _MasterKeyCheckboxSearchWidgetState
}); });
}), }),
Expanded( Expanded(
child: Padding( child: AppText(
padding: const EdgeInsets.symmetric( projectViewModel.isArabic
horizontal: 10, vertical: 0), ? historyInfo.nameAr != ""
child: AppText( ? historyInfo.nameAr
projectViewModel.isArabic : historyInfo.nameEn
? historyInfo.nameAr != "" : historyInfo.nameEn,
? historyInfo.nameAr
: historyInfo.nameEn color: Color(0xFF575757),
: historyInfo.nameEn, fontSize: 14,
color: Color(0xFF575757), fontWeight: FontWeight.w600,
fontSize: 16, letterSpacing: -0.56,
fontWeight: FontWeight.w600,
),
), ),
), ),
], ],

Loading…
Cancel
Save