Add favorite procedure templates for lab and radiology

merge-requests/704/head
Mohammad Aljammal 5 years ago
parent 6620c79478
commit 725c87fe8b

@ -44,7 +44,7 @@ class DashboardService extends BaseService {
super.error = error;
},
body: {
"DoctorID": doctorProfile.doctorID// test user 9920
"DoctorID": doctorProfile?.doctorID// test user 9920
},
);
}

@ -23,6 +23,7 @@ import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:flutter/cupertino.dart';
class ProcedureViewModel extends BaseViewModel {
//TODO Hussam clean it
FilterType filterType = FilterType.Clinic;
bool hasError = false;
ProcedureService _procedureService = locator<ProcedureService>();

@ -241,12 +241,12 @@ class _HomeScreenState extends State<HomeScreen> {
),
sliderActiveIndex == 1
? DashboardSliderItemWidget(
model.dashboardItemsList[6])
model.dashboardItemsList[4])
: sliderActiveIndex == 0
? DashboardSliderItemWidget(
model.dashboardItemsList[3])
: DashboardSliderItemWidget(
model.dashboardItemsList[4]),
model.dashboardItemsList[6]),
])))
: SizedBox(),
FractionallySizedBox(
@ -332,7 +332,7 @@ class _HomeScreenState extends State<HomeScreen> {
patientCards.add(HomePatientCard(
backgroundColor: backgroundColors[colorIndex],
backgroundIconColor: backgroundIconColors[colorIndex],
cardIcon: DoctorApp.inpatient,
cardIcon: DoctorApp.livecare,
textColor: textColors[colorIndex],
text:
"${TranslationBase.of(context).liveCare}\n${TranslationBase.of(context).patients}",

@ -51,7 +51,7 @@ class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> {
),
Expanded(
child: AppText(
"Live Care Patients",
"LiveCare Patients",
fontSize: SizeConfig.textMultiplier * 2.8,
fontWeight: FontWeight.bold,
color: Color(0xFF2B353E),

@ -39,7 +39,7 @@ class _InsuranceApprovalScreenNewState
? (model) => model.getInsuranceInPatient(mrn: patient.patientId)
: patient.appointmentNo != null
? (model) => model.getInsuranceApproval(patient,
appointmentNo: patient.appointmentNo,
appointmentNo: patient?.appointmentNo,
projectId: patient.projectId)
: (model) => model.getInsuranceApproval(patient),
builder: (BuildContext context, InsuranceViewModel model, Widget child) =>

@ -4,6 +4,7 @@ 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/patients/profile/radiology/radiology_details_page.dart';
import 'package:doctor_app_flutter/screens/procedures/add_radiology_order.dart';
import 'package:doctor_app_flutter/screens/procedures/add_radiology_screen.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
@ -117,7 +118,7 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
context,
MaterialPageRoute(
builder: (context) =>
AddSelectedRadiologyOrder(
AddRadiologyScreen(
patient: patient,
model: model,
)),

@ -11,7 +11,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class ExpansionProcedure extends StatefulWidget {
final ProcedureTempleteModel procedureTempleteModel;
final ProcedureTempleteDetailsModelList procedureTempleteModel;
final ProcedureViewModel model;
final Function(ProcedureTempleteDetailsModel) removeFavProcedure;
final Function(ProcedureTempleteDetailsModel) addFavProcedure;
@ -37,19 +37,14 @@ class ExpansionProcedure extends StatefulWidget {
class _ExpansionProcedureState extends State<ExpansionProcedure> {
bool _isShowMore = false;
List<ProcedureTempleteDetailsModel> _templateDetailsList = List();
BaseAppClient baseAppClient = BaseAppClient();
@override
Widget build(BuildContext context) {
return Column(
children: [
InkWell(
onTap: () async {
if (!_isShowMore && _templateDetailsList.isEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
await getProcedureTemplateDetails(widget.procedureTempleteModel.templateID);
GifLoaderDialogUtils.hideDialog(context);
}
setState(() {
_isShowMore = !_isShowMore;
});
@ -116,8 +111,8 @@ class _ExpansionProcedureState extends State<ExpansionProcedure> {
)),
duration: Duration(milliseconds: 7000),
child: Column(
children:
_templateDetailsList.map((itemProcedure) {
children: widget.procedureTempleteModel.procedureTemplate
.map((itemProcedure) {
return Container(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 12),
@ -135,8 +130,10 @@ class _ExpansionProcedureState extends State<ExpansionProcedure> {
activeColor: Color(0xffD02127),
onChanged: (bool newValue) {
setState(() {
if (widget.isEntityFavListSelected(itemProcedure)) {
widget.removeFavProcedure(itemProcedure);
if (widget.isEntityFavListSelected(
itemProcedure)) {
widget
.removeFavProcedure(itemProcedure);
} else {
widget.addFavProcedure(itemProcedure);
}
@ -145,8 +142,7 @@ class _ExpansionProcedureState extends State<ExpansionProcedure> {
),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 0),
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 0),
child: AppText(itemProcedure.procedureName,
fontSize: 14.0,
variant: "bodyText",
@ -169,21 +165,4 @@ class _ExpansionProcedureState extends State<ExpansionProcedure> {
],
);
}
getProcedureTemplateDetails(templateId)async {
ProcedureTempleteDetailsRequestModel _procedureTempleteDetailsRequestModel = ProcedureTempleteDetailsRequestModel(templateID: templateId, searchType: 1, patientID: 0);
_templateDetailsList.clear();
await baseAppClient.post(GET_PROCEDURE_TEMPLETE_DETAILS,
onSuccess: (dynamic response, int statusCode) {
response['HIS_ProcedureTemplateDetailsList'].forEach((template) {
setState(() {
_templateDetailsList.add(ProcedureTempleteDetailsModel.fromJson(template));
});
});
}, onFailure: (String error, int statusCode) {
DrAppToastMsg.showErrorToast(error);
}, body: _procedureTempleteDetailsRequestModel.toJson());
}
}

@ -20,9 +20,17 @@ import 'package:flutter/material.dart';
class AddFavouriteProcedure extends StatefulWidget {
final ProcedureViewModel model;
final PatiantInformtion patient;
final String categoryID;
final String addButtonTitle;
final String toolbarTitle;
const AddFavouriteProcedure({Key key, this.model, this.patient})
: super(key: key);
AddFavouriteProcedure(
{Key key,
this.model,
this.patient,
this.categoryID,
@required this.addButtonTitle,
@required this.toolbarTitle});
@override
_AddFavouriteProcedureState createState() => _AddFavouriteProcedureState();
@ -46,6 +54,7 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold(
isShowAppBar: false,
baseViewModel: model,
body: Column(
children: [
Container(
@ -54,27 +63,25 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
if (model.procedureTemplate.length != 0)
Expanded(
child: NetworkBaseView(
baseViewModel: model,
child: EntityListCheckboxSearchFavProceduresWidget(
model: widget.model,
masterList: widget.model.procedureTemplate,
removeFavProcedure: (item) {
setState(() {
entityList.remove(item);
});
},
addFavProcedure: (history) {
setState(() {
entityList.add(history);
});
},
addSelectedHistories: () {
//TODO build your fun herr
// widget.addSelectedHistories();
},
isEntityFavListSelected: (master) =>
isEntityListSelected(master),
)),
baseViewModel: model,
child: EntityListCheckboxSearchFavProceduresWidget(
model: widget.model,
masterList: widget.model.procedureTemplate,
//TODO change it to the new model
removeFavProcedure: (item) {
setState(() {
entityList.remove(item);
});
},
addFavProcedure: (history) {
setState(() {
entityList.add(history);
});
},
isEntityFavListSelected: (master) =>
isEntityListSelected(master),
),
),
),
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
@ -82,7 +89,8 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: TranslationBase.of(context).addSelectedProcedures,
title: widget.addButtonTitle ??
TranslationBase.of(context).addSelectedProcedures,
color: Color(0xff359846),
fontWeight: FontWeight.w700,
onPressed: () {
@ -97,11 +105,14 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ProcedureCheckOutScreen(
items: entityList,
model: model,
patient: widget.patient,
)),
builder: (context) => ProcedureCheckOutScreen(
items: entityList,
model: model,
patient: widget.patient,
addButtonTitle: widget.addButtonTitle,
toolbarTitle: widget.toolbarTitle,
),
),
);
},
),

@ -111,6 +111,7 @@ class AddSelectedProcedure extends StatefulWidget {
const AddSelectedProcedure({Key key, this.model, this.patient})
: super(key: key);
@override
_AddSelectedProcedureState createState() =>
_AddSelectedProcedureState(patient: patient, model: model);
@ -120,7 +121,9 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
int selectedType;
ProcedureViewModel model;
PatiantInformtion patient;
_AddSelectedProcedureState({this.patient, this.model});
TextEditingController procedureController = TextEditingController();
TextEditingController remarksController = TextEditingController();
List<EntityList> entityList = List();
@ -220,7 +223,8 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
if (procedureName.text.isNotEmpty &&
procedureName.text.length >= 3)
model.getProcedureCategory(
categoryName: procedureName.text);
categoryName:
procedureName.text);
else
DrAppToastMsg.showErrorToast(
TranslationBase.of(context)
@ -235,90 +239,11 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
),
],
),
// SizedBox(
// width: MediaQuery.of(context).size.width * 0.29,
// ),
// InkWell(
// child: Icon(
// Icons.close,
// size: 24.0,
// ),
// onTap: () {
// Navigator.pop(context);
// },
// ),
// ],
// ),
// SizedBox(
// height: 10.0,
// ),
// Container(
// height: screenSize.height * 0.070,
// child: InkWell(
// onTap: model.categoryList != null &&
// model.categoryList.length > 0
// ? () {
// ListSelectDialog dialog =
// ListSelectDialog(
// list: model.categoryList,
// attributeName: 'categoryName',
// attributeValueId: 'categoryId',
// okText: TranslationBase.of(context).ok,
// okFunction: (selectedValue) {
// setState(() {
// selectedCategory = selectedValue;
// model.getProcedureCategory(
// categoryName: selectedCategory[
// 'categoryName'],
// categoryID: selectedCategory[
// 'categoryId'] <=
// 9
// ? "0" +
// selectedCategory[
// 'categoryId']
// .toString()
// : selectedCategory[
// 'categoryId']
// .toString());
// });
// },
// );
// showDialog(
// barrierDismissible: false,
// context: context,
// builder: (BuildContext context) {
// return dialog;
// },
// );
// //model.getProcedureCategory();
// }
// : null,
// child: TextField(
// decoration: textFieldSelectorDecoration(
// TranslationBase.of(context)
// .procedureCategorise,
// selectedCategory != null
// ? selectedCategory['categoryName']
// : null,
// true,
// suffixIcon: Icon(
// Icons.search,
// color: Colors.black,
// )),
// enabled: false,
// ),
// ),
// ),
if (procedureName.text.isNotEmpty &&
model.procedureList.length != 0)
NetworkBaseView(
baseViewModel: model,
child:
// selectedCategory != null
// ? selectedCategory['categoryId'] == 02 ||
// selectedCategory['categoryId'] == 03
// ?
EntityListCheckboxSearchWidget(
child: EntityListCheckboxSearchWidget(
model: widget.model,
masterList: widget
.model.categoriesList[0].entityList,
@ -338,77 +263,10 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
},
isEntityListSelected: (master) =>
isEntityListSelected(master),
)
// : ProcedureListWidget(
// model: widget.model,
// masterList: widget.model
// .categoriesList[0].entityList,
// removeHistory: (item) {
// setState(() {
// entityList.remove(item);
// });
// },
// addHistory: (history) {
// setState(() {
// entityList.add(history);
// });
// },
// addSelectedHistories: () {
// //TODO build your fun herr
// // widget.addSelectedHistories();
// },
// isEntityListSelected: (master) =>
// isEntityListSelected(master),
// )
// : null,
),
)),
SizedBox(
height: 15.0,
height: 115.0,
),
Column(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
// Container(
// child: Row(
// children: [
// AppText(
// TranslationBase.of(context).orderType),
// Radio(
// activeColor: Color(0xFFB9382C),
// value: 1,
// groupValue: selectedType,
// onChanged: (value) {
// setSelectedType(value);
// },
// ),
// Text('routine'),
// Radio(
// activeColor: Color(0xFFB9382C),
// groupValue: selectedType,
// value: 0,
// onChanged: (value) {
// setSelectedType(value);
// },
// ),
// Text(TranslationBase.of(context).urgent),
// ],
// ),
// ),
// SizedBox(
// height: 15.0,
// ),
// TextFields(
// hintText: TranslationBase.of(context).remarks,
// controller: remarksController,
// minLines: 3,
// maxLines: 5,
// ),
SizedBox(
height: 100.0,
),
],
)
],
),
),

@ -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,
),
),
),
),
],
),
),
);
}
}

@ -218,14 +218,10 @@ class _AddSelectedLabOrderState extends State<AddSelectedLabOrder> {
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: TranslationBase.of(context)
.addLabOrder, //TranslationBase.of(context)
title: TranslationBase.of(context).addLabOrder,
fontWeight: FontWeight.w700,
//.addSelectedProcedures,
color: Color(0xff359846),
onPressed: () {
//print(entityList.toString());
onPressed:
if (entityList.isEmpty == true) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context)

@ -147,6 +147,8 @@ class _AddProcedureHomeState extends State<AddProcedureHome>
AddFavouriteProcedure(
patient: patient,
model: model,
addButtonTitle: TranslationBase.of(context).addSelectedProcedures,
toolbarTitle: 'Add Procedure',
),
AddSelectedProcedure(
model: model,

@ -110,6 +110,7 @@ class AddSelectedRadiologyOrder extends StatefulWidget {
const AddSelectedRadiologyOrder({Key key, this.model, this.patient})
: super(key: key);
@override
_AddSelectedRadiologyOrderState createState() =>
_AddSelectedRadiologyOrderState(patient: patient, model: model);
@ -119,7 +120,9 @@ class _AddSelectedRadiologyOrderState extends State<AddSelectedRadiologyOrder> {
int selectedType;
ProcedureViewModel model;
PatiantInformtion patient;
_AddSelectedRadiologyOrderState({this.patient, this.model});
TextEditingController procedureController = TextEditingController();
TextEditingController remarksController = TextEditingController();
List<EntityList> entityList = List();
@ -221,8 +224,6 @@ class _AddSelectedRadiologyOrderState extends State<AddSelectedRadiologyOrder> {
color: Color(0xff359846),
fontWeight: FontWeight.w700,
onPressed: () {
//print(entityList.toString());
onPressed:
if (entityList.isEmpty == true) {
DrAppToastMsg.showErrorToast(TranslationBase.of(context)
.fillTheMandatoryProcedureDetails);

@ -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).addLabOrder,
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).addLabOrder,
toolbarTitle: TranslationBase.of(context).applyForNewLabOrder,
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,
),
),
),
),
],
),
),
);
}
}

@ -61,6 +61,7 @@ class _EntityListCheckboxSearchFavProceduresWidgetState
}
List<ProcedureTempleteModel> items = List();
List<ProcedureTempleteDetailsModelList> itemss = List();
List<ProcedureTempleteDetailsModel> itemsProcedure = List();
List<String> remarksList = List();
List<int> typeList = List();
@ -104,7 +105,7 @@ class _EntityListCheckboxSearchFavProceduresWidgetState
),
items.length != 0
? Column(
children: items.map((historyInfo) {
children: itemss.map((historyInfo) {
return ExpansionProcedure(
procedureTempleteModel: historyInfo,
model: widget.model,

@ -14,10 +14,14 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class ProcedureCheckOutScreen extends StatefulWidget {
ProcedureCheckOutScreen({this.items, this.model, this.patient});
final List<ProcedureTempleteDetailsModel> items;
final ProcedureViewModel model;
final PatiantInformtion patient;
final String addButtonTitle;
final String toolbarTitle;
ProcedureCheckOutScreen(
{this.items, this.model, this.patient,@required this.addButtonTitle,@required this.toolbarTitle});
@override
_ProcedureCheckOutScreenState createState() =>
@ -63,7 +67,7 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
width: 5.0,
),
AppText(
'Add Procedure',
widget.toolbarTitle ?? 'Add Procedure',
fontWeight: FontWeight.w700,
fontSize: 20,
),
@ -71,122 +75,129 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
),
),
),
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: [
Row(
children: [
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 11),
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(
TranslationBase.of(context).orderType,
fontWeight: FontWeight.w700,
color: Color(0xff2B353E),
),
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,
),
],
),
],
),
],
),
),
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,),
)),
SizedBox(
height: 90,
),
],
),
),
@ -196,7 +207,7 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: TranslationBase.of(context).addSelectedProcedures,
title: widget.addButtonTitle ?? TranslationBase.of(context).addSelectedProcedures,
color: Color(0xff359846),
fontWeight: FontWeight.w700,
onPressed: () async {

Loading…
Cancel
Save