Merge branch 'fix_issues' into 'development'

Fix issues

See merge request Cloud_Solution/doctor_app_flutter!293
merge-requests/294/merge
Mohammad Aljammal 4 years ago
commit 05ed1202fe

@ -419,93 +419,6 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
SizedBox(
height: 10,
),
Container(
height: 40.0,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(
width: 1.0,
style: BorderStyle.solid,
color: HexColor("#CCCCCC")),
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
),
),
width: double.infinity,
child: Padding(
padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9,
bottom: SizeConfig.widthMultiplier * 0.9,
right: SizeConfig.widthMultiplier * 3,
left: SizeConfig.widthMultiplier * 3),
child: Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Expanded(
// add Expanded to have your dropdown button fill remaining space
child: DropdownButtonHideUnderline(
child: DropdownButton(
isExpanded: true,
value: _selectedLocation,
iconSize: 25,
elevation: 16,
selectedItemBuilder:
(BuildContext context) {
return LOCATIONS.map((item) {
return Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
!projectsProvider.isArabic
? AppText(
item['text'],
fontSize: SizeConfig
.textMultiplier *
2.1,
)
: AppText(
item['text-ar'],
fontSize: SizeConfig
.textMultiplier *
2.1,
)
],
);
}).toList();
},
onChanged: (String newValue) {
setState(() {
_selectedLocation = newValue;
});
if (newValue == '1')
{
_patientSearchFormValues
.PatientOutSA = false;
}
else
{
_patientSearchFormValues
.PatientOutSA = true;
}
},
items: LOCATIONS.map((item) {
!projectsProvider.isArabic
? itemText2 = item['text']
: itemText2 = item['text-ar'];
return DropdownMenuItem(
child: Text(
itemText2,
textAlign: TextAlign.end,
),
value: item['val'],
);
}).toList(),
)),
),
],
),
),
),
SizedBox(
height: 10,
),

@ -49,7 +49,7 @@ class _LabOrdersScreenState extends State<LabOrdersScreen> {
patientID: patient.patientId,
projectID: patient.projectId,
tokenID: token,
patientTypeID: patient.patientType,
patientTypeID: patient.patientType??1,
languageID: 2);
model.getLabResultOrders(labOrdersReqModel.toJson());

@ -491,6 +491,10 @@ class AddAssessmentDetails extends StatefulWidget {
class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
TextEditingController remarkController = TextEditingController();
TextEditingController appointmentIdController = TextEditingController();
TextEditingController conditionController = TextEditingController();
TextEditingController typeController = TextEditingController();
TextEditingController icdNameController = TextEditingController();
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
bool isFormSubmitted = false;
@ -501,31 +505,52 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
remarkController.text = widget.mySelectedAssessment.remark ?? "";
appointmentIdController.text =
widget.mySelectedAssessment.appointmentId.toString();
final screenSize = MediaQuery
.of(context)
.size;
InputDecoration textFieldSelectorDecoration(String hintText,
String selectedText, bool isDropDown, {IconData icon}) {
//TODO: make one Input InputDecoration for all
if(widget.isUpdate){
if(widget.mySelectedAssessment
.selectedDiagnosisCondition != null)
conditionController.text = projectViewModel.isArabic
? widget.mySelectedAssessment
.selectedDiagnosisCondition
.nameAr
: widget.mySelectedAssessment
.selectedDiagnosisCondition
.nameEn;
if(widget.mySelectedAssessment
.selectedDiagnosisType !=null)
typeController.text = projectViewModel.isArabic
? widget.mySelectedAssessment
.selectedDiagnosisType
.nameAr
: widget.mySelectedAssessment
.selectedDiagnosisType
.nameEn;
if(widget.mySelectedAssessment.selectedICD !=null)
icdNameController.text = widget.mySelectedAssessment.selectedICD.code;
}
final screenSize = MediaQuery.of(context).size;
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{IconData icon}) {
return InputDecoration(
contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderSide: BorderSide(color: Colors.grey, width: 1.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderSide: BorderSide(color: Colors.grey, width: 1.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderSide: BorderSide(color: Colors.grey, width: 1.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown ? Icon(icon??Icons.arrow_drop_down) : null,
suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
fontSize: 10,
color: Theme.of(context).hintColor,
fontWeight: FontWeight.w700),
);
}
return FractionallySizedBox(
@ -590,46 +615,109 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
height: 10,
),
Container(
height: screenSize.height * 0.070,
height: screenSize.height * 0.080,
child: InkWell(
onTap: model.listOfDiagnosisType != null
? () {
setState(() {
widget.mySelectedAssessment.selectedICD = null;
});
}
: null,
onTap: model.listOfICD10 != null
? () {
setState(() {
widget.mySelectedAssessment
.selectedICD = null;
icdNameController.text = null;
});
}
: null,
child: widget.mySelectedAssessment.selectedICD == null ? AutoCompleteTextField<MasterKeyModel>(
decoration: textFieldSelectorDecoration(TranslationBase.of(context).nameOrICD, widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.nameEn : null, true,icon: EvaIcons.search),
itemSubmitted: (item) => setState(() => widget.mySelectedAssessment.selectedICD = item),
decoration: textFieldSelectorDecoration(
TranslationBase
.of(context)
.nameOrICD,
widget.mySelectedAssessment.selectedICD !=
null ? widget.mySelectedAssessment
.selectedICD.nameEn : null, true,
icon: EvaIcons.search),
itemSubmitted: (item) =>
setState(()
{
widget.mySelectedAssessment
.selectedICD = item;
icdNameController.text =item.code;
}),
key: key,
suggestions: model.listOfICD10,
itemBuilder: (context, suggestion) => new Padding(
child:Texts( suggestion.description +" / "+ suggestion.code.toString()),
itemBuilder: (context, suggestion) =>
new Padding(
child: Texts(
suggestion.description + " / " +
suggestion.code.toString()),
padding: EdgeInsets.all(8.0)),
itemSorter: (a, b) => 1,
itemFilter: (suggestion, input) =>
suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||suggestion.description.toLowerCase().startsWith(input.toLowerCase())
||suggestion.code.toLowerCase().startsWith(input.toLowerCase())
suggestion.description.toLowerCase().startsWith(
input.toLowerCase()) ||
suggestion.description.toLowerCase()
.startsWith(input.toLowerCase())
|| suggestion.code.toLowerCase().startsWith(
input.toLowerCase())
,
): TextField(
decoration: textFieldSelectorDecoration(
widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.code :"Name or ICD",
widget.mySelectedAssessment.selectedICD != null ? projectViewModel.isArabic?widget.mySelectedAssessment.selectedICD.nameAr:widget.mySelectedAssessment.selectedICD.nameEn : null, true,icon: EvaIcons.search),
enabled: false,
),
),
)
: TextFields(
onTapTextFields: model.listOfICD10 != null
? () {
setState(() {
widget.mySelectedAssessment.selectedICD =
null;
icdNameController.text = null;
});
}
: null,
hasLabelText: icdNameController.text !=
'' ? true : false,
showLabelText: true,
hintText: TranslationBase
.of(context)
.nameOrICD,
fontSize: 13.5,
readOnly: true,
fontWeight: FontWeight.w600,
maxLines: 2,
minLines: 1,
controller: icdNameController,
suffixIcon: EvaIcons.search,
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
})
// TextField(
// decoration: textFieldSelectorDecoration(
// widget.mySelectedAssessment.selectedICD !=
// null ? widget.mySelectedAssessment
// .selectedICD.code : "Name or ICD",
// widget.mySelectedAssessment.selectedICD !=
// null ? projectViewModel.isArabic
// ? widget.mySelectedAssessment
// .selectedICD.nameAr
// : widget.mySelectedAssessment
// .selectedICD.nameEn : null, true,
// icon: EvaIcons.search),
// enabled: false,
// ),
),
),
if(isFormSubmitted && widget.mySelectedAssessment
.selectedICD == null)
if(isFormSubmitted &&
widget.mySelectedAssessment
.selectedICD == null)
CustomValidationError(),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.listOfDiagnosisCondition !=
TextFields(
onTapTextFields: model
.listOfDiagnosisCondition !=
null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
@ -643,6 +731,14 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
widget.mySelectedAssessment
.selectedDiagnosisCondition =
selectedValue;
conditionController.text =
projectViewModel.isArabic
? widget.mySelectedAssessment
.selectedDiagnosisCondition
.nameAr
: widget.mySelectedAssessment
.selectedDiagnosisCondition
.nameEn;
});
},
);
@ -655,32 +751,39 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).condition,
widget.mySelectedAssessment
.selectedDiagnosisCondition != null
? projectViewModel.isArabic?widget.mySelectedAssessment
.selectedDiagnosisCondition
.nameAr:widget.mySelectedAssessment
.selectedDiagnosisCondition
.nameEn
: null,
true),
enabled: false,
),
),
),
if(isFormSubmitted && widget.mySelectedAssessment
.selectedDiagnosisCondition == null)
hasLabelText: conditionController.text !=
'' ? true : false,
showLabelText: true,
hintText: TranslationBase
.of(context)
.condition,
fontSize: 13.5,
readOnly: true,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 2,
minLines: 1,
controller: conditionController,
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
}),
if(isFormSubmitted &&
widget.mySelectedAssessment
.selectedDiagnosisCondition == null)
CustomValidationError(),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.listOfDiagnosisType != null
TextFields(
onTapTextFields: model
.listOfDiagnosisType != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisType,
@ -695,6 +798,12 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
widget.mySelectedAssessment
.selectedDiagnosisType =
selectedValue;
typeController.text =
projectViewModel.isArabic
? selectedValue
.nameAr
: selectedValue
.nameEn;
});
},
);
@ -707,22 +816,30 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).dType,
widget.mySelectedAssessment
.selectedDiagnosisType != null
?projectViewModel.isArabic?widget.mySelectedAssessment
.selectedDiagnosisType.nameAr: widget.mySelectedAssessment
.selectedDiagnosisType.nameEn
: null,
true),
enabled: false,
),
),
),
if(isFormSubmitted && widget.mySelectedAssessment
.selectedDiagnosisType == null)
hasLabelText: typeController.text !=
'' ? true : false,
showLabelText: true,
hintText: TranslationBase
.of(context)
.dType,
fontSize: 13.5,
readOnly: true,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 2,
minLines: 1,
controller: typeController,
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
}),
if(isFormSubmitted &&
widget.mySelectedAssessment
.selectedDiagnosisType == null)
CustomValidationError(),
SizedBox(
height: 10,
@ -731,17 +848,21 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
margin: EdgeInsets.only(
left: 0, right: 0, top: 15),
child: TextFields(
hintText: TranslationBase.of(context).remarks,
hintText: TranslationBase
.of(context)
.remarks,
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 18,
minLines: 5,
hasLabelText: remarkController.text != ''?true:false,
hasLabelText: remarkController.text !=
'' ? true : false,
showLabelText: true,
controller: remarkController,
onChanged:(value) {
widget.mySelectedAssessment.remark = remarkController.text;
onChanged: (value) {
widget.mySelectedAssessment.remark =
remarkController.text;
},
validator: (value) {
if (value == null)

@ -559,7 +559,7 @@ packages:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.4"
version: "1.3.0-nullsafety.3"
mime:
dependency: transitive
description:
@ -830,7 +830,7 @@ packages:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0-nullsafety.2"
version: "1.10.0-nullsafety.1"
stream_channel:
dependency: transitive
description:
@ -965,5 +965,5 @@ packages:
source: hosted
version: "2.2.1"
sdks:
dart: ">=2.10.0 <=2.11.0-213.1.beta"
dart: ">=2.10.0 <2.11.0"
flutter: ">=1.22.0 <2.0.0"

Loading…
Cancel
Save