|
|
|
|
@ -1,12 +1,16 @@
|
|
|
|
|
import 'package:doctor_app_flutter/config/config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/PatientMedicalReportViewModel.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
@ -14,23 +18,28 @@ 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_to_text.dart' as stt;
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/MedicalReport/MeidcalReportModel.dart';
|
|
|
|
|
|
|
|
|
|
class AddVerifyMedicalReport extends StatefulWidget {
|
|
|
|
|
final MedicalReportStatus status;
|
|
|
|
|
|
|
|
|
|
AddVerifyMedicalReport(this.status);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_AddVerifyMedicalReportState createState() => _AddVerifyMedicalReportState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
|
|
|
|
|
stt.SpeechToText speech = stt.SpeechToText();
|
|
|
|
|
var reconizedWord;
|
|
|
|
|
stt.SpeechToText speechHistoryFinding = stt.SpeechToText();
|
|
|
|
|
stt.SpeechToText speechLaboratoryData = stt.SpeechToText();
|
|
|
|
|
stt.SpeechToText speechRecommendation = stt.SpeechToText();
|
|
|
|
|
var recognizedWord1;
|
|
|
|
|
var recognizedWord2;
|
|
|
|
|
var recognizedWord3;
|
|
|
|
|
var event = RobotProvider();
|
|
|
|
|
|
|
|
|
|
TextEditingController commentController = TextEditingController();
|
|
|
|
|
TextEditingController historyFindingController = TextEditingController();
|
|
|
|
|
TextEditingController laboratoryDataController = TextEditingController();
|
|
|
|
|
TextEditingController recommendationController = TextEditingController();
|
|
|
|
|
String commentsError;
|
|
|
|
|
String comments2Error;
|
|
|
|
|
String comments3Error;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
@ -38,7 +47,15 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
|
|
|
|
|
event.controller.stream.listen((p) {
|
|
|
|
|
if (p['startPopUp'] == 'true') {
|
|
|
|
|
if (this.mounted) {
|
|
|
|
|
initSpeechState().then((value) => {onVoiceText()});
|
|
|
|
|
initSpeechState().then((value) {
|
|
|
|
|
onVoiceText();
|
|
|
|
|
});
|
|
|
|
|
initSpeechState2().then((value) {
|
|
|
|
|
onVoiceText2();
|
|
|
|
|
});
|
|
|
|
|
initSpeechState3().then((value) {
|
|
|
|
|
onVoiceText3();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
@ -48,79 +65,229 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
ProjectViewModel projectViewModel = Provider.of<ProjectViewModel>(context);
|
|
|
|
|
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
|
|
|
|
PatiantInformtion patient = routeArgs['patient'];
|
|
|
|
|
MedicalReportStatus status = routeArgs['status'];
|
|
|
|
|
MedicalReportModel medicalReport = routeArgs.containsKey("medicalReport")
|
|
|
|
|
? routeArgs['medicalReport']
|
|
|
|
|
: null;
|
|
|
|
|
|
|
|
|
|
// model.medicalReportTemplate[0].templateTextHtml
|
|
|
|
|
|
|
|
|
|
return BaseView<BaseViewModel>(
|
|
|
|
|
return BaseView<PatientMedicalReportViewModel>(
|
|
|
|
|
onModelReady: (model) => model.getMedicalReportTemplate(),
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
isShowAppBar: true,
|
|
|
|
|
appBarTitle: widget.status == MedicalReportStatus.ADD
|
|
|
|
|
appBarTitle: status == MedicalReportStatus.ADD
|
|
|
|
|
? TranslationBase.of(context).medicalReportAdd
|
|
|
|
|
: TranslationBase.of(context).medicalReportVerify,
|
|
|
|
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
|
body: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
child: Container(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Stack(
|
|
|
|
|
children: [
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
|
.sickLeaveComments,
|
|
|
|
|
controller: commentController,
|
|
|
|
|
maxLines: 30,
|
|
|
|
|
minLines: 20,
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
validationError: commentsError,
|
|
|
|
|
),
|
|
|
|
|
Positioned(
|
|
|
|
|
top: -2,
|
|
|
|
|
//MediaQuery.of(context).size.height * 0,
|
|
|
|
|
right: projectViewModel.isArabic
|
|
|
|
|
? MediaQuery.of(context).size.width *
|
|
|
|
|
0.75
|
|
|
|
|
: 15,
|
|
|
|
|
child: Column(
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.all(16),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
child: Container(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Stack(
|
|
|
|
|
children: [
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
|
.historyPhysicalFinding,
|
|
|
|
|
controller: historyFindingController,
|
|
|
|
|
maxLines: 15,
|
|
|
|
|
minLines: 10,
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
validationError: commentsError,
|
|
|
|
|
),
|
|
|
|
|
Positioned(
|
|
|
|
|
top: -2,
|
|
|
|
|
//MediaQuery.of(context).size.height * 0,
|
|
|
|
|
right: projectViewModel.isArabic
|
|
|
|
|
? MediaQuery.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.width *
|
|
|
|
|
0.75
|
|
|
|
|
: 15,
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
IconButton(
|
|
|
|
|
icon: Icon(
|
|
|
|
|
DoctorApp.speechtotext,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
size: 35),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
initSpeechState().then(
|
|
|
|
|
(value) =>
|
|
|
|
|
{onVoiceText()});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Stack(
|
|
|
|
|
children: [
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
|
.laboratoryPhysicalData,
|
|
|
|
|
controller: laboratoryDataController,
|
|
|
|
|
maxLines: 15,
|
|
|
|
|
minLines: 10,
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
validationError: comments2Error,
|
|
|
|
|
),
|
|
|
|
|
Positioned(
|
|
|
|
|
top: -2,
|
|
|
|
|
//MediaQuery.of(context).size.height * 0,
|
|
|
|
|
right: projectViewModel.isArabic
|
|
|
|
|
? MediaQuery.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.width *
|
|
|
|
|
0.75
|
|
|
|
|
: 15,
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
IconButton(
|
|
|
|
|
icon: Icon(
|
|
|
|
|
DoctorApp.speechtotext,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
size: 35),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
initSpeechState2().then(
|
|
|
|
|
(value) =>
|
|
|
|
|
{onVoiceText2()});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Stack(
|
|
|
|
|
children: [
|
|
|
|
|
IconButton(
|
|
|
|
|
icon: Icon(DoctorApp.speechtotext,
|
|
|
|
|
color: Colors.black, size: 35),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
initSpeechState().then(
|
|
|
|
|
(value) => {onVoiceText()});
|
|
|
|
|
},
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
|
.impressionRecommendation,
|
|
|
|
|
controller: recommendationController,
|
|
|
|
|
maxLines: 15,
|
|
|
|
|
minLines: 10,
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
validationError: comments3Error,
|
|
|
|
|
),
|
|
|
|
|
Positioned(
|
|
|
|
|
top: -2,
|
|
|
|
|
//MediaQuery.of(context).size.height * 0,
|
|
|
|
|
right: projectViewModel.isArabic
|
|
|
|
|
? MediaQuery.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.width *
|
|
|
|
|
0.75
|
|
|
|
|
: 15,
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
IconButton(
|
|
|
|
|
icon: Icon(
|
|
|
|
|
DoctorApp.speechtotext,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
size: 35),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
initSpeechState3().then(
|
|
|
|
|
(value) =>
|
|
|
|
|
{onVoiceText3()});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(16.0),
|
|
|
|
|
child: AppButton(
|
|
|
|
|
title: widget.status == MedicalReportStatus.ADD
|
|
|
|
|
? TranslationBase.of(context).medicalReportAdd
|
|
|
|
|
: TranslationBase.of(context).medicalReportVerify,
|
|
|
|
|
color: Color(0xff359846),
|
|
|
|
|
// disabled: progressNoteController.text.isEmpty,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
if (commentController.text == "") {
|
|
|
|
|
commentsError =
|
|
|
|
|
TranslationBase.of(context).fieldRequired;
|
|
|
|
|
} else {
|
|
|
|
|
commentsError = null;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
padding: EdgeInsets.all(16.0),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: AppButton(
|
|
|
|
|
title: status == MedicalReportStatus.ADD
|
|
|
|
|
? TranslationBase.of(context).save
|
|
|
|
|
: TranslationBase.of(context).save,
|
|
|
|
|
color: Color(0xffEAEAEA),
|
|
|
|
|
fontColor: Colors.black,
|
|
|
|
|
// disabled: progressNoteController.text.isEmpty,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
setState(() {
|
|
|
|
|
if (historyFindingController.text == "") {
|
|
|
|
|
commentsError =
|
|
|
|
|
TranslationBase.of(context).fieldRequired;
|
|
|
|
|
} else {
|
|
|
|
|
commentsError = null;
|
|
|
|
|
}
|
|
|
|
|
if (laboratoryDataController.text == "") {
|
|
|
|
|
comments2Error =
|
|
|
|
|
TranslationBase.of(context).fieldRequired;
|
|
|
|
|
} else {
|
|
|
|
|
comments2Error = null;
|
|
|
|
|
}
|
|
|
|
|
if (recommendationController.text == "") {
|
|
|
|
|
comments3Error =
|
|
|
|
|
TranslationBase.of(context).fieldRequired;
|
|
|
|
|
} else {
|
|
|
|
|
comments3Error = null;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
if (historyFindingController.text != "" &&
|
|
|
|
|
laboratoryDataController.text != "" &&
|
|
|
|
|
recommendationController.text != "") {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
model.insertMedicalReport(patient,
|
|
|
|
|
"${historyFindingController.text}\n${laboratoryDataController.text}\n${recommendationController.text}");
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(model.error);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 8,
|
|
|
|
|
),
|
|
|
|
|
if (medicalReport != null)
|
|
|
|
|
Expanded(
|
|
|
|
|
child: AppButton(
|
|
|
|
|
title: status == MedicalReportStatus.ADD
|
|
|
|
|
? TranslationBase.of(context).add
|
|
|
|
|
: TranslationBase.of(context).verify,
|
|
|
|
|
color: Color(0xff359846),
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
await model.verifyMedicalReport(
|
|
|
|
|
patient, medicalReport);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(model.error);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
@ -131,10 +298,10 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
|
|
|
|
|
onVoiceText() async {
|
|
|
|
|
new SpeechToText(context: context).showAlertDialog(context);
|
|
|
|
|
var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode;
|
|
|
|
|
bool available = await speech.initialize(
|
|
|
|
|
bool available = await speechHistoryFinding.initialize(
|
|
|
|
|
onStatus: statusListener, onError: errorListener);
|
|
|
|
|
if (available) {
|
|
|
|
|
speech.listen(
|
|
|
|
|
speechHistoryFinding.listen(
|
|
|
|
|
onResult: resultListener,
|
|
|
|
|
listenMode: stt.ListenMode.confirmation,
|
|
|
|
|
localeId: lang == 'en' ? 'en-US' : 'ar-SA',
|
|
|
|
|
@ -144,6 +311,38 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onVoiceText2() async {
|
|
|
|
|
new SpeechToText(context: context).showAlertDialog(context);
|
|
|
|
|
var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode;
|
|
|
|
|
bool available = await speechLaboratoryData.initialize(
|
|
|
|
|
onStatus: statusListener, onError: errorListener);
|
|
|
|
|
if (available) {
|
|
|
|
|
speechLaboratoryData.listen(
|
|
|
|
|
onResult: resultListener2,
|
|
|
|
|
listenMode: stt.ListenMode.confirmation,
|
|
|
|
|
localeId: lang == 'en' ? 'en-US' : 'ar-SA',
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
print("The user has denied the use of speech recognition.");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onVoiceText3() async {
|
|
|
|
|
new SpeechToText(context: context).showAlertDialog(context);
|
|
|
|
|
var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode;
|
|
|
|
|
bool available = await speechRecommendation.initialize(
|
|
|
|
|
onStatus: statusListener, onError: errorListener);
|
|
|
|
|
if (available) {
|
|
|
|
|
speechRecommendation.listen(
|
|
|
|
|
onResult: resultListener3,
|
|
|
|
|
listenMode: stt.ListenMode.confirmation,
|
|
|
|
|
localeId: lang == 'en' ? 'en-US' : 'ar-SA',
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
print("The user has denied the use of speech recognition.");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void errorListener(SpeechRecognitionError error) {
|
|
|
|
|
event.setValue({"searchText": 'null'});
|
|
|
|
|
//SpeechToText.closeAlertDialog(context);
|
|
|
|
|
@ -151,7 +350,9 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void statusListener(String status) {
|
|
|
|
|
reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....';
|
|
|
|
|
recognizedWord1 = status == 'listening' ? 'Lisening...' : 'Sorry....';
|
|
|
|
|
recognizedWord2 = status == 'listening' ? 'Lisening...' : 'Sorry....';
|
|
|
|
|
recognizedWord3 = status == 'listening' ? 'Lisening...' : 'Sorry....';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void requestPermissions() async {
|
|
|
|
|
@ -161,14 +362,44 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void resultListener(result) {
|
|
|
|
|
reconizedWord = result.recognizedWords;
|
|
|
|
|
event.setValue({"searchText": reconizedWord});
|
|
|
|
|
recognizedWord1 = result.recognizedWords;
|
|
|
|
|
event.setValue({"searchText": recognizedWord1});
|
|
|
|
|
|
|
|
|
|
if (result.finalResult == true) {
|
|
|
|
|
setState(() {
|
|
|
|
|
SpeechToText.closeAlertDialog(context);
|
|
|
|
|
speechHistoryFinding.stop();
|
|
|
|
|
historyFindingController.text += recognizedWord1 + '\n';
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
print(result.finalResult);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void resultListener2(result) {
|
|
|
|
|
recognizedWord2 = result.recognizedWords;
|
|
|
|
|
event.setValue({"searchText": recognizedWord2});
|
|
|
|
|
|
|
|
|
|
if (result.finalResult == true) {
|
|
|
|
|
setState(() {
|
|
|
|
|
SpeechToText.closeAlertDialog(context);
|
|
|
|
|
speechLaboratoryData.stop();
|
|
|
|
|
laboratoryDataController.text += recognizedWord2 + '\n';
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
print(result.finalResult);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void resultListener3(result) {
|
|
|
|
|
recognizedWord3 = result.recognizedWords;
|
|
|
|
|
event.setValue({"searchText": recognizedWord3});
|
|
|
|
|
|
|
|
|
|
if (result.finalResult == true) {
|
|
|
|
|
setState(() {
|
|
|
|
|
SpeechToText.closeAlertDialog(context);
|
|
|
|
|
speech.stop();
|
|
|
|
|
commentController.text += reconizedWord + '\n';
|
|
|
|
|
speechRecommendation.stop();
|
|
|
|
|
recommendationController.text += recognizedWord3 + '\n';
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
print(result.finalResult);
|
|
|
|
|
@ -176,7 +407,21 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> initSpeechState() async {
|
|
|
|
|
bool hasSpeech = await speech.initialize(
|
|
|
|
|
bool hasSpeech = await speechHistoryFinding.initialize(
|
|
|
|
|
onError: errorListener, onStatus: statusListener);
|
|
|
|
|
print(hasSpeech);
|
|
|
|
|
if (!mounted) return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> initSpeechState2() async {
|
|
|
|
|
bool hasSpeech = await speechLaboratoryData.initialize(
|
|
|
|
|
onError: errorListener, onStatus: statusListener);
|
|
|
|
|
print(hasSpeech);
|
|
|
|
|
if (!mounted) return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> initSpeechState3() async {
|
|
|
|
|
bool hasSpeech = await speechRecommendation.initialize(
|
|
|
|
|
onError: errorListener, onStatus: statusListener);
|
|
|
|
|
print(hasSpeech);
|
|
|
|
|
if (!mounted) return;
|
|
|
|
|
|