Merge branch 'soap_new_design' into 'development'

Soap new design

See merge request Cloud_Solution/doctor_app_flutter!444
merge-requests/445/merge
Mohammad Aljammal 5 years ago
commit 4af6e45c97

@ -517,7 +517,7 @@ const Map<String, Map<String, String>> localizedValues = {
'addHistory': {'en': "Add History", 'ar': "اضافه تاريخ مرضي"},
'searchHistory': {'en': "Search History", 'ar': " البحث"},
'addSelectedHistories': {
'en': "add selected histories",
'en': "Add Selected Histories",
'ar': " اضافه تاريخ مرضي"
},
'addAllergies': {'en': "Add Allergies", 'ar': "أضف الحساسية"},
@ -829,6 +829,8 @@ const Map<String, Map<String, String>> localizedValues = {
"typeHereToReply": {
"en": "Type here to reply",
"ar": "اكتب هنا للرد"
},"remove": {
"en": "Remove",
"ar": "حذف"
},
"remove": {"en": "Remove", "ar": " حذف"},
};

@ -11,9 +11,10 @@ class ExpandableSOAPWidget extends StatelessWidget {
final Widget child;
final Function onTap;
final headerTitle;
final bool isRequired;
const ExpandableSOAPWidget(
{Key key, this.isExpanded, this.child, this.onTap, this.headerTitle})
{Key key, this.isExpanded, this.child, this.onTap, this.headerTitle, this.isRequired= true})
: super(key: key);
@override
@ -37,9 +38,10 @@ class ExpandableSOAPWidget extends StatelessWidget {
children: [
Texts(headerTitle,
variant: isExpanded ? "bodyText" : '',
bold: isExpanded ? true : false,
// bold: isExpanded ? true : false,
fontSize: 15,
color: Colors.black),
if(isRequired)
Icon(
FontAwesomeIcons.asterisk,
color: AppGlobal.appPrimaryColor,

@ -0,0 +1,93 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
class PriorityBar extends StatefulWidget {
final Function onTap;
const PriorityBar({Key key, this.onTap}) : super(key: key);
@override
_PriorityBarState createState() => _PriorityBarState();
}
class _PriorityBarState extends State<PriorityBar> {
int _activePriority = 0;
int index = -1;
List<String> _priorities = [
"Family",
"Surgical/Sports",
"Medical",
];
List<String> _prioritiesAr = [
"أسرة",
"جراحي / رياضي",
"طبي",
];
BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) {
return BoxDecoration();
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
ProjectViewModel projectViewModel = Provider.of(context);
return Container(
height: screenSize.height * 0.080,
child: Row(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: _priorities.map((
item,
) {
bool _isActive = _priorities[_activePriority] == item ? true : false;
if (index < 2) {
index++;
}
return Expanded(
child: InkWell(
child: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
height: screenSize.height * 0.070,
decoration: containerBorderDecoration(
_isActive ? HexColor("#B8382B") : Colors.white,
_isActive ? HexColor("#B8382B") : Colors.white),
child: Center(
child: Text(
(projectViewModel.isArabic)
? _prioritiesAr[index]
: item,
style: TextStyle(
fontSize: 15,
color: Colors.black, //Colors.black,
fontWeight: FontWeight.bold,
),
),
),
),
if(_isActive)
Container(width: 120,height: 4,color: AppGlobal.appPrimaryColor,)
],
),
),
onTap: () {
widget.onTap(_priorities.indexOf(item));
setState(() {
_activePriority = _priorities.indexOf(item);
});
}),
);
}).toList(),
),
);
}
}

@ -1,5 +1,4 @@
import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
@ -17,6 +16,7 @@ import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dar
import 'package:eva_icons_flutter/eva_icons_flutter.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 '../custom_validation_error.dart';
@ -41,21 +41,21 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields(
hintText: TranslationBase.of(context).addAllergies,
borderColor: HexColor('#707070'),
borderWidth: 0.30,
fontSize: 13.5,
borderRadius: 12,
onTapTextFields: () {
openAllergiesList(context);
},
readOnly: true,
// hintColor: Colors.black,
suffixIcon: EvaIcons.plusCircleOutline,
suffixIconColor: AppGlobal.appPrimaryColor,
suffixIconColor: Color(0xFF2B353E),
fontWeight: FontWeight.w600,
// controller: messageController,
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
return TranslationBase.of(context).emptyMessage;
else
return null;
}),
@ -80,36 +80,59 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: Texts(
projectViewModel.isArabic
? selectedAllergy.selectedAllergy.nameAr
: selectedAllergy.selectedAllergy.nameEn
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
projectViewModel.isArabic
? selectedAllergy.selectedAllergy.nameAr
: selectedAllergy.selectedAllergy.nameEn
.toUpperCase(),
variant: "bodyText",
textDecoration: selectedAllergy.isChecked
? null
: TextDecoration.lineThrough,
bold: true,
color: Colors.black),
width: MediaQuery.of(context).size.width * 0.5,
// variant: "bodyText",
textDecoration: selectedAllergy.isChecked
? null
: TextDecoration.lineThrough,
bold: true,
color: Color(0xFF2B353E)),
Texts(
projectViewModel.isArabic
? selectedAllergy.selectedAllergySeverity
.nameAr
: selectedAllergy.selectedAllergySeverity
.nameEn
.toUpperCase(),
// variant: "bodyText",
textDecoration: selectedAllergy.isChecked
? null
: TextDecoration.lineThrough,
// bold: true,
color: Color(0xFFCC9B14)),
],
),
width: MediaQuery
.of(context)
.size
.width * 0.5,
),
Texts(
projectViewModel.isArabic
? selectedAllergy.selectedAllergySeverity.nameAr
: selectedAllergy.selectedAllergySeverity.nameEn
.toUpperCase(),
variant: "bodyText",
textDecoration: selectedAllergy.isChecked
? null
: TextDecoration.lineThrough,
bold: true,
color: AppGlobal.appPrimaryColor),
if (selectedAllergy.isChecked)
InkWell(
child: Icon(
FontAwesomeIcons.trash,
color: Colors.grey,
size: 20,
child: Row(
children: [Container(
child: Texts(
TranslationBase
.of(context)
.remove,
fontSize: 15,
variant: "bodyText",
color: HexColor("#B8382C"),),
),
Icon(
FontAwesomeIcons.times,
color: HexColor("#B8382C"),
size: 20,
),
],
),
onTap: () => removeAllergy(selectedAllergy),
)
@ -119,14 +142,6 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
padding: const EdgeInsets.symmetric(vertical: 8),
child: Row(
children: [
AppText(
selectedAllergy.remark != null &&
selectedAllergy.remark != ''
? TranslationBase.of(context).remarks + " : "
: '',
fontWeight: FontWeight.bold,
fontSize: 13,
),
Container(
width: MediaQuery.of(context).size.width * 0.55,
child: AppText(

@ -1,4 +1,4 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
@ -17,6 +17,8 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import 'PriorityBar.dart';
class UpdateHistoryWidget extends StatefulWidget {
final List<MySelectedHistory> myHistoryList;
@ -51,20 +53,21 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields(
hintText: TranslationBase.of(context).addHistory,
borderColor: HexColor('#707070'),
borderWidth: 0.30,
fontSize: 13.5,
borderRadius: 12,
onTapTextFields: () {
openHistoryList(context);
},
readOnly: true,
// hintColor: Colors.black,
suffixIcon: EvaIcons.plusCircleOutline,
suffixIconColor: AppGlobal.appPrimaryColor,
suffixIconColor: Color(0xFF2B353E),
readOnly: true,
fontWeight: FontWeight.w600,
// controller: messageController,
validator: (value) {
if (value == null)
return TranslationBase.of(context)
.emptyMessage;
return TranslationBase.of(context).emptyMessage;
else
return null;
}),
@ -87,20 +90,41 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
projectViewModel.isArabic
? myHistory.selectedHistory.nameAr
: myHistory.selectedHistory.nameEn,
variant: "bodyText",
fontSize: 15,
textDecoration: myHistory.isChecked
? null
: TextDecoration.lineThrough,
bold: true,
// bold: true,
color: Colors.black),
width: MediaQuery.of(context).size.width * 0.7,
width: MediaQuery
.of(context)
.size
.width * 0.5,
),
if (myHistory.isChecked)
InkWell(
child: Icon(
FontAwesomeIcons.trash,
color: Colors.grey,
size: 20,
child: Row(
children: [
Container(
child: Texts(
TranslationBase
.of(context)
.remove,
fontSize: 15,
variant: "bodyText",
textDecoration: myHistory.isChecked
? null
: TextDecoration.lineThrough,
// bold: true,
color: HexColor("#B8382C"),),
// width: MediaQuery.of(context).size.width * 0.3,
),
Icon(
FontAwesomeIcons.times,
color: HexColor("#B8382C"),
size: 17,
),
],
),
onTap: () => removeHistory(myHistory.selectedHistory),
)
@ -142,111 +166,29 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
openHistoryList(BuildContext context) {
showModalBottomSheet(
backgroundColor: Colors.white,
isDismissible: false,
isScrollControlled: true,
context: context,
builder: (context) {
return AddHistoryDialog(
changePageViewIndex: changePageViewIndex,
controller: _controller,
myHistoryList: widget.myHistoryList,
addSelectedHistories: () {
setState(() {
Navigator.of(context).pop();
});
},
removeHistory: (masterKey) => removeHistory(masterKey),
return FractionallySizedBox(
heightFactor: 1,
child: AddHistoryDialog(
changePageViewIndex: changePageViewIndex,
controller: _controller,
myHistoryList: widget.myHistoryList,
addSelectedHistories: () {
setState(() {
Navigator.of(context).pop();
});
},
removeHistory: (masterKey) => removeHistory(masterKey),
),
);
});
}
}
class PriorityBar extends StatefulWidget {
final Function onTap;
const PriorityBar({Key key, this.onTap}) : super(key: key);
@override
_PriorityBarState createState() => _PriorityBarState();
}
class _PriorityBarState extends State<PriorityBar> {
int _activePriority = 0;
int index =-1;
List<String> _priorities = [
"Family",
"Surgical/Sports",
"Medical",
];
List<String> _prioritiesAr = [
"أسرة",
"جراحي / رياضي" ,
"طبي",
];
BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) {
return BoxDecoration(
color: containerColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(6)),
border: Border.fromBorderSide(BorderSide(
color: borderColor,
width: 2.0,
)),
);
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
ProjectViewModel projectViewModel = Provider.of(context);
return Container(
height: screenSize.height * 0.070,
decoration:
containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)),
child: Row(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: _priorities.map((item,) {
bool _isActive = _priorities[_activePriority] == item ? true : false;
if(index <2){
index++;
}
return Expanded(
child: InkWell(
child: Center(
child: Container(
height: screenSize.height * 0.070,
decoration: containerBorderDecoration(
_isActive ? HexColor("#B8382B") : Colors.white,
_isActive ? HexColor("#B8382B") : Colors.white),
child: Center(
child: Text(
(projectViewModel.isArabic)?_prioritiesAr[index]: item,
style: TextStyle(
fontSize: 12,
color: _isActive
? Colors.white
: Colors.black, //Colors.black,
fontWeight: FontWeight.bold,
),
),
)),
),
onTap: () {
widget.onTap(_priorities.indexOf(item));
setState(() {
_activePriority = _priorities.indexOf(item);
});
}),
);
}).toList(),
),
);
}
}
class AddHistoryDialog extends StatefulWidget {
final Function changePageViewIndex;
@ -267,7 +209,7 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
@override
Widget build(BuildContext context) {
return FractionallySizedBox(
heightFactor: 0.7,
heightFactor: 1,
child: BaseView<SOAPViewModel>(
onModelReady: (model) async {
if (model.historyFamilyList.length == 0) {
@ -288,20 +230,66 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
isShowAppBar: false,
body: Center(
child: Container(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
children: [
SizedBox(
height: 10,
child: Column(
children: [
Container(
padding: EdgeInsets.only(
left: 0, right: 5, bottom: 5, top: 5),
decoration: BoxDecoration(
color: Colors.white,
),
PriorityBar(onTap: (activePriority) async {
widget.changePageViewIndex(activePriority);
}),
SizedBox(
height: 20,
),
Expanded(
height: 115,
child: Container(
padding: EdgeInsets.only(
left: 10, right: 10),
margin: EdgeInsets.only(top: 40),
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
RichText(
text: TextSpan(
style: TextStyle(
fontSize:20,
color: Colors.black),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).addHistory,
style: TextStyle(
color: Color(0xFF2B353E),
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 20)),
],
),
),
InkWell(
onTap: () {
Navigator.pop(context);
},
child: Icon(FontAwesomeIcons.times,
size: 30,
color: Color(0xFF2B353E)))
],
),
],
),
),
),
SizedBox(
height: 10,
),
PriorityBar(onTap: (activePriority) async {
widget.changePageViewIndex(activePriority);
}),
SizedBox(
height: 20,
),
Expanded(
child: FractionallySizedBox(
widthFactor: 0.9,
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: widget.controller,
@ -381,9 +369,9 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
],
),
),
),
],
),
)),
)),
),
),
));

@ -263,6 +263,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
headerTitle: TranslationBase
.of(context)
.histories,
isRequired: false,
onTap: () {
setState(() {
isHistoryExpand = !isHistoryExpand;
@ -285,6 +286,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
.of(context)
.allergiesSoap
,
isRequired: false,
onTap: () {
setState(() {
isAllergiesExpand = !isAllergiesExpand;
@ -337,6 +339,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
title: TranslationBase
.of(context)
.next,
fontWeight: FontWeight.bold,
loading: model.state == ViewState.BusyLocal,
onPressed: () async {
addSubjectiveInfo(

@ -9,13 +9,13 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/steps_widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_assessment_page.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/widgets/patients/profile/soap_update/objective/update_objective_page.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_plan_page.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../patient-profile-header-new-design.dart';
import 'objective/update_objective_page.dart';
class UpdateSoapIndex extends StatefulWidget {
final bool isUpdate;

@ -75,7 +75,7 @@ class _AppButtonState extends State<AppButton> {
),
)
: AppText(
widget.title.toUpperCase(),
widget.title,
color: widget.fontColor,
fontSize: SizeConfig.textMultiplier * widget.fontSize,
fontWeight: widget.fontWeight,

@ -13,6 +13,8 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'app_texts_widget.dart';
class MasterKeyCheckboxSearchWidget extends StatefulWidget {
final SOAPViewModel model;
final Function addSelectedHistories;
@ -49,80 +51,103 @@ class _MasterKeyCheckboxSearchWidgetState extends State<MasterKeyCheckboxSearchW
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Container(
child: Column(
children: [
Container(
height: MediaQuery.of(context).size.height * 0.5,
child: Center(
child: Container(
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: ListView(
children: [
TextFields(
hintText: widget.hintSearchText ?? TranslationBase
.of(context)
.searchHistory,
suffixIcon: EvaIcons.search,
onChanged: (value) {
filterSearchResults(value);
},
),
SizedBox(height: 15,),
Column(
children: items.map((historyInfo) {
return Column(
children: [
Row(
Expanded(
child: Container(
height: MediaQuery.of(context).size.height * 0.62,
child: Center(
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: ListView(
children: [
TextFields(
hintText: widget.hintSearchText ?? TranslationBase
.of(context)
.searchHistory,
borderWidth: 0.0,
padding: EdgeInsets.all(20),
borderRadius: 0,
suffixIcon: EvaIcons.search,
onChanged: (value) {
filterSearchResults(value);
},
),
// SizedBox(height: 15,),
DividerWithSpacesAround(),
Container(
// padding:EdgeInsets.all(20),
child: Column(
children: items.map((historyInfo) {
return Column(
children: [
Checkbox(
value:
widget.isServiceSelected(historyInfo),
activeColor: Colors.red[800],
onChanged: (bool newValue) {
setState(() {
if (widget
.isServiceSelected(historyInfo)) {
widget.removeHistory(historyInfo);
} else {
widget.addHistory(historyInfo);
}
});
}),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 0),
child: Texts(projectViewModel.isArabic
? historyInfo.nameAr!=""?historyInfo.nameAr:historyInfo.nameEn
: historyInfo.nameEn,
variant: "bodyText",
bold: true,
color: Colors.black),
InkWell(
onTap:(){
setState(() {
if (widget
.isServiceSelected(historyInfo)) {
widget.removeHistory(historyInfo);
} else {
widget.addHistory(historyInfo);
}
});
},
child: Row(
children: [
Checkbox(
value:
widget.isServiceSelected(historyInfo),
activeColor: Colors.red[800],
onChanged: (bool newValue) {
setState(() {
if (widget
.isServiceSelected(historyInfo)) {
widget.removeHistory(historyInfo);
} else {
widget.addHistory(historyInfo);
}
});
}),
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,
),
),
),
],
),
),
// DividerWithSpacesAround(),
],
),
DividerWithSpacesAround(),
],
);
}).toList(),
),
],
),
)),
);
}).toList(),
),
),
],
),
)),
),
),
SizedBox(
height: 10,
),
if (widget.model.state == ViewState.Idle)
AppButton(
title: widget.buttonName?? TranslationBase.of(context).addSelectedHistories.toUpperCase(),
title: widget.buttonName?? TranslationBase.of(context).addSelectedHistories,
padding: 10,
color: Color(0xFF359846),
onPressed: () {
widget.addSelectedHistories();
},

Loading…
Cancel
Save