Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into prescription_refactor
Conflicts: lib/screens/prescription/add_prescription_form.dartmerge-requests/714/head
commit
7595629c8b
@ -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;
|
||||
}
|
||||
}
|
||||
@ -1,307 +0,0 @@
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/project_view_model.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/date-utils.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/patient-page-header-widget.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:flutter/material.dart';
|
||||
import 'package:hexcolor/hexcolor.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../../../routes.dart';
|
||||
|
||||
class AdmissionRequestDetailScreen extends StatefulWidget {
|
||||
@override
|
||||
_AdmissionRequestDetailScreenState createState() =>
|
||||
_AdmissionRequestDetailScreenState();
|
||||
}
|
||||
|
||||
class _AdmissionRequestDetailScreenState
|
||||
extends State<AdmissionRequestDetailScreen> {
|
||||
DateTime selectedDate;
|
||||
dynamic _selectedSpeciality;
|
||||
dynamic _selectedDoctor;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
||||
PatiantInformtion patient = routeArgs['patient'];
|
||||
final screenSize = MediaQuery.of(context).size;
|
||||
ProjectViewModel projectViewModel = Provider.of(context);
|
||||
|
||||
return BaseView<AdmissionRequestViewModel>(
|
||||
onModelReady: (model) => model.getSpecialityList(),
|
||||
builder: (_, model, w) => AppScaffold(
|
||||
baseViewModel: model,
|
||||
appBarTitle: TranslationBase.of(context).admissionRequest,
|
||||
body: model.doctorsList != null
|
||||
? Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
PatientPageHeaderWidget(patient),
|
||||
Container(
|
||||
margin: EdgeInsets.symmetric(
|
||||
vertical: 16, horizontal: 16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
AppText(
|
||||
TranslationBase.of(context).patientDetails,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: SizeConfig.textMultiplier * 2.5,
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
decoration:
|
||||
Helpers.containerBorderDecoration(
|
||||
Color(0xFFEEEEEE),
|
||||
Color(0xFFCCCCCC),
|
||||
borderWidth: 0.0),
|
||||
height: screenSize.height * 0.070,
|
||||
child: TextField(
|
||||
decoration:
|
||||
Helpers.textFieldSelectorDecoration(
|
||||
"Pre Admission Number :01",
|
||||
null,
|
||||
false),
|
||||
enabled: false,
|
||||
// controller: _remarksController,
|
||||
keyboardType: TextInputType.text,
|
||||
)),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
height: screenSize.height * 0.070,
|
||||
child: InkWell(
|
||||
onTap: () => _selectDate(context, model),
|
||||
child: TextField(
|
||||
decoration:
|
||||
Helpers.textFieldSelectorDecoration(
|
||||
TranslationBase.of(context).date,
|
||||
selectedDate != null
|
||||
? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}"
|
||||
: null,
|
||||
true,
|
||||
suffixIcon: Icon(
|
||||
Icons.calendar_today,
|
||||
color: Colors.black,
|
||||
)),
|
||||
enabled: false,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
AppText(
|
||||
TranslationBase.of(context)
|
||||
.specialityAndDoctorDetail,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: SizeConfig.textMultiplier * 2.5,
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
height: screenSize.height * 0.070,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
ListSelectDialog dialog =
|
||||
ListSelectDialog(
|
||||
list: model.speciality,
|
||||
attributeName:
|
||||
projectViewModel.isArabic
|
||||
? 'nameAr'
|
||||
: 'nameEn',
|
||||
attributeValueId: 'id',
|
||||
okText:
|
||||
TranslationBase.of(context)
|
||||
.ok,
|
||||
okFunction: (selectedValue) {
|
||||
setState(() {
|
||||
_selectedSpeciality =
|
||||
selectedValue;
|
||||
});
|
||||
});
|
||||
showDialog(
|
||||
barrierDismissible: false,
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return dialog;
|
||||
},
|
||||
);
|
||||
},
|
||||
child: TextField(
|
||||
decoration:
|
||||
Helpers.textFieldSelectorDecoration(
|
||||
TranslationBase.of(context)
|
||||
.speciality,
|
||||
_selectedSpeciality != null
|
||||
? projectViewModel.isArabic
|
||||
? _selectedSpeciality[
|
||||
'nameAr']
|
||||
: _selectedSpeciality[
|
||||
'nameEn']
|
||||
: null,
|
||||
true),
|
||||
enabled: false,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
height: screenSize.height * 0.070,
|
||||
child: InkWell(
|
||||
onTap: model.doctorsList != null &&
|
||||
model.doctorsList.length > 0
|
||||
? () {
|
||||
ListSelectDialog dialog =
|
||||
ListSelectDialog(
|
||||
list: model.doctorsList,
|
||||
attributeName: 'DoctorName',
|
||||
attributeValueId: 'DoctorID',
|
||||
usingSearch: true,
|
||||
hintSearchText:
|
||||
TranslationBase.of(context)
|
||||
.doctorSearch,
|
||||
okText:
|
||||
TranslationBase.of(context)
|
||||
.ok,
|
||||
okFunction: (selectedValue) {
|
||||
setState(() {
|
||||
_selectedDoctor =
|
||||
selectedValue;
|
||||
});
|
||||
},
|
||||
);
|
||||
showDialog(
|
||||
barrierDismissible: false,
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return dialog;
|
||||
},
|
||||
);
|
||||
}
|
||||
: null,
|
||||
child: TextField(
|
||||
decoration:
|
||||
Helpers.textFieldSelectorDecoration(
|
||||
TranslationBase.of(context)
|
||||
.doctor,
|
||||
_selectedDoctor != null
|
||||
? _selectedDoctor[
|
||||
'DoctorName']
|
||||
: null,
|
||||
true),
|
||||
enabled: false,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
height: screenSize.height * 0.070,
|
||||
decoration: Helpers.containerBorderDecoration(
|
||||
Color(0xFFEEEEEE), Color(0xFFCCCCCC),
|
||||
borderWidth: 0.0),
|
||||
child: InkWell(
|
||||
onTap: () => null,
|
||||
child: TextField(
|
||||
decoration:
|
||||
Helpers.textFieldSelectorDecoration(
|
||||
TranslationBase.of(context)
|
||||
.referringDate,
|
||||
null,
|
||||
true,
|
||||
suffixIcon: Icon(
|
||||
Icons.calendar_today,
|
||||
color: Color(0xFFCCCCCC),
|
||||
)),
|
||||
enabled: false,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
decoration:
|
||||
Helpers.containerBorderDecoration(
|
||||
Color(0xFFEEEEEE),
|
||||
Color(0xFFCCCCCC),
|
||||
borderWidth: 0.0),
|
||||
height: screenSize.height * 0.070,
|
||||
child: TextField(
|
||||
decoration:
|
||||
Helpers.textFieldSelectorDecoration(
|
||||
TranslationBase.of(context)
|
||||
.referringDoctor,
|
||||
null,
|
||||
true,
|
||||
dropDownColor: Color(0xFFCCCCCC)),
|
||||
enabled: false,
|
||||
// controller: _remarksController,
|
||||
keyboardType: TextInputType.text,
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
child: AppButton(
|
||||
title: TranslationBase.of(context).next,
|
||||
color: HexColor("#B8382B"),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
PATIENT_ADMISSION_REQUEST_2,
|
||||
arguments: {'patient': patient});
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
: Container(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_selectDate(BuildContext context, AdmissionRequestViewModel model) async {
|
||||
selectedDate = DateTime.now();
|
||||
final DateTime picked = await showDatePicker(
|
||||
context: context,
|
||||
initialDate: selectedDate,
|
||||
firstDate: DateTime.now().add(Duration(hours: 2)),
|
||||
lastDate: DateTime(2040),
|
||||
initialEntryMode: DatePickerEntryMode.calendar,
|
||||
);
|
||||
if (picked != null && picked != selectedDate) {
|
||||
setState(() {
|
||||
selectedDate = picked;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,218 @@
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.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/procedures/add-favourite-procedure.dart';
|
||||
import 'package:doctor_app_flutter/screens/procedures/add-procedure-form.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/app_texts_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'add_lab_orders.dart';
|
||||
|
||||
class AddLabHomeScreen extends StatefulWidget {
|
||||
final ProcedureViewModel model;
|
||||
final PatiantInformtion patient;
|
||||
const AddLabHomeScreen({Key key, this.model, this.patient}) : super(key: key);
|
||||
@override
|
||||
_AddLabHomeScreenState createState() =>
|
||||
_AddLabHomeScreenState(patient: patient, model: model);
|
||||
}
|
||||
|
||||
class _AddLabHomeScreenState extends State<AddLabHomeScreen>
|
||||
with SingleTickerProviderStateMixin {
|
||||
_AddLabHomeScreenState({this.patient, this.model});
|
||||
ProcedureViewModel model;
|
||||
PatiantInformtion patient;
|
||||
TabController _tabController;
|
||||
int _activeTab = 0;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_tabController = TabController(length: 2, vsync: this);
|
||||
_tabController.addListener(_handleTabSelection);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
_tabController.dispose();
|
||||
}
|
||||
|
||||
_handleTabSelection() {
|
||||
setState(() {
|
||||
_activeTab = _tabController.index;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final screenSize = MediaQuery.of(context).size;
|
||||
return BaseView<ProcedureViewModel>(
|
||||
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
|
||||
AppScaffold(
|
||||
isShowAppBar: false,
|
||||
body: NetworkBaseView(
|
||||
baseViewModel: model,
|
||||
child: DraggableScrollableSheet(
|
||||
minChildSize: 0.90,
|
||||
initialChildSize: 0.95,
|
||||
maxChildSize: 1.0,
|
||||
builder:
|
||||
(BuildContext context, ScrollController scrollController) {
|
||||
return Container(
|
||||
height: MediaQuery.of(context).size.height * 1.20,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(12.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
AppText(
|
||||
'Add Procedure',
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 20,
|
||||
),
|
||||
InkWell(
|
||||
child: Icon(
|
||||
Icons.close,
|
||||
size: 24.0,
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
)
|
||||
]),
|
||||
SizedBox(
|
||||
height: MediaQuery.of(context).size.height * 0.04,
|
||||
),
|
||||
Expanded(
|
||||
child: Scaffold(
|
||||
extendBodyBehindAppBar: true,
|
||||
appBar: PreferredSize(
|
||||
preferredSize: Size.fromHeight(
|
||||
MediaQuery.of(context).size.height * 0.070),
|
||||
child: Container(
|
||||
height:
|
||||
MediaQuery.of(context).size.height * 0.070,
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: Theme.of(context).dividerColor,
|
||||
width: 0.5), //width: 0.7
|
||||
),
|
||||
color: Colors.white),
|
||||
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: [
|
||||
tabWidget(
|
||||
screenSize,
|
||||
_activeTab == 0,
|
||||
"Favorite Templates",
|
||||
),
|
||||
tabWidget(
|
||||
screenSize,
|
||||
_activeTab == 1,
|
||||
'All Lab',
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
physics: BouncingScrollPhysics(),
|
||||
controller: _tabController,
|
||||
children: [
|
||||
AddFavouriteProcedure(
|
||||
patient: patient,
|
||||
model: model,
|
||||
addButtonTitle: TranslationBase.of(context).addLabOrder,
|
||||
toolbarTitle: TranslationBase.of(context).applyForNewLabOrder,
|
||||
categoryID: "02",
|
||||
),
|
||||
AddSelectedLabOrder(
|
||||
model: model,
|
||||
patient: patient,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget tabWidget(Size screenSize, bool isActive, String title,
|
||||
{int counter = -1}) {
|
||||
return Center(
|
||||
child: Container(
|
||||
height: screenSize.height * 0.070,
|
||||
decoration: TextFieldsUtils.containerBorderDecoration(
|
||||
isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA),
|
||||
isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA),
|
||||
borderRadius: 4,
|
||||
borderWidth: 0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
AppText(
|
||||
title,
|
||||
fontSize: SizeConfig.textMultiplier * 1.5,
|
||||
color: isActive ? Colors.white : Color(0xFF2B353E),
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
if (counter != -1)
|
||||
Container(
|
||||
margin: EdgeInsets.all(4),
|
||||
width: 15,
|
||||
height: 15,
|
||||
decoration: BoxDecoration(
|
||||
color: isActive ? Colors.white : Color(0xFFD02127),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Center(
|
||||
child: FittedBox(
|
||||
child: AppText(
|
||||
"$counter",
|
||||
fontSize: SizeConfig.textMultiplier * 1.5,
|
||||
color: !isActive ? Colors.white : Color(0xFFD02127),
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,219 @@
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.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/procedures/add-favourite-procedure.dart';
|
||||
import 'package:doctor_app_flutter/screens/procedures/add-procedure-form.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/app_texts_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'add_lab_orders.dart';
|
||||
import 'add_radiology_order.dart';
|
||||
|
||||
class AddRadiologyScreen extends StatefulWidget {
|
||||
final ProcedureViewModel model;
|
||||
final PatiantInformtion patient;
|
||||
const AddRadiologyScreen({Key key, this.model, this.patient}) : super(key: key);
|
||||
@override
|
||||
_AddRadiologyScreenState createState() =>
|
||||
_AddRadiologyScreenState(patient: patient, model: model);
|
||||
}
|
||||
|
||||
class _AddRadiologyScreenState extends State<AddRadiologyScreen>
|
||||
with SingleTickerProviderStateMixin {
|
||||
_AddRadiologyScreenState({this.patient, this.model});
|
||||
ProcedureViewModel model;
|
||||
PatiantInformtion patient;
|
||||
TabController _tabController;
|
||||
int _activeTab = 0;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_tabController = TabController(length: 2, vsync: this);
|
||||
_tabController.addListener(_handleTabSelection);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
_tabController.dispose();
|
||||
}
|
||||
|
||||
_handleTabSelection() {
|
||||
setState(() {
|
||||
_activeTab = _tabController.index;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final screenSize = MediaQuery.of(context).size;
|
||||
return BaseView<ProcedureViewModel>(
|
||||
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
|
||||
AppScaffold(
|
||||
isShowAppBar: false,
|
||||
body: NetworkBaseView(
|
||||
baseViewModel: model,
|
||||
child: DraggableScrollableSheet(
|
||||
minChildSize: 0.90,
|
||||
initialChildSize: 0.95,
|
||||
maxChildSize: 1.0,
|
||||
builder:
|
||||
(BuildContext context, ScrollController scrollController) {
|
||||
return Container(
|
||||
height: MediaQuery.of(context).size.height * 1.20,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(12.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
AppText(
|
||||
TranslationBase.of(context).addRadiologyOrder,
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 20,
|
||||
),
|
||||
InkWell(
|
||||
child: Icon(
|
||||
Icons.close,
|
||||
size: 24.0,
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
)
|
||||
]),
|
||||
SizedBox(
|
||||
height: MediaQuery.of(context).size.height * 0.04,
|
||||
),
|
||||
Expanded(
|
||||
child: Scaffold(
|
||||
extendBodyBehindAppBar: true,
|
||||
appBar: PreferredSize(
|
||||
preferredSize: Size.fromHeight(
|
||||
MediaQuery.of(context).size.height * 0.070),
|
||||
child: Container(
|
||||
height:
|
||||
MediaQuery.of(context).size.height * 0.070,
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: Theme.of(context).dividerColor,
|
||||
width: 0.5), //width: 0.7
|
||||
),
|
||||
color: Colors.white),
|
||||
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: [
|
||||
tabWidget(
|
||||
screenSize,
|
||||
_activeTab == 0,
|
||||
"Favorite Templates",
|
||||
),
|
||||
tabWidget(
|
||||
screenSize,
|
||||
_activeTab == 1,
|
||||
'All Radiology',
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
physics: BouncingScrollPhysics(),
|
||||
controller: _tabController,
|
||||
children: [
|
||||
AddFavouriteProcedure(
|
||||
patient: patient,
|
||||
model: model,
|
||||
addButtonTitle: TranslationBase.of(context).addRadiologyOrder,
|
||||
toolbarTitle: TranslationBase.of(context).addRadiologyOrder,
|
||||
categoryID: "03",
|
||||
),
|
||||
AddSelectedRadiologyOrder(
|
||||
model: model,
|
||||
patient: patient,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget tabWidget(Size screenSize, bool isActive, String title,
|
||||
{int counter = -1}) {
|
||||
return Center(
|
||||
child: Container(
|
||||
height: screenSize.height * 0.070,
|
||||
decoration: TextFieldsUtils.containerBorderDecoration(
|
||||
isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA),
|
||||
isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA),
|
||||
borderRadius: 4,
|
||||
borderWidth: 0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
AppText(
|
||||
title,
|
||||
fontSize: SizeConfig.textMultiplier * 1.5,
|
||||
color: isActive ? Colors.white : Color(0xFF2B353E),
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
if (counter != -1)
|
||||
Container(
|
||||
margin: EdgeInsets.all(4),
|
||||
width: 15,
|
||||
height: 15,
|
||||
decoration: BoxDecoration(
|
||||
color: isActive ? Colors.white : Color(0xFFD02127),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Center(
|
||||
child: FittedBox(
|
||||
child: AppText(
|
||||
"$counter",
|
||||
fontSize: SizeConfig.textMultiplier * 1.5,
|
||||
color: !isActive ? Colors.white : Color(0xFFD02127),
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue