Merge branch 'fix_feedback' into 'development'

Fix feedback

See merge request Cloud_Solution/diplomatic-quarter!360
merge-requests/362/merge
Mohammad Aljammal 3 years ago
commit 10f4a30921

@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project # Uncomment this line to define a global platform for your project
# platform :ios, '11.0' # platform :ios, '10.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency. # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true' ENV['COCOAPODS_DISABLE_STATS'] = 'true'

@ -220,7 +220,6 @@
9705A1C41CF9048500538489 /* Embed Frameworks */, 9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
EFDAD5E1235DCA1DB6187148 /* [CP] Embed Pods Frameworks */, EFDAD5E1235DCA1DB6187148 /* [CP] Embed Pods Frameworks */,
835BB6C21DD911F74065B670 /* [CP] Copy Pods Resources */,
); );
buildRules = ( buildRules = (
); );
@ -320,23 +319,6 @@
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
}; };
835BB6C21DD911F74065B670 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
showEnvVarsInLog = 0;
};
9740EEB61CF901F6004384FC /* Run Script */ = { 9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;

@ -13,7 +13,7 @@ class SickLeave {
int appointmentNo; int appointmentNo;
int admissionNo; int admissionNo;
int actualDoctorRate; int actualDoctorRate;
String appointmentDate; DateTime appointmentDate;
String clinicName; String clinicName;
String doctorImageURL; String doctorImageURL;
String doctorName; String doctorName;
@ -80,7 +80,7 @@ class SickLeave {
appointmentNo = json['AppointmentNo']; appointmentNo = json['AppointmentNo'];
admissionNo = json['AdmissionNo']; admissionNo = json['AdmissionNo'];
actualDoctorRate = json['ActualDoctorRate']; actualDoctorRate = json['ActualDoctorRate'];
appointmentDate = json['AppointmentDate']; appointmentDate = DateUtil.convertStringToDate(json['AppointmentDate']);
clinicName = json['ClinicName']; clinicName = json['ClinicName'];
doctorImageURL = json['DoctorImageURL']; doctorImageURL = json['DoctorImageURL'];
doctorName = json['DoctorName']; doctorName = json['DoctorName'];

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/feedback/COC_items.dart'; import 'package:diplomaticquarterapp/core/model/feedback/COC_items.dart';
import 'package:diplomaticquarterapp/core/model/feedback/request_insert_coc_item.dart'; import 'package:diplomaticquarterapp/core/model/feedback/request_insert_coc_item.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
@ -11,14 +12,14 @@ import 'package:diplomaticquarterapp/uitl/utils.dart';
class FeedbackService extends BaseService { class FeedbackService extends BaseService {
List<COCItem> cOCItemList = List(); List<COCItem> cOCItemList = List();
RequestInsertCOCItem _requestInsertCOCItem = RequestInsertCOCItem(); RequestInsertCOCItem _requestInsertCOCItem = RequestInsertCOCItem();
List<AppointmentHistory> appointHistoryList = List(); List<AppoitmentAllHistoryResultList> appointHistoryList = List();
Future sendCOCItem( Future sendCOCItem(
{String title, {String title,
String details, String details,
String cOCTypeName, String cOCTypeName,
String attachment, String attachment,
AppointmentHistory appointHistory}) async { AppoitmentAllHistoryResultList appointHistory}) async {
hasError = false; hasError = false;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
@ -45,7 +46,7 @@ class FeedbackService extends BaseService {
if (appointHistory != null) { if (appointHistory != null) {
body['AppoinmentNo'] = appointHistory.appointmentNo; body['AppoinmentNo'] = appointHistory.appointmentNo;
body['AppointmentDate'] = DateUtil.convertDateToString(appointHistory.appointmentDate); body['AppointmentDate'] = appointHistory.appointmentDate;
body['ClinicID'] = appointHistory.clinicID; body['ClinicID'] = appointHistory.clinicID;
body['ClinicName'] = appointHistory.clinicName; body['ClinicName'] = appointHistory.clinicName;
body['DoctorID'] = appointHistory.doctorID; body['DoctorID'] = appointHistory.doctorID;
@ -88,7 +89,7 @@ class FeedbackService extends BaseService {
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
appointHistoryList = []; appointHistoryList = [];
response['AppoimentAllHistoryResultList'].forEach((appoint) { response['AppoimentAllHistoryResultList'].forEach((appoint) {
appointHistoryList.add(AppointmentHistory.fromJson(appoint)); appointHistoryList.add(AppoitmentAllHistoryResultList.fromJson(appoint));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/feedback/COC_items.dart'; import 'package:diplomaticquarterapp/core/model/feedback/COC_items.dart';
import 'package:diplomaticquarterapp/core/service/feedback/feedback_service.dart'; import 'package:diplomaticquarterapp/core/service/feedback/feedback_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -23,7 +24,7 @@ class FeedbackViewModel extends BaseViewModel {
List<COCItem> get cOCItemList => _feedbackService.cOCItemList; List<COCItem> get cOCItemList => _feedbackService.cOCItemList;
List<AppointmentHistory> get appointHistoryList => List<AppoitmentAllHistoryResultList> get appointHistoryList =>
_feedbackService.appointHistoryList; _feedbackService.appointHistoryList;
Future<bool> sendCOCItem( Future<bool> sendCOCItem(
@ -31,7 +32,7 @@ class FeedbackViewModel extends BaseViewModel {
String details, String details,
String cOCTypeName, String cOCTypeName,
String attachment, String attachment,
AppointmentHistory appointHistory}) async { AppoitmentAllHistoryResultList appointHistory}) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _feedbackService.sendCOCItem( await _feedbackService.sendCOCItem(
title: title, title: title,

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart';
import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart'; import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart';
import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_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/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/appoDetailsButtons.dart'; import 'package:diplomaticquarterapp/models/Appointments/appoDetailsButtons.dart';
@ -685,7 +686,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
} }
navigateToInsertComplaint() { navigateToInsertComplaint() {
Navigator.push(context, FadePage(page: FeedbackHomePage())); Navigator.push(context, FadePage(page: FeedbackHomePage(messageType: MessageType.ComplaintOnAnAppointment,appointment: widget.appo,)));
} }
rateAppointment() { rateAppointment() {

@ -5,7 +5,7 @@ class AppointmentHistory {
int projectID; int projectID;
int appointmentNo; int appointmentNo;
DateTime appointmentDate; DateTime appointmentDate;
Null appointmentDateN; dynamic appointmentDateN;
int appointmentType; int appointmentType;
String bookDate; String bookDate;
int patientType; int patientType;
@ -26,14 +26,14 @@ class AppointmentHistory {
String confirmedOn; String confirmedOn;
int arrivalChangedBy; int arrivalChangedBy;
DateTime arrivedOn; DateTime arrivedOn;
Null editedBy; dynamic editedBy;
Null editedOn; dynamic editedOn;
Null doctorName; dynamic doctorName;
Null doctorNameN; dynamic doctorNameN;
String statusDesc; String statusDesc;
Null statusDescN; dynamic statusDescN;
bool vitalStatus; bool vitalStatus;
Null vitalSignAppointmentNo; dynamic vitalSignAppointmentNo;
int episodeID; int episodeID;
int actualDoctorRate; int actualDoctorRate;
String clinicName; String clinicName;
@ -55,8 +55,8 @@ class AppointmentHistory {
bool isMedicalReportRequested; bool isMedicalReportRequested;
bool isOnlineCheckedIN; bool isOnlineCheckedIN;
String latitude; String latitude;
Null listHISGetContactLensPerscription; dynamic listHISGetContactLensPerscription;
Null listHISGetGlassPerscription; dynamic listHISGetGlassPerscription;
String longitude; String longitude;
int nextAction; int nextAction;
int noOfPatientsRate; int noOfPatientsRate;

@ -1,5 +1,7 @@
import 'dart:ui'; import 'dart:ui';
import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/pages/feedback/send_feedback_page.dart'; import 'package:diplomaticquarterapp/pages/feedback/send_feedback_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -10,6 +12,10 @@ import 'package:flutter/material.dart';
import 'status_feedback_page.dart'; import 'status_feedback_page.dart';
class FeedbackHomePage extends StatefulWidget { class FeedbackHomePage extends StatefulWidget {
final AppoitmentAllHistoryResultList appointment;
final MessageType messageType;
const FeedbackHomePage({Key key, this.appointment, this.messageType= MessageType.NON}) : super(key: key);
@override @override
_FeedbackHomePageState createState() => _FeedbackHomePageState(); _FeedbackHomePageState createState() => _FeedbackHomePageState();
} }
@ -105,7 +111,7 @@ class _FeedbackHomePageState extends State<FeedbackHomePage>
child: TabBarView( child: TabBarView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
controller: _tabController, controller: _tabController,
children: <Widget>[SendFeedbackPage(), StatusFeedbackPage()], children: <Widget>[SendFeedbackPage(appointment: widget.appointment,messageType: widget.messageType,), StatusFeedbackPage()],
), ),
) )
], ],

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_model.dart';
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/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
@ -20,6 +22,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_recognition_error.dart';
import 'dart:convert'; import 'dart:convert';
import 'dart:io'; import 'dart:io';
@ -27,6 +30,10 @@ import 'appointment_history.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt; import 'package:speech_to_text/speech_to_text.dart' as stt;
class SendFeedbackPage extends StatefulWidget { class SendFeedbackPage extends StatefulWidget {
final AppoitmentAllHistoryResultList appointment;
final MessageType messageType;
const SendFeedbackPage({Key key, this.appointment, this.messageType = MessageType.NON}) : super(key: key);
@override @override
_SendFeedbackPageState createState() => _SendFeedbackPageState(); _SendFeedbackPageState createState() => _SendFeedbackPageState();
} }
@ -36,7 +43,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
TextEditingController messageController = TextEditingController(); TextEditingController messageController = TextEditingController();
List<String> images = []; List<String> images = [];
String title; String title;
AppointmentHistory appointHistory; AppoitmentAllHistoryResultList appointHistory;
bool isShowListAppointHistory = true; bool isShowListAppointHistory = true;
String message; String message;
final formKey = GlobalKey<FormState>(); final formKey = GlobalKey<FormState>();
@ -73,17 +80,23 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
setMessageType(MessageType messageType) { setMessageType(MessageType messageType) {
setState(() { setState(() {
this.messageType = messageType; this.messageType = messageType;
this.appointHistory = widget.appointment;
}); });
} }
@override @override
void initState() { void initState() {
setState(() {
this.messageType = widget.messageType;
this.appointHistory = widget.appointment;
});
requestPermissions(); requestPermissions();
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<FeedbackViewModel>( return BaseView<FeedbackViewModel>(
allowAny: true, allowAny: true,
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
@ -144,14 +157,59 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
InkWell( InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
isShowListAppointHistory = true; isShowListAppointHistory = true;
}); });
}, },
child: Container( child: Container(
margin: EdgeInsets.all(8.0), margin: EdgeInsets.all(8.0),
color: Colors.white, decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8)
),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Container(
width: projectViewModel.isArabic ? 27 : 20,
height: projectViewModel.isArabic ? 105 : 90,
decoration: BoxDecoration(
//Colors.red[900] Color(0xff404545)
color: appointHistory.isLiveCareAppointment
? Color(0xff404545)
: !appointHistory.isInOutPatient
? Colors.red[900]
: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(0)
: Radius.circular(8),
bottomLeft: projectViewModel.isArabic
? Radius.circular(0)
: Radius.circular(8),
topRight: projectViewModel.isArabic
? Radius.circular(8)
: Radius.circular(0),
bottomRight: projectViewModel.isArabic
? Radius.circular(8)
: Radius.circular(0),
),
),
child: RotatedBox(
quarterTurns: 3,
child: Center(
child: Text(
appointHistory.isLiveCareAppointment
? TranslationBase.of(context).liveCare.toUpperCase()
: !appointHistory.isInOutPatient
? TranslationBase.of(context)
.inPatient
.toUpperCase()
: TranslationBase.of(context)
.outpatient
.toUpperCase(),
style: TextStyle(color: Colors.white,fontSize: 12),
),
)),
),
Expanded( Expanded(
flex: 4, flex: 4,
child: Column( child: Column(
@ -182,9 +240,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
), ),
Texts( Texts(
DateUtil DateUtil
.getMonthDayYearDateFormatted( .getMonthDayYearDateFormatted(DateUtil.convertStringToDate(appointHistory.appointmentDate)),
appointHistory
.appointmentDate),
variant: 'caption3', variant: 'caption3',
), ),
StarRating( StarRating(
@ -278,10 +334,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
bold: true, bold: true,
), ),
Texts( Texts(
DateUtil.getMonthDayYearDateFormatted(model DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(model.appointHistoryList[index].appointmentDate)),
.appointHistoryList[
index]
.appointmentDate),
variant: 'caption3', variant: 'caption3',
), ),
StarRating( StarRating(

@ -47,7 +47,7 @@ class _PatientSickLeavePageState extends State<PatientSickLeavePage> {
itemBuilder: (context, index) => DoctorCard( itemBuilder: (context, index) => DoctorCard(
isLiveCareAppointment: model.sickLeaveList[index].isLiveCareAppointment, isLiveCareAppointment: model.sickLeaveList[index].isLiveCareAppointment,
name: model.sickLeaveList[index].doctorName, name: model.sickLeaveList[index].doctorName,
date:projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr(model.sickLeaveList[index].requestDate):DateUtil.getMonthDayYearDateFormatted(model.sickLeaveList[index].requestDate), date:projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr(model.sickLeaveList[index].appointmentDate):DateUtil.getMonthDayYearDateFormatted(model.sickLeaveList[index].appointmentDate),
profileUrl: model.sickLeaveList[index].doctorImageURL, profileUrl: model.sickLeaveList[index].doctorImageURL,
rat: model.sickLeaveList[index].actualDoctorRate.toDouble(), rat: model.sickLeaveList[index].actualDoctorRate.toDouble(),
subName: model.sickLeaveList[index].projectName, subName: model.sickLeaveList[index].projectName,

Loading…
Cancel
Save