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,33 +373,13 @@ 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 {
),
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(
fontWeight: FontWeight.w700,
color: Colors.green,
title: (widget.isUpdate
? 'Update Assessment Details'
: 'Add Assessment Details'),
loading: model.state == ViewState.BusyLocal,
onPressed: () async {
setState(() { setState(() {
isFormSubmitted = true; isFormSubmitted = true;
}); });
@ -423,15 +404,6 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
), ),
), ),
), ),
),
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';
@ -63,33 +64,14 @@ class ExaminationItemCard extends StatelessWidget {
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
.of(context)
.remove :TranslationBase
.of(context)
.notExamined,
fontSize: 15,
variant: "bodyText",
color: HexColor("#B8382C"),),
),
Icon(
FontAwesomeIcons.times,
color: HexColor("#B8382C"),
size: 20,
),
],
),
onTap: removeExamination, onTap: removeExamination,
), ),
], ],
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),

@ -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,30 +146,9 @@ 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(
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).addAllergies,
padding: 10,
color: Color(0xFF359846),
onPressed: () {
setState(() { setState(() {
widget.addAllergiesFun(myAllergiesListLocal); widget.addAllergiesFun(myAllergiesListLocal);
}); });
@ -177,15 +156,6 @@ class _AddAllergiesState extends State<AddAllergies> {
), ),
), ),
), ),
),
SizedBox(
height: 5,
),
],
),
),
),
),
); );
} }
@ -244,3 +214,4 @@ class _AddAllergiesState extends State<AddAllergies> {
} }
} }
} }

@ -74,9 +74,6 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
}), }),
InkWell( InkWell(
onTap:onTapItem, onTap:onTapItem,
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 10, vertical: 0),
child: Container( child: Container(
child: AppText( child: AppText(
projectViewModel.isArabic projectViewModel.isArabic
@ -85,13 +82,13 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
: widget.item.nameEn : widget.item.nameEn
: widget.item.nameEn, : widget.item.nameEn,
color: Color(0xFF575757), color: Color(0xFF575757),
fontSize: 16, fontSize: 14,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.56,
), ),
width: MediaQuery.of(context).size.width * 0.55, width: MediaQuery.of(context).size.width * 0.55,
), ),
), ),
),
], ],
), ),
InkWell( InkWell(
@ -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';
@ -27,22 +26,22 @@ 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(
label: "${TranslationBase.of(context).addAllergies}",
onTap: () {
openAllergiesList(context, changeAllState, removeAllergy); 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(
@ -69,45 +68,33 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
? 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,
), ),
), ),
], ],
@ -144,11 +133,13 @@ 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
.where((element) =>
mySelectedAllergy.selectedAllergySeverity.id == mySelectedAllergy.selectedAllergySeverity.id ==
element.selectedAllergySeverity.id && element.selectedAllergySeverity.id &&
mySelectedAllergy.selectedAllergy.id == element.selectedAllergy.id mySelectedAllergy.selectedAllergy.id ==
).toList(); element.selectedAllergy.id)
.toList();
if (allergy.length > 0) { if (allergy.length > 0) {
if (allergy.first.isLocal) { if (allergy.first.isLocal) {
@ -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,
@ -181,8 +173,12 @@ 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);
} }
}); });
@ -190,10 +186,15 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
/// 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,44 +167,13 @@ 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(
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(); widget.addSelectedHistories();
}, },
), ),
), ),
),
),
SizedBox(
height: 5,
),
],
),
),
),
)); ));
} }
@ -216,7 +186,9 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
if (myhistory.isEmpty) { if (myhistory.isEmpty) {
setState(() { setState(() {
MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory(remark: history.remarks ?? "", MySelectedHistory mySelectedHistory =
SoapUtils.generateMySelectedHistory(
remark: history.remarks ?? "",
history: history, history: history,
isChecked: true); isChecked: true);

@ -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}",
onTap: () {
openHistoryList(context); 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(
@ -63,39 +64,18 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
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: Colors.black), color: Color(0xFF2B353E),
width: MediaQuery fontSize: 12,
.of(context) fontWeight: FontWeight.w700,
.size letterSpacing: -0.48,
.width * 0.5,
), ),
if (myHistory.isChecked) width: MediaQuery.of(context).size.width * 0.5,
InkWell(
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,
),
],
), ),
if (myHistory.isChecked)
RemoveButton(
onTap: () => removeHistory(myHistory.selectedHistory), onTap: () => removeHistory(myHistory.selectedHistory),
) )
], ],
@ -115,13 +95,11 @@ 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) {
@ -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,31 +387,12 @@ 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(
Radius.circular(10.0),
),
border: Border.all(color: HexColor('#707070'), width: 0.30),
),
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)
.addMedication .addMedication
.toUpperCase(), .toUpperCase(),
color: Color(0xFF359846), onTap: () {
onPressed: () {
setState(() { setState(() {
isFormSubmitted = true; isFormSubmitted = true;
}); });
@ -425,16 +407,7 @@ class _AddMedicationState extends State<AddMedication> {
Navigator.of(context).pop(); 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(
padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 0),
child: AppText( child: AppText(
projectViewModel.isArabic projectViewModel.isArabic
? historyInfo.nameAr != "" ? historyInfo.nameAr != ""
? historyInfo.nameAr ? historyInfo.nameAr
: historyInfo.nameEn : historyInfo.nameEn
: historyInfo.nameEn, : historyInfo.nameEn,
color: Color(0xFF575757), color: Color(0xFF575757),
fontSize: 16, fontSize: 14,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), letterSpacing: -0.56,
), ),
), ),
], ],

Loading…
Cancel
Save