Merge branch 'fix_issues' into 'development'

Fix issues

See merge request Cloud_Solution/doctor_app_flutter!271
merge-requests/274/head
Mohammad Aljammal 4 years ago
commit 81fdcb2d8d

@ -29,7 +29,7 @@ const Map<String, Map<String, String>> localizedValues = {
'en': 'Answer/Suggestions',
'ar': 'ملاحضات وتفاصيل العيادة'
},
'outPatients': {'en': 'Out-Patients', 'ar': 'ةالمريض الخارجي'},
'outPatients': {'en': 'Out-Patients', 'ar': 'المريض الخارجي'},
'searchPatient': {'en': 'Search Patient', 'ar': 'البحث عن مريض'},
'searchAbout': {'en': 'Search', 'ar': 'البحث عن'},
'patient': {'en': 'Patient', 'ar': ' مريض'},
@ -37,14 +37,14 @@ const Map<String, Map<String, String>> localizedValues = {
'lab': {'en': 'Lab', 'ar': 'المختبر'},
'result': {'en': 'Result', 'ar': 'نتيجة'},
'todayStatistics': {'en': 'Today Statistics', 'ar': 'إحصائيات اليوم'},
'arrived': {'en': 'Arrived', 'ar': 'وصل'},
'arrived': {'en': 'Arrival Patients', 'ar': ' المرضى الواصلين'},
'er': {'en': 'ER', 'ar': 'حالة طوارئ'},
'walkIn': {'en': 'Walk-in', 'ar': 'ادخل'},
'notArrived': {'en': 'Not Arrived', 'ar': 'لم يصل'},
'radiology': {'en': 'Radiology', 'ar': 'الأشعة'},
'service': {'en': 'Service', 'ar': 'خدمة'},
'referral': {'en': 'Referral', 'ar': 'االإحالة'},
'inPatient': {'en': 'In-Patient', 'ar': 'االمريض الداخلي'},
'inPatient': {'en': 'In-Patient', 'ar': 'المريض الداخلي'},
'operations': {'en': 'Operations', 'ar': 'عمليات'},
'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'},
'searchMedicine': {'en': 'Search Medicine', 'ar': 'بحث عن الدواء'},

@ -24,11 +24,7 @@ class PrescriptionService extends BaseService {
PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel();
SearchDrugRequestModel _drugRequestModel = SearchDrugRequestModel(
//search: ["Acetaminophen"],
// vidaAuthTokenID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CJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiY2QwOWU3MTEtZDEwYy00NjZhLWEwNDctMjc4MDBmNmRkMTYxIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYyMDMiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkhFQUQgTlVSU0VTIiwiRE9DVE9SUyIsIkhFQUQgRE9DVE9SUyIsIkFETUlOSVNUUkFUT1JTIiwiUkVDRVBUSU9OSVNUIiwiRVIgTlVSU0UiLCJJVkYgUkVDRVBUSU9OSVNUIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIklWRiBET0NUT1IiLCJJVkYgTlVSU0UiLCJJVkYgQ09PUkRJTkFUT1IiLCJJVkYgTEFCIFNUQUZGIiwiQ09OU0VOVCAiLCJNRURJQ0FMIFJFUE9SVCAtIFNJQ0sgTEVBVkUgTUFOQUdFUiJdLCJuYmYiOjE2MDkyNjQ2MTQsImV4cCI6MTYxMDEyODYxNCwiaWF0IjoxNjA5MjY0NjE0fQ.xCJ0jGtSFf36G8uZpdmHVoLfXDyP6e9mBpuOPSlzuio",
);
PostPrescriptionReqModel _postPrescriptionReqModel =

@ -49,18 +49,22 @@ class PatientViewModel extends BaseViewModel {
_patientService.referalFrequancyList;
Future getPatientList(patient, patientType,
{bool isBusyLocal = false}) async {
var localRes ;
if (isBusyLocal) {
setState(ViewState.BusyLocal);
} else {
setState(ViewState.Busy);
}
localRes = await _patientService.getPatientList(patient, patientType);
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.Error);
}
return _patientService.getPatientList(patient, patientType);
return localRes;
}

@ -141,16 +141,6 @@ class _DashboardScreenState extends State<DashboardScreen> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
AppText(
TranslationBase.of(context).welcome,
fontSize:
SizeConfig.textMultiplier * 1.7,
color: Colors.white,
)
],
),
SizedBox(
height: 4,
),
@ -1201,8 +1191,8 @@ class DashboardItem extends StatelessWidget {
height: height != null
? height
: MediaQuery.of(context).orientation == Orientation.portrait
? MediaQuery.of(context).size.height * 0.19
: MediaQuery.of(context).size.height * 0.35,
? MediaQuery.of(context).size.height * 0.20
: MediaQuery.of(context).size.height * 0.36,
decoration: BoxDecoration(
color: !hasBorder
? color != null

@ -44,6 +44,8 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
bool _autoValidate = false;
bool onlyArrived = true;
bool isFormSubmitted = false;
var _patientSearchFormValues = PatientModel(
FirstName: "0",
MiddleName: "0",
@ -64,7 +66,9 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
PatientOutSA: false);
void _validateInputs() async {
setState(() {
isFormSubmitted = true;
});
try {
if (_formKey.currentState.validate()) {
@ -73,8 +77,11 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
if ((_patientSearchFormValues.From == "0" ||
_patientSearchFormValues.To == "0") &&
_selectedType == "7") {
helpers.showErrorToast("Please Choose The Dates");
// helpers.showErrorToast("Please Choose The Dates");
} else {
setState(() {
isFormSubmitted = false;
});
Navigator.of(context).pushNamed(PATIENTS, arguments: {
"patientSearchForm": _patientSearchFormValues,
"selectedType": _selectedType
@ -112,7 +119,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
children: <Widget>[
Container(
child: Icon(
DoctorApp.search_patient,
DoctorApp.search_patient_1,
size: 100,
color: Colors.black,
),
@ -403,7 +410,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
),
),
(!(_selectedType == '2' || _selectedType == '4'))
? DynamicElements(_patientSearchFormValues)
? DynamicElements(_patientSearchFormValues, isFormSubmitted)
: SizedBox(
height: 0,
),

@ -273,7 +273,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
patientType)
.then((res) {
setState(() {
_isLoading = false;
if (res != null && res['MessageStatus'] == 1) {
if (val2 == 7) {
@ -302,10 +302,13 @@ class _PatientsScreenState extends State<PatientsScreen> {
responseModelList = new ModelResponse.fromJson(parsed).list;
responseModelList2 = responseModelList;
_isError = false;
} else {
_isError = true;
error = model.error; //res['ErrorEndUserMessage'] ?? res['ErrorMessage'];
error = model.error??res['ErrorEndUserMessage'] ?? res['ErrorMessage'];
}
_isLoading = false;
});
}).catchError((error) {
setState(() {

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -34,7 +35,7 @@ class SettingsScreen extends StatelessWidget {
child: AnimatedContainer(
duration: Duration(milliseconds: 350),
decoration: BoxDecoration(
color: !projectsProvider.isArabic ? HexColor('#58434F') : Colors.transparent,
color: !projectsProvider.isArabic ? AppGlobal.appPrimaryColor : Colors.transparent,
border: Border(right: BorderSide(color: Colors.grey[200], width: 2.0))
),
child: Center(child: AppText(TranslationBase.of(context).lanEnglish, color: !projectsProvider.isArabic ? Colors.white : Colors.grey[500]))
@ -47,7 +48,7 @@ class SettingsScreen extends StatelessWidget {
child: AnimatedContainer(
duration: Duration(milliseconds: 350),
decoration: BoxDecoration(
color: projectsProvider.isArabic ? HexColor('#58434F') : Colors.transparent,
color: projectsProvider.isArabic ? AppGlobal.appPrimaryColor : Colors.transparent,
border: Border(right: BorderSide(color: Colors.grey[200], width: 2.0))
),
child: Center(child: AppText(TranslationBase.of(context).lanArabic, color: projectsProvider.isArabic ? Colors.white : Colors.grey[500],))

@ -1,13 +1,15 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/custom_validation_error.dart';
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
class DynamicElements extends StatefulWidget {
final PatientModel _patientSearchFormValues;
DynamicElements(this._patientSearchFormValues);
final bool isFormSubmitted;
DynamicElements(this._patientSearchFormValues, this.isFormSubmitted);
@override
_DynamicElementsState createState() => _DynamicElementsState();
}
@ -113,6 +115,10 @@ class _DynamicElementsState extends State<DynamicElements> {
),
SizedBox(
height: 5,
),
if(widget._patientSearchFormValues.From == "0" && widget.isFormSubmitted)
CustomValidationError(),SizedBox(
height: 10,
),
AppTextFormField(
@ -137,6 +143,10 @@ class _DynamicElementsState extends State<DynamicElements> {
}
},
),
if(widget._patientSearchFormValues.To == "0" && widget.isFormSubmitted)
CustomValidationError(),SizedBox(
height: 10,
),
],
);
},

@ -43,7 +43,8 @@ final double height;
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
AppText(
'Dr. ${authProvider.doctorProfile.doctorName}',
TranslationBase.of(context).dr +
' ${authProvider.doctorProfile.doctorName}',
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5,
color: Colors.white,

@ -83,19 +83,17 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: Expanded(
child: Texts(
projectViewModel.isArabic
? selectedAllergy.selectedAllergy.nameAr
: selectedAllergy.selectedAllergy.nameEn
.toUpperCase(),
variant: "bodyText",
textDecoration: selectedAllergy.isChecked
? null
: TextDecoration.lineThrough,
bold: true,
color: Colors.black),
),
child: 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,
),
Texts(

@ -83,18 +83,16 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
child: Expanded(
child: Texts(
projectViewModel.isArabic
? myHistory.selectedHistory.nameAr
: myHistory.selectedHistory.nameEn,
variant: "bodyText",
textDecoration: myHistory.isChecked
? null
: TextDecoration.lineThrough,
bold: true,
color: Colors.black),
),
child: Texts(
projectViewModel.isArabic
? myHistory.selectedHistory.nameAr
: myHistory.selectedHistory.nameEn,
variant: "bodyText",
textDecoration: myHistory.isChecked
? null
: TextDecoration.lineThrough,
bold: true,
color: Colors.black),
width: MediaQuery.of(context).size.width * 0.7,
),
if (myHistory.isChecked)
@ -212,7 +210,9 @@ class _PriorityBarState extends State<PriorityBar> {
crossAxisAlignment: CrossAxisAlignment.center,
children: _priorities.map((item,) {
bool _isActive = _priorities[_activePriority] == item ? true : false;
index++;
if(index <2){
index++;
}
return Expanded(
child: InkWell(
child: Center(

@ -1,9 +1,10 @@
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:provider/provider.dart';
import '../../config/size_config.dart';
@ -28,6 +29,7 @@ class _AppDrawerState extends State<AppDrawer> {
bool _isInit = true;
Helpers helpers = new Helpers();
ProjectViewModel projectsProvider;
// @override
// void didChangeDependencies() {
// super.didChangeDependencies();
@ -47,119 +49,126 @@ class _AppDrawerState extends State<AppDrawer> {
// margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * 2),
child: Drawer(
child: Column(children: <Widget>[
Expanded(
flex: 4,
child: ListView(padding: EdgeInsets.zero, children: <Widget>[
Container(
height: SizeConfig.heightMultiplier * 50,
child: InkWell(
child: DrawerHeader(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
child: Image.asset('assets/images/logo.png'),
margin: EdgeInsets.only(top: 10, bottom: 15),
),
SizedBox(
height: 1,
child: Container(
color: Colors.black26,
Expanded(
flex: 4,
child: ListView(padding: EdgeInsets.zero, children: <Widget>[
Container(
height: SizeConfig.heightMultiplier * 50,
child: InkWell(
child: DrawerHeader(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
child: Image.asset(
'assets/images/logo.png',
),
margin: EdgeInsets.only(top: 10, bottom: 15),
),
SizedBox(height: 15),
authProvider.doctorProfile != null
? CircleAvatar(
radius: SizeConfig.imageSizeMultiplier * 12,
backgroundImage: NetworkImage(
authProvider.doctorProfile.doctorImageURL),
backgroundColor: Colors.white,
)
: SizedBox(),
authProvider.doctorProfile != null
? Padding(
padding: EdgeInsets.only(top: 10),
child: AppText(
authProvider.doctorProfile?.doctorName,
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: SizeConfig.textMultiplier * 2,
))
: SizedBox(),
AppText(
projectsProvider.isArabic
? authProvider
.doctorProfile.titleDescriptionN ??
""
: authProvider
.doctorProfile?.titleDescription ??
"",
fontWeight: FontWeight.normal,
color: Colors.black87),
RaisedButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(18.0),
side: BorderSide(color: Colors.red)),
child: AppText(
TranslationBase.of(context).logout,
color: Colors.white,
),
onPressed: () async {
Navigator.pop(context);
await helpers.logout();
},
SizedBox(
height: 1,
child: Container(
color: Colors.black26,
),
),
SizedBox(height: 15),
InkWell(
onTap: (){
Navigator.of(context).pushNamed(PROFILE, arguments: {
'title': authProvider.doctorProfile.doctorName,
"doctorProfileall": authProvider.doctorProfile
});
},
child: Column(
children: [
authProvider.doctorProfile != null
? CircleAvatar(
radius: SizeConfig.imageSizeMultiplier * 12,
backgroundImage: NetworkImage(
authProvider.doctorProfile.doctorImageURL),
backgroundColor: Colors.white,
)
: SizedBox(),
authProvider.doctorProfile != null
? Padding(
padding: EdgeInsets.only(top: 10),
child: AppText(
authProvider.doctorProfile?.doctorName,
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: SizeConfig.textMultiplier * 2,
))
: SizedBox(),
AppText(
projectsProvider.isArabic
? authProvider
.doctorProfile.titleDescriptionN ??
""
: authProvider
.doctorProfile?.titleDescription ??
"",
fontWeight: FontWeight.normal,
color: Colors.black87),
],
),
),
RaisedButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(18.0),
side: BorderSide(color: Colors.red)),
child: AppText(
TranslationBase.of(context).logout,
color: Colors.white,
),
onPressed: () async {
Navigator.pop(context);
await helpers.logout();
},
),
],
),
],
),
),
),
onTap: () {
//Navigator.of(context).pushNamed(PROFILE);
Navigator.of(context).pushNamed(PROFILE, arguments: {
'title': authProvider.doctorProfile.doctorName,
"doctorProfileall": authProvider.doctorProfile
});
},
),
),
InkWell(
child: DrawerItem(
TranslationBase.of(context).settings, Icons.settings),
onTap: () {
Navigator.pop(context);
Navigator.of(context).pushNamed(SETTINGS);
},
),
InkWell(
child: DrawerItem(
TranslationBase.of(context).qr +
TranslationBase.of(context).reader,
DoctorApp.qr_code),
onTap: () {
Navigator.pop(context);
Navigator.of(context).pushNamed(QR_READER);
},
InkWell(
child: DrawerItem(
TranslationBase.of(context).settings, Icons.settings),
onTap: () {
Navigator.pop(context);
Navigator.of(context).pushNamed(SETTINGS);
},
),
InkWell(
child: DrawerItem(
TranslationBase.of(context).qr +
TranslationBase.of(context).reader,
DoctorApp.qr_code),
onTap: () {
Navigator.pop(context);
Navigator.of(context).pushNamed(QR_READER);
},
),
]),
),
]),
),
Expanded(
flex: 1,
child: Column(children: <Widget>[
Container(
// This align moves the children to the bottom
child: Align(
alignment: FractionalOffset.bottomCenter,
child: Container(
child: Column(
children: <Widget>[
Text("Powered by"),
Image.asset(
'assets/images/cs_logo_container.png',
width: SizeConfig.imageSizeMultiplier * 30,
)
],
))))
]))
])),
Expanded(
flex: 1,
child: Column(children: <Widget>[
Container(
// This align moves the children to the bottom
child: Align(
alignment: FractionalOffset.bottomCenter,
child: Container(
child: Column(
children: <Widget>[
Text("Powered by"),
Image.asset(
'assets/images/cs_logo_container.png',
width: SizeConfig.imageSizeMultiplier * 30,
)
],
))))
]))
])),
),
width: SizeConfig.realScreenWidth * 0.60,
margin: 0,

@ -28,7 +28,7 @@ class _DrawerItemState extends State<DrawerItem> {
return Container(
margin: EdgeInsets.only(top: 5, bottom: 5, left: 10, right: 10),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Icon(
widget.icon,
@ -37,12 +37,15 @@ class _DrawerItemState extends State<DrawerItem> {
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
AppText(
widget.title,
color: widget.color ?? Colors.black,
// fontWeight: FontWeight.bold,
margin: 5,
// margin: 5,
marginLeft: 5,
marginRight: 5,
fontSize: SizeConfig.textMultiplier * 2.3,
),
AppText(

Loading…
Cancel
Save