updates & fixes

merge-requests/427/head
haroon amjad 5 years ago
parent 503ab739ca
commit 01ca8b8f84

@ -11,6 +11,7 @@ class GetPatientICProjectsModel {
dynamic editedOn; dynamic editedOn;
dynamic editedBy; dynamic editedBy;
bool isActive; bool isActive;
dynamic distanceInKilometers;
GetPatientICProjectsModel( GetPatientICProjectsModel(
{this.id, {this.id,
@ -22,6 +23,7 @@ class GetPatientICProjectsModel {
this.createdBy, this.createdBy,
this.editedOn, this.editedOn,
this.editedBy, this.editedBy,
this.distanceInKilometers,
this.isActive}); this.isActive});
GetPatientICProjectsModel.fromJson(Map<String, dynamic> json) { GetPatientICProjectsModel.fromJson(Map<String, dynamic> json) {
@ -35,6 +37,7 @@ class GetPatientICProjectsModel {
editedOn = json['EditedOn']; editedOn = json['EditedOn'];
editedBy = json['EditedBy']; editedBy = json['EditedBy'];
isActive = json['IsActive']; isActive = json['IsActive'];
distanceInKilometers = json['DistanceInKilometers'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -49,6 +52,7 @@ class GetPatientICProjectsModel {
data['EditedOn'] = this.editedOn; data['EditedOn'] = this.editedOn;
data['EditedBy'] = this.editedBy; data['EditedBy'] = this.editedBy;
data['IsActive'] = this.isActive; data['IsActive'] = this.isActive;
data['DistanceInKilometers'] = this.distanceInKilometers;
return data; return data;
} }
} }

@ -569,7 +569,7 @@ class BaseAppClient {
var model = Provider.of<ToDoCountProviderModel>(AppGlobal.context, listen: false); var model = Provider.of<ToDoCountProviderModel>(AppGlobal.context, listen: false);
_vitalSignService.weightKg = ""; _vitalSignService.weightKg = "";
_vitalSignService.heightCm = ""; _vitalSignService.heightCm = "";
model.setState(0, false); model.setState(0, false, 0);
Navigator.of(AppGlobal.context).pushReplacementNamed(HOME); Navigator.of(AppGlobal.context).pushReplacementNamed(HOME);
} }

@ -1,26 +1,28 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_request_model.dart'; import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_request_model.dart';
import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_response_model.dart'; import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_response_model.dart';
import 'package:diplomaticquarterapp/core/model/notifications/mark_message_as_read_request_model.dart'; import 'package:diplomaticquarterapp/core/model/notifications/mark_message_as_read_request_model.dart';
import 'package:diplomaticquarterapp/core/service/notifications_service.dart'; import 'package:diplomaticquarterapp/core/service/notifications_service.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../locator.dart'; import '../../locator.dart';
import 'base_view_model.dart'; import 'base_view_model.dart';
class NotificationViewModel extends BaseViewModel { class NotificationViewModel extends BaseViewModel {
NotificationService _notificationService = locator<NotificationService>(); NotificationService _notificationService = locator<NotificationService>();
ToDoCountProviderModel model = Provider.of<ToDoCountProviderModel>(AppGlobal.context);
List<GetNotificationsResponseModel> get notifications => List<GetNotificationsResponseModel> get notifications => _notificationService.notificationsList;
_notificationService.notificationsList;
Future getNotifications( Future getNotifications(GetNotificationsRequestModel getNotificationsRequestModel, BuildContext context) async {
GetNotificationsRequestModel getNotificationsRequestModel, BuildContext context) async { if (getNotificationsRequestModel.currentPage == 0) setState(ViewState.Busy);
if(getNotificationsRequestModel.currentPage == 0)
setState(ViewState.Busy);
await _notificationService await _notificationService.getAllNotifications(getNotificationsRequestModel);
.getAllNotifications(getNotificationsRequestModel);
if (_notificationService.hasError) { if (_notificationService.hasError) {
error = _notificationService.error; error = _notificationService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -31,9 +33,16 @@ class NotificationViewModel extends BaseViewModel {
Future markAsRead(id) async { Future markAsRead(id) async {
// setState(ViewState.Busy); // setState(ViewState.Busy);
MarkMessageAsReadRequestModel markMessageAsReadRequestModel = MarkMessageAsReadRequestModel markMessageAsReadRequestModel = new MarkMessageAsReadRequestModel(notificationPoolID: id);
new MarkMessageAsReadRequestModel(notificationPoolID: id); final authService = new AuthProvider();
await _notificationService.markAsRead(markMessageAsReadRequestModel); await _notificationService.markAsRead(markMessageAsReadRequestModel);
await authService.getDashboard().then((value) {
var notificationCount = '';
notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
model.setState(model.count, true, num.tryParse(notificationCount));
sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
});
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }

@ -2,15 +2,19 @@ import 'package:flutter/cupertino.dart';
class ToDoCountProviderModel with ChangeNotifier { class ToDoCountProviderModel with ChangeNotifier {
int _count; int _count;
int _notificationsCount;
bool _isShowBadge = false; bool _isShowBadge = false;
int get count => _count == null ? 0 : _count; int get count => _count == null ? 0 : _count;
int get notificationsCount => _notificationsCount == null ? 0 : _notificationsCount;
bool get isShowBadge => _isShowBadge; bool get isShowBadge => _isShowBadge;
void setState(int count, bool isShowBadge) { void setState(int count, bool isShowBadge, int notifCount) {
_count = count; _count = count;
_isShowBadge = isShowBadge; _isShowBadge = isShowBadge;
_notificationsCount = notifCount;
notifyListeners(); notifyListeners();
} }
} }

@ -346,12 +346,12 @@ class _BookConfirmState extends State<BookConfirm> {
} }
getToDoCount() { getToDoCount() {
toDoProvider.setState(0, true); toDoProvider.setState(0, true, toDoProvider.notificationsCount);
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
print(res['AppointmentActiveNumber']); print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true); toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount);
} else {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);

@ -86,7 +86,7 @@ class _HospitalsLiveChatPageState extends State<HospitalsLiveChatPage> {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Text( child: Text(
model.LiveChatModelList[index]?.projectName ?? "", model.LiveChatModelList[index].projectName.toString() + "\n" + model.LiveChatModelList[index].distanceInKilometers.toString() + " " + TranslationBase.of(context).km_ ?? "",
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: tappedIndex == index ? Colors.white : Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: tappedIndex == index ? Colors.white : Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16),
), ),
), ),

@ -32,7 +32,6 @@ class PharmaciesLiveChatPage extends StatelessWidget {
SizedBox(height: 20), SizedBox(height: 20),
Text( Text(
TranslationBase.of(context).instructions, TranslationBase.of(context).instructions,
textAlign: TextAlign.center,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16),
), ),
], ],
@ -44,14 +43,13 @@ class PharmaciesLiveChatPage extends StatelessWidget {
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).start, TranslationBase.of(context).start,
() { null,
String chat; // () {
chat = // String chat;
"http://chat.dshmg.com:7788/EPharmacyChat/EIndex.aspx?CustomerID=undefined&Name=${model.user.firstName}&MobileNo=${model.user.mobileNumber}&Language=${projectViewModel.isArabic ? 1 : 2}"; // chat =
launch(chat); // "http://chat.dshmg.com:7788/EPharmacyChat/EIndex.aspx?CustomerID=undefined&Name=${model.user.firstName}&MobileNo=${model.user.mobileNumber}&Language=${projectViewModel.isArabic ? 1 : 2}";
}, // launch(chat);
color: Color(0xffD02127), // },
textColor: Colors.white,
disabledColor: Color(0xffEAEAEA), disabledColor: Color(0xffEAEAEA),
), ),
), ),

@ -485,12 +485,12 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
} }
getToDoCount() { getToDoCount() {
toDoProvider.setState(0, true); toDoProvider.setState(0, true, toDoProvider.notificationsCount);
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
print(res['AppointmentActiveNumber']); print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true); toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount);
} else {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);

@ -615,12 +615,12 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
} }
getToDoCount() { getToDoCount() {
toDoProvider.setState(0, true); toDoProvider.setState(0, true, toDoProvider.notificationsCount);
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
print(res['AppointmentActiveNumber']); print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1 && res['AppointmentActiveNumber'] != null) { if (res['MessageStatus'] == 1 && res['AppointmentActiveNumber'] != null) {
toDoProvider.setState(res['AppointmentActiveNumber'], true); toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount);
} else {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);

@ -50,13 +50,12 @@ class NotificationsDetailsPage extends StatelessWidget {
height: 25, height: 25,
), ),
Container( Container(
// margin: EdgeInsets.only(left: 30),
width: double.infinity, width: double.infinity,
color: Colors.grey[400], color: Colors.grey[400],
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Texts( child: Texts(
getDateForm(notification.createdOn), DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(notification.createdOn)) + " " + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(notification.createdOn), false),
fontSize: 16, fontSize: 16,
), ),
), ),

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_
import 'package:diplomaticquarterapp/core/viewModels/notifications_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/notifications_view_model.dart';
import 'package:diplomaticquarterapp/pages/DrawerPages/notifications/notification_details_page.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/notifications/notification_details_page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; 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';
@ -60,8 +61,9 @@ class NotificationsPage extends StatelessWidget {
.map( .map(
(notification) => InkWell( (notification) => InkWell(
onTap: () async { onTap: () async {
if (!notification.isRead) if (!notification.isRead) {
model.markAsRead(notification.id); model.markAsRead(notification.id);
}
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
@ -82,7 +84,7 @@ class NotificationsPage extends StatelessWidget {
border: Border.all( border: Border.all(
color: notification.isRead color: notification.isRead
? Colors.grey[200] ? Colors.grey[200]
: Theme.of(context).primaryColor, : CustomColors.accentColor,
width: 0.5), width: 0.5),
), ),
child: Row( child: Row(
@ -93,7 +95,7 @@ class NotificationsPage extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Texts(getDateForm(notification.createdOn)), Texts(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(notification.createdOn)) + " " + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(notification.createdOn), false)),
SizedBox( SizedBox(
height: 5, height: 5,
), ),

@ -87,7 +87,7 @@ class _ErOptionsState extends State<ErOptions> {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.push(context, FadePage(page: RRTMainScreen())); if(rrtLocked) Navigator.push(context, FadePage(page: RRTMainScreen()));
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).rrtService, title: TranslationBase.of(context).rrtService,

@ -582,11 +582,11 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
} }
getToDoCount() { getToDoCount() {
toDoProvider.setState(0, true); toDoProvider.setState(0, true, toDoProvider.notificationsCount);
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true); toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount);
} else {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);

@ -5,7 +5,9 @@ import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_mode
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
@ -50,6 +52,8 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
var reconizedWord; var reconizedWord;
var event = RobotProvider(); var event = RobotProvider();
List<AppoitmentAllHistoryResultList> appoList = [];
String getSelected(BuildContext context) { String getSelected(BuildContext context) {
switch (messageType) { switch (messageType) {
case MessageType.ComplaintOnAnAppointment: case MessageType.ComplaintOnAnAppointment:
@ -174,105 +178,36 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
), ),
), ),
SizedBox(height: 12), SizedBox(height: 12),
if (messageType == MessageType.ComplaintOnAnAppointment && model.appointHistoryList.length != 0 && isShowListAppointHistory) if (messageType == MessageType.ComplaintOnAnAppointment && appoList.length != 0 && isShowListAppointHistory)
Container( Container(
height: model.appointHistoryList.length > 2 ? MediaQuery.of(context).size.height * 0.35 : MediaQuery.of(context).size.height * 0.17, margin: EdgeInsets.only(bottom: 10.0),
height: appoList.length > 2 ? MediaQuery.of(context).size.height * 0.35 : MediaQuery.of(context).size.height * 0.17,
child: ListView.builder( child: ListView.builder(
itemCount: model.appointHistoryList.length, itemCount: appoList.length,
itemBuilder: (context, index) => InkWell( itemBuilder: (context, index) => InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
appointHistory = model.appointHistoryList[index]; appointHistory = appoList[index];
isShowListAppointHistory = false; isShowListAppointHistory = false;
}); });
}, },
child: DoctorCard( child: DoctorCard(
onTap: null, onTap: null,
isInOutPatient: model.appointHistoryList[index].isInOutPatient, isInOutPatient: appoList[index].isInOutPatient,
name: model.appointHistoryList[index].doctorTitle + " " + model.appointHistoryList[index].doctorNameObj, name: appoList[index].doctorTitle + " " + appoList[index].doctorNameObj,
profileUrl: model.appointHistoryList[index].doctorImageURL, profileUrl: appoList[index].doctorImageURL,
subName: model.appointHistoryList[index].projectName, subName: appoList[index].projectName,
isLiveCareAppointment: model.appointHistoryList[index].isLiveCareAppointment, isLiveCareAppointment: appoList[index].isLiveCareAppointment,
date: DateUtil.convertStringToDate(model.appointHistoryList[index].appointmentDate), date: DateUtil.convertStringToDate(appoList[index].appointmentDate),
rating: model.appointHistoryList[index].actualDoctorRate + 0.0, rating: appoList[index].actualDoctorRate + 0.0,
appointmentTime: model.appointHistoryList[index].startTime.substring(0, 5), appointmentTime: appoList[index].startTime.substring(0, 5),
), ),
// Container( ),
// margin: EdgeInsets.only(left: 8, right: 8), ),
// color: Colors.white, ),
// child: Column( inputWidget(TranslationBase.of(context).subject, "", titleController),
// children: <Widget>[
// Row(
// children: <Widget>[
// Expanded(
// flex: 4,
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: <Widget>[
// Padding(
// padding: const EdgeInsets.all(10.0),
// child: Row(
// children: <Widget>[
// Expanded(
// flex: 1,
// child: LargeAvatar(
// name: model.appointHistoryList[index].doctorNameObj,
// url: model.appointHistoryList[index].doctorImageURL,
// ),
// ),
// Expanded(
// flex: 4,
// child: Container(
// margin: EdgeInsets.all(10),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: <Widget>[
// Texts(
// model.appointHistoryList[index].doctorNameObj,
// bold: true,
// ),
// Texts(
// DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(model.appointHistoryList[index].appointmentDate)),
// variant: 'caption3',
// ),
// StarRating(totalAverage: model.appointHistoryList[index].doctorRate.toDouble(), forceStars: true),
// ],
// ),
// ),
// ),
// ],
// ),
// ),
// ],
// ),
// ),
// Expanded(
// flex: 1,
// child: Center(
// child: Icon(
// Icons.arrow_forward_ios,
// size: 15,
// ),
// ),
// )
// ],
// ),
// SizedBox(
// height: 5,
// ),
// Divider(
// height: 0.5,
// color: Colors.grey[400],
// )
// ],
// ),
// ),
),
),
),
inputWidget(TranslationBase.of(context).subject, "xxxxxxxx", titleController),
SizedBox(height: 12), SizedBox(height: 12),
inputWidget(TranslationBase.of(context).message, "xxxxxxxx", messageController, lines: 11, suffixTap: () { inputWidget(TranslationBase.of(context).message, "", messageController, lines: 11, suffixTap: () {
openSpeechReco(); openSpeechReco();
}), }),
SizedBox(height: 12), SizedBox(height: 12),
@ -428,7 +363,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
TextField( TextField(
enabled: isEnable, enabled: isEnable,
scrollPadding: EdgeInsets.zero, scrollPadding: EdgeInsets.zero,
keyboardType: TextInputType.number, keyboardType: TextInputType.text,
controller: _controller, controller: _controller,
maxLines: lines, maxLines: lines,
onChanged: (value) => {setState(() {})}, onChanged: (value) => {setState(() {})},
@ -493,19 +428,36 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
// Show Dialog function // Show Dialog function
void confirmBox(FeedbackViewModel model) { void confirmBox(FeedbackViewModel model) {
DoctorsListService service = new DoctorsListService();
showDialog( showDialog(
context: context, context: context,
child: FeedbackTypeDialog( child: FeedbackTypeDialog(
messageTypeDialog: messageType, messageTypeDialog: messageType,
onValueSelected: (MessageType value) { onValueSelected: (MessageType value) {
if (value == MessageType.ComplaintOnAnAppointment) { if (value == MessageType.ComplaintOnAnAppointment) {
appoList.clear();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
model.getPatentAppointmentHistory().then((value) { service.getPatientAppointmentHistory(false, context, isForCOC: true).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
setState(() {
if (res['MessageStatus'] == 1) {
if (res['AppoimentAllHistoryResultList'].length != 0) {
res['AppoimentAllHistoryResultList'].forEach((v) {
appoList.add(new AppoitmentAllHistoryResultList.fromJson(v));
});
setState(() { setState(() {
appointHistory = null; appointHistory = null;
isShowListAppointHistory = true; isShowListAppointHistory = true;
}); });
} else {}
} else {
}
});
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
// print(err);
// AppToast.showErrorToast(message: err);
// Navigator.of(context).pop();
}); });
} else { } else {
isShowListAppointHistory = false; isShowListAppointHistory = false;
@ -620,7 +572,7 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
leading: Radio( leading: Radio(
value: MessageType.NON, value: MessageType.NON,
groupValue: messageTypeDialog, groupValue: messageTypeDialog,
activeColor: Theme.of(context).primaryColor, activeColor: CustomColors.accentColor,
onChanged: (MessageType value) => setMessageDialogType(value), onChanged: (MessageType value) => setMessageDialogType(value),
), ),
), ),
@ -642,7 +594,7 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
leading: Radio( leading: Radio(
value: MessageType.ComplaintOnAnAppointment, value: MessageType.ComplaintOnAnAppointment,
groupValue: messageTypeDialog, groupValue: messageTypeDialog,
activeColor: Theme.of(context).primaryColor, activeColor: CustomColors.accentColor,
onChanged: (MessageType value) => setMessageDialogType(value), onChanged: (MessageType value) => setMessageDialogType(value),
), ),
), ),
@ -664,7 +616,7 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
leading: Radio( leading: Radio(
value: MessageType.ComplaintWithoutAppointment, value: MessageType.ComplaintWithoutAppointment,
groupValue: messageTypeDialog, groupValue: messageTypeDialog,
activeColor: Theme.of(context).primaryColor, activeColor: CustomColors.accentColor,
onChanged: (MessageType value) => setMessageDialogType(value), onChanged: (MessageType value) => setMessageDialogType(value),
), ),
), ),
@ -686,7 +638,7 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
leading: Radio( leading: Radio(
value: MessageType.Question, value: MessageType.Question,
groupValue: messageTypeDialog, groupValue: messageTypeDialog,
activeColor: Theme.of(context).primaryColor, activeColor: CustomColors.accentColor,
onChanged: (MessageType value) => setMessageDialogType(value), onChanged: (MessageType value) => setMessageDialogType(value),
), ),
), ),
@ -708,7 +660,7 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
leading: Radio( leading: Radio(
value: MessageType.Compliment, value: MessageType.Compliment,
groupValue: messageTypeDialog, groupValue: messageTypeDialog,
activeColor: Theme.of(context).primaryColor, activeColor: CustomColors.accentColor,
onChanged: (MessageType value) => setMessageDialogType(value), onChanged: (MessageType value) => setMessageDialogType(value),
), ),
), ),
@ -730,7 +682,7 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
leading: Radio( leading: Radio(
value: MessageType.Suggestion, value: MessageType.Suggestion,
groupValue: messageTypeDialog, groupValue: messageTypeDialog,
activeColor: Theme.of(context).primaryColor, activeColor: CustomColors.accentColor,
onChanged: (MessageType value) => setMessageDialogType(value), onChanged: (MessageType value) => setMessageDialogType(value),
), ),
), ),
@ -763,7 +715,7 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
child: Center( child: Center(
child: Texts( child: Texts(
TranslationBase.of(context).cancel, TranslationBase.of(context).cancel,
color: Theme.of(context).primaryColor, color: CustomColors.accentColor,
), ),
), ),
), ),

@ -36,7 +36,6 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
itemCount: model.cOCItemList.length, itemCount: model.cOCItemList.length,
itemBuilder: (context, index) => InkWell( itemBuilder: (context, index) => InkWell(
onTap: () { onTap: () {
// gotodetails(model.cOCItemList[index]);
}, },
child: Card( child: Card(
shape: cardRadius(12), shape: cardRadius(12),
@ -124,7 +123,9 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
), ),
), ),
), ),
Container( ],
),
bottomSheet: Container(
color: Colors.white, color: Colors.white,
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: DefaultButton( child: DefaultButton(
@ -133,8 +134,6 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
disabledColor: Colors.grey, disabledColor: Colors.grey,
), ),
), ),
],
),
), ),
); );
} }

@ -77,6 +77,8 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
SignalRUtil signalRUtil; SignalRUtil signalRUtil;
ToDoCountProviderModel toDoProvider;
bool _showBottomNavigationBar = true; bool _showBottomNavigationBar = true;
///inject the user data ///inject the user data
@ -505,6 +507,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
setState(() { setState(() {
notificationCount = notificationCount =
value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
model.setState(model.count, true, num.tryParse(notificationCount));
sharedPref.setString(NOTIFICATION_COUNT, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
}) })
} }
@ -555,14 +558,14 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
pageController.jumpToPage(0); pageController.jumpToPage(0);
}, },
), ),
projectViewModel.isLogin && notificationCount != '' projectViewModel.isLogin && model.notificationsCount != 0
? new Positioned( ? new Positioned(
right: projectViewModel.isArabic ? 35 : 0, right: projectViewModel.isArabic ? 35 : 0,
top: 5, top: 5,
child: new Container( child: new Container(
padding: EdgeInsets.all(4), padding: EdgeInsets.all(4),
decoration: new BoxDecoration( decoration: new BoxDecoration(
color: Colors.red, color: CustomColors.accentColor,
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
), ),
constraints: BoxConstraints( constraints: BoxConstraints(
@ -570,7 +573,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
minHeight: 20, minHeight: 20,
), ),
child: new Text( child: new Text(
notificationCount, model.notificationsCount.toString(),
style: new TextStyle( style: new TextStyle(
color: Colors.white, color: Colors.white,
fontSize: projectViewModel.isArabic ? 8 : 9, fontSize: projectViewModel.isArabic ? 8 : 9,
@ -677,6 +680,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
setState(() { setState(() {
if (value != null) { if (value != null) {
notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
model.setState(model.count, true, num.tryParse(notificationCount));
sharedPref.setString(NOTIFICATION_COUNT, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
} }
}), }),

@ -170,11 +170,11 @@ class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
), ),
InkWell( InkWell(
onTap: (){ onTap: (){
Navigator.pop(context, "schedule"); // Navigator.pop(context, "schedule");
}, },
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.grey[700], color: Colors.grey[400],
borderRadius: BorderRadius.all(Radius.circular(10.0))), borderRadius: BorderRadius.all(Radius.circular(10.0))),
height: 100.0, height: 100.0,
margin: EdgeInsets.only(top: 20.0), margin: EdgeInsets.only(top: 20.0),

@ -160,9 +160,9 @@ class _ConfirmLogin extends State<ConfirmLogin> {
), ),
Text( Text(
user.editedOn != null user.editedOn != null
? DateUtil.formatDateToDate(DateUtil.convertStringToDate(user.editedOn), projectViewModel.isArabic) ? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user.editedOn))
: user.createdOn != null : user.createdOn != null
? DateUtil.formatDateToDate(DateUtil.convertStringToDate(user.createdOn), projectViewModel.isArabic) ? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user.createdOn))
: '--', : '--',
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48),
), ),
@ -191,9 +191,9 @@ class _ConfirmLogin extends State<ConfirmLogin> {
Expanded(child: SizedBox()), Expanded(child: SizedBox()),
Text( Text(
user.editedOn != null user.editedOn != null
? DateUtil.formatDateToTime(DateUtil.convertStringToDate(user.editedOn)) ? DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(user.editedOn), false)
: user.createdOn != null : user.createdOn != null
? DateUtil.formatDateToTime(DateUtil.convertStringToDate(user.createdOn)) ? DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(user.createdOn), false)
: '--', : '--',
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.48), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.48),
), ),
@ -582,11 +582,11 @@ class _ConfirmLogin extends State<ConfirmLogin> {
} }
getToDoCount() { getToDoCount() {
toDoProvider.setState(0, true); toDoProvider.setState(0, true, 0);
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true); toDoProvider.setState(res['AppointmentActiveNumber'], true, 0);
} else {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);

@ -359,12 +359,12 @@ class _Login extends State<Login> {
} }
getToDoCount() { getToDoCount() {
toDoProvider.setState(0, true); toDoProvider.setState(0, true, toDoProvider.notificationsCount);
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
print(res['AppointmentActiveNumber']); print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true); toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount);
} else {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);

@ -109,11 +109,11 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Text( Text(
DateUtil.formatDateToDate(prescriptionsOrder.createdOn, projectViewModel.isArabic), DateUtil.getDayMonthYearDateFormatted(prescriptionsOrder.createdOn),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
), ),
Text( Text(
DateUtil.formatDateToTime(prescriptionsOrder.createdOn), DateUtil.formatDateToTimeLang(prescriptionsOrder.createdOn, false),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
), ),
], ],

@ -119,11 +119,11 @@ class PrescriptionsHistoryPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Text( Text(
DateUtil.formatDateToDate(prescriptionsViewModel.prescriptionsHistory[index].createdOn, projectViewModel.isArabic), DateUtil.getDayMonthYearDateFormatted(prescriptionsViewModel.prescriptionsHistory[index].createdOn),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
), ),
Text( Text(
DateUtil.formatDateToTime(prescriptionsViewModel.prescriptionsHistory[index].createdOn), DateUtil.formatDateToTimeLang(prescriptionsViewModel.prescriptionsHistory[index].createdOn, false),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
), ),
], ],

@ -96,7 +96,7 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
height: 25 / 16), height: 25 / 16),
), ),
Text( Text(
model.appointmentDetails.startTime, model.appointmentDetails.startTime.toString().substring(0, 5),
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -131,7 +131,7 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
projectViewModel.isArabic), projectViewModel.isArabic),
myRichText( myRichText(
TranslationBase.of(context).date + ":", TranslationBase.of(context).date + ":",
DateUtil.getMonthDayYearDateFormatted( DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDate(model DateUtil.convertStringToDate(model
.appointmentDetails .appointmentDetails
.appointmentDate)), .appointmentDate)),

@ -496,7 +496,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getPatientAppointmentHistory(bool isActiveAppointment, BuildContext context) async { Future<Map> getPatientAppointmentHistory(bool isActiveAppointment, BuildContext context, {bool isForCOC = false}) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -520,6 +520,7 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": req.DeviceTypeID, "DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID, "PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType, "PatientTypeID": authUser.patientType,
"IsComingFromCOC": isForCOC,
"PatientType": authUser.patientType "PatientType": authUser.patientType
}; };

@ -406,7 +406,7 @@ class DateUtil {
/// get data formatted like 10:30 according to lang /// get data formatted like 10:30 according to lang
static String formatDateToTimeLang(DateTime date, bool isArabic) { static String formatDateToTimeLang(DateTime date, bool isArabic) {
return DateFormat('hh:mm a', isArabic ? "ar_SA" : "en_US").format(date); return DateFormat('HH:mm', isArabic ? "ar_SA" : "en_US").format(date);
} }
/// get data formatted like 26/4/2020 10:30 /// get data formatted like 26/4/2020 10:30

@ -20,6 +20,7 @@ import 'package:diplomaticquarterapp/pages/webRTC/call_page.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/family_files/family_files_provider.dart'; import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/theme/theme_notifier.dart'; import 'package:diplomaticquarterapp/theme/theme_notifier.dart';
import 'package:diplomaticquarterapp/theme/theme_value.dart'; import 'package:diplomaticquarterapp/theme/theme_value.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
@ -328,12 +329,12 @@ class _AppDrawerState extends State<AppDrawer> {
letterSpacing: -0.84, letterSpacing: -0.84,
fontSize: 14, fontSize: 14,
projectProvider: projectProvider, projectProvider: projectProvider,
count: notificationCount != null count: toDoProvider.notificationsCount != 0
? new Container( ? new Container(
padding: EdgeInsets.all(4), padding: EdgeInsets.all(4),
margin: EdgeInsets.all(2), margin: EdgeInsets.all(2),
decoration: new BoxDecoration( decoration: new BoxDecoration(
color: Colors.red, color: CustomColors.accentColor,
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
), ),
constraints: BoxConstraints( constraints: BoxConstraints(
@ -341,7 +342,7 @@ class _AppDrawerState extends State<AppDrawer> {
minHeight: 20, minHeight: 20,
), ),
child: new Text( child: new Text(
notificationCount, toDoProvider.notificationsCount.toString(),
style: new TextStyle( style: new TextStyle(
color: Colors.white, color: Colors.white,
fontSize: projectProvider.isArabic ? 8 : 9, fontSize: projectProvider.isArabic ? 8 : 9,
@ -605,12 +606,12 @@ class _AppDrawerState extends State<AppDrawer> {
} }
getToDoCount() { getToDoCount() {
toDoProvider.setState(0, true); toDoProvider.setState(0, true, toDoProvider.notificationsCount);
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
print(res['AppointmentActiveNumber']); print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1 && res['AppointmentActiveNumber'] != null) { if (res['MessageStatus'] == 1 && res['AppointmentActiveNumber'] != null) {
toDoProvider.setState(res['AppointmentActiveNumber'], true); toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount);
} else {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);

Loading…
Cancel
Save