Merge branches 'development' and 'live_care_patient' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into live_care_patient

 Conflicts:
	lib/core/service/patient/LiveCarePatientServices.dart
	lib/core/viewModel/LiveCarePatientViewModel.dart
	lib/screens/patients/profile/profile_screen/patient_profile_screen.dart
merge-requests/690/head
Elham Rababah 5 years ago
commit fdc23ce932

@ -48,8 +48,8 @@ class BaseAppClient {
if (body['EditedBy'] == '') {
body.remove("EditedBy");
}
body['TokenID'] = "@dm!n";// token ?? '';
// body['TokenID'] = "@dm!n" ?? '';
body['TokenID'] = token ?? '';
// body['TokenID'] = "@dm!n" ?? '';
String lang = await sharedPref.getString(APP_Language);
if (lang != null && lang == 'ar')
body['LanguageID'] = 1;

@ -297,9 +297,11 @@ const GET_PROCEDURE_TEMPLETE =
const GET_PROCEDURE_TEMPLETE_DETAILS =
"Services/Doctors.svc/REST/DAPP_ProcedureTemplateDetailsGet";
const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP ='Services/DoctorApplication.svc/REST/GetPendingPatientERForDoctorApp';
const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP =
'Services/DoctorApplication.svc/REST/GetPendingPatientERForDoctorApp';
const DOCTOR_CHECK_HAS_LIVE_CARE = "Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare";
const DOCTOR_CHECK_HAS_LIVE_CARE =
"Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare";
var selectedPatientType = 1;

@ -1,6 +1,7 @@
const Map<String, Map<String, String>> localizedValues = {
'dashboardScreenToolbarTitle': {'ar': 'الرئيسة', 'en': 'Home'},
'settings': {'en': 'Settings', 'ar': 'الاعدادات'},
'areYouSureYouWantTo': {'en': 'Are you sure you want to', 'ar': 'هل انت متاكد من انك تريد أن'},
'language': {'en': 'App Language', 'ar': 'لغة التطبيق'},
'lanEnglish': {'en': 'English', 'ar': 'English'},
'lanArabic': {'en': 'العربية', 'ar': 'العربية'},

@ -53,6 +53,7 @@ class EntityList {
String remarks;
String status;
String template;
int doctorID;
EntityList(
{this.achiCode,
@ -78,10 +79,12 @@ class EntityList {
this.procedureName,
this.remarks,
this.status,
this.template});
this.template,
this.doctorID});
EntityList.fromJson(Map<String, dynamic> json) {
achiCode = json['achiCode'];
doctorID = json['doctorID'];
appointmentDate = json['appointmentDate'];
appointmentNo = json['appointmentNo'];
categoryID = json['categoryID'];
@ -110,6 +113,7 @@ class EntityList {
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['achiCode'] = this.achiCode;
data['doctorID'] = this.doctorID;
data['appointmentDate'] = this.appointmentDate;
data['appointmentNo'] = this.appointmentNo;
data['categoryID'] = this.categoryID;

@ -17,6 +17,7 @@ class LiveCarePatientServices extends BaseService {
var endCallResponse = {};
var transferToAdminResponse = {};
StartCallRes _startCallRes;
StartCallRes get startCallRes => _startCallRes;
@ -61,4 +62,39 @@ class LiveCarePatientServices extends BaseService {
super.error = error;
}, body: startCallReq.toJson());
}
Future endCallWithCharge(int vcID) async{
hasError = false;
await baseAppClient.post(
END_CALL_WITH_CHARGE,
onSuccess: (dynamic response, int statusCode) {
endCallResponse = response;
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: {
"VC_ID": vcID,
},
);
}
Future transferToAdmin(int vcID, String notes) async{
hasError = false;
await baseAppClient.post(
TRANSFERT_TO_ADMIN,
onSuccess: (dynamic response, int statusCode) {
transferToAdminResponse = response;
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: {
"VC_ID": vcID,
"IsOutKsa": false,
"Notes": notes,
},
);
}
}

@ -11,8 +11,6 @@ class PatientMedicalReportService extends BaseService {
Future getMedicalReportList(PatiantInformtion patient) async {
hasError = false;
Map<String, dynamic> body = Map();
// body['TokenID'] = "@dm!n";
body['SetupID'] = "91877";
body['AdmissionNo'] = patient.admissionNo;
await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_GET_LIST,

@ -84,6 +84,32 @@ class LiveCarePatientViewModel extends BaseViewModel {
}
}
Future endCallWithCharge(int vcID) async {
setState(ViewState.BusyLocal);
await _liveCarePatientServices
.endCallWithCharge(vcID);
if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error;
setState(ViewState.ErrorLocal);
} else {
await getPendingPatientERForDoctorApp();
setState(ViewState.Idle);
}
}
Future transferToAdmin(int vcID, String notes) async {
setState(ViewState.BusyLocal);
await _liveCarePatientServices
.transferToAdmin(vcID, notes);
if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error;
setState(ViewState.ErrorLocal);
} else {
await getPendingPatientERForDoctorApp();
setState(ViewState.Idle);
}
}
searchData(String str) {
var strExist= str.length > 0 ? true : false;
if (strExist) {

@ -421,8 +421,9 @@ class AuthenticationViewModel extends BaseViewModel {
doctorProfile = null;
sharedPref.setString(APP_Language, lang);
deleteUser();
await getDeviceInfoFromFirebase();
await getDeviceInfoFromFirebase();
this.isFromLogin = isFromLogin;
setState(ViewState.Idle);
Navigator.pushAndRemoveUntil(
AppGlobal.CONTEX,
FadePage(

@ -7,7 +7,7 @@ class DoctorProfileModel {
Null clinicDescriptionN;
Null licenseExpiry;
int employmentType;
Null setupID;
dynamic setupID;
int projectID;
String projectName;
String nationalityID;

@ -1,12 +1,19 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.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/screens/live_care/live-care_transfer_to_admin.dart';
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/PatientProfileCardModel.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/patients/profile/PatientProfileButton.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_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:flutter/material.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:hexcolor/hexcolor.dart';
@ -30,23 +37,38 @@ class _EndCallScreenState extends State<EndCallScreen> {
String from;
String to;
LiveCarePatientViewModel liveCareModel;
@override
Widget build(BuildContext context) {
final List<PatientProfileCardModel> cardsList = [
PatientProfileCardModel(TranslationBase.of(context).resume,
TranslationBase.of(context).theCall, '', 'patient/vital_signs.png',
isInPatient: isInpatient, onTap: () {}, isDartIcon: true,
isInPatient: isInpatient,
onTap: () {},
isDartIcon: true,
dartIcon: DoctorApp.call),
PatientProfileCardModel(
TranslationBase.of(context).endLC,
TranslationBase.of(context).consultation,
'',
'patient/vital_signs.png',
isInPatient: isInpatient,
onTap: () {},
isDartIcon: true,
dartIcon: DoctorApp.end_consultaion
),
isInPatient: isInpatient, onTap: () {
Helpers.showConfirmationDialog(context,
"${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).endLC} ${TranslationBase.of(context).consultation} ?",
() async {
Navigator.of(context).pop();
GifLoaderDialogUtils.showMyDialog(context);
liveCareModel.endCallWithCharge(widget.patient.vcId);
GifLoaderDialogUtils.hideDialog(context);
if (liveCareModel.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(liveCareModel.error);
} else {
Navigator.of(context).pop();
Navigator.of(context).pop();
}
});
}, isDartIcon: true, dartIcon: DoctorApp.end_consultaion),
PatientProfileCardModel(
TranslationBase.of(context).sendLC,
TranslationBase.of(context).instruction,
@ -55,128 +77,136 @@ class _EndCallScreenState extends State<EndCallScreen> {
onTap: () {},
isInPatient: isInpatient,
isDartIcon: true,
dartIcon: DoctorApp.send_instruction
),
PatientProfileCardModel(
TranslationBase.of(context).transferTo,
TranslationBase.of(context).admin,
'',
'patient/health_summary.png',
onTap: () {},
isInPatient: isInpatient,
isDartIcon: true,
dartIcon: DoctorApp.transfer_to_admin
),
dartIcon: DoctorApp.send_instruction),
PatientProfileCardModel(TranslationBase.of(context).transferTo,
TranslationBase.of(context).admin, '', 'patient/health_summary.png',
onTap: () {
Navigator.push(context, MaterialPageRoute(
builder: (BuildContext context) =>
LivaCareTransferToAdmin(patient:widget.patient)));
},
isInPatient: isInpatient,
isDartIcon: true,
dartIcon: DoctorApp.transfer_to_admin),
];
return AppScaffold(
appBarTitle: TranslationBase.of(context).patientProfile,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
isShowAppBar: true,
appBar: PatientProfileHeaderNewDesignAppBar(
widget.patient, arrivalType ?? '7', '1',
isInpatient: isInpatient,
height: (widget.patient.patientStatusType != null &&
widget.patient.patientStatusType == 43)
? 210
: isDischargedPatient
? 240
: 0,
isDischargedPatient: isDischargedPatient),
body: Container(
height: !isSearchAndOut
? isDischargedPatient
? MediaQuery.of(context).size.height * 0.64
: MediaQuery.of(context).size.height * 0.65
: MediaQuery.of(context).size.height * 0.69,
child: ListView(
children: [
Padding(
padding: const EdgeInsets.symmetric(
vertical: 15.0, horizontal: 15),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).patient,
fontSize: 14,
fontWeight: FontWeight.w500,
),
AppText(TranslationBase.of(context).endcall,
fontSize: 26,
fontWeight: FontWeight.bold,
),
SizedBox(height: 10,),
StaggeredGridView.countBuilder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
crossAxisSpacing: 10,
mainAxisSpacing: 10,
crossAxisCount: 3,
itemCount: cardsList.length,
staggeredTileBuilder: (int index) => StaggeredTile.fit(1),
itemBuilder: (BuildContext context, int index) =>
PatientProfileButton(
patient: widget.patient,
patientType: patientType,
arrivalType: arrivalType,
from: from,
to: to,
nameLine1: cardsList[index].nameLine1,
nameLine2: cardsList[index].nameLine2,
route: cardsList[index].route,
icon: cardsList[index].icon,
isInPatient: cardsList[index].isInPatient,
isDischargedPatient: cardsList[index].isDischargedPatient,
isDisable: cardsList[index].isDisable,
onTap: cardsList[index].onTap,
isLoading: cardsList[index].isLoading,
isDartIcon: cardsList[index].isDartIcon,
dartIcon: cardsList[index].dartIcon,
return BaseView<LiveCarePatientViewModel>(
onModelReady: (model) {
liveCareModel = model;
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).patientProfile,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
isShowAppBar: true,
appBar: PatientProfileHeaderNewDesignAppBar(
widget.patient, arrivalType ?? '7', '1',
isInpatient: isInpatient,
height: (widget.patient.patientStatusType != null &&
widget.patient.patientStatusType == 43)
? 210
: isDischargedPatient
? 240
: 0,
isDischargedPatient: isDischargedPatient),
body: Container(
height: !isSearchAndOut
? isDischargedPatient
? MediaQuery.of(context).size.height * 0.64
: MediaQuery.of(context).size.height * 0.65
: MediaQuery.of(context).size.height * 0.69,
child: ListView(
children: [
Padding(
padding:
const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).patient,
fontSize: 14,
fontWeight: FontWeight.w500,
),
),
],
AppText(
TranslationBase.of(context).endcall,
fontSize: 26,
fontWeight: FontWeight.bold,
),
SizedBox(
height: 10,
),
StaggeredGridView.countBuilder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
crossAxisSpacing: 10,
mainAxisSpacing: 10,
crossAxisCount: 3,
itemCount: cardsList.length,
staggeredTileBuilder: (int index) => StaggeredTile.fit(1),
itemBuilder: (BuildContext context, int index) =>
PatientProfileButton(
patient: widget.patient,
patientType: patientType,
arrivalType: arrivalType,
from: from,
to: to,
nameLine1: cardsList[index].nameLine1,
nameLine2: cardsList[index].nameLine2,
route: cardsList[index].route,
icon: cardsList[index].icon,
isInPatient: cardsList[index].isInPatient,
isDischargedPatient:
cardsList[index].isDischargedPatient,
isDisable: cardsList[index].isDisable,
onTap: cardsList[index].onTap,
isLoading: cardsList[index].isLoading,
isDartIcon: cardsList[index].isDartIcon,
dartIcon: cardsList[index].dartIcon,
),
),
],
),
),
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.05,
)
],
),
),
bottomSheet: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(0.0),
SizedBox(
height: MediaQuery.of(context).size.height * 0.05,
)
],
),
border: Border.all(color: HexColor('#707070'), width: 0),
),
height: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
bottomSheet: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(0.0),
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: Center(
child: AppButton(
fontWeight: FontWeight.w700,
color: Colors.red[600],
title: "Close", //TranslationBase.of(context).close,
onPressed: () async {},
border: Border.all(color: HexColor('#707070'), width: 0),
),
height: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: Center(
child: AppButton(
fontWeight: FontWeight.w700,
color: Colors.red[600],
title: "Close", //TranslationBase.of(context).close,
onPressed: () async {},
),
),
),
),
),
SizedBox(
height: 5,
),
],
SizedBox(
height: 5,
),
],
),
),
),
);

@ -0,0 +1,197 @@
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';
import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt;
class LivaCareTransferToAdmin extends StatefulWidget {
final PatiantInformtion patient;
const LivaCareTransferToAdmin({Key key, this.patient}) : super(key: key);
@override
_LivaCareTransferToAdminState createState() =>
_LivaCareTransferToAdminState();
}
class _LivaCareTransferToAdminState extends State<LivaCareTransferToAdmin> {
stt.SpeechToText speech = stt.SpeechToText();
var reconizedWord;
var event = RobotProvider();
ProjectViewModel projectViewModel;
TextEditingController noteController = TextEditingController();
String noteError;
void initState() {
requestPermissions();
event.controller.stream.listen((p) {
if (p['startPopUp'] == 'true') {
if (this.mounted) {
initSpeechState().then((value) => {onVoiceText()});
}
}
});
super.initState();
}
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return BaseView<LiveCarePatientViewModel>(
onModelReady: (model) {},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle:
"${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin}",
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
isShowAppBar: true,
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();
}
});
}
});
},
)
],
),
),
),
);
}
onVoiceText() async {
new SpeechToText(context: context).showAlertDialog(context);
var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode;
bool available = await speech.initialize(
onStatus: statusListener, onError: errorListener);
if (available) {
speech.listen(
onResult: resultListener,
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);
print(error);
}
void statusListener(String status) {
reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....';
}
void requestPermissions() async {
Map<Permission, PermissionStatus> statuses = await [
Permission.microphone,
].request();
}
void resultListener(result) {
reconizedWord = result.recognizedWords;
event.setValue({"searchText": reconizedWord});
if (result.finalResult == true) {
setState(() {
SpeechToText.closeAlertDialog(context);
speech.stop();
noteController.text += reconizedWord + '\n';
});
} else {
print(result.finalResult);
}
}
Future<void> initSpeechState() async {
bool hasSpeech = await speech.initialize(
onError: errorListener, onStatus: statusListener);
print(hasSpeech);
if (!mounted) return;
}
}

@ -80,7 +80,7 @@ class _VideoCallPageState extends State<VideoCallPage> {
});
},
onCallNotRespond: (SessionStatusModel sessionStatusModel) {
//TODO handling onCalcallNotRespondlEnd
//TODO handling onCalNotRespondEnd
WidgetsBinding.instance.addPostFrameCallback((_) {
changeRoute(context);
});

@ -283,7 +283,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
.initiateCall,
disabled: model.state == ViewState.BusyLocal,
onPressed: () async {
if(model.isFinished) {
// if(model.isFinished) {
Navigator.push(context, MaterialPageRoute(
builder: (BuildContext context) =>
EndCallScreen(patient:patient)));

@ -5,10 +5,12 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.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/SOAP/GetAssessmentReqModel.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
@ -23,12 +25,16 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.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:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.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_to_text.dart' as stt;
addPrescriptionForm(context, PrescriptionViewModel model,
PatiantInformtion patient, prescription) {
@ -102,6 +108,13 @@ class PrescriptionFormWidget extends StatefulWidget {
}
class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
String routeError;
String frequencyError;
String doseTimeError;
String durationError;
String unitError;
String strengthError;
int selectedType;
TextEditingController durationController = TextEditingController();
TextEditingController strengthController = TextEditingController();
@ -124,6 +137,9 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
TextEditingController drugIdController = TextEditingController();
TextEditingController doseController = TextEditingController();
final searchController = TextEditingController();
stt.SpeechToText speech = stt.SpeechToText();
var event = RobotProvider();
var reconizedWord;
var notesList;
var filteredNotesList;
@ -188,6 +204,60 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
});
}
onVoiceText() async {
new SpeechToText(context: context).showAlertDialog(context);
var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode;
bool available = await speech.initialize(
onStatus: statusListener, onError: errorListener);
if (available) {
speech.listen(
onResult: resultListener,
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);
print(error);
}
void statusListener(String status) {
reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....';
}
void requestPermissions() async {
Map<Permission, PermissionStatus> statuses = await [
Permission.microphone,
].request();
}
void resultListener(result) {
reconizedWord = result.recognizedWords;
event.setValue({"searchText": reconizedWord});
if (result.finalResult == true) {
setState(() {
SpeechToText.closeAlertDialog(context);
speech.stop();
indicationController.text += reconizedWord + '\n';
});
} else {
print(result.finalResult);
}
}
Future<void> initSpeechState() async {
bool hasSpeech = await speech.initialize(
onError: errorListener, onStatus: statusListener);
print(hasSpeech);
if (!mounted) return;
}
@override
Widget build(BuildContext context) {
ListSelectDialog drugDialog;
@ -244,7 +314,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
(BuildContext context, ScrollController scrollController) {
return SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height * 1.45,
height: MediaQuery.of(context).size.height * 1.65,
color: Color(0xffF8F8F8),
child: Padding(
padding: EdgeInsets.symmetric(
@ -437,11 +507,6 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
SizedBox(
height: spaceBetweenTextFileds),
Container(
//height: screenSize.height * 0.062,
height: MediaQuery.of(context)
.size
.height *
0.0749,
width: double.infinity,
child: Row(
children: [
@ -451,44 +516,43 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
.size
.width *
0.35,
child: TextField(
decoration:
textFieldSelectorDecorationStreangrh(
strengthController
.text,
'Strength', //strengthController.text,
false),
enabled: true,
controller:
strengthController,
onChanged:
(String value) {
setState(() {
strengthChar =
value.length;
});
if (strengthChar >= 5) {
DrAppToastMsg
.showErrorToast(
TranslationBase.of(
context)
.only5DigitsAllowedForStrength,
);
}
},
keyboardType: TextInputType
.numberWithOptions(
decimal: true,
)),
child: AppTextFieldCustom(
height: 40,
validationError:
strengthError,
hintText: 'Strength',
isTextFieldHasSuffix: false,
enabled: true,
controller:
strengthController,
onChanged: (String value) {
setState(() {
strengthChar =
value.length;
});
if (strengthChar >= 5) {
DrAppToastMsg
.showErrorToast(
TranslationBase.of(
context)
.only5DigitsAllowedForStrength,
);
}
},
inputType: TextInputType
.numberWithOptions(
decimal: true,
),
// keyboardType: TextInputType
// .numberWithOptions(
// decimal: true,
// ),
),
),
SizedBox(
width: 5.0,
),
Container(
// height: MediaQuery.of(context)
// .size
// .height *
// 0.06,
color: Colors.white,
width: MediaQuery.of(context)
.size
@ -538,23 +602,27 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
);
}
: null,
child: TextField(
decoration:
textFieldSelectorDecoration(
'Select',
model.itemMedicineListUnit
.length ==
1
? units = model
.itemMedicineListUnit[0]
[
'description']
: units !=
null
? units['description']
.toString()
: null,
true),
child: AppTextFieldCustom(
hintText: 'Select',
isTextFieldHasSuffix:
true,
dropDownText: model
.itemMedicineListUnit
.length ==
1
? units = model
.itemMedicineListUnit[0]
['description']
: units != null
? units['description']
.toString()
: null,
validationError:
model.itemMedicineListUnit
.length !=
1
? unitError
: null,
enabled: false),
),
),
@ -564,7 +632,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
SizedBox(
height: spaceBetweenTextFileds),
Container(
height: screenSize.height * 0.070,
//height: screenSize.height * 0.070,
color: Colors.white,
child: InkWell(
onTap:
@ -613,23 +681,44 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
);
}
: null,
child: TextField(
decoration:
textFieldSelectorDecoration(
TranslationBase.of(
context)
.route,
model.itemMedicineListRoute
.length ==
1
? model.itemMedicineListRoute[
0]
['description']
: route != null
? route[
'description']
: null,
true),
child: AppTextFieldCustom(
// decoration:
// textFieldSelectorDecoration(
// TranslationBase.of(
// context)
// .route,
// model.itemMedicineListRoute
// .length ==
// 1
// ? model.itemMedicineListRoute[
// 0]
// ['description']
// : route != null
// ? route[
// 'description']
// : null,
// true),
hintText:
TranslationBase.of(context)
.route,
dropDownText: model
.itemMedicineListRoute
.length ==
1
? model.itemMedicineListRoute[
0]['description']
: route != null
? route['description']
: null,
isTextFieldHasSuffix: true,
//height: 45,
validationError:
model.itemMedicineListRoute
.length !=
1
? routeError
: null,
enabled: false,
),
),
@ -637,7 +726,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
SizedBox(
height: spaceBetweenTextFileds),
Container(
height: screenSize.height * 0.070,
//height: screenSize.height * 0.070,
color: Colors.white,
child: InkWell(
onTap:
@ -704,23 +793,27 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
);
}
: null,
child: TextField(
decoration:
textFieldSelectorDecoration(
TranslationBase.of(
context)
.frequency,
model.itemMedicineList
.length ==
1
? model.itemMedicineList[
0]
['description']
: frequency != null
? frequency[
'description']
: null,
true),
child: AppTextFieldCustom(
isTextFieldHasSuffix: true,
hintText:
TranslationBase.of(context)
.frequency,
dropDownText: model
.itemMedicineList
.length ==
1
? model.itemMedicineList[0]
['description']
: frequency != null
? frequency[
'description']
: null,
validationError: model
.itemMedicineList
.length !=
1
? frequencyError
: null,
enabled: false,
),
),
@ -728,7 +821,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
SizedBox(
height: spaceBetweenTextFileds),
Container(
height: screenSize.height * 0.070,
//height: screenSize.height * 0.070,
color: Colors.white,
child: InkWell(
onTap:
@ -770,17 +863,18 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
);
}
: null,
child: TextField(
decoration:
textFieldSelectorDecoration(
TranslationBase.of(
context)
.doseTime,
doseTime != null
? doseTime['nameEn']
: null,
true),
child: AppTextFieldCustom(
hintText:
TranslationBase.of(context)
.doseTime,
isTextFieldHasSuffix: true,
dropDownText: doseTime != null
? doseTime['nameEn']
: null,
//height: 45,
enabled: false,
validationError: doseTimeError,
),
),
),
@ -894,7 +988,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
SizedBox(
height: spaceBetweenTextFileds),
Container(
height: screenSize.height * 0.070,
//height: screenSize.height * 0.070,
color: Colors.white,
child: InkWell(
onTap:
@ -963,16 +1057,15 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
);
}
: null,
child: TextField(
decoration:
textFieldSelectorDecoration(
TranslationBase.of(
context)
.duration,
duration != null
? duration['nameEn']
: null,
true),
child: AppTextFieldCustom(
validationError: durationError,
isTextFieldHasSuffix: true,
dropDownText: duration != null
? duration['nameEn']
: null,
hintText:
TranslationBase.of(context)
.duration,
enabled: false,
),
),
@ -1101,14 +1194,36 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
width: 1.0,
color:
HexColor("#CCCCCC"))),
child: TextFields(
maxLines: 6,
minLines: 4,
hintText:
TranslationBase.of(context)
child: Stack(
children: [
TextFields(
maxLines: 6,
minLines: 4,
hintText: TranslationBase.of(
context)
.instruction,
controller: instructionController,
//keyboardType: TextInputType.number,
controller:
instructionController,
//keyboardType: TextInputType.number,
),
Positioned(
top:
0, //MediaQuery.of(context).size.height * 0,
right: 15,
child: IconButton(
icon: Icon(
DoctorApp.speechtotext,
color: Colors.black,
size: 35,
),
onPressed: () {
initSpeechState().then(
(value) =>
{onVoiceText()});
},
),
),
],
),
),
SizedBox(
@ -1125,139 +1240,205 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
context)
.addMedication,
fontWeight: FontWeight.w600,
onPressed: () {
formKey.currentState.save();
// Navigator.pop(context);
// openDrugToDrug();
if (frequency == null ||
onPressed: () async {
if (route != null &&
duration != null &&
doseTime != null &&
frequency != null &&
units != null &&
selectedDate != null &&
strengthController
.text ==
"" ||
doseTime == null ||
duration == null ||
selectedDate == null) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(
context)
.pleaseFillAllFields);
return;
}
if (_selectedMedication
.isNarcotic ==
true) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(
context)
.narcoticMedicineCanOnlyBePrescribedFromVida);
Navigator.pop(context);
return;
}
.text !=
"") {
if (_selectedMedication
.isNarcotic ==
true) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(
context)
.narcoticMedicineCanOnlyBePrescribedFromVida);
Navigator.pop(context);
return;
}
if (double.parse(
strengthController
.text) >
1000.0) {
DrAppToastMsg.showErrorToast(
"1000 is the MAX for the strength");
return;
}
if (double.parse(
strengthController
.text) <
0.0) {
DrAppToastMsg.showErrorToast(
"strength can't be zero");
return;
}
if (double.parse(
strengthController
.text) >
1000.0) {
DrAppToastMsg
.showErrorToast(
"1000 is the MAX for the strength");
return;
}
if (double.parse(
strengthController
.text) <
0.0) {
DrAppToastMsg
.showErrorToast(
"strength can't be zero");
return;
}
if (formKey.currentState
.validate()) {
Navigator.pop(context);
openDrugToDrug(model);
{
// postProcedure(
// icdCode: model
// .patientAssessmentList
// .isNotEmpty
// ? model
// .patientAssessmentList[
// 0]
// .icdCode10ID
// .isEmpty
// ? "test"
// : model
// .patientAssessmentList[
// 0]
// .icdCode10ID
// .toString()
// : "test",
// // icdCode: model
// // .patientAssessmentList
// // .map((value) => value
// // .icdCode10ID
// // .trim())
// // .toList()
// // .join(' '),
// dose: strengthController
// .text,
// doseUnit: model
// .itemMedicineListUnit
// .length ==
// 1
// ? model
// .itemMedicineListUnit[
// 0][
// 'parameterCode']
// .toString()
// : units['parameterCode']
// .toString(),
// patient: widget.patient,
// doseTimeIn:
// doseTime['id']
// .toString(),
// model: widget.model,
// duration: duration['id']
// .toString(),
// frequency: model
// .itemMedicineList
// .length ==
// 1
// ? model
// .itemMedicineList[
// 0][
// 'parameterCode']
// .toString()
// : frequency[
// 'parameterCode']
// .toString(),
// route: model.itemMedicineListRoute
// .length ==
// 1
// ? model
// .itemMedicineListRoute[
// 0][
// 'parameterCode']
// .toString()
// : route['parameterCode']
// .toString(),
// drugId:
// _selectedMedication
// .itemId
// .toString(),
// strength:
// strengthController
// .text,
// indication:
// indicationController
// .text,
// instruction:
// instructionController
// .text,
// doseTime: selectedDate,
// );
if (formKey.currentState
.validate()) {
Navigator.pop(context);
openDrugToDrug(model);
{
// postProcedure(
// icdCode: model
// .patientAssessmentList
// .isNotEmpty
// ? model
// .patientAssessmentList[
// 0]
// .icdCode10ID
// .isEmpty
// ? "test"
// : model
// .patientAssessmentList[
// 0]
// .icdCode10ID
// .toString()
// : "test",
// // icdCode: model
// // .patientAssessmentList
// // .map((value) => value
// // .icdCode10ID
// // .trim())
// // .toList()
// // .join(' '),
// dose: strengthController
// .text,
// doseUnit: model
// .itemMedicineListUnit
// .length ==
// 1
// ? model
// .itemMedicineListUnit[
// 0][
// 'parameterCode']
// .toString()
// : units['parameterCode']
// .toString(),
// patient: widget.patient,
// doseTimeIn:
// doseTime['id']
// .toString(),
// model: widget.model,
// duration: duration['id']
// .toString(),
// frequency: model
// .itemMedicineList
// .length ==
// 1
// ? model
// .itemMedicineList[
// 0][
// 'parameterCode']
// .toString()
// : frequency[
// 'parameterCode']
// .toString(),
// route: model.itemMedicineListRoute
// .length ==
// 1
// ? model
// .itemMedicineListRoute[
// 0][
// 'parameterCode']
// .toString()
// : route['parameterCode']
// .toString(),
// drugId:
// _selectedMedication
// .itemId
// .toString(),
// strength:
// strengthController
// .text,
// indication:
// indicationController
// .text,
// instruction:
// instructionController
// .text,
// doseTime: selectedDate,
// );
}
}
} else {
setState(() {
if (duration == null) {
durationError =
TranslationBase.of(
context)
.fieldRequired;
} else {
durationError = null;
}
if (doseTime == null) {
doseTimeError =
TranslationBase.of(
context)
.fieldRequired;
} else {
doseTimeError = null;
}
if (route == null) {
routeError =
TranslationBase.of(
context)
.fieldRequired;
} else {
routeError = null;
}
if (frequency == null) {
frequencyError =
TranslationBase.of(
context)
.fieldRequired;
} else {
frequencyError = null;
}
if (units == null) {
unitError =
TranslationBase.of(
context)
.fieldRequired;
} else {
unitError = null;
}
if (strengthController
.text ==
"") {
strengthError =
TranslationBase.of(
context)
.fieldRequired;
} else {
strengthError = null;
}
});
}
formKey.currentState.save();
// Navigator.pop(context);
// openDrugToDrug();
// if (frequency == null ||
// strengthController
// .text ==
// "" ||
// doseTime == null ||
// duration == null ||
// selectedDate == null) {
// DrAppToastMsg.showErrorToast(
// TranslationBase.of(
// context)
// .pleaseFillAllFields);
// return;
// }
{
// Navigator.push(
// context,
@ -1430,17 +1611,20 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
// .join(' '),
dose: strengthController.text,
doseUnit: model.itemMedicineListUnit.length == 1
? model.itemMedicineListUnit[0]['parameterCode'].toString()
? model.itemMedicineListUnit[0]['parameterCode']
.toString()
: units['parameterCode'].toString(),
patient: widget.patient,
doseTimeIn: doseTime['id'].toString(),
model: widget.model,
duration: duration['id'].toString(),
frequency: model.itemMedicineList.length == 1
? model.itemMedicineList[0]['parameterCode'].toString()
? model.itemMedicineList[0]['parameterCode']
.toString()
: frequency['parameterCode'].toString(),
route: model.itemMedicineListRoute.length == 1
? model.itemMedicineListRoute[0]['parameterCode'].toString()
? model.itemMedicineListRoute[0]['parameterCode']
.toString()
: route['parameterCode'].toString(),
drugId: _selectedMedication.itemId.toString(),
strength: strengthController.text,

@ -2,6 +2,7 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.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/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -16,7 +17,7 @@ class ProcedureCard extends StatelessWidget {
final String categoryName;
final int categoryID;
final PatiantInformtion patient;
final String doctorName;
final int doctorID;
const ProcedureCard({
Key key,
@ -25,7 +26,7 @@ class ProcedureCard extends StatelessWidget {
this.categoryID,
this.categoryName,
this.patient,
this.doctorName,
this.doctorID,
}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -241,22 +242,27 @@ class ProcedureCard extends StatelessWidget {
),
),
),*/
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// AppText(
// entityList.remarks.toString() ?? '',
// fontSize: 12,
// ),
// if (entityList.categoryID == 2 ||
// entityList.categoryID == 4 &&
// doctorName == entityList.doctorName)
// InkWell(
// child: Icon(DoctorApp.edit),
// onTap: onTap,
// )
// ],
// )
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: AppText(
entityList.remarks.toString() ?? '',
fontSize: 12,
),
),
if (entityList.categoryID == 2 ||
entityList.categoryID == 4 &&
doctorID == entityList.doctorID)
InkWell(
child: Icon(DoctorApp.edit),
onTap: onTap,
)
],
),
)
],
),
//onTap: onTap,

@ -13,13 +13,11 @@ 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/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart';
import 'entity_list_checkbox_search_widget.dart';
import 'entity_list_procedure_widget.dart';
valdateProcedure(ProcedureViewModel model, PatiantInformtion patient,
List<EntityList> entityList) async {
@ -139,9 +137,7 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return BaseView<ProcedureViewModel>(
//onModelReady: (model) => model.getCategory(),
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold(
isShowAppBar: false,
@ -186,7 +182,7 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
children: [
Container(
width: MediaQuery.of(context).size.width *
0.81,
0.79,
child: AppTextFieldCustom(
hintText: TranslationBase.of(context)
.searchProcedureHere,
@ -218,21 +214,23 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
width: MediaQuery.of(context).size.width *
0.02,
),
InkWell(
onTap: () {
if (procedureName.text.isNotEmpty &&
procedureName.text.length >= 3)
model.getProcedureCategory(
categoryName: procedureName.text);
else
DrAppToastMsg.showErrorToast(
TranslationBase.of(context)
.atLeastThreeCharacters,
);
},
child: Icon(
Icons.search,
size: 25.0,
Expanded(
child: InkWell(
onTap: () {
if (procedureName.text.isNotEmpty &&
procedureName.text.length >= 3)
model.getProcedureCategory(
categoryName: procedureName.text);
else
DrAppToastMsg.showErrorToast(
TranslationBase.of(context)
.atLeastThreeCharacters,
);
},
child: Icon(
Icons.search,
size: 25.0,
),
),
),
],
@ -429,8 +427,6 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
color: Color(0xff359846),
fontWeight: FontWeight.w700,
onPressed: () {
//print(entityList.toString());
onPressed:
if (entityList.isEmpty == true) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context)

@ -125,12 +125,12 @@ class _AddProcedureHomeState extends State<AddProcedureHome>
tabWidget(
screenSize,
_activeTab == 0,
'All Procedures',
"Favorite Templates",
),
tabWidget(
screenSize,
_activeTab == 1,
"Favorite Templates",
'All Procedures',
),
],
),
@ -144,14 +144,14 @@ class _AddProcedureHomeState extends State<AddProcedureHome>
physics: BouncingScrollPhysics(),
controller: _tabController,
children: [
AddSelectedProcedure(
model: model,
patient: patient,
),
AddFavouriteProcedure(
patient: patient,
model: model,
),
AddSelectedProcedure(
model: model,
patient: patient,
),
],
),
),

@ -10,7 +10,6 @@ import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -37,164 +36,159 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
AppScaffold(
backgroundColor: Color(0xffF8F8F8).withOpacity(0.9),
isShowAppBar: false,
body: Column(
children: [
Container(
height: MediaQuery.of(context).size.height * 0.070,
color: Colors.white,
),
Container(
color: Colors.white,
child: Padding(
padding: EdgeInsets.all(12.0),
child: Row(
//mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
child: Icon(
Icons.arrow_back_ios_sharp,
size: 24.0,
body: SingleChildScrollView(
child: Column(
children: [
Container(
height: MediaQuery.of(context).size.height * 0.070,
color: Colors.white,
),
Container(
color: Colors.white,
child: Padding(
padding: EdgeInsets.all(12.0),
child: Row(
//mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
child: Icon(
Icons.arrow_back_ios_sharp,
size: 24.0,
),
onTap: () {
Navigator.pop(context);
},
),
onTap: () {
Navigator.pop(context);
},
),
SizedBox(
width: 5.0,
),
AppText(
'Add Procedure',
fontWeight: FontWeight.w700,
fontSize: 20,
),
],
SizedBox(
width: 5.0,
),
AppText(
'Add Procedure',
fontWeight: FontWeight.w700,
fontSize: 20,
),
],
),
),
),
),
Padding(
padding: const EdgeInsets.only(
left: 12.0, right: 12.0, bottom: 26.0, top: 10),
child: ListView.builder(
scrollDirection: Axis.vertical,
physics: AlwaysScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: widget.items.length,
itemBuilder: (BuildContext context, int index) {
return Container(
margin: EdgeInsets.only(bottom: 15.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius:
BorderRadius.all(Radius.circular(10.0))),
child: ExpansionTile(
initiallyExpanded: true,
title: Row(
SizedBox(height: 30,),
...List.generate(widget.items.length, (index) => Container(
margin: EdgeInsets.only(bottom: 15.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius:
BorderRadius.all(Radius.circular(10.0))),
child: ExpansionTile(
initiallyExpanded: true,
title: Row(
children: [
Icon(
Icons.check_box,
color: Color(0xffD02127),
size: 30.5,
),
SizedBox(
width: 6.0,
),
Expanded(
child:
AppText(widget.items[index].procedureName)),
],
),
children: [
Container(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(
Icons.check_box,
color: Color(0xffD02127),
size: 30.5,
Row(
children: [
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 11),
child: AppText(
TranslationBase.of(context).orderType,
fontWeight: FontWeight.w700,
color: Color(0xff2B353E),
),
),
],
),
SizedBox(
width: 6.0,
Row(
children: [
Radio(
activeColor: Color(0xFFD02127),
value: 0,
groupValue:
widget.items[index].selectedType,
onChanged: (value) {
widget.items[index].selectedType = 0;
setState(() {
widget.items[index].type =
value.toString();
});
},
),
AppText(
'routine',
color: Color(0xff575757),
fontWeight: FontWeight.w600,
),
Radio(
activeColor: Color(0xFFD02127),
groupValue:
widget.items[index].selectedType,
value: 1,
onChanged: (value) {
widget.items[index].selectedType = 1;
setState(() {
widget.items[index].type =
value.toString();
});
},
),
AppText(
TranslationBase.of(context).urgent,
color: Color(0xff575757),
fontWeight: FontWeight.w600,
),
],
),
Expanded(
child:
AppText(widget.items[index].procedureName)),
],
),
children: [
Container(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 11),
child: AppText(
TranslationBase.of(context).orderType,
fontWeight: FontWeight.w700,
color: Color(0xff2B353E),
),
),
],
),
Row(
children: [
Radio(
activeColor: Color(0xFFD02127),
value: 0,
groupValue:
widget.items[index].selectedType,
onChanged: (value) {
widget.items[index].selectedType = 0;
setState(() {
widget.items[index].type =
value.toString();
});
},
),
AppText(
'routine',
color: Color(0xff575757),
fontWeight: FontWeight.w600,
),
Radio(
activeColor: Color(0xFFD02127),
groupValue:
widget.items[index].selectedType,
value: 1,
onChanged: (value) {
widget.items[index].selectedType = 1;
setState(() {
widget.items[index].type =
value.toString();
});
},
),
AppText(
TranslationBase.of(context).urgent,
color: Color(0xff575757),
fontWeight: FontWeight.w600,
),
],
),
],
),
),
),
SizedBox(
height: 2.0,
),
Padding(
padding: EdgeInsets.symmetric(
horizontal: 12, vertical: 15.0),
child: TextFields(
hintText: TranslationBase.of(context).remarks,
controller: remarksController,
onChanged: (value) {
widget.items[index].remarks = value;
},
minLines: 3,
maxLines: 5,
borderWidth: 0.5,
borderColor: Colors.grey[500],
),
),
SizedBox(
height: 19.0,
),
//DividerWithSpacesAround(),
],
),
);
}),
),
],
),
SizedBox(
height: 2.0,
),
Padding(
padding: EdgeInsets.symmetric(
horizontal: 12, vertical: 15.0),
child: TextFields(
hintText: TranslationBase.of(context).remarks,
controller: remarksController,
onChanged: (value) {
widget.items[index].remarks = value;
},
minLines: 3,
maxLines: 5,
borderWidth: 0.5,
borderColor: Colors.grey[500],
),
),
SizedBox(
height: 19.0,
),
//DividerWithSpacesAround(),
],
),
)),
SizedBox(height: 90,),
],
),
),
bottomSheet: Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
@ -206,15 +200,6 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
color: Color(0xff359846),
fontWeight: FontWeight.w700,
onPressed: () async {
//print(entityList.toString());
onPressed:
// if (entityList.isEmpty == true) {
// DrAppToastMsg.showErrorToast(
// TranslationBase.of(context)
// .fillTheMandatoryProcedureDetails,
// );
// return;
// }
List<EntityList> entityList = List();
widget.items.forEach((element) {
entityList.add(

@ -17,12 +17,12 @@ import 'package:flutter/material.dart';
import 'ProcedureCard.dart';
class ProcedureScreen extends StatelessWidget {
String doctorNameP;
int doctorNameP;
void initState() async {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
doctorNameP = doctorProfile.doctorName;
doctorNameP = doctorProfile.doctorID;
}
@override
@ -192,7 +192,7 @@ class ProcedureScreen extends StatelessWidget {
// 'You Cant Update This Procedure');
},
patient: patient,
doctorName: doctorNameP,
doctorID: doctorNameP,
),
),
if (model.state == ViewState.ErrorLocal ||

@ -100,7 +100,7 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
baseViewModel: model,
child: SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height * 0.65,
height: MediaQuery.of(context).size.height * 0.9,
child: Form(
child: Padding(
padding:

@ -8,6 +8,8 @@ import 'package:doctor_app_flutter/models/doctor/list_doctor_working_hours_table
import 'package:doctor_app_flutter/screens/auth/login_screen.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -24,7 +26,47 @@ class Helpers {
static int cupertinoPickerIndex = 0;
get currentLanguage => null;
static showCupertinoPicker(context, List<GetHospitalsResponseModel> items, decKey, onSelectFun, AuthenticationViewModel model) {
static showConfirmationDialog(
BuildContext context, String message, Function okFunction) {
return showDialog(
context: context,
barrierDismissible: false, // user must tap button!
builder: (_) {
return Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AlertDialog(
title: null,
content: Container(
child: AppText(message),
),
actions: [
AppButton(
onPressed: okFunction,
title: TranslationBase.of(context).noteConfirm,
fontColor: Colors.white,
color: Colors.green[600],
),
AppButton(
onPressed: (){
Navigator.of(context).pop();
},
title: TranslationBase.of(context).cancel,
fontColor: Colors.white,
color: Colors.red[600],
),
],
),
],
),
);
});
}
static showCupertinoPicker(context, List<GetHospitalsResponseModel> items,
decKey, onSelectFun, AuthenticationViewModel model) {
showModalBottomSheet(
isDismissible: false,
context: context,
@ -64,8 +106,8 @@ class Helpers {
Container(
height: SizeConfig.realScreenHeight * 0.3,
color: Color(0xfff7f7f7),
child:
buildPickerItems(context, items, decKey, onSelectFun, model))
child: buildPickerItems(
context, items, decKey, onSelectFun, model))
],
),
);
@ -75,7 +117,8 @@ class Helpers {
static TextStyle textStyle(context) =>
TextStyle(color: Theme.of(context).primaryColor);
static buildPickerItems(context, List<GetHospitalsResponseModel> items, decKey, onSelectFun, model) {
static buildPickerItems(context, List<GetHospitalsResponseModel> items,
decKey, onSelectFun, model) {
return CupertinoPicker(
magnification: 1.5,
scrollController:

@ -18,6 +18,8 @@ class TranslationBase {
String get settings => localizedValues['settings'][locale.languageCode];
String get areYouSureYouWantTo => localizedValues['areYouSureYouWantTo'][locale.languageCode];
String get language => localizedValues['language'][locale.languageCode];
String get lanEnglish => localizedValues['lanEnglish'][locale.languageCode];

@ -42,23 +42,27 @@ class ButtonBottomSheet extends StatelessWidget {
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: AppButton(
title: title,
onPressed: onPressed,
fontWeight: fontWeight,
color: color,
fontSize: fontSize,
padding: padding,
disabled: disabled,
radius: radius,
hasBorder: hasBorder,
fontColor: fontColor,
icon: icon,
iconData: iconData,
hPadding: hPadding,
vPadding: vPadding,
borderColor: borderColor,
loading: loading,
child: Column(
children: [
AppButton(
title: title,
onPressed: onPressed,
fontWeight: fontWeight,
color: color,
fontSize: fontSize,
padding: padding,
disabled: disabled,
radius: radius,
hasBorder: hasBorder,
fontColor: fontColor,
icon: icon,
iconData: iconData,
hPadding: hPadding,
vPadding: vPadding,
borderColor: borderColor,
loading: loading,
),
],
),
);
}

Loading…
Cancel
Save