|
|
|
|
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/procedure/procedure_templateModel.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/entity_list_checkbox_search_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/procedures/entity_list_fav_procedure.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
|
|
|
|
|
class AddFavouriteProcedure extends StatefulWidget {
|
|
|
|
|
final ProcedureViewModel model;
|
|
|
|
|
final PatiantInformtion patient;
|
|
|
|
|
|
|
|
|
|
const AddFavouriteProcedure({Key key, this.model, this.patient})
|
|
|
|
|
: super(key: key);
|
|
|
|
|
@override
|
|
|
|
|
_AddFavouriteProcedureState createState() => _AddFavouriteProcedureState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
|
|
|
|
|
_AddFavouriteProcedureState({this.patient, this.model});
|
|
|
|
|
ProcedureViewModel model;
|
|
|
|
|
PatiantInformtion patient;
|
|
|
|
|
List<ProcedureTempleteModel> entityList = List();
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return BaseView<ProcedureViewModel>(
|
|
|
|
|
onModelReady: (model) => model.getProcedureTemplate(),
|
|
|
|
|
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
|
|
|
|
|
AppScaffold(
|
|
|
|
|
isShowAppBar: false,
|
|
|
|
|
body: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.070,
|
|
|
|
|
),
|
|
|
|
|
if (model.procedureList.length != 0)
|
|
|
|
|
NetworkBaseView(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
child:
|
|
|
|
|
// selectedCategory != null
|
|
|
|
|
// ? selectedCategory['categoryId'] == 02 ||
|
|
|
|
|
// selectedCategory['categoryId'] == 03
|
|
|
|
|
// ?
|
|
|
|
|
EntityListCheckboxSearchFavProceduresWidget(
|
|
|
|
|
model: widget.model,
|
|
|
|
|
masterList: widget.model.ProcedureTemplate,
|
|
|
|
|
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,
|
|
|
|
|
),
|
|
|
|
|
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,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool isEntityListSelected(ProcedureTempleteModel masterKey) {
|
|
|
|
|
Iterable<ProcedureTempleteModel> history = entityList
|
|
|
|
|
.where((element) => masterKey.templateID == element.templateID);
|
|
|
|
|
if (history.length > 0) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|