|
|
|
@ -1,6 +1,8 @@
|
|
|
|
|
import 'package:diplomaticquarterapp/config/config.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/enum/viewstate.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/services/robo_search/event_provider.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
|
|
|
@ -20,6 +22,7 @@ import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
|
|
|
|
import 'package:permission_handler/permission_handler.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
import 'package:speech_to_text/speech_recognition_error.dart';
|
|
|
|
|
import 'dart:convert';
|
|
|
|
|
import 'dart:io';
|
|
|
|
@ -27,6 +30,10 @@ import 'appointment_history.dart';
|
|
|
|
|
import 'package:speech_to_text/speech_to_text.dart' as stt;
|
|
|
|
|
|
|
|
|
|
class SendFeedbackPage extends StatefulWidget {
|
|
|
|
|
final AppoitmentAllHistoryResultList appointment;
|
|
|
|
|
final MessageType messageType;
|
|
|
|
|
const SendFeedbackPage({Key key, this.appointment, this.messageType = MessageType.NON}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_SendFeedbackPageState createState() => _SendFeedbackPageState();
|
|
|
|
|
}
|
|
|
|
@ -36,7 +43,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
|
|
|
|
|
TextEditingController messageController = TextEditingController();
|
|
|
|
|
List<String> images = [];
|
|
|
|
|
String title;
|
|
|
|
|
AppointmentHistory appointHistory;
|
|
|
|
|
AppoitmentAllHistoryResultList appointHistory;
|
|
|
|
|
bool isShowListAppointHistory = true;
|
|
|
|
|
String message;
|
|
|
|
|
final formKey = GlobalKey<FormState>();
|
|
|
|
@ -73,17 +80,23 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
|
|
|
|
|
setMessageType(MessageType messageType) {
|
|
|
|
|
setState(() {
|
|
|
|
|
this.messageType = messageType;
|
|
|
|
|
this.appointHistory = widget.appointment;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
setState(() {
|
|
|
|
|
this.messageType = widget.messageType;
|
|
|
|
|
this.appointHistory = widget.appointment;
|
|
|
|
|
});
|
|
|
|
|
requestPermissions();
|
|
|
|
|
super.initState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
|
return BaseView<FeedbackViewModel>(
|
|
|
|
|
allowAny: true,
|
|
|
|
|
builder: (_, model, widget) => AppScaffold(
|
|
|
|
@ -144,14 +157,59 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
isShowListAppointHistory = true;
|
|
|
|
|
isShowListAppointHistory = true;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.circular(8)
|
|
|
|
|
),
|
|
|
|
|
child: Row(
|
|
|
|
|
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(
|
|
|
|
|
flex: 4,
|
|
|
|
|
child: Column(
|
|
|
|
@ -182,9 +240,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
DateUtil
|
|
|
|
|
.getMonthDayYearDateFormatted(
|
|
|
|
|
appointHistory
|
|
|
|
|
.appointmentDate),
|
|
|
|
|
.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(appointHistory.appointmentDate)),
|
|
|
|
|
variant: 'caption3',
|
|
|
|
|
),
|
|
|
|
|
StarRating(
|
|
|
|
@ -278,10 +334,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
|
|
|
|
|
bold: true,
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
DateUtil.getMonthDayYearDateFormatted(model
|
|
|
|
|
.appointHistoryList[
|
|
|
|
|
index]
|
|
|
|
|
.appointmentDate),
|
|
|
|
|
DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(model.appointHistoryList[index].appointmentDate)),
|
|
|
|
|
variant: 'caption3',
|
|
|
|
|
),
|
|
|
|
|
StarRating(
|
|
|
|
|