Merge branch 'diplomatic-quarter-live' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into hot_fix

 Conflicts:
	lib/config/localized_values.dart
	lib/pages/login/login.dart
dq_and_master
Mohammad Aljammal 4 years ago
commit d9759560c3

@ -75,7 +75,8 @@ const Map localizedValues = {
'ar': 'يرجى تأكيد الموعد لتفادي الإلغاء' 'ar': 'يرجى تأكيد الموعد لتفادي الإلغاء'
}, },
"book-success-confirm-more-24-1-2": { "book-success-confirm-more-24-1-2": {
"en": "The online payment process will be available 24 hours before the appointment.", "en":
"The online payment process will be available 24 hours before the appointment.",
"ar": "- عملية الدفع الالكتروني ستكون متاحة قبل الموعد ب 24 ساعة." "ar": "- عملية الدفع الالكتروني ستكون متاحة قبل الموعد ب 24 ساعة."
}, },
'upcoming-payment-pending': { 'upcoming-payment-pending': {
@ -1114,85 +1115,78 @@ const Map localizedValues = {
"not-active": {"en": "Not Active", "ar": "غير نشط"}, "not-active": {"en": "Not Active", "ar": "غير نشط"},
"card-detail": {"en": "Insurance Details", "ar": "منافعك التامينية"}, "card-detail": {"en": "Insurance Details", "ar": "منافعك التامينية"},
"Dr": {"en": "Dr. ", "ar": "الدكتور."}, "Dr": {"en": "Dr. ", "ar": "الدكتور."},
"empty": { "empty": {"en": "You do not have any records.", "ar": "ليس لديك أي سجلات"},
"en": "You do not have any records.",
"ar": "ليس لديك أي سجلات"
},
"last-visit": { "last-visit": {
"en": "How was your last visit with doctor?", "en": "How was your last visit with doctor?",
"ar": "كيف تقيم زيارتك الأخيرة للطبيب؟" "ar": "كيف تقيم زيارتك الأخيرة للطبيب؟"
}, },
"tap-title": { "tap-title": {"en": "Please rate the doctor", "ar": "يرجى تقييم الطبيب"},
"en": "Please rate the doctor", "later": {"en": "Later", "ar": "لاحقاً"},
"ar": "يرجى تقييم الطبيب" "sendSuc": {
}, "en": "A copy has been sent to the email",
"later": { "ar": "تم إرسال نسخة إلى البريد الإلكتروني"
"en": "Later",
"ar": "لاحقاً"
},
"sendSuc":{
"en":"A copy has been sent to the email",
"ar":"تم إرسال نسخة إلى البريد الإلكتروني"
}, },
"instructions": { "instructions": {
"en": "You can now talk directly to the appointments department by chat or request a call back", "en":
"ar": "يمكنك الان التحدث مباشرة مع قسم المواعيد عن طريق خدمة المحادثة النصية أو طلب معاودة الاتصال" "You can now talk directly to the appointments department by chat or request a call back",
"ar":
"يمكنك الان التحدث مباشرة مع قسم المواعيد عن طريق خدمة المحادثة النصية أو طلب معاودة الاتصال"
}, },
"instructions-pharmacies": { "instructions-pharmacies": {
"en": "You can now talk directly to the pharmacist by chat or request a call back", "en":
"ar": "يمكنك الآن التحدث مباشرة إلى الصيدلي عن طريق الدردشة أو طلب معاودة الاتصال" "You can now talk directly to the pharmacist by chat or request a call back",
}, "ar":
"select-hospital": { "يمكنك الآن التحدث مباشرة إلى الصيدلي عن طريق الدردشة أو طلب معاودة الاتصال"
"en": "Choose Hospital",
"ar": "اختر المستشفى"
},
"start": {
"en": "Start",
"ar": "ابدأ"
}, },
"select-hospital": {"en": "Choose Hospital", "ar": "اختر المستشفى"},
"start": {"en": "Start", "ar": "ابدأ"},
"info-chat": { "info-chat": {
"en": "This service allows you to chat with customer service directly without the need to call.", "en":
"ar": "المحادثة المباشرة: هذه الخدمة تمكنك التحدث كتابياً مع خدمة العملاء مباشرة دون الحاجة الى الاتصال هاتفياً." "This service allows you to chat with customer service directly without the need to call.",
"ar":
"المحادثة المباشرة: هذه الخدمة تمكنك التحدث كتابياً مع خدمة العملاء مباشرة دون الحاجة الى الاتصال هاتفياً."
}, },
"last-appointment": { "last-appointment": {
"en": "How was your appointment?", "en": "How was your appointment?",
"ar": "كيف كان موعدك الطبي ؟" "ar": "كيف كان موعدك الطبي ؟"
}, },
"rate-clinic": { "rate-clinic": {"en": "Please rate the clinic", "ar": "يرجى تقييم العيادة"},
"en": "Please rate the clinic", "fetch-data": {"en": "Fetch Data", "ar": "تحديث الان"},
"ar": "يرجى تقييم العيادة" "rate": {"en": "Rate", "ar": "تقييم"},
},
"fetch-data": {
"en": "Fetch Data",
"ar": "تحديث الان"
},
"send-email": { "send-email": {
"en": "Send a copy of this report to the email", "en": "Send a copy of this report to the email",
"ar": "أرسل نسخة من هذا التقرير إلى البريد الإلكتروني" "ar": "أرسل نسخة من هذا التقرير إلى البريد الإلكتروني"
}, },
"update-email": { "update-email": {"en": "Update Email", "ar": "تحديث البريد الالكتروني"},
"en": "Update Email", "booked-success": {
"ar": "تحديث البريد الالكتروني" "en": "The appointment has been successfully booked.",
"ar": "لقد تم حجز الموعد بنجاح"
}, },
"noDataAvailable": { "appo-reminder-select-option-30": {
"en": "No data available", "en": "Before 30 Mins",
"ar": " لا يوجد بيانات متاحة " "ar": "قبل 30 دقيقة"
},
"appo-reminder-select-option-60": {
"en": "Before 1 Hour",
"ar": "قبل ساعة واحدة"
}, },
"noSearchResult": { "appo-reminder-select-option-90": {
"en": "No Search Result", "en": "Before 1 Hour and 30 mins",
"ar": "لا توجد نتيجة بحث" "ar": "قبل ساعة و 30 دقيقة"
}, },
"selectFileSouse": { "appo-reminder-select-option-120": {
"en": "Select file souse", "en": "Before 2 Hours",
"ar": "حدد الملف" "ar": "قبل ساعتين"
}, },
"gallery": { "noDataAvailable": {
"en": "Gallery", "en": "No data available",
"ar": "معرض الصور" "ar": " لا يوجد بيانات متاحة "
}, "camera": {
"en": "Camera",
"ar": "كاميرا"
}, },
"thename": {"en": "The Name", "ar": "الاسم"},
"noSearchResult": {"en": "No Search Result", "ar": "لا توجد نتيجة بحث"},
"selectFileSouse": {"en": "Select file souse", "ar": "حدد الملف"},
"gallery": {"en": "Gallery", "ar": "معرض الصور"},
"camera": {"en": "Camera", "ar": "كاميرا"},
"med-report": { "med-report": {
"en": "Medical Reports", "en": "Medical Reports",
"ar": "التقارير الطبية" "ar": "التقارير الطبية"

@ -20,3 +20,5 @@ const IS_VIBRATION = 'is_vibration';
const THEME_VALUE = 'is_vibration'; const THEME_VALUE = 'is_vibration';
const MAIN_USER = 'main-user'; const MAIN_USER = 'main-user';
const WEATHER = 'weather'; const WEATHER = 'weather';
const BLOOD_TYPE = 'blood-type';
const NOTIFICATION_COUNT = 'notification-count';

@ -423,7 +423,7 @@ class _BookConfirmState extends State<BookConfirm> {
context) context)
.then((res) { .then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: "Appointment Booked Successfully"); AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
print(res['AppointmentNo']); print(res['AppointmentNo']);
Future.delayed(new Duration(milliseconds: 500), () { Future.delayed(new Duration(milliseconds: 500), () {

@ -178,7 +178,8 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
holidayStyle: TextStyle().copyWith(color: Colors.blue[800]), holidayStyle: TextStyle().copyWith(color: Colors.blue[800]),
), ),
daysOfWeekStyle: DaysOfWeekStyle( daysOfWeekStyle: DaysOfWeekStyle(
weekendStyle: TextStyle().copyWith(color: Colors.blue[600]), weekendStyle: TextStyle().copyWith(color: Colors.black, fontSize: 14.0),
weekdayStyle: TextStyle().copyWith(color: Colors.black, fontSize: 14.0),
), ),
headerStyle: HeaderStyle( headerStyle: HeaderStyle(
centerHeaderTitle: true, centerHeaderTitle: true,
@ -190,7 +191,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
opacity: Tween(begin: 0.0, end: 1.0).animate(_animationController), opacity: Tween(begin: 0.0, end: 1.0).animate(_animationController),
child: Container( child: Container(
margin: const EdgeInsets.all(4.0), margin: const EdgeInsets.all(4.0),
padding: const EdgeInsets.only(top: 5.0, left: 6.0), padding: const EdgeInsets.only(top: 5.0, left: 5.0),
color: Colors.transparent, color: Colors.transparent,
width: 0, width: 0,
height: 0, height: 0,

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
@ -15,16 +16,9 @@ class DoctorInformation extends StatelessWidget {
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
Card( AppExpandableNotifier(
shape: RoundedRectangleBorder( headerWidget: Container(
borderRadius: BorderRadius.circular(10), margin: EdgeInsets.all(10.0),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
margin: EdgeInsets.all(15.0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
@ -33,12 +27,15 @@ class DoctorInformation extends StatelessWidget {
Container( Container(
margin: EdgeInsets.fromLTRB(15.0, 5.0, 15.0, 0.0), margin: EdgeInsets.fromLTRB(15.0, 5.0, 15.0, 0.0),
child: Text(TranslationBase.of(context).docInfo, child: Text(TranslationBase.of(context).docInfo,
style: style: TextStyle(fontSize: 16.0, letterSpacing: 0.8)),
TextStyle(fontSize: 16.0, letterSpacing: 0.8)),
), ),
], ],
), ),
), ),
bodyWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container( Container(
padding: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 10.0), padding: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 10.0),
child: Table( child: Table(
@ -79,16 +76,10 @@ class DoctorInformation extends StatelessWidget {
], ],
), ),
), ),
Card( // ),
shape: RoundedRectangleBorder( AppExpandableNotifier(
borderRadius: BorderRadius.circular(10), headerWidget: Container(
), margin: EdgeInsets.all(10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
margin: EdgeInsets.all(15.0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
@ -96,14 +87,16 @@ class DoctorInformation extends StatelessWidget {
"assets/images/DQ/doctor_qualification_icon.svg"), "assets/images/DQ/doctor_qualification_icon.svg"),
Container( Container(
margin: EdgeInsets.fromLTRB(15.0, 5.0, 15.0, 0.0), margin: EdgeInsets.fromLTRB(15.0, 5.0, 15.0, 0.0),
child: Text( child: Text(TranslationBase.of(context).docQualifications,
TranslationBase.of(context).docQualifications, style: TextStyle(fontSize: 16.0, letterSpacing: 0.8)),
style:
TextStyle(fontSize: 16.0, letterSpacing: 0.8)),
), ),
], ],
), ),
), ),
bodyWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container( Container(
margin: EdgeInsets.fromLTRB(20.0, 0.0, 10.0, 5.0), margin: EdgeInsets.fromLTRB(20.0, 0.0, 10.0, 5.0),
child: Column( child: Column(
@ -136,9 +129,7 @@ class DoctorInformation extends StatelessWidget {
child: Text(text, child: Text(text,
maxLines: 16, maxLines: 16,
style: TextStyle( style: TextStyle(
fontSize: 13, fontSize: 13, letterSpacing: 0.5, color: Colors.grey[700])),
letterSpacing: 0.5,
color: Colors.grey[700])),
); );
} }
@ -151,10 +142,7 @@ class DoctorInformation extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Text(text.trim(), Text(text.trim(),
style: TextStyle( style: TextStyle(
fontSize: 13, fontSize: 13, letterSpacing: 0.5, color: Colors.grey[700])),
letterSpacing: 0.5,
color: Colors.grey[700])),
Container( Container(
margin: EdgeInsets.only(left: 5.0, right: 5.0), margin: EdgeInsets.only(left: 5.0, right: 5.0),
child: Image.network(icon, width: 18.0, height: 18.0), child: Image.network(icon, width: 18.0, height: 18.0),

@ -27,7 +27,7 @@ class AddFamilyMemberType extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Image.asset( Image.asset(
'assets/images/habib-logo.png', 'assets/images/DQ/dq_logo_icon.png',
height: 80, height: 80,
width: 80, width: 80,
), ),

@ -55,7 +55,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
AuthenticatedUser user; AuthenticatedUser user;
VitalSignService _vitalSignService = locator<VitalSignService>(); VitalSignService _vitalSignService = locator<VitalSignService>();
var isVaiable = false;
@override @override
void initState() { void initState() {
_tabController = new TabController(length: 2, vsync: this, initialIndex: 0); _tabController = new TabController(length: 2, vsync: this, initialIndex: 0);
@ -229,7 +229,8 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
if (snapshot.hasError) if (snapshot.hasError)
return Padding( return Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Text("No data found")); child: Text(
TranslationBase.of(context).noDataAvailable));
else else
return Padding( return Padding(
padding: EdgeInsets.only(top: 50), padding: EdgeInsets.only(top: 50),
@ -355,7 +356,8 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
if (snapshot.hasError) if (snapshot.hasError)
return Padding( return Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Text('No data found')); child: Text(TranslationBase.of(context)
.noDataAvailable));
else else
return Column( return Column(
children: [ children: [
@ -389,12 +391,20 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
left: 10, right: 10), left: 10, right: 10),
child: Row(children: [ child: Row(children: [
Expanded( Expanded(
flex: 3, child: AppText('Name')), flex: 3,
child: AppText(
TranslationBase.of(context)
.theName)),
Expanded( Expanded(
flex: 1, child: AppText('Allow')), flex: 1,
child: AppText(
TranslationBase.of(context)
.allowView)),
Expanded( Expanded(
flex: 1, flex: 1,
child: AppText('Reject')), child: AppText(
TranslationBase.of(context)
.rejectView)),
])), ])),
Column( Column(
children: familyFileProvider children: familyFileProvider
@ -469,12 +479,25 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
if (snapshot.hasError) if (snapshot.hasError)
return Padding( return Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Text('No data found')); child: Text(TranslationBase.of(context)
.noDataAvailable));
else else
return SingleChildScrollView( return Container(
child: Container(
height: SizeConfig.screenHeight * .3, height: SizeConfig.screenHeight * .3,
child: ListView( child: SingleChildScrollView(
child: Column(
children: [
Padding(
padding: EdgeInsets.only(
left: 10, right: 10),
child: Row(children: [
Expanded(
flex: 3,
child: AppText(
TranslationBase.of(context)
.theName))
])),
Column(
children: snapshot children: snapshot
.data.getAllSharedRecordsByStatusList .data.getAllSharedRecordsByStatusList
.map<Widget>((result) { .map<Widget>((result) {
@ -492,11 +515,16 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
result.statusDescription, result.statusDescription,
color: result.status == 3 color: result.status == 3
? Colors.green ? Colors.green
: result.status == 2
? Colors
.yellow[800]
: Colors.red, : Colors.red,
)), )),
], ],
)); ));
}).toList(), }).toList(),
)
],
))); )));
} }
}) })
@ -522,49 +550,34 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
if (snapshot.hasError) if (snapshot.hasError)
return Padding( return Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Text('No data found')); child: Text(TranslationBase.of(context)
.noDataAvailable));
else else
return Column( return Column(
children: [ children: [
// Padding(
// padding:EdgeInsets.only(left:10, right:10),
// child: Row(
// mainAxisAlignment:
// MainAxisAlignment.spaceBetween,
// children: <Widget>[
// Expanded(
// flex: 3,
// child: AppText(
// TranslationBase.of(context).request),
// ),
// Expanded(
// flex: 2,
// child: AppText(
// TranslationBase.of(context).switchUser,
// )),
// Expanded(
// flex: 1,
// child: AppText(
// TranslationBase.of(context).deleteView,
// )),
// ],
// )),
Column(children: [ Column(children: [
Padding( Padding(
padding: padding:
EdgeInsets.only(left: 10, right: 10), EdgeInsets.only(left: 10, right: 10),
child: Row(children: [ child: Row(children: [
Expanded( Expanded(
flex: 3, child: AppText('Name')), flex: 3,
child: AppText(
TranslationBase.of(context)
.theName)),
Expanded( Expanded(
flex: 1, child: AppText('Delete')), flex: 1,
child: AppText(
TranslationBase.of(context)
.deleteView)),
])), ])),
Column( Column(
children: familyFileProvider children: familyFileProvider
.allSharedRecordsByStatusResponse .allSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList .getAllSharedRecordsByStatusList
.map<Widget>((result) { .map<Widget>((result) {
return Padding( return result.status == 3
? Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
@ -581,11 +594,15 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
), ),
onPressed: () { onPressed: () {
deactivateRequest( deactivateRequest(
result.iD, 5, context); result.iD,
5,
context);
}, },
)), )),
], ],
)); ))
: Container(
child: AppText(isAvailable()));
}).toList()) }).toList())
]) ])
], ],
@ -600,6 +617,15 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
); );
} }
String isAvailable() {
if (isVaiable == false) {
this.isVaiable = true;
return TranslationBase.of(context).noDataAvailable;
} else {
return "";
}
}
Future<GetAllSharedRecordsByStatusResponse> getFamilyFiles() async { Future<GetAllSharedRecordsByStatusResponse> getFamilyFiles() async {
if (user != null) { if (user != null) {
if (await sharedPref.getObject(FAMILY_FILE) != null) { if (await sharedPref.getObject(FAMILY_FILE) != null) {
@ -689,6 +715,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
} }
this.sharedPref.setString(APP_LANGUAGE, currentLang); this.sharedPref.setString(APP_LANGUAGE, currentLang);
this.sharedPref.setObject(MAIN_USER, mainUser); this.sharedPref.setObject(MAIN_USER, mainUser);
//sharedPref.setString(BLOOD_TYPE, result['PatientBloodType']);
this.sharedPref.setObject(USER_PROFILE, result.list); this.sharedPref.setObject(USER_PROFILE, result.list);
this.sharedPref.setObject(FAMILY_FILE, familyFile); this.sharedPref.setObject(FAMILY_FILE, familyFile);
this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID);

@ -37,13 +37,16 @@ class _AppointmentDetailsState extends State<AppointmentDetails>
@override @override
void initState() { void initState() {
_tabController = new TabController(length: 2, vsync: this); _tabController = new TabController(length: 2, vsync: this);
AppointmentDetails.showFooterButton = false;
super.initState(); super.initState();
} }
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
_tabController.dispose(); _tabController.dispose();
AppointmentDetails.showFooterButton = false;
} }
@override @override
@ -162,7 +165,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails>
), ),
Container( Container(
alignment: Alignment.center, alignment: Alignment.center,
child: Text(widget.appo.startTime), child: Text(widget.appo.startTime.substring(0, 5)),
), ),
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/enum/filter_type.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
@ -28,6 +29,10 @@ class MyAppointments extends StatefulWidget {
List(); List();
List<PatientAppointmentList> _patientArrivedAppointmentListHospital = List(); List<PatientAppointmentList> _patientArrivedAppointmentListHospital = List();
List<PatientAppointmentList> _patientBookedAppointmentListClinic = List();
List<PatientAppointmentList> _patientConfirmedAppointmentListClinic = List();
List<PatientAppointmentList> _patientArrivedAppointmentListClinic = List();
@override @override
_MyAppointmentsState createState() => _MyAppointmentsState(); _MyAppointmentsState createState() => _MyAppointmentsState();
} }
@ -43,9 +48,12 @@ class _MyAppointmentsState extends State<MyAppointments>
List<ImagesInfo> imagesInfo = List(); List<ImagesInfo> imagesInfo = List();
FilterType filterType;
@override @override
void initState() { void initState() {
_tabController = new TabController(length: 3, vsync: this); _tabController = new TabController(length: 3, vsync: this);
filterType = FilterType.Clinic;
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
if (Provider.of<ProjectViewModel>(context, listen: false).isLogin) if (Provider.of<ProjectViewModel>(context, listen: false).isLogin)
getPatientAppointmentHistory(); getPatientAppointmentHistory();
@ -84,6 +92,42 @@ class _MyAppointmentsState extends State<MyAppointments>
color: Colors.grey[600], color: Colors.grey[600],
thickness: 0.5, thickness: 0.5,
), ),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () => setFilterType(FilterType.Clinic),
child: ListTile(
title: Text(TranslationBase.of(context).clinic),
leading: Radio(
value: FilterType.Clinic,
groupValue: filterType,
activeColor: Theme.of(context).primaryColor,
onChanged: (FilterType value) {
setFilterType(value);
},
),
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () => setFilterType(FilterType.Hospital),
child: ListTile(
title: Text(TranslationBase.of(context).hospital),
leading: Radio(
value: FilterType.Hospital,
groupValue: filterType,
activeColor: Theme.of(context).primaryColor,
onChanged: (FilterType value) => setFilterType(value),
),
),
),
)
],
),
isDataLoaded isDataLoaded
? Expanded( ? Expanded(
child: new TabBarView( child: new TabBarView(
@ -114,6 +158,10 @@ class _MyAppointmentsState extends State<MyAppointments>
widget._patientConfirmedAppointmentListHospital.clear(); widget._patientConfirmedAppointmentListHospital.clear();
widget._patientArrivedAppointmentListHospital.clear(); widget._patientArrivedAppointmentListHospital.clear();
widget._patientBookedAppointmentListClinic.clear();
widget._patientConfirmedAppointmentListClinic.clear();
widget._patientArrivedAppointmentListClinic.clear();
service.getPatientAppointmentHistory(false, context).then((res) { service.getPatientAppointmentHistory(false, context).then((res) {
print(res['AppoimentAllHistoryResultList'].length); print(res['AppoimentAllHistoryResultList'].length);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -123,7 +171,8 @@ class _MyAppointmentsState extends State<MyAppointments>
if (res['AppoimentAllHistoryResultList'].length != 0) { if (res['AppoimentAllHistoryResultList'].length != 0) {
// isDataLoaded = true; // isDataLoaded = true;
res['AppoimentAllHistoryResultList'].forEach((v) { res['AppoimentAllHistoryResultList'].forEach((v) {
widget.appoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); widget.appoList
.add(new AppoitmentAllHistoryResultList.fromJson(v));
}); });
sortAppointmentList(); sortAppointmentList();
} else {} } else {}
@ -169,11 +218,31 @@ class _MyAppointmentsState extends State<MyAppointments>
}); });
widget.bookedAppoList.forEach((element) { widget.bookedAppoList.forEach((element) {
List<PatientAppointmentList> doctorByClinic =
widget._patientBookedAppointmentListClinic
.where(
(elementClinic) =>
elementClinic.filterName == element.clinicName,
)
.toList();
if (doctorByClinic.length != 0) {
widget
._patientBookedAppointmentListClinic[widget
._patientBookedAppointmentListClinic
.indexOf(doctorByClinic[0])]
.patientDoctorAppointmentList
.add(element);
} else {
widget._patientBookedAppointmentListClinic.add(PatientAppointmentList(
filterName: element.clinicName, patientDoctorAppointment: element));
}
List<PatientAppointmentList> doctorByHospital = List<PatientAppointmentList> doctorByHospital =
widget._patientBookedAppointmentListHospital widget._patientBookedAppointmentListHospital
.where( .where(
(elementClinic) => (elementClinic) =>
elementClinic.filterName == element.clinicName, elementClinic.filterName == element.projectName,
) )
.toList(); .toList();
@ -186,16 +255,39 @@ class _MyAppointmentsState extends State<MyAppointments>
.add(element); .add(element);
} else { } else {
widget._patientBookedAppointmentListHospital.add(PatientAppointmentList( widget._patientBookedAppointmentListHospital.add(PatientAppointmentList(
filterName: element.clinicName, patientDoctorAppointment: element)); filterName: element.projectName,
patientDoctorAppointment: element));
} }
}); });
widget.confirmedAppoList.forEach((element) { widget.confirmedAppoList.forEach((element) {
List<PatientAppointmentList> doctorByClinic =
widget._patientConfirmedAppointmentListClinic
.where(
(elementClinic) =>
elementClinic.filterName == element.clinicName,
)
.toList();
if (doctorByClinic.length != 0) {
widget
._patientConfirmedAppointmentListClinic[widget
._patientConfirmedAppointmentListClinic
.indexOf(doctorByClinic[0])]
.patientDoctorAppointmentList
.add(element);
} else {
widget._patientConfirmedAppointmentListClinic.add(
PatientAppointmentList(
filterName: element.clinicName,
patientDoctorAppointment: element));
}
List<PatientAppointmentList> doctorByHospital = List<PatientAppointmentList> doctorByHospital =
widget._patientConfirmedAppointmentListHospital widget._patientConfirmedAppointmentListHospital
.where( .where(
(elementClinic) => (elementClinic) =>
elementClinic.filterName == element.clinicName, elementClinic.filterName == element.projectName,
) )
.toList(); .toList();
@ -209,17 +301,37 @@ class _MyAppointmentsState extends State<MyAppointments>
} else { } else {
widget._patientConfirmedAppointmentListHospital.add( widget._patientConfirmedAppointmentListHospital.add(
PatientAppointmentList( PatientAppointmentList(
filterName: element.clinicName, filterName: element.projectName,
patientDoctorAppointment: element)); patientDoctorAppointment: element));
} }
}); });
widget.arrivedAppoList.forEach((element) { widget.arrivedAppoList.forEach((element) {
List<PatientAppointmentList> doctorByClinic =
widget._patientArrivedAppointmentListClinic
.where(
(elementClinic) =>
elementClinic.filterName == element.clinicName,
)
.toList();
if (doctorByClinic.length != 0) {
widget
._patientArrivedAppointmentListClinic[widget
._patientArrivedAppointmentListClinic
.indexOf(doctorByClinic[0])]
.patientDoctorAppointmentList
.add(element);
} else {
widget._patientArrivedAppointmentListClinic.add(PatientAppointmentList(
filterName: element.clinicName, patientDoctorAppointment: element));
}
List<PatientAppointmentList> doctorByHospital = List<PatientAppointmentList> doctorByHospital =
widget._patientArrivedAppointmentListHospital widget._patientArrivedAppointmentListHospital
.where( .where(
(elementClinic) => (elementClinic) =>
elementClinic.filterName == element.clinicName, elementClinic.filterName == element.projectName,
) )
.toList(); .toList();
@ -233,9 +345,10 @@ class _MyAppointmentsState extends State<MyAppointments>
} else { } else {
widget._patientArrivedAppointmentListHospital.add( widget._patientArrivedAppointmentListHospital.add(
PatientAppointmentList( PatientAppointmentList(
filterName: element.clinicName, filterName: element.projectName,
patientDoctorAppointment: element)); patientDoctorAppointment: element));
} }
openAppointmentsTab(); openAppointmentsTab();
}); });
} }
@ -250,11 +363,11 @@ class _MyAppointmentsState extends State<MyAppointments>
} else if (flag == 3) { } else if (flag == 3) {
_tabController.index = 2; _tabController.index = 2;
} else { } else {
if (widget._patientBookedAppointmentListHospital.length != 0) { if (widget._patientBookedAppointmentListClinic.length != 0) {
_tabController.index = 0; _tabController.index = 0;
} else if (widget._patientConfirmedAppointmentListHospital.length != 0) { } else if (widget._patientConfirmedAppointmentListClinic.length != 0) {
_tabController.index = 1; _tabController.index = 1;
} else if (widget._patientArrivedAppointmentListHospital.length != 0) { } else if (widget._patientArrivedAppointmentListClinic.length != 0) {
_tabController.index = 2; _tabController.index = 2;
return; return;
} }
@ -270,16 +383,34 @@ class _MyAppointmentsState extends State<MyAppointments>
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
...List.generate( ...List.generate(
widget._patientBookedAppointmentListHospital.length, filterType == FilterType.Clinic
? widget._patientBookedAppointmentListClinic.length
: widget._patientBookedAppointmentListHospital.length,
(index) => AppExpandableNotifier( (index) => AppExpandableNotifier(
title: widget title: filterType == FilterType.Clinic
? widget
._patientBookedAppointmentListClinic[index]
.filterName
: widget
._patientBookedAppointmentListHospital[index] ._patientBookedAppointmentListHospital[index]
.filterName, .filterName,
bodyWidget: Column( bodyWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: widget children: filterType == FilterType.Clinic
._patientBookedAppointmentListHospital[index] ? widget
._patientBookedAppointmentListClinic[index]
.patientDoctorAppointmentList
.map((doctor) {
return AppointmentCard(
appo: doctor,
onReloadAppointmentHistory:
getPatientAppointmentHistory,
);
}).toList()
: widget
._patientBookedAppointmentListHospital[
index]
.patientDoctorAppointmentList .patientDoctorAppointmentList
.map((doctor) { .map((doctor) {
return AppointmentCard( return AppointmentCard(
@ -325,16 +456,35 @@ class _MyAppointmentsState extends State<MyAppointments>
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
...List.generate( ...List.generate(
widget._patientConfirmedAppointmentListHospital.length, filterType == FilterType.Clinic
? widget._patientConfirmedAppointmentListClinic.length
: widget
._patientConfirmedAppointmentListHospital.length,
(index) => AppExpandableNotifier( (index) => AppExpandableNotifier(
title: widget title: filterType == FilterType.Clinic
? widget
._patientConfirmedAppointmentListClinic[index]
.filterName
: widget
._patientConfirmedAppointmentListHospital[index] ._patientConfirmedAppointmentListHospital[index]
.filterName, .filterName,
bodyWidget: Column( bodyWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: widget children: filterType == FilterType.Clinic
._patientConfirmedAppointmentListHospital[index] ? widget
._patientConfirmedAppointmentListClinic[index]
.patientDoctorAppointmentList
.map((doctor) {
return AppointmentCard(
appo: doctor,
onReloadAppointmentHistory:
getPatientAppointmentHistory,
);
}).toList()
: widget
._patientConfirmedAppointmentListHospital[
index]
.patientDoctorAppointmentList .patientDoctorAppointmentList
.map((doctor) { .map((doctor) {
return AppointmentCard( return AppointmentCard(
@ -378,15 +528,29 @@ class _MyAppointmentsState extends State<MyAppointments>
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
...List.generate( ...List.generate(
widget._patientArrivedAppointmentListHospital.length, filterType == FilterType.Clinic
? widget._patientArrivedAppointmentListClinic.length
: widget._patientArrivedAppointmentListHospital.length,
(index) => AppExpandableNotifier( (index) => AppExpandableNotifier(
title: widget title: filterType == FilterType.Clinic
._patientArrivedAppointmentListHospital[index] ? widget._patientArrivedAppointmentListClinic[index]
.filterName
: widget._patientArrivedAppointmentListHospital[index]
.filterName, .filterName,
bodyWidget: Column( bodyWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: widget children: filterType == FilterType.Clinic
? widget._patientArrivedAppointmentListClinic[index]
.patientDoctorAppointmentList
.map((doctor) {
return AppointmentCard(
appo: doctor,
onReloadAppointmentHistory:
getPatientAppointmentHistory,
);
}).toList()
: widget
._patientArrivedAppointmentListHospital[index] ._patientArrivedAppointmentListHospital[index]
.patientDoctorAppointmentList .patientDoctorAppointmentList
.map((doctor) { .map((doctor) {
@ -422,4 +586,10 @@ class _MyAppointmentsState extends State<MyAppointments>
), ),
); );
} }
setFilterType(FilterType filterType) {
setState(() {
this.filterType = filterType;
});
}
} }

@ -46,7 +46,7 @@ class ArrivedButtons {
"caller": "Insurance" "caller": "Insurance"
}, },
{ {
"title": TranslationBase.of(AppGlobal.context).askYour, "title": TranslationBase.of(AppGlobal.context).askDoctor,
"subtitle": TranslationBase.of(AppGlobal.context).askYourSubtitle, "subtitle": TranslationBase.of(AppGlobal.context).askYourSubtitle,
"icon": "assets/images/new-design/ask_doctor_icon.png", "icon": "assets/images/new-design/ask_doctor_icon.png",
"caller": "askDoc" "caller": "askDoc"

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AskDocRequestTypeModel.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/AskDocRequestTypeModel.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/askDocDialog.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/askDocDialog.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class CustomRadio extends StatefulWidget { class CustomRadio extends StatefulWidget {
@ -21,17 +22,23 @@ class CustomRadioState extends State<CustomRadio> {
void initState() { void initState() {
super.initState(); super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
if (widget.requestData != null) { if (widget.requestData != null) {
widget.requestData.forEach((element) { widget.requestData.forEach((element) {
sampleData.add( sampleData.add(new RadioModel(
new RadioModel(false, element.description, element.parameterCode)); false, element.description, element.parameterCode));
}); });
} else { } else {
sampleData.add(new RadioModel(false, "Before 30 Mins", 30)); sampleData.add(new RadioModel(
sampleData.add(new RadioModel(false, 'Before 1 Hour', 60)); false, TranslationBase.of(context).appoReminder30, 30));
sampleData.add(new RadioModel(false, 'Before 2 Hours', 120)); sampleData.add(new RadioModel(
sampleData.add(new RadioModel(false, 'Before 4 Hours', 240)); false, TranslationBase.of(context).appoReminder60, 60));
sampleData.add(new RadioModel(
false, TranslationBase.of(context).appoReminder90, 90));
sampleData.add(new RadioModel(
false, TranslationBase.of(context).appoReminder120, 120));
} }
});
} }
@override @override
@ -96,7 +103,7 @@ class RadioItem extends StatelessWidget {
), ),
), ),
new Container( new Container(
margin: new EdgeInsets.only(left: 15.0), margin: new EdgeInsets.only(left: 15.0, right: 15.0),
child: new Text(_item.text, style: TextStyle(fontSize: 16.0)), child: new Text(_item.text, style: TextStyle(fontSize: 16.0)),
), ),
], ],

@ -27,19 +27,18 @@ class _ReminderDialogState extends State<ReminderDialog> {
shape: shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)), RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)),
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 0.57, // height: MediaQuery.of(context).size.height * 0.57,
width: 450.0, width: 450.0,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
Container( Container(
margin: EdgeInsets.all(20.0), margin: EdgeInsets.all(20.0),
child: Text(TranslationBase.of(context).setReminder, child: Text(TranslationBase.of(context).setReminder,
style: TextStyle( style: TextStyle(
fontSize: 20.0, fontSize: 20.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold)),
fontFamily: "Open-Sans-Bold")),
), ),
Container( Container(
transform: Matrix4.translationValues(0.0, -30.0, 0.0), transform: Matrix4.translationValues(0.0, -30.0, 0.0),
@ -61,13 +60,12 @@ class _ReminderDialogState extends State<ReminderDialog> {
child: Text(TranslationBase.of(context).confirm, child: Text(TranslationBase.of(context).confirm,
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold)),
fontFamily: 'Open-Sans-Bold')),
), ),
), ),
Container( Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
margin: EdgeInsets.only(left: 100.0, top: 20.0, right: 100.0), margin: EdgeInsets.only(left: 100.0, top: 20.0, right: 100.0, bottom: 20.0),
child: OutlineButton( child: OutlineButton(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0)), borderRadius: BorderRadius.circular(10.0)),
@ -81,8 +79,7 @@ class _ReminderDialogState extends State<ReminderDialog> {
child: Text(TranslationBase.of(context).cancel_nocaps, child: Text(TranslationBase.of(context).cancel_nocaps,
style: TextStyle( style: TextStyle(
color: Colors.red, color: Colors.red,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold)),
fontFamily: 'Open-Sans-Bold')),
), ),
), ),
]), ]),

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
@ -69,6 +70,7 @@ class _ToDoState extends State<ToDo> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
toDoProvider = Provider.of<ToDoCountProviderModel>(context); toDoProvider = Provider.of<ToDoCountProviderModel>(context);
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).todoList, appBarTitle: TranslationBase.of(context).todoList,
imagesInfo: imagesInfo, imagesInfo: imagesInfo,
@ -109,11 +111,15 @@ class _ToDoState extends State<ToDo> {
height: 20.0), height: 20.0),
Container( Container(
margin: margin:
EdgeInsets.only(left: 5.0, right: 20.0), EdgeInsets.only(left: 10.0, right: 10.0),
child: Text( child: Text(
getDate(widget DateUtil.getWeekDayMonthDayYearDateFormatted(
DateUtil.convertStringToDate(widget
.appoList[index].appointmentDate), .appoList[index].appointmentDate),
style: TextStyle(fontSize: 11.0)), projectViewModel.isArabic
? "ar"
: "en") + " " + widget.appoList[index].startTime.substring(0, 5),
style: TextStyle(fontSize: 10.0)),
), ),
widget.appoList[index].isLiveCareAppointment widget.appoList[index].isLiveCareAppointment
? SvgPicture.asset( ? SvgPicture.asset(
@ -141,7 +147,7 @@ class _ToDoState extends State<ToDo> {
: "-", : "-",
overflow: TextOverflow.clip, overflow: TextOverflow.clip,
maxLines: 2, maxLines: 2,
style: TextStyle(fontSize: 11.0)), style: TextStyle(fontSize: 10.0)),
), ),
], ],
), ),

@ -32,7 +32,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import '../../locator.dart'; import '../../locator.dart';
import '../../routes.dart'; import '../../routes.dart';
import 'home_page.dart'; import 'home_page.dart';
@ -154,7 +154,10 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
if (token != null && await sharedPref.getObject(USER_PROFILE) == null) { if (token != null && await sharedPref.getObject(USER_PROFILE) == null) {
DEVICE_TOKEN = token; DEVICE_TOKEN = token;
checkUserStatus(token); checkUserStatus(token);
} else {
getNotificationCount(token);
} }
requestPermissions(); requestPermissions();
}).catchError((err) { }).catchError((err) {
print(err); print(err);
@ -513,26 +516,14 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
// themeNotifier.setTheme(defaultTheme); // themeNotifier.setTheme(defaultTheme);
} }
void checkUserStatus(token) async { void checkUserStatus(token) async {
GifLoaderDialogUtils.showMyDialog(context);
authService authService
.selectDeviceImei(token) .selectDeviceImei(token)
.then((SelectDeviceIMEIRES value) => setUserValues(value)); .then((SelectDeviceIMEIRES value) => setUserValues(value))
if (await sharedPref.getObject(USER_PROFILE) != null) { .catchError((err) {
var data = GifLoaderDialogUtils.hideDialog(context);
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
if (data != null) {
authService
.registeredAuthenticatedUser(data, token, 0, 0)
.then((res) => {print(res)});
authService.getDashboard().then((value) => {
setState(() {
notificationCount = value['List_PatientDashboard'][0]
['UnreadPatientNotificationCount']
.toString();
})
}); });
} }
}
}
static Future<dynamic> myBackgroundMessageHandler( static Future<dynamic> myBackgroundMessageHandler(
Map<String, dynamic> message) async { Map<String, dynamic> message) async {
@ -551,6 +542,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
} }
void setUserValues(value) async { void setUserValues(value) async {
GifLoaderDialogUtils.hideDialog(context);
sharedPref.setObject(IMEI_USER_DATA, value); sharedPref.setObject(IMEI_USER_DATA, value);
} }
@ -571,4 +563,24 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
); );
} }
} }
getNotificationCount(token) async {
if (await sharedPref.getObject(USER_PROFILE) != null) {
var data =
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
if (data != null) {
authService
.registeredAuthenticatedUser(data, token, 0, 0)
.then((res) => {print(res)});
authService.getDashboard().then((value) => {
setState(() {
notificationCount = value['List_PatientDashboard'][0]
['UnreadPatientNotificationCount']
.toString();
sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
})
});
}
}
}
} }

@ -9,6 +9,8 @@ import 'package:diplomaticquarterapp/models/Authentication/check_activation_code
import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart';
import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
import 'package:diplomaticquarterapp/models/Authentication/send_activation_request.dart'; import 'package:diplomaticquarterapp/models/Authentication/send_activation_request.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
@ -22,6 +24,7 @@ import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart'; import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@ -384,55 +387,34 @@ class _ConfirmLogin extends State<ConfirmLogin> {
} }
getMobileInfo(request) { getMobileInfo(request) {
GifLoaderDialogUtils.showMyDialog(context); // GifLoaderDialogUtils.showMyDialog(context);
this this.authService.getLoginInfo(request).then((result) {
.authService GifLoaderDialogUtils.hideDialog(context);
.getLoginInfo(request) if (result['SMSLoginRequired'] == false) {
.then((result) => { this.loginTokenID = result.logInTokenID;
GifLoaderDialogUtils.hideDialog(context), this.patientOutSA = result.patientOutSA;
if (result['SMSLoginRequired'] == false)
{
this.loginTokenID = result.logInTokenID,
this.patientOutSA = result.patientOutSA,
// sms for register the biometric // sms for register the biometric
if (result.isSMSSent) if (result.isSMSSent) {
{ this.onlySMSBox = false;
this.onlySMSBox = false,
//this.button(); //this.button();
} else {
checkActivationCode();
} }
else } else {
{checkActivationCode()} if (result['IsAuthenticated'] == true) {
}
else
{
if (result['IsAuthenticated'] == true)
{
setState(() { setState(() {
isMoreOption = true; isMoreOption = true;
this.onlySMSBox = true; this.onlySMSBox = true;
// this.fingrePrintBefore = true; // this.fingrePrintBefore = true;
}), });
//sharedPref.setBool(ONLY_SMS, true),
// this.cs.sharedService.setSharedData(true, AuthenticationService.ONLY_SMS);
//this.cs.sharedService.setSharedData(this.selectedOption, AuthenticationService.FINGUREPRINT_BEFORE);
// this.cs.confirmLogin();
//this.button();
} }
// else
// {
// // this.cs.presentAlert(result.ErrorEndUserMessage);
// }
} }
}) }).catchError((err) {
.catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
}); });
} }
setUser() async {}
setDefault() async { setDefault() async {
if (await sharedPref.getObject(IMEI_USER_DATA) != null) if (await sharedPref.getObject(IMEI_USER_DATA) != null)
user = SelectDeviceIMEIRES.fromJson( user = SelectDeviceIMEIRES.fromJson(
@ -533,6 +515,8 @@ class _ConfirmLogin extends State<ConfirmLogin> {
sharedPref.remove(FAMILY_FILE), sharedPref.remove(FAMILY_FILE),
result.list.isFamily = false, result.list.isFamily = false,
userData = result.list, userData = result.list,
// sharedPref.setString(
// BLOOD_TYPE, result['PatientBloodType']),
sharedPref.setObject(MAIN_USER, result.list), sharedPref.setObject(MAIN_USER, result.list),
sharedPref.setObject(USER_PROFILE, result.list), sharedPref.setObject(USER_PROFILE, result.list),
loginTokenID = result.logInTokenID, loginTokenID = result.logInTokenID,
@ -591,7 +575,35 @@ class _ConfirmLogin extends State<ConfirmLogin> {
appointmentRateViewModel.isLogin = true; appointmentRateViewModel.isLogin = true;
projectViewModel.isLogin = true; projectViewModel.isLogin = true;
getToDoCount(); getToDoCount();
Navigator.of(context).pushNamed(HOME); appointmentRateViewModel
.getIsLastAppointmentRatedList()
.then((value) => {
getToDoCount(),
// GifLoaderDialogUtils.hideDialog(context),
if (appointmentRateViewModel.isHaveAppointmentNotRate)
{
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: RateAppointmentDoctor(),
),
(r) => false)
}
else
{
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: LandingPage(),
),
(r) => false)
}
})
.catchError((err) {
print(err);
//GifLoaderDialogUtils.hideDialog(context);
});
// SMSOTP.showLoadingDialog(context, false),
} }
loading(flag) { loading(flag) {

@ -244,6 +244,7 @@ class _Login extends State<Login> {
sharedPref.remove(FAMILY_FILE); sharedPref.remove(FAMILY_FILE);
result = CheckActivationCode.fromJson(result); result = CheckActivationCode.fromJson(result);
result.list.isFamily = false; result.list.isFamily = false;
// this.sharedPref.setString(BLOOD_TYPE, result['PatientBloodType']),
this.sharedPref.setObject(USER_PROFILE, result.list); this.sharedPref.setObject(USER_PROFILE, result.list);
this.sharedPref.setObject(MAIN_USER, result.list); this.sharedPref.setObject(MAIN_USER, result.list);
this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID);

@ -179,7 +179,7 @@ class PrescriptionItemsPage extends StatelessWidget {
), ),
bottomSheet: Container( bottomSheet: Container(
width: double.infinity, width: double.infinity,
height: MediaQuery.of(context).size.height * 0.1, height: MediaQuery.of(context).size.height * 0.12,
color: Colors.grey[100], color: Colors.grey[100],
child: Column( child: Column(
children: <Widget>[ children: <Widget>[

@ -40,7 +40,7 @@ class _RateAppointmentDoctorState extends State<RateAppointmentDoctor> {
headline6: headline6:
TextStyle(color: Colors.white, fontWeight: FontWeight.bold), TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
), ),
title: Text('Rate'), title: Text(TranslationBase.of(context).rate),
leading: Builder( leading: Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
return IconButton( return IconButton(
@ -94,7 +94,7 @@ class _RateAppointmentDoctorState extends State<RateAppointmentDoctor> {
height: 22, height: 22,
), ),
Texts( Texts(
model.appointmentDetails.doctorName, TranslationBase.of(context).dr + " " + model.appointmentDetails.doctorName,
bold: true, bold: true,
), ),
SizedBox( SizedBox(

@ -256,6 +256,7 @@ class AuthProvider with ChangeNotifier {
return Future.value(error); return Future.value(error);
// throw error; // throw error;
}, body: neRequest.toJson()); }, body: neRequest.toJson());
sharedPref.setString(BLOOD_TYPE, localRes['PatientBloodType']);
return Future.value(localRes); return Future.value(localRes);
} catch (error) { } catch (error) {
throw error; throw error;

@ -299,7 +299,7 @@ class FamilyFilesProvider with ChangeNotifier {
AppToast.showErrorToast(message: error); AppToast.showErrorToast(message: error);
throw error; throw error;
}, body: request); }, body: request);
sharedPref.setString(BLOOD_TYPE, localRes['PatientBloodType']);
return Future.value(localRes); return Future.value(localRes);
} catch (error) { } catch (error) {
print(error); print(error);

@ -1004,28 +1004,47 @@ class TranslationBase {
String get cardDetail => localizedValues['card-detail'][locale.languageCode]; String get cardDetail => localizedValues['card-detail'][locale.languageCode];
String get dr => localizedValues['Dr'][locale.languageCode]; String get dr => localizedValues['Dr'][locale.languageCode];
String get sendSuc => localizedValues['sendSuc'][locale.languageCode]; String get sendSuc => localizedValues['sendSuc'][locale.languageCode];
String get instructions => localizedValues['instructions'][locale.languageCode]; String get instructions =>
String get instructionsPharmacies => localizedValues['instructions-pharmacies'][locale.languageCode]; localizedValues['instructions'][locale.languageCode];
String get selectHospitalDec => localizedValues['select-hospital'][locale.languageCode]; String get instructionsPharmacies =>
localizedValues['instructions-pharmacies'][locale.languageCode];
String get selectHospitalDec =>
localizedValues['select-hospital'][locale.languageCode];
String get start => localizedValues['start'][locale.languageCode]; String get start => localizedValues['start'][locale.languageCode];
String get infoChat => localizedValues['info-chat'][locale.languageCode]; String get infoChat => localizedValues['info-chat'][locale.languageCode];
String get noRecords => localizedValues['empty'][locale.languageCode]; String get noRecords => localizedValues['empty'][locale.languageCode];
String get lastVisit => localizedValues['last-visit'][locale.languageCode]; String get lastVisit => localizedValues['last-visit'][locale.languageCode];
String get tapTitle => localizedValues['tap-title'][locale.languageCode]; String get tapTitle => localizedValues['tap-title'][locale.languageCode];
String get later => localizedValues['later'][locale.languageCode]; String get later => localizedValues['later'][locale.languageCode];
String get lastAppointment => localizedValues['last-appointment'][locale.languageCode]; String get lastAppointment =>
localizedValues['last-appointment'][locale.languageCode];
String get rateClinic => localizedValues['rate-clinic'][locale.languageCode]; String get rateClinic => localizedValues['rate-clinic'][locale.languageCode];
String get fetchData => localizedValues['fetch-data'][locale.languageCode]; String get fetchData => localizedValues['fetch-data'][locale.languageCode];
String get sendConfEmail =>
String get sendConfEmail => localizedValues['send-email'][locale.languageCode]; localizedValues['send-email'][locale.languageCode];
String get updateEmail => localizedValues['update-email'][locale.languageCode]; String get updateEmail =>
String get noDataAvailable => localizedValues['noDataAvailable'][locale.languageCode]; localizedValues['update-email'][locale.languageCode];
String get noSearchResult => localizedValues['noSearchResult'][locale.languageCode]; String get noDataAvailable =>
String get selectFileSouse => localizedValues['selectFileSouse'][locale.languageCode]; localizedValues['noDataAvailable'][locale.languageCode];
String get theName => localizedValues['thename'][locale.languageCode];
String get noSearchResult =>
localizedValues['noSearchResult'][locale.languageCode];
String get selectFileSouse =>
localizedValues['selectFileSouse'][locale.languageCode];
String get rate => localizedValues['rate'][locale.languageCode];
String get bookedSuccess =>
localizedValues['booked-success'][locale.languageCode];
String get appoReminder30 =>
localizedValues['appo-reminder-select-option-30'][locale.languageCode];
String get appoReminder60 =>
localizedValues['appo-reminder-select-option-60'][locale.languageCode];
String get appoReminder90 =>
localizedValues['appo-reminder-select-option-90'][locale.languageCode];
String get appoReminder120 =>
localizedValues['appo-reminder-select-option-120'][locale.languageCode];
String get gallery => localizedValues['gallery'][locale.languageCode]; String get gallery => localizedValues['gallery'][locale.languageCode];
String get camera => localizedValues['camera'][locale.languageCode]; String get camera => localizedValues['camera'][locale.languageCode];
String get medReport => localizedValues['med-report'][locale.languageCode]; String get medReport => localizedValues['med-report'][locale.languageCode];

@ -2,12 +2,15 @@ import 'dart:io';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/pages/DrawerPages/notifications/notifications_page.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/notifications/notifications_page.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
@ -16,6 +19,7 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
@ -44,9 +48,11 @@ class _AppDrawerState extends State<AppDrawer> {
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>(); locator<AuthenticatedUserObject>();
VitalSignService _vitalSignService = locator<VitalSignService>(); VitalSignService _vitalSignService = locator<VitalSignService>();
AppointmentRateViewModel appointmentRateViewModel =
locator<AppointmentRateViewModel>();
ToDoCountProviderModel toDoProvider; ToDoCountProviderModel toDoProvider;
String booldType;
String notificationCount;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
toDoProvider = Provider.of<ToDoCountProviderModel>(context); toDoProvider = Provider.of<ToDoCountProviderModel>(context);
@ -64,7 +70,7 @@ class _AppDrawerState extends State<AppDrawer> {
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
children: <Widget>[ children: <Widget>[
Container( Container(
height: SizeConfig.screenHeight * .27, height: SizeConfig.screenHeight * .28,
padding: EdgeInsets.all(15), padding: EdgeInsets.all(15),
child: InkWell( child: InkWell(
child: Column( child: Column(
@ -86,23 +92,27 @@ class _AppDrawerState extends State<AppDrawer> {
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: padding:
EdgeInsets.only(right: 5), EdgeInsets.only(right: 0),
child: Icon( child: Icon(
Icons.account_circle, Icons.account_circle,
color: Color(0xFF40ACC9), color: Color(0xFF40ACC9),
size: 28,
)), )),
AppText( Padding(
padding:
EdgeInsets.only(right: 5),
child: AppText(
user.firstName + user.firstName +
' ' + ' ' +
user.lastName, user.lastName,
color: Color(0xFF40ACC9), color: Color(0xFF40ACC9),
) ))
], ],
), ),
Row(children: <Widget>[ Row(children: <Widget>[
Padding( Padding(
padding: padding: EdgeInsets.only(
EdgeInsets.only(left: 30), left: 30, right: 10),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
AppText( AppText(
@ -118,9 +128,9 @@ class _AppDrawerState extends State<AppDrawer> {
1.5, 1.5,
), ),
AppText( AppText(
user.bloodGroup != null booldType != null
? 'Blood Group: ' + ? 'Blood Group: ' +
user.bloodGroup booldType
: '', : '',
fontSize: SizeConfig fontSize: SizeConfig
.textMultiplier * .textMultiplier *
@ -128,7 +138,8 @@ class _AppDrawerState extends State<AppDrawer> {
), ),
], ],
)) ))
]) ]),
Divider()
])) ]))
: SizedBox(), : SizedBox(),
], ],
@ -206,9 +217,15 @@ class _AppDrawerState extends State<AppDrawer> {
children: < children: <
Widget>[ Widget>[
Expanded( Expanded(
child: Icon( child:
Icon(
Icons Icons
.person), .account_circle,
color: Color(
0xFF40ACC9),
size:
24,
),
), ),
Expanded( Expanded(
flex: 7, flex: 7,
@ -246,14 +263,14 @@ class _AppDrawerState extends State<AppDrawer> {
result, result,
context); context);
}, },
child: Padding(
padding: EdgeInsets.only(right: 5),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: < children: <Widget>[
Widget>[
Expanded( Expanded(
child: child: Icon(Icons.account_circle, color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black),
Icon(Icons.person, color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black),
), ),
Expanded( Expanded(
flex: 7, flex: 7,
@ -264,7 +281,7 @@ class _AppDrawerState extends State<AppDrawer> {
AppText(TranslationBase.of(context).fileno + ": " + result.responseID.toString(), color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), AppText(TranslationBase.of(context).fileno + ": " + result.responseID.toString(), color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black),
]))), ]))),
], ],
))) ))))
: SizedBox(); : SizedBox();
}).toList()) }).toList())
], ],
@ -286,10 +303,43 @@ class _AppDrawerState extends State<AppDrawer> {
}, },
), ),
InkWell( InkWell(
child: DrawerItem( child: Stack(
children: [
DrawerItem(
TranslationBase.of(context) TranslationBase.of(context)
.notification, .notification,
Icons.notifications), Icons.notifications,
count: notificationCount != null
? new Container(
padding: EdgeInsets.all(4),
margin: EdgeInsets.all(2),
decoration: new BoxDecoration(
color: Colors.red,
borderRadius:
BorderRadius.circular(
20),
),
constraints: BoxConstraints(
minWidth: 20,
minHeight: 20,
),
child: new Text(
notificationCount,
style: new TextStyle(
color: Colors.white,
fontSize: projectProvider
.isArabic
? 8
: 9,
),
textAlign: TextAlign.center,
),
// ),
)
: SizedBox(),
),
],
),
onTap: () { onTap: () {
//NotificationsPage //NotificationsPage
Navigator.of(context).pop(); Navigator.of(context).pop();
@ -446,8 +496,11 @@ class _AppDrawerState extends State<AppDrawer> {
var data2 = AuthenticatedUser.fromJson( var data2 = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(MAIN_USER)); await this.sharedPref.getObject(MAIN_USER));
print(data2); booldType = await sharedPref.getString(BLOOD_TYPE);
notificationCount = await sharedPref.getString(NOTIFICATION_COUNT);
setState(() { setState(() {
notificationCount = notificationCount;
this.user = data; this.user = data;
this.mainUser = data2; this.mainUser = data2;
}); });
@ -466,8 +519,6 @@ class _AppDrawerState extends State<AppDrawer> {
Navigator.of(context).pushNamed(HOME); Navigator.of(context).pushNamed(HOME);
} }
login() async { login() async {
var data = await sharedPref.getObject(IMEI_USER_DATA); var data = await sharedPref.getObject(IMEI_USER_DATA);
sharedPref.remove(REGISTER_DATA_FOR_LOGIIN); sharedPref.remove(REGISTER_DATA_FOR_LOGIIN);
@ -498,7 +549,7 @@ class _AppDrawerState extends State<AppDrawer> {
.familyFileProvider .familyFileProvider
.silentLoggin(user is AuthenticatedUser ? null : user, .silentLoggin(user is AuthenticatedUser ? null : user,
mainUser: user is AuthenticatedUser) mainUser: user is AuthenticatedUser)
.then((value) async{ .then((value) async {
await authenticatedUserObject.getUser(); await authenticatedUserObject.getUser();
_vitalSignService.heightCm = ""; _vitalSignService.heightCm = "";
_vitalSignService.weightKg = ""; _vitalSignService.weightKg = "";
@ -513,7 +564,6 @@ class _AppDrawerState extends State<AppDrawer> {
} }
loginAfter(result, context) async { loginAfter(result, context) async {
Utils.hideProgressDialog();
result = CheckActivationCode.fromJson(result); result = CheckActivationCode.fromJson(result);
var familyFile = await sharedPref.getObject(FAMILY_FILE); var familyFile = await sharedPref.getObject(FAMILY_FILE);
var currentLang = await sharedPref.getString(APP_LANGUAGE); var currentLang = await sharedPref.getString(APP_LANGUAGE);
@ -523,15 +573,41 @@ class _AppDrawerState extends State<AppDrawer> {
result.list.isFamily = true; result.list.isFamily = true;
} }
this.sharedPref.setString(APP_LANGUAGE, currentLang); this.sharedPref.setString(APP_LANGUAGE, currentLang);
// sharedPref.setString(BLOOD_TYPE, result['PatientBloodType']);
this.sharedPref.setObject(MAIN_USER, mainUser); this.sharedPref.setObject(MAIN_USER, mainUser);
this.sharedPref.setObject(USER_PROFILE, result.list); this.sharedPref.setObject(USER_PROFILE, result.list);
this.sharedPref.setObject(FAMILY_FILE, familyFile); this.sharedPref.setObject(FAMILY_FILE, familyFile);
this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID);
this.sharedPref.setString(TOKEN, result.authenticationTokenID); this.sharedPref.setString(TOKEN, result.authenticationTokenID);
//this.checkIfUserAgreedBefore(result), //this.checkIfUserAgreedBefore(result),
Navigator.of(context).pushNamed( appointmentRateViewModel
HOME, .getIsLastAppointmentRatedList()
); .then((value) => {
//getToDoCount(),
Utils.hideProgressDialog(),
if (appointmentRateViewModel.isHaveAppointmentNotRate)
{
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: RateAppointmentDoctor(),
),
(r) => false)
}
else
{
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: LandingPage(),
),
(r) => false)
}
})
.catchError((err) {
print(err);
Utils.hideProgressDialog();
// GifLoaderDialogUtils.hideDialog(context);
});
} }
} }

@ -13,11 +13,13 @@ class DrawerItem extends StatefulWidget {
final Color iconColor; final Color iconColor;
final bool bottomLine; final bool bottomLine;
final bool sideArrow; final bool sideArrow;
final Widget count;
DrawerItem(this.title, this.icon, DrawerItem(this.title, this.icon,
{this.textColor = Colors.black, {this.textColor = Colors.black,
this.iconColor = Colors.black87, this.iconColor = Colors.black87,
this.subTitle = '', this.subTitle = '',
this.bottomLine = true, this.bottomLine = true,
this.count,
this.sideArrow = false}); this.sideArrow = false});
@override @override
@ -55,11 +57,16 @@ class _DrawerItemState extends State<DrawerItem> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Row(
children: [
Texts( Texts(
widget.title, widget.title,
color: widget.textColor, color: widget.textColor,
fontSize: SizeConfig.textMultiplier * 2.3, fontSize: SizeConfig.textMultiplier * 2.3,
), ),
widget.count ?? SizedBox(),
],
),
widget.subTitle != '' widget.subTitle != ''
? Texts( ? Texts(
widget.subTitle, widget.subTitle,
@ -73,7 +80,7 @@ class _DrawerItemState extends State<DrawerItem> {
flex: 1, flex: 1,
child: child:
Icon(Icons.keyboard_arrow_right, color: Colors.red)) Icon(Icons.keyboard_arrow_right, color: Colors.red))
: Expanded(flex: 1, child: SizedBox()) : Expanded(flex: 1, child: SizedBox()),
], ],
), ),
)); ));

Loading…
Cancel
Save