Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into sultan
commit
12f936d045
@ -0,0 +1,51 @@
|
|||||||
|
class ProcedureValadteModel {
|
||||||
|
List<EntityList> entityList;
|
||||||
|
int rowcount;
|
||||||
|
dynamic statusMessage;
|
||||||
|
dynamic success;
|
||||||
|
|
||||||
|
ProcedureValadteModel(
|
||||||
|
{this.entityList, this.rowcount, this.statusMessage, this.success});
|
||||||
|
|
||||||
|
ProcedureValadteModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
if (json['entityList'] != null) {
|
||||||
|
entityList = new List<EntityList>();
|
||||||
|
json['entityList'].forEach((v) {
|
||||||
|
entityList.add(new EntityList.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
rowcount = json['rowcount'];
|
||||||
|
statusMessage = json['statusMessage'];
|
||||||
|
success = json['success'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
if (this.entityList != null) {
|
||||||
|
data['entityList'] = this.entityList.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
data['rowcount'] = this.rowcount;
|
||||||
|
data['statusMessage'] = this.statusMessage;
|
||||||
|
data['success'] = this.success;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class EntityList {
|
||||||
|
String procedureId;
|
||||||
|
List<String> warringMessages;
|
||||||
|
|
||||||
|
EntityList({this.procedureId, this.warringMessages});
|
||||||
|
|
||||||
|
EntityList.fromJson(Map<String, dynamic> json) {
|
||||||
|
procedureId = json['procedureId'];
|
||||||
|
warringMessages = json['warringMessages'].cast<String>();
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['procedureId'] = this.procedureId;
|
||||||
|
data['warringMessages'] = this.warringMessages;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
class ProcedureValadteRequestModel {
|
||||||
|
String vidaAuthTokenID;
|
||||||
|
int patientMRN;
|
||||||
|
int appointmentNo;
|
||||||
|
int episodeID;
|
||||||
|
List<String> procedure;
|
||||||
|
|
||||||
|
ProcedureValadteRequestModel(
|
||||||
|
{this.vidaAuthTokenID,
|
||||||
|
this.patientMRN,
|
||||||
|
this.appointmentNo,
|
||||||
|
this.episodeID,
|
||||||
|
this.procedure});
|
||||||
|
|
||||||
|
ProcedureValadteRequestModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
vidaAuthTokenID = json['VidaAuthTokenID'];
|
||||||
|
patientMRN = json['PatientMRN'];
|
||||||
|
appointmentNo = json['AppointmentNo'];
|
||||||
|
episodeID = json['EpisodeID'];
|
||||||
|
procedure = json['Procedure'].cast<String>();
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
|
||||||
|
data['PatientMRN'] = this.patientMRN;
|
||||||
|
data['AppointmentNo'] = this.appointmentNo;
|
||||||
|
data['EpisodeID'] = this.episodeID;
|
||||||
|
data['Procedure'] = this.procedure;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,171 @@
|
|||||||
|
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
|
||||||
|
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class ProcedureListWidget extends StatefulWidget {
|
||||||
|
final ProcedureViewModel model;
|
||||||
|
final Function addSelectedHistories;
|
||||||
|
final Function(EntityList) removeHistory;
|
||||||
|
final Function(EntityList) addHistory;
|
||||||
|
final Function(EntityList) addRemarks;
|
||||||
|
|
||||||
|
final bool Function(EntityList) isEntityListSelected;
|
||||||
|
final List<EntityList> masterList;
|
||||||
|
|
||||||
|
ProcedureListWidget(
|
||||||
|
{Key key,
|
||||||
|
this.model,
|
||||||
|
this.addSelectedHistories,
|
||||||
|
this.removeHistory,
|
||||||
|
this.masterList,
|
||||||
|
this.addHistory,
|
||||||
|
this.isEntityListSelected,
|
||||||
|
this.addRemarks})
|
||||||
|
: super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_ProcedureListWidgetState createState() => _ProcedureListWidgetState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ProcedureListWidgetState extends State<ProcedureListWidget> {
|
||||||
|
int selectedType = 0;
|
||||||
|
int typeUrgent;
|
||||||
|
int typeRegular;
|
||||||
|
|
||||||
|
setSelectedType(int val) {
|
||||||
|
setState(() {
|
||||||
|
selectedType = val;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
List<EntityList> items = List();
|
||||||
|
List<String> remarksList = List();
|
||||||
|
List<int> typeList = List();
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
items.addAll(widget.masterList);
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
TextEditingController remarksController = TextEditingController();
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
NetworkBaseView(
|
||||||
|
baseViewModel: widget.model,
|
||||||
|
child: Container(
|
||||||
|
height: MediaQuery.of(context).size.height * 0.55,
|
||||||
|
child: Center(
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.only(top: 15),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
color: Colors.white),
|
||||||
|
child: ListView(
|
||||||
|
children: [
|
||||||
|
TextFields(
|
||||||
|
hintText: TranslationBase.of(context).searchProcedures,
|
||||||
|
suffixIcon: EvaIcons.search,
|
||||||
|
onChanged: (value) {
|
||||||
|
filterSearchResults(value);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 15,
|
||||||
|
),
|
||||||
|
items.length != 0
|
||||||
|
? Column(
|
||||||
|
children: items.map((historyInfo) {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Checkbox(
|
||||||
|
value: widget.isEntityListSelected(
|
||||||
|
historyInfo),
|
||||||
|
activeColor: Colors.red[800],
|
||||||
|
onChanged: (bool newValue) {
|
||||||
|
setState(() {
|
||||||
|
if (widget.isEntityListSelected(
|
||||||
|
historyInfo)) {
|
||||||
|
widget
|
||||||
|
.removeHistory(historyInfo);
|
||||||
|
} else {
|
||||||
|
widget.addHistory(historyInfo);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}),
|
||||||
|
Expanded(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 10, vertical: 0),
|
||||||
|
child: Texts(
|
||||||
|
historyInfo.procedureName,
|
||||||
|
variant: "bodyText",
|
||||||
|
bold: true,
|
||||||
|
color: Colors.black),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
DividerWithSpacesAround(),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
)
|
||||||
|
: Center(
|
||||||
|
child: Container(
|
||||||
|
child: AppText(
|
||||||
|
"There's no procedures for this category",
|
||||||
|
color: Color(0xFFB9382C)),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void filterSearchResults(String query) {
|
||||||
|
List<EntityList> dummySearchList = List();
|
||||||
|
dummySearchList.addAll(widget.masterList);
|
||||||
|
if (query.isNotEmpty) {
|
||||||
|
List<EntityList> dummyListData = List();
|
||||||
|
dummySearchList.forEach((item) {
|
||||||
|
if (item.procedureName.toLowerCase().contains(query.toLowerCase())) {
|
||||||
|
dummyListData.add(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
setState(() {
|
||||||
|
items.clear();
|
||||||
|
items.addAll(dummyListData);
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
setState(() {
|
||||||
|
items.clear();
|
||||||
|
items.addAll(widget.masterList);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue