fix design issues on first step form create episode

episode_fixes
Elham Rababh 4 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/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/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/helpers.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(
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,
),
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(() {
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,
),
],
),
bottomSheet: model.state == ViewState.Busy?Container(height: 0,):
BottomSheetDialogButton(
label: TranslationBase.of(context)
.addMedication
.toUpperCase(),
onTap: () 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);
}
},
),
),
),

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

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

@ -21,12 +21,17 @@ class SOAPStepHeader extends StatelessWidget {
SizedBox(height: 15,),
AppText(
TranslationBase.of(context).createNew,
fontSize: 14,
fontWeight: FontWeight.w500,
fontSize: 12,
fontWeight: FontWeight.w700,
letterSpacing:-0.72,
color: Color(0xFF2E303A),
),
AppText(TranslationBase.of(context).episode,
fontSize: 26,
fontSize: 24,
fontWeight: FontWeight.bold,
letterSpacing:-1.44,
color: Color(0xFF2E303A),
),
Container(
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: [
AppText(headerTitle,
variant: isExpanded ? "bodyText" : '',
fontSize: 15,
color: Colors.black),
fontSize: 16,
letterSpacing:-0.64,
fontWeight: FontWeight.w700,
color: Color(0xFF2E303A),),
if(isRequired)
Icon(
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 {
static MySelectedHistory generateMySelectedHistory(
{history, isChecked, remark, isLocal}) {
{history, isChecked, remark, isLocal = true}) {
MySelectedHistory mySelectedHistory = MySelectedHistory(
selectedHistory: history,
isChecked: isChecked,
@ -19,7 +19,7 @@ class SoapUtils {
allergySeverity,
isChecked,
remark,
isLocal,
isLocal = true,
int createdBy,
bool isExpanded}) {
MySelectedAllergy mySelectedAllergy = MySelectedAllergy(
@ -38,7 +38,7 @@ class SoapUtils {
allergySeverity,
isChecked,
remark,
isLocal,
isLocal = true,
isNormal,
createdBy,
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/selected_items/my_selected_allergy.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/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -120,7 +121,6 @@ class _AddAllergiesState extends State<AddAllergies> {
addAllergyLocally(mySelectedAllergy);
},
addSelectedAllergy: () {
setState(() {
widget
.addAllergiesFun(myAllergiesListLocal);
@ -146,43 +146,13 @@ class _AddAllergiesState extends State<AddAllergies> {
? Container(
height: 0,
)
: 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,
),
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,
),
],
),
: BottomSheetDialogButton(
label: TranslationBase.of(context).addAllergies,
onTap: () {
setState(() {
widget.addAllergiesFun(myAllergiesListLocal);
});
},
),
),
),
@ -244,3 +214,4 @@ class _AddAllergiesState extends State<AddAllergies> {
}
}
}

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

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

@ -1,12 +1,11 @@
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/remove_button.dart';
import 'package:doctor_app_flutter/util/helpers.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/divider_with_spaces_around.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 '../../shared_soap_widgets/SOAP_open_items.dart';
@ -14,7 +13,7 @@ import 'add_allergies.dart';
// ignore: must_be_immutable
class UpdateAllergiesWidget extends StatefulWidget {
List<MySelectedAllergy> myAllergiesList;
List<MySelectedAllergy> myAllergiesList;
UpdateAllergiesWidget({Key key, this.myAllergiesList});
@ -27,28 +26,28 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
changeAllState() {
setState(() {
});
setState(() {});
}
return Column(
children: [
SOAPOpenItems(label: "${TranslationBase.of(context).addAllergies}",onTap: () {
openAllergiesList(context, changeAllState, removeAllergy);
},),
SOAPOpenItems(
label: "${TranslationBase.of(context).addAllergies}",
onTap: () {
openAllergiesList(context, changeAllState, removeAllergy);
},
),
SizedBox(
height: 20,
),
Container(
margin:
EdgeInsets.only(left: 15, right: 15, top: 15),
margin: EdgeInsets.only(left: 15, right: 15, top: 15),
child: Column(
children: widget.myAllergiesList.map((selectedAllergy) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -61,53 +60,41 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
projectViewModel.isArabic
? selectedAllergy.selectedAllergy.nameAr
: selectedAllergy.selectedAllergy.nameEn
.toUpperCase(),
textDecoration: selectedAllergy.isChecked
? null
: TextDecoration.lineThrough,
bold: true,
color: Color(0xFF2B353E)),
projectViewModel.isArabic
? selectedAllergy.selectedAllergy.nameAr
: selectedAllergy.selectedAllergy.nameEn
.toUpperCase(),
textDecoration: selectedAllergy.isChecked
? null
: TextDecoration.lineThrough,
bold: true,
color: Color(0xFF2B353E),
fontSize: 12,
fontWeight: FontWeight.w700,
letterSpacing: -0.48,
// fontHeight:0.18 ,
),
AppText(
projectViewModel.isArabic
? selectedAllergy.selectedAllergySeverity
.nameAr
: selectedAllergy.selectedAllergySeverity
.nameEn
.toUpperCase(),
textDecoration: selectedAllergy.isChecked
? null
: TextDecoration.lineThrough,
color: Color(0xFFCC9B14)),
projectViewModel.isArabic
? selectedAllergy
.selectedAllergySeverity.nameAr
: selectedAllergy
.selectedAllergySeverity.nameEn
.toUpperCase(),
textDecoration: selectedAllergy.isChecked
? null
: TextDecoration.lineThrough,
color: Color(0xFFCC9B14),
fontSize: 10,
fontWeight: FontWeight.w700,
letterSpacing: -0.48,
),
],
),
width: MediaQuery
.of(context)
.size
.width * 0.5,
width: MediaQuery.of(context).size.width * 0.5,
),
if (selectedAllergy.isChecked)
InkWell(
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,
),
],
),
RemoveButton(
onTap: () => removeAllergy(selectedAllergy),
)
],
@ -120,8 +107,10 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
width: MediaQuery.of(context).size.width * 0.55,
child: AppText(
selectedAllergy.remark ?? '',
color: Color(0xFF575757),
fontSize: 10,
color: Colors.grey,
fontWeight: FontWeight.w700,
letterSpacing: -0.4,
),
),
],
@ -143,15 +132,17 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
removeAllergy(MySelectedAllergy mySelectedAllergy) {
List<MySelectedAllergy> allergy =
// ignore: missing_return
widget.myAllergiesList.where((element) =>
mySelectedAllergy.selectedAllergySeverity.id ==
element.selectedAllergySeverity.id &&
mySelectedAllergy.selectedAllergy.id == element.selectedAllergy.id
).toList();
// ignore: missing_return
widget.myAllergiesList
.where((element) =>
mySelectedAllergy.selectedAllergySeverity.id ==
element.selectedAllergySeverity.id &&
mySelectedAllergy.selectedAllergy.id ==
element.selectedAllergy.id)
.toList();
if (allergy.length > 0) {
if(allergy.first.isLocal) {
if (allergy.first.isLocal) {
setState(() {
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(
backgroundColor: Colors.white,
isScrollControlled: true,
@ -170,7 +162,7 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
context: context,
builder: (context) {
return AddAllergies(
myAllergiesList: widget.myAllergiesList,
myAllergiesList: widget.myAllergiesList,
addAllergiesFun: (List<MySelectedAllergy> mySelectedAllergy) {
bool isAllDataFilled = true;
mySelectedAllergy.forEach((element) {
@ -181,19 +173,28 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
});
if (isAllDataFilled) {
mySelectedAllergy.forEach((element) {
if ((widget.myAllergiesList.singleWhere((it) => it.selectedAllergy.id == element.selectedAllergy.id,
orElse: () => null)) == null) {
if ((widget.myAllergiesList.singleWhere(
(it) =>
it.selectedAllergy.id ==
element.selectedAllergy.id,
orElse: () => null)) ==
null) {
widget.myAllergiesList.add(element);
}
});
/// remove items.
List<MySelectedAllergy> removedList= [];
List<MySelectedAllergy> removedList = [];
widget.myAllergiesList.forEach((element) {
if ((mySelectedAllergy.singleWhere((it) => it.selectedAllergy.id == element.selectedAllergy.id,
orElse: () => null)) == null) {
if ((mySelectedAllergy.singleWhere(
(it) =>
it.selectedAllergy.id ==
element.selectedAllergy.id,
orElse: () => null)) ==
null) {
removedList.add(element);
}});
}
});
removedList.forEach((element) {
removeAllergy(element);
@ -201,18 +202,11 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
changeParentState();
Navigator.of(context).pop();
} else {
Helpers.showErrorToast(TranslationBase
.of(context)
.requiredMsg);
Helpers.showErrorToast(
TranslationBase.of(context).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/selected_items/my_selected_history.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/util/translations_delegate_base.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(
baseViewModel: model,
isShowAppBar: true,
appBar: BottomSheetTitle(
title: TranslationBase.of(context).addHistory),
appBar:
BottomSheetTitle(title: TranslationBase.of(context).addHistory),
body: Center(
child: Container(
child: Column(
@ -166,42 +167,11 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
? Container(
height: 0,
)
: 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,
),
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,
),
],
),
: BottomSheetDialogButton(
label: TranslationBase.of(context).addSelectedHistories,
onTap: () {
widget.addSelectedHistories();
},
),
),
));
@ -216,9 +186,11 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
if (myhistory.isEmpty) {
setState(() {
MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory(remark: history.remarks ?? "",
history: history,
isChecked: true);
MySelectedHistory mySelectedHistory =
SoapUtils.generateMySelectedHistory(
remark: history.remarks ?? "",
history: history,
isChecked: true);
widget.myHistoryList.add(mySelectedHistory);
});

@ -1,6 +1,7 @@
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/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/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
@ -40,17 +41,17 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
ProjectViewModel projectViewModel = Provider.of(context);
return Column(
children: [
SOAPOpenItems(label: "${TranslationBase.of(context).addHistory}",onTap: () {
openHistoryList(context);
},),
SOAPOpenItems(
label: "${TranslationBase.of(context).addHistory}",
onTap: () {
openHistoryList(context);
},
),
SizedBox(
height: 20,
),
Container(
margin:
EdgeInsets.only(left: 15, right: 15, top: 15),
margin: EdgeInsets.only(left: 15, right: 15, top: 15),
child: Column(
children: widget.myHistoryList.map((myHistory) {
return Column(
@ -60,42 +61,21 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
children: [
Container(
child: AppText(
projectViewModel.isArabic
? myHistory.selectedHistory.nameAr
: myHistory.selectedHistory.nameEn,
fontSize: 15,
textDecoration: myHistory.isChecked
? null
: TextDecoration.lineThrough,
color: Colors.black),
width: MediaQuery
.of(context)
.size
.width * 0.5,
projectViewModel.isArabic
? myHistory.selectedHistory.nameAr
: myHistory.selectedHistory.nameEn,
textDecoration: myHistory.isChecked
? null
: TextDecoration.lineThrough,
color: Color(0xFF2B353E),
fontSize: 12,
fontWeight: FontWeight.w700,
letterSpacing: -0.48,
),
width: MediaQuery.of(context).size.width * 0.5,
),
if (myHistory.isChecked)
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,
),
],
),
RemoveButton(
onTap: () => removeHistory(myHistory.selectedHistory),
)
],
@ -114,17 +94,15 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
removeHistory(MasterKeyModel historyKey) {
List<MySelectedHistory> history =
// ignore: missing_return
widget.myHistoryList.where((element) =>
historyKey.id ==
element.selectedHistory.id &&
historyKey.typeId ==
element.selectedHistory.typeId
).toList();
// ignore: missing_return
widget.myHistoryList
.where((element) =>
historyKey.id == element.selectedHistory.id &&
historyKey.typeId == element.selectedHistory.typeId)
.toList();
if (history.length > 0) {
if(history.first.isLocal) {
if (history.first.isLocal) {
setState(() {
widget.myHistoryList.remove(history.first);
});
@ -133,9 +111,7 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
history[0].isChecked = false;
});
}
}
}
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/models/SOAP/master_key_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/bottom_sheet_dialog_button.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_texts_widget.dart';
@ -386,55 +387,27 @@ class _AddMedicationState extends State<AddMedication> {
]),
),
),
bottomSheet:model.state == ViewState.Busy?Container(height: 0,): Container(
decoration: BoxDecoration(
color: Colors.white,
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
.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,
),
],
),
),
bottomSheet:model.state == ViewState.Busy?Container(height: 0,):
BottomSheetDialogButton(
label: TranslationBase.of(context)
.addMedication
.toUpperCase(),
onTap: () {
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();
}
},
)
),
),
);

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

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

Loading…
Cancel
Save