updates & fixes

merge-update-with-lab-changes
haroon amjad 4 years ago
parent 503ab739ca
commit 01ca8b8f84

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

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

@ -1,39 +1,48 @@
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/model/notifications/get_notifications_request_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/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:provider/provider.dart';
import '../../locator.dart';
import 'base_view_model.dart';
class NotificationViewModel extends BaseViewModel {
NotificationService _notificationService = locator<NotificationService>();
ToDoCountProviderModel model = Provider.of<ToDoCountProviderModel>(AppGlobal.context);
List<GetNotificationsResponseModel> get notifications =>
_notificationService.notificationsList;
List<GetNotificationsResponseModel> get notifications => _notificationService.notificationsList;
Future getNotifications(
GetNotificationsRequestModel getNotificationsRequestModel, BuildContext context) async {
if(getNotificationsRequestModel.currentPage == 0)
setState(ViewState.Busy);
Future getNotifications(GetNotificationsRequestModel getNotificationsRequestModel, BuildContext context) async {
if (getNotificationsRequestModel.currentPage == 0) setState(ViewState.Busy);
await _notificationService
.getAllNotifications(getNotificationsRequestModel);
await _notificationService.getAllNotifications(getNotificationsRequestModel);
if (_notificationService.hasError) {
error = _notificationService.error;
setState(ViewState.Error);
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
setState(ViewState.Idle);
}
}
Future markAsRead(id) async {
// setState(ViewState.Busy);
MarkMessageAsReadRequestModel markMessageAsReadRequestModel =
new MarkMessageAsReadRequestModel(notificationPoolID: id);
MarkMessageAsReadRequestModel markMessageAsReadRequestModel = new MarkMessageAsReadRequestModel(notificationPoolID: id);
final authService = new AuthProvider();
await _notificationService.markAsRead(markMessageAsReadRequestModel);
setState(ViewState.Idle);
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);
}
}
}

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

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

@ -86,7 +86,7 @@ class _HospitalsLiveChatPageState extends State<HospitalsLiveChatPage> {
children: <Widget>[
Expanded(
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),
),
),

@ -32,7 +32,6 @@ class PharmaciesLiveChatPage extends StatelessWidget {
SizedBox(height: 20),
Text(
TranslationBase.of(context).instructions,
textAlign: TextAlign.center,
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),
child: DefaultButton(
TranslationBase.of(context).start,
() {
String chat;
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,
null,
// () {
// String chat;
// 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);
// },
disabledColor: Color(0xffEAEAEA),
),
),

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

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

@ -50,13 +50,12 @@ class NotificationsDetailsPage extends StatelessWidget {
height: 25,
),
Container(
// margin: EdgeInsets.only(left: 30),
width: double.infinity,
color: Colors.grey[400],
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
getDateForm(notification.createdOn),
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(notification.createdOn)) + " " + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(notification.createdOn), false),
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/pages/DrawerPages/notifications/notification_details_page.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/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -60,8 +61,9 @@ class NotificationsPage extends StatelessWidget {
.map(
(notification) => InkWell(
onTap: () async {
if (!notification.isRead)
if (!notification.isRead) {
model.markAsRead(notification.id);
}
Navigator.push(
context,
FadePage(
@ -82,7 +84,7 @@ class NotificationsPage extends StatelessWidget {
border: Border.all(
color: notification.isRead
? Colors.grey[200]
: Theme.of(context).primaryColor,
: CustomColors.accentColor,
width: 0.5),
),
child: Row(
@ -93,7 +95,7 @@ class NotificationsPage extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(getDateForm(notification.createdOn)),
Texts(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(notification.createdOn)) + " " + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(notification.createdOn), false)),
SizedBox(
height: 5,
),

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

@ -582,11 +582,11 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
}
getToDoCount() {
toDoProvider.setState(0, true);
toDoProvider.setState(0, true, toDoProvider.notificationsCount);
ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) {
if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true);
toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount);
} else {}
}).catchError((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/models/Appointments/AppoimentAllHistoryResultList.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/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
@ -50,6 +52,8 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
var reconizedWord;
var event = RobotProvider();
List<AppoitmentAllHistoryResultList> appoList = [];
String getSelected(BuildContext context) {
switch (messageType) {
case MessageType.ComplaintOnAnAppointment:
@ -174,105 +178,36 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
),
),
SizedBox(height: 12),
if (messageType == MessageType.ComplaintOnAnAppointment && model.appointHistoryList.length != 0 && isShowListAppointHistory)
if (messageType == MessageType.ComplaintOnAnAppointment && appoList.length != 0 && isShowListAppointHistory)
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(
itemCount: model.appointHistoryList.length,
itemCount: appoList.length,
itemBuilder: (context, index) => InkWell(
onTap: () {
setState(() {
appointHistory = model.appointHistoryList[index];
appointHistory = appoList[index];
isShowListAppointHistory = false;
});
},
child: DoctorCard(
onTap: null,
isInOutPatient: model.appointHistoryList[index].isInOutPatient,
name: model.appointHistoryList[index].doctorTitle + " " + model.appointHistoryList[index].doctorNameObj,
profileUrl: model.appointHistoryList[index].doctorImageURL,
subName: model.appointHistoryList[index].projectName,
isLiveCareAppointment: model.appointHistoryList[index].isLiveCareAppointment,
date: DateUtil.convertStringToDate(model.appointHistoryList[index].appointmentDate),
rating: model.appointHistoryList[index].actualDoctorRate + 0.0,
appointmentTime: model.appointHistoryList[index].startTime.substring(0, 5),
isInOutPatient: appoList[index].isInOutPatient,
name: appoList[index].doctorTitle + " " + appoList[index].doctorNameObj,
profileUrl: appoList[index].doctorImageURL,
subName: appoList[index].projectName,
isLiveCareAppointment: appoList[index].isLiveCareAppointment,
date: DateUtil.convertStringToDate(appoList[index].appointmentDate),
rating: appoList[index].actualDoctorRate + 0.0,
appointmentTime: appoList[index].startTime.substring(0, 5),
),
// Container(
// margin: EdgeInsets.only(left: 8, right: 8),
// color: Colors.white,
// child: Column(
// 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),
inputWidget(TranslationBase.of(context).subject, "", titleController),
SizedBox(height: 12),
inputWidget(TranslationBase.of(context).message, "xxxxxxxx", messageController, lines: 11, suffixTap: () {
inputWidget(TranslationBase.of(context).message, "", messageController, lines: 11, suffixTap: () {
openSpeechReco();
}),
SizedBox(height: 12),
@ -428,7 +363,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
TextField(
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: TextInputType.number,
keyboardType: TextInputType.text,
controller: _controller,
maxLines: lines,
onChanged: (value) => {setState(() {})},
@ -493,19 +428,36 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
// Show Dialog function
void confirmBox(FeedbackViewModel model) {
DoctorsListService service = new DoctorsListService();
showDialog(
context: context,
child: FeedbackTypeDialog(
messageTypeDialog: messageType,
onValueSelected: (MessageType value) {
if (value == MessageType.ComplaintOnAnAppointment) {
appoList.clear();
GifLoaderDialogUtils.showMyDialog(context);
model.getPatentAppointmentHistory().then((value) {
service.getPatientAppointmentHistory(false, context, isForCOC: true).then((res) {
GifLoaderDialogUtils.hideDialog(context);
setState(() {
appointHistory = null;
isShowListAppointHistory = true;
if (res['MessageStatus'] == 1) {
if (res['AppoimentAllHistoryResultList'].length != 0) {
res['AppoimentAllHistoryResultList'].forEach((v) {
appoList.add(new AppoitmentAllHistoryResultList.fromJson(v));
});
setState(() {
appointHistory = null;
isShowListAppointHistory = true;
});
} else {}
} else {
}
});
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
// print(err);
// AppToast.showErrorToast(message: err);
// Navigator.of(context).pop();
});
} else {
isShowListAppointHistory = false;
@ -620,7 +572,7 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
leading: Radio(
value: MessageType.NON,
groupValue: messageTypeDialog,
activeColor: Theme.of(context).primaryColor,
activeColor: CustomColors.accentColor,
onChanged: (MessageType value) => setMessageDialogType(value),
),
),
@ -642,7 +594,7 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
leading: Radio(
value: MessageType.ComplaintOnAnAppointment,
groupValue: messageTypeDialog,
activeColor: Theme.of(context).primaryColor,
activeColor: CustomColors.accentColor,
onChanged: (MessageType value) => setMessageDialogType(value),
),
),
@ -664,7 +616,7 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
leading: Radio(
value: MessageType.ComplaintWithoutAppointment,
groupValue: messageTypeDialog,
activeColor: Theme.of(context).primaryColor,
activeColor: CustomColors.accentColor,
onChanged: (MessageType value) => setMessageDialogType(value),
),
),
@ -686,7 +638,7 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
leading: Radio(
value: MessageType.Question,
groupValue: messageTypeDialog,
activeColor: Theme.of(context).primaryColor,
activeColor: CustomColors.accentColor,
onChanged: (MessageType value) => setMessageDialogType(value),
),
),
@ -708,7 +660,7 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
leading: Radio(
value: MessageType.Compliment,
groupValue: messageTypeDialog,
activeColor: Theme.of(context).primaryColor,
activeColor: CustomColors.accentColor,
onChanged: (MessageType value) => setMessageDialogType(value),
),
),
@ -730,7 +682,7 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
leading: Radio(
value: MessageType.Suggestion,
groupValue: messageTypeDialog,
activeColor: Theme.of(context).primaryColor,
activeColor: CustomColors.accentColor,
onChanged: (MessageType value) => setMessageDialogType(value),
),
),
@ -763,7 +715,7 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
child: Center(
child: Texts(
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,
itemBuilder: (context, index) => InkWell(
onTap: () {
// gotodetails(model.cOCItemList[index]);
},
child: Card(
shape: cardRadius(12),
@ -124,17 +123,17 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
),
),
),
Container(
color: Colors.white,
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: DefaultButton(
TranslationBase.of(context).search,
projectViewModel.isLogin ? null : () => {},
disabledColor: Colors.grey,
),
),
],
),
bottomSheet: Container(
color: Colors.white,
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: DefaultButton(
TranslationBase.of(context).search,
projectViewModel.isLogin ? null : () => {},
disabledColor: Colors.grey,
),
),
),
);
}

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

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

@ -160,9 +160,9 @@ class _ConfirmLogin extends State<ConfirmLogin> {
),
Text(
user.editedOn != null
? DateUtil.formatDateToDate(DateUtil.convertStringToDate(user.editedOn), projectViewModel.isArabic)
? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user.editedOn))
: 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),
),
@ -191,9 +191,9 @@ class _ConfirmLogin extends State<ConfirmLogin> {
Expanded(child: SizedBox()),
Text(
user.editedOn != null
? DateUtil.formatDateToTime(DateUtil.convertStringToDate(user.editedOn))
? DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(user.editedOn), false)
: 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),
),
@ -582,11 +582,11 @@ class _ConfirmLogin extends State<ConfirmLogin> {
}
getToDoCount() {
toDoProvider.setState(0, true);
toDoProvider.setState(0, true, 0);
ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) {
if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true);
toDoProvider.setState(res['AppointmentActiveNumber'], true, 0);
} else {}
}).catchError((err) {
print(err);

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

@ -109,11 +109,11 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end,
children: [
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),
),
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),
),
],

@ -119,11 +119,11 @@ class PrescriptionsHistoryPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end,
children: [
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),
),
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),
),
],

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

@ -496,7 +496,7 @@ class DoctorsListService extends BaseService {
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;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -520,6 +520,7 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType,
"IsComingFromCOC": isForCOC,
"PatientType": authUser.patientType
};

@ -406,7 +406,7 @@ class DateUtil {
/// get data formatted like 10:30 according to lang
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

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

Loading…
Cancel
Save