|
|
|
|
@ -1,12 +1,19 @@
|
|
|
|
|
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/LiveCarePatientViewModel.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/helpers.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/button_bottom_sheet.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';
|
|
|
|
|
import 'package:permission_handler/permission_handler.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
@ -30,6 +37,7 @@ class _LivaCareTransferToAdminState extends State<LivaCareTransferToAdmin> {
|
|
|
|
|
ProjectViewModel projectViewModel;
|
|
|
|
|
|
|
|
|
|
TextEditingController noteController = TextEditingController();
|
|
|
|
|
String noteError;
|
|
|
|
|
|
|
|
|
|
void initState() {
|
|
|
|
|
requestPermissions();
|
|
|
|
|
@ -51,10 +59,84 @@ class _LivaCareTransferToAdminState extends State<LivaCareTransferToAdmin> {
|
|
|
|
|
onModelReady: (model) {},
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
appBarTitle: "${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin}",
|
|
|
|
|
appBarTitle:
|
|
|
|
|
"${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin}",
|
|
|
|
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
|
isShowAppBar: true,
|
|
|
|
|
body: Container(),
|
|
|
|
|
body: Container(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
child: Container(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
margin: EdgeInsets.all(16),
|
|
|
|
|
child: Stack(
|
|
|
|
|
children: [
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
hintText: TranslationBase.of(context).notes,
|
|
|
|
|
//TranslationBase.of(context).addProgressNote,
|
|
|
|
|
controller: noteController,
|
|
|
|
|
maxLines: 35,
|
|
|
|
|
minLines: 25,
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
validationError: noteError,
|
|
|
|
|
),
|
|
|
|
|
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()});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
))
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
ButtonBottomSheet(
|
|
|
|
|
title:
|
|
|
|
|
"${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin}",
|
|
|
|
|
onPressed: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
if (noteController.text.isEmpty) {
|
|
|
|
|
noteError = TranslationBase.of(context).emptyMessage;
|
|
|
|
|
} else {
|
|
|
|
|
noteError = null;
|
|
|
|
|
}
|
|
|
|
|
if (noteController.text.isNotEmpty) {
|
|
|
|
|
Helpers.showConfirmationDialog(context,
|
|
|
|
|
"${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin} ?",
|
|
|
|
|
() async {
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
model.endCallWithCharge(widget.patient.vcId);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(model.error);
|
|
|
|
|
} else {
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|