|
|
|
|
@ -15,6 +15,7 @@ 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';
|
|
|
|
|
@ -126,6 +127,7 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
|
|
|
|
|
TextEditingController remarksController = TextEditingController();
|
|
|
|
|
List<EntityList> entityList = List();
|
|
|
|
|
List<EntityList> entityListProcedure = List();
|
|
|
|
|
TextEditingController procedureName = TextEditingController();
|
|
|
|
|
|
|
|
|
|
dynamic selectedCategory;
|
|
|
|
|
|
|
|
|
|
@ -139,7 +141,7 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
final screenSize = MediaQuery.of(context).size;
|
|
|
|
|
return BaseView<ProcedureViewModel>(
|
|
|
|
|
onModelReady: (model) => model.getCategory(),
|
|
|
|
|
//onModelReady: (model) => model.getCategory(),
|
|
|
|
|
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
|
|
|
|
|
AppScaffold(
|
|
|
|
|
isShowAppBar: false,
|
|
|
|
|
@ -159,136 +161,191 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
'Please Enter 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,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
'Please Select Category',
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
fontSize: 20,
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.85,
|
|
|
|
|
child: AppTextFieldCustom(
|
|
|
|
|
hintText: 'Search Procedure here...',
|
|
|
|
|
isTextFieldHasSuffix: false,
|
|
|
|
|
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
minLines: 1,
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
controller: procedureName,
|
|
|
|
|
// onSubmitted: (_) {
|
|
|
|
|
// model.getProcedureCategory(
|
|
|
|
|
// categoryName: procedureName.text);
|
|
|
|
|
// },
|
|
|
|
|
onClick: () {
|
|
|
|
|
model.getProcedureCategory(
|
|
|
|
|
categoryName: procedureName.text);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.29,
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.02,
|
|
|
|
|
),
|
|
|
|
|
InkWell(
|
|
|
|
|
child: Icon(
|
|
|
|
|
Icons.close,
|
|
|
|
|
size: 24.0,
|
|
|
|
|
),
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
model.getProcedureCategory(
|
|
|
|
|
categoryName: procedureName.text);
|
|
|
|
|
},
|
|
|
|
|
child: Icon(
|
|
|
|
|
Icons.search,
|
|
|
|
|
size: 25.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
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 (widget.model.categoriesList.length != 0)
|
|
|
|
|
// 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(
|
|
|
|
|
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),
|
|
|
|
|
)
|
|
|
|
|
: 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),
|
|
|
|
|
child:
|
|
|
|
|
// selectedCategory != null
|
|
|
|
|
// ? selectedCategory['categoryId'] == 02 ||
|
|
|
|
|
// selectedCategory['categoryId'] == 03
|
|
|
|
|
// ?
|
|
|
|
|
EntityListCheckboxSearchWidget(
|
|
|
|
|
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),
|
|
|
|
|
)
|
|
|
|
|
// : 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,
|
|
|
|
|
),
|
|
|
|
|
|