|
|
|
|
@ -3,14 +3,12 @@ import 'package:doctor_app_flutter/config/size_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/patient-referral-viewmodel.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/core/model/patient/patiant_info_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/utils/date-utils.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/utils/tab_utils.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart';
|
|
|
|
|
@ -25,7 +23,6 @@ import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
|
import 'package:intl/intl.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;
|
|
|
|
|
|
|
|
|
|
@ -35,9 +32,7 @@ class PatientMakeInPatientReferralScreen extends StatefulWidget {
|
|
|
|
|
_PatientMakeInPatientReferralScreenState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatientReferralScreen> with SingleTickerProviderStateMixin{
|
|
|
|
|
TabController _tabController;
|
|
|
|
|
int index = 0;
|
|
|
|
|
class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatientReferralScreen>{
|
|
|
|
|
PatiantInformtion patient;
|
|
|
|
|
List<dynamic> referToList;
|
|
|
|
|
dynamic _referTo;
|
|
|
|
|
@ -50,7 +45,6 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
|
|
|
|
|
final _extController = TextEditingController();
|
|
|
|
|
int _activePriority = 1;
|
|
|
|
|
String appointmentDate;
|
|
|
|
|
|
|
|
|
|
String branchError;
|
|
|
|
|
String hospitalError;
|
|
|
|
|
String clinicError;
|
|
|
|
|
@ -62,18 +56,6 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_handleTabSelection() {
|
|
|
|
|
setState(() {
|
|
|
|
|
index = _tabController.index;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void dispose() {
|
|
|
|
|
super.dispose();
|
|
|
|
|
_tabController.dispose();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
requestPermissions();
|
|
|
|
|
@ -85,8 +67,6 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
super.initState();
|
|
|
|
|
_tabController = TabController(length: 3, vsync: this);
|
|
|
|
|
_tabController.addListener(_handleTabSelection);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onVoiceText() async {
|
|
|
|
|
@ -160,12 +140,9 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
List<Object> _priorityList = List();
|
|
|
|
|
_priorityList.add(
|
|
|
|
|
priority1,);
|
|
|
|
|
_priorityList.add(
|
|
|
|
|
priority2,);
|
|
|
|
|
_priorityList.add(
|
|
|
|
|
priority3,);
|
|
|
|
|
_priorityList.add(priority1);
|
|
|
|
|
_priorityList.add(priority2);
|
|
|
|
|
_priorityList.add(priority3);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
|
|
|
|
@ -652,67 +629,6 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget priorityBar(BuildContext _context, Size screenSize) {
|
|
|
|
|
ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context);
|
|
|
|
|
return Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
width: SizeConfig.widthMultiplier * 120,
|
|
|
|
|
height: TabHelper.getTabHeight(context),
|
|
|
|
|
color: TabHelper.getBgTabColor(),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: TabBar(
|
|
|
|
|
isScrollable: false,
|
|
|
|
|
controller: _tabController,
|
|
|
|
|
indicatorColor: Colors.transparent,
|
|
|
|
|
indicatorWeight: 1.0,
|
|
|
|
|
indicatorSize: TabBarIndicatorSize.tab,
|
|
|
|
|
labelColor: Theme.of(context).primaryColor,
|
|
|
|
|
labelPadding:
|
|
|
|
|
EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0),
|
|
|
|
|
unselectedLabelColor: Colors.grey[800],
|
|
|
|
|
tabs: [
|
|
|
|
|
Container(
|
|
|
|
|
decoration: TabHelper.getBoxTabsBoxDecoration(
|
|
|
|
|
isActive: index == 0,
|
|
|
|
|
isFirst: true,
|
|
|
|
|
projectViewModel: projectsProvider),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: TabHelper.getTabText(
|
|
|
|
|
title: TranslationBase.of(context).veryUrgent.toUpperCase(),
|
|
|
|
|
isActive: index == 0)),
|
|
|
|
|
),
|
|
|
|
|
Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: TabHelper.getBoxTabsBoxDecoration(
|
|
|
|
|
isActive: index == 1,
|
|
|
|
|
isMiddle: true,
|
|
|
|
|
projectViewModel: projectsProvider),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: TabHelper.getTabText(
|
|
|
|
|
title: TranslationBase.of(context).urgent.toUpperCase(),
|
|
|
|
|
isActive: index == 1)),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: TabHelper.getBoxTabsBoxDecoration(
|
|
|
|
|
isActive: index == 2,
|
|
|
|
|
isLast: true,
|
|
|
|
|
projectViewModel: projectsProvider),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: TabHelper.getTabText(
|
|
|
|
|
title: TranslationBase.of(context).routine.toUpperCase(),
|
|
|
|
|
isActive: index == 2),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String getPriority() {
|
|
|
|
|
DateTime date = DateTime.now();
|
|
|
|
|
switch (_activePriority) {
|
|
|
|
|
|