Merge branch 'fix_issues' into 'development'

Fix issues

See merge request Cloud_Solution/doctor_app_flutter!285
merge-requests/286/merge
Mohammad Aljammal 5 years ago
commit 44152e8a74

@ -689,12 +689,15 @@ const Map<String, Map<String, String>> localizedValues = {
'years': {'en': "Years", 'ar': "سنين"}, 'years': {'en': "Years", 'ar': "سنين"},
'hr': {'en': "HR", 'ar': "س"}, 'hr': {'en': "HR", 'ar': "س"},
'min': {'en': "Min", 'ar': "د"}, 'min': {'en': "Min", 'ar': "د"},
'appointmentNumber': {'en': "Appointment Number", 'ar': "رقم الموعد"},
'referralStatusHold': {'en': "Hold", 'ar': "معلق"}, 'referralStatusHold': {'en': "Hold", 'ar': "معلق"},
'referralStatusActive': {'en': "Active", 'ar': "نشط"}, 'referralStatusActive': {'en': "Active", 'ar': "نشط"},
'referralStatusCancelled': {'en': "Cancelled", 'ar': "ملغاة"}, 'referralStatusCancelled': {'en': "Cancelled", 'ar': "ملغاة"},
'referralStatusCompleted': {'en': "Completed", 'ar': "مكتمل"}, 'referralStatusCompleted': {'en': "Completed", 'ar': "مكتمل"},
'referralStatusNotSeen': {'en': "NotSeen", 'ar': "لم يرى"}, 'referralStatusNotSeen': {'en': "NotSeen", 'ar': "لم يرى"},
'clinicSearch': {'en': "Search Clinic", 'ar': "بحث عن عيادة"}, 'clinicSearch': {'en': "Search Clinic", 'ar': "بحث عن عيادة"},
'doctorSearch': {'en': "Search Doctor", 'ar': "بحث عن طبيب"}, 'doctorSearch': {'en': "Search Doctor", 'ar': "بحث عن طبيب"},
// 'icd': {'en': "ICD", 'ar': " "}, // 'icd': {'en': "ICD", 'ar': " "},
}; };

@ -1074,6 +1074,9 @@ String get ICDName =>
String get patientName => String get patientName =>
localizedValues['patient-name'][locale.languageCode]; localizedValues['patient-name'][locale.languageCode];
String get appointmentNumber =>
localizedValues['appointmentNumber'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -8,7 +8,6 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-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/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -140,14 +139,6 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
nameLine1: TranslationBase.of(context).myReferral, nameLine1: TranslationBase.of(context).myReferral,
nameLine2: TranslationBase.of(context).patient, nameLine2: TranslationBase.of(context).patient,
icon: 'note.png'), icon: 'note.png'),
if (selectedPatientType != 0 && selectedPatientType != 5)
PatientProfileButton(
key: key,
patient: patient,
route: PATIENT_ORDERS,
nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).list,
icon: 'radiology-1.png'),
if (int.parse(patientType) == 7 || int.parse(patientType) == 6) if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton( PatientProfileButton(
key: key, key: key,

@ -410,6 +410,8 @@ class _AddAllergiesState extends State<AddAllergies> {
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: 0, right: 0, top: 15), left: 0, right: 0, top: 15),
child: TextFields( child: TextFields(
hasLabelText: remarkController.text != ''?true:false,
showLabelText: true,
hintText: TranslationBase.of(context).remarks, hintText: TranslationBase.of(context).remarks,
fontSize: 13.5, fontSize: 13.5,
// hintColor: Colors.black, // hintColor: Colors.black,

@ -267,19 +267,21 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
Container( Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15), margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields( child: TextFields(
hintText: TranslationBase hasLabelText: complaintsController.text != ''
.of(context) ? true
: false,
hintText: TranslationBase.of(context)
.addChiefComplaints, .addChiefComplaints,
fontSize: 13.5, fontSize: 13.5,
// hintColor: Colors.black, // hintColor: Colors.black,
showLabelText: true,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
maxLines: 25, maxLines: 25,
minLines: 13, minLines: 13,
controller: complaintsController, controller: complaintsController,
validator: (value) { validator: (value) {
if (value == null || value == "") if (value == null || value == "")
return TranslationBase return TranslationBase.of(context)
.of(context)
.emptyMessage; .emptyMessage;
else if (value.length < 25) else if (value.length < 25)
return TranslationBase return TranslationBase
@ -296,6 +298,10 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
Container( Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15), margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields( child: TextFields(
hasLabelText: illnessController.text != ''
? true
: false,
showLabelText: true,
hintText: TranslationBase hintText: TranslationBase
.of(context) .of(context)
.historyOfPresentIllness, .historyOfPresentIllness,
@ -322,17 +328,23 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
Container( Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15), margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields( child: TextFields(
hintText: TranslationBase.of(context) hasLabelText: medicationController.text != ''
? true
: false,
showLabelText: true,
hintText: TranslationBase
.of(context)
.currentMedications, .currentMedications,
fontSize: 13.5, fontSize: 13.5,
// hintColor: Colors.black, // hintColor: Colors.black,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
maxLines: 2, maxLines: 23,
minLines: 1, minLines: 1,
controller: medicationController, controller: medicationController,
validator: (value) { validator: (value) {
if (value == null || value == "") if (value == null || value == "")
return TranslationBase.of(context) return TranslationBase
.of(context)
.emptyMessage; .emptyMessage;
else else
return null; return null;

@ -569,9 +569,11 @@ 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: "Appointment Number", hintText: TranslationBase.of(context).appointmentNumber,
fontSize: 13.5, fontSize: 13.5,
// hintColor: Colors.black, // hintColor: Colors.black,
hasLabelText: appointmentIdController.text != ''?true:false,
showLabelText: true,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
readOnly: true, readOnly: true,
controller: appointmentIdController, controller: appointmentIdController,
@ -735,6 +737,8 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
maxLines: 18, maxLines: 18,
minLines: 5, minLines: 5,
hasLabelText: remarkController.text != ''?true:false,
showLabelText: true,
controller: remarkController, controller: remarkController,
onChanged:(value) { onChanged:(value) {
widget.mySelectedAssessment.remark = remarkController.text; widget.mySelectedAssessment.remark = remarkController.text;

@ -319,6 +319,8 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: 0, right: 0, top: 15), left: 0, right: 0, top: 15),
child: TextFields( child: TextFields(
hasLabelText: remarksController.text != ''?true:false,
showLabelText: true,
hintText: TranslationBase.of(context).remarks, hintText: TranslationBase.of(context).remarks,
fontSize: 13.5, fontSize: 13.5,
// hintColor: Colors.black, // hintColor: Colors.black,

@ -137,6 +137,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
margin: margin:
EdgeInsets.only(left: 10, right: 10, top: 15), EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields( child: TextFields(
hintText: TranslationBase hintText: TranslationBase
.of(context) .of(context)
.addProgressNote, .addProgressNote,
@ -361,6 +362,8 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
margin: EdgeInsets.only(left: 0, right: 0, top: 15), margin: EdgeInsets.only(left: 0, right: 0, top: 15),
child: TextFields( child: TextFields(
hasLabelText: progressNoteController.text != ''?true:false,
showLabelText: true,
hintText: TranslationBase.of(context).addProgressNote, hintText: TranslationBase.of(context).addProgressNote,
fontSize: 13.5, fontSize: 13.5,
// hintColor: Colors.black, // hintColor: Colors.black,

@ -74,7 +74,9 @@ class TextFields extends StatefulWidget {
this.autoValidate = false, this.autoValidate = false,
this.fillColor, this.fillColor,
this.hintColor, this.hintColor,
this.onTapTextFields}) this.hasBorder = true,
this.onTapTextFields,
this.hasLabelText = false, this.showLabelText= false})
: super(key: key); : super(key: key);
final String hintText; final String hintText;
@ -111,6 +113,9 @@ class TextFields extends StatefulWidget {
final bool borderOnlyError; final bool borderOnlyError;
final Color hintColor; final Color hintColor;
final Color fillColor; final Color fillColor;
final bool hasBorder;
final bool showLabelText;
bool hasLabelText;
@override @override
_TextFieldsState createState() => _TextFieldsState(); _TextFieldsState createState() => _TextFieldsState();
@ -208,93 +213,140 @@ class _TextFieldsState extends State<TextFields> {
offset: Offset(0.0, 13.0), offset: Offset(0.0, 13.0),
blurRadius: focus ? 34.0 : 12.0) blurRadius: focus ? 34.0 : 12.0)
]), ]),
child: TextFormField( child: Column(
onTap: widget.onTapTextFields, children: [
keyboardAppearance: Theme.of(context).brightness, TextFormField(
scrollPhysics: BouncingScrollPhysics(), onTap: widget.onTapTextFields,
autovalidate: widget.autoValidate, keyboardAppearance: Theme.of(context).brightness,
textCapitalization: widget.textCapitalization, scrollPhysics: BouncingScrollPhysics(),
onFieldSubmitted: widget.inputAction == TextInputAction.next autovalidate: widget.autoValidate,
? (widget.onSubmit != null textCapitalization: widget.textCapitalization,
? widget.onSubmit onFieldSubmitted: widget.inputAction == TextInputAction.next
: (val) { ? (widget.onSubmit != null
_focusNode.nextFocus(); ? widget.onSubmit
}) : (val) {
: widget.onSubmit, _focusNode.nextFocus();
textInputAction: widget.inputAction, })
minLines: widget.minLines ?? 1, : widget.onSubmit,
maxLines: widget.maxLines ?? 1, textInputAction: widget.inputAction,
maxLengthEnforced: widget.maxLengthEnforced, minLines: widget.minLines ?? 1,
initialValue: widget.initialValue, maxLines: widget.maxLines ?? 1,
onChanged: widget.onChanged, maxLengthEnforced: widget.maxLengthEnforced,
focusNode: _focusNode, initialValue: widget.initialValue,
maxLength: widget.maxLength ?? null, onChanged: (value){
controller: widget.controller, if(widget.showLabelText) {
keyboardType: widget.keyboardType, if((value== null || value =='' )) {
readOnly: _determineReadOnly(), setState(() {
obscureText: widget.type == "password" && !view ? true : false, widget.hasLabelText = false;
autofocus: widget.autoFocus ?? false, });
validator: widget.validator, }else{
onSaved: widget.onSaved, setState(() {
style: Theme.of(context) widget.hasLabelText = true;
.textTheme });
.bodyText1 }
.copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), }
inputFormatters: widget.keyboardType == TextInputType.phone
? <TextInputFormatter>[
WhitelistingTextInputFormatter.digitsOnly, widget.onChanged(value);
_mobileFormatter, } ,
] focusNode: _focusNode,
: widget.inputFormatters, maxLength: widget.maxLength ?? null,
decoration: InputDecoration( controller: widget.controller,
counterText: "", keyboardType: widget.keyboardType,
hintText: widget.hintText, readOnly: _determineReadOnly(),
hintStyle: TextStyle( obscureText: widget.type == "password" && !view ? true : false,
fontSize: widget.fontSize, autofocus: widget.autoFocus ?? false,
fontWeight: widget.fontWeight, validator: widget.validator,
color: widget.hintColor ?? Theme.of(context).hintColor, onSaved: widget.onSaved,
), style: Theme.of(context)
contentPadding: widget.padding != null .textTheme
? widget.padding .bodyText1
: EdgeInsets.symmetric( .copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight),
inputFormatters: widget.keyboardType == TextInputType.phone
? <TextInputFormatter>[
WhitelistingTextInputFormatter.digitsOnly,
_mobileFormatter,
]
: widget.inputFormatters,
decoration: InputDecoration(
labelText: widget.hasLabelText ? widget.hintText : null,
labelStyle: TextStyle(
fontSize: widget.fontSize,
fontWeight: widget.fontWeight,
color: widget.hintColor ?? Theme
.of(context)
.hintColor,
),
counterText: "",
hintText: widget.hintText,
hintStyle: TextStyle(
fontSize: widget.fontSize,
fontWeight: widget.fontWeight,
color: widget.hintColor ?? Theme
.of(context)
.hintColor,
),
contentPadding: widget.padding != null
? widget.padding
: EdgeInsets.symmetric(
vertical: (widget.bare && !widget.keepPadding) ? 0.0 : 10.0, vertical: (widget.bare && !widget.keepPadding) ? 0.0 : 10.0,
horizontal: 16.0), horizontal: 16.0),
filled: true, filled: true,
fillColor: widget.bare fillColor: widget.bare
? Colors.transparent ? Colors.transparent
: Theme.of(context).backgroundColor, : Theme
suffixIcon: _buildSuffixIcon(), .of(context)
prefixIcon: widget.prefixIcon, .backgroundColor,
errorStyle: TextStyle( suffixIcon: _buildSuffixIcon(),
fontSize: 12.0, prefixIcon: widget.prefixIcon,
fontWeight: widget.fontWeight, errorStyle: TextStyle(
height: widget.borderOnlyError ? 0.0 : null), fontSize: 12.0,
errorBorder: OutlineInputBorder( fontWeight: widget.fontWeight,
borderSide: BorderSide( height: widget.borderOnlyError ? 0.0 : null),
color: Theme.of(context) errorBorder: OutlineInputBorder(
.errorColor borderSide: widget.hasBorder ? BorderSide(
.withOpacity(widget.bare ? 0.0 : 0.5), color: Theme
width: 1.0), .of(context)
borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), .errorColor
focusedErrorBorder: OutlineInputBorder( .withOpacity(widget.bare ? 0.0 : 0.5),
borderSide: BorderSide( width: 1.0) : BorderSide(
color: Theme.of(context) color: Colors.transparent, width: 0),
.errorColor borderRadius: widget.hasBorder ? BorderRadius.circular(
.withOpacity(widget.bare ? 0.0 : 0.5), widget.bare ? 0.0 : 8.0) : BorderRadius.circular(0.0),),
width: 1.0), focusedErrorBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), borderSide: widget.hasBorder ? BorderSide(
focusedBorder: OutlineInputBorder( color: Theme
borderSide: BorderSide(color: Colors.grey, width: 1.0), .of(context)
borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), .errorColor
disabledBorder: OutlineInputBorder( .withOpacity(widget.bare ? 0.0 : 0.5),
borderSide: BorderSide(color: Colors.grey, width: 1.0), width: 1.0) : BorderSide(
borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), color: Colors.transparent, width: 0),
enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)),
borderSide: BorderSide(color: Colors.grey, width: 1.0), focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0), borderSide: widget.hasBorder ? BorderSide(
color: Colors.grey, width: 1.0) : BorderSide(
color: Colors.transparent, width: 0),
borderRadius: widget.hasBorder ? BorderRadius.circular(
widget.bare ? 0.0 : 8.0) : BorderRadius.circular(0.0),),
disabledBorder: OutlineInputBorder(
borderSide: widget.hasBorder ? BorderSide(
color: Colors.grey, width: 1.0) : BorderSide(
color: Colors.transparent, width: 0),
borderRadius: widget.hasBorder ? BorderRadius.circular(
widget.bare ? 0.0 : 8.0) : BorderRadius.circular(0.0)),
enabledBorder: OutlineInputBorder(
borderSide: widget.hasBorder ? BorderSide(
color: Colors.grey, width: 1.0) : BorderSide(
color: Colors.transparent, width: 0),
borderRadius: widget.hasBorder ? BorderRadius.circular(
widget.bare ? 0.0 : 8.0) : BorderRadius.circular(0.0),
),
),
), ),
), ],
), ),
)); ));
} }
} }

Loading…
Cancel
Save