|
|
|
|
@ -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,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
|