Merge branch 'fix_issues' into 'development'

Fix issues

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

@ -419,93 +419,6 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
SizedBox( SizedBox(
height: 10, 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( SizedBox(
height: 10, height: 10,
), ),

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

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

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

Loading…
Cancel
Save