|
|
|
|
@ -30,7 +30,7 @@ class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> {
|
|
|
|
|
void initState() {
|
|
|
|
|
super.initState();
|
|
|
|
|
timer = Timer.periodic(Duration(seconds: 10), (Timer t) {
|
|
|
|
|
if(_liveCareViewModel != null){
|
|
|
|
|
if (_liveCareViewModel != null) {
|
|
|
|
|
_liveCareViewModel.getPendingPatientERForDoctorApp(isFromTimer: true);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
@ -38,6 +38,7 @@ class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> {
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void dispose() {
|
|
|
|
|
_liveCareViewModel.isLogin(0);
|
|
|
|
|
_liveCareViewModel = null;
|
|
|
|
|
timer?.cancel();
|
|
|
|
|
super.dispose();
|
|
|
|
|
@ -49,7 +50,7 @@ class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> {
|
|
|
|
|
onModelReady: (model) async {
|
|
|
|
|
_liveCareViewModel = model;
|
|
|
|
|
await model.getPendingPatientERForDoctorApp();
|
|
|
|
|
|
|
|
|
|
await model.isLogin(1);
|
|
|
|
|
},
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
@ -82,7 +83,9 @@ class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> {
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 20,),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 20,
|
|
|
|
|
),
|
|
|
|
|
Center(
|
|
|
|
|
child: FractionallySizedBox(
|
|
|
|
|
widthFactor: .9,
|
|
|
|
|
@ -90,44 +93,35 @@ class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> {
|
|
|
|
|
width: double.maxFinite,
|
|
|
|
|
height: 75,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: Color(0xffCCCCCC),
|
|
|
|
|
),
|
|
|
|
|
color: Colors.white),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
left: 10, top: 10),
|
|
|
|
|
child: AppText(
|
|
|
|
|
TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.searchPatientName,
|
|
|
|
|
fontSize: 13,
|
|
|
|
|
)),
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
// focusNode: focusProject,
|
|
|
|
|
controller: _controller,
|
|
|
|
|
borderColor: Colors.white,
|
|
|
|
|
prefix: IconButton(
|
|
|
|
|
icon: Icon(
|
|
|
|
|
DoctorApp.filter_1,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
),
|
|
|
|
|
iconSize: 20,
|
|
|
|
|
padding:
|
|
|
|
|
EdgeInsets.only(
|
|
|
|
|
bottom: 30),
|
|
|
|
|
),
|
|
|
|
|
onChanged: (String str) {
|
|
|
|
|
model.searchData(str);
|
|
|
|
|
}),
|
|
|
|
|
])),
|
|
|
|
|
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(left: 10, top: 10),
|
|
|
|
|
child: AppText(
|
|
|
|
|
TranslationBase.of(context).searchPatientName,
|
|
|
|
|
fontSize: 13,
|
|
|
|
|
)),
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
// focusNode: focusProject,
|
|
|
|
|
controller: _controller,
|
|
|
|
|
borderColor: Colors.white,
|
|
|
|
|
prefix: IconButton(
|
|
|
|
|
icon: Icon(
|
|
|
|
|
DoctorApp.filter_1,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
),
|
|
|
|
|
iconSize: 20,
|
|
|
|
|
padding: EdgeInsets.only(bottom: 30),
|
|
|
|
|
),
|
|
|
|
|
onChanged: (String str) {
|
|
|
|
|
model.searchData(str);
|
|
|
|
|
}),
|
|
|
|
|
])),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
model.state == ViewState.Idle
|
|
|
|
|
@ -136,44 +130,44 @@ class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> {
|
|
|
|
|
child: model.filterData.isEmpty
|
|
|
|
|
? Center(
|
|
|
|
|
child: ErrorMessage(
|
|
|
|
|
error: TranslationBase.of(context)
|
|
|
|
|
.youDontHaveAnyPatient,
|
|
|
|
|
error: TranslationBase.of(context).youDontHaveAnyPatient,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: ListView.builder(
|
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
itemCount: model.filterData.length,
|
|
|
|
|
itemBuilder: (BuildContext ctxt, int index) {
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
|
child: PatientCard(
|
|
|
|
|
patientInfo: model.filterData[index],
|
|
|
|
|
patientType: "0",
|
|
|
|
|
arrivalType: "0",
|
|
|
|
|
isFromSearch: false,
|
|
|
|
|
isInpatient: false,
|
|
|
|
|
isFromLiveCare:true,
|
|
|
|
|
onTap: () {
|
|
|
|
|
// TODO change the parameter to daynamic
|
|
|
|
|
Navigator.of(context).pushNamed(
|
|
|
|
|
PATIENTS_PROFILE,
|
|
|
|
|
arguments: {
|
|
|
|
|
"patient": model.filterData[index],
|
|
|
|
|
"patientType": "0",
|
|
|
|
|
"isSearch": false,
|
|
|
|
|
"isInpatient": false,
|
|
|
|
|
"arrivalType": "0",
|
|
|
|
|
"isSearchAndOut": false,
|
|
|
|
|
"isFromLiveCare":true,
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// isFromSearch: widget.isSearch,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
})),
|
|
|
|
|
) : Expanded(
|
|
|
|
|
child: AppLoaderWidget(containerColor: Colors.transparent,)),
|
|
|
|
|
itemCount: model.filterData.length,
|
|
|
|
|
itemBuilder: (BuildContext ctxt, int index) {
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
|
child: PatientCard(
|
|
|
|
|
patientInfo: model.filterData[index],
|
|
|
|
|
patientType: "0",
|
|
|
|
|
arrivalType: "0",
|
|
|
|
|
isFromSearch: false,
|
|
|
|
|
isInpatient: false,
|
|
|
|
|
isFromLiveCare: true,
|
|
|
|
|
onTap: () {
|
|
|
|
|
// TODO change the parameter to daynamic
|
|
|
|
|
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
|
|
|
|
|
"patient": model.filterData[index],
|
|
|
|
|
"patientType": "0",
|
|
|
|
|
"isSearch": false,
|
|
|
|
|
"isInpatient": false,
|
|
|
|
|
"arrivalType": "0",
|
|
|
|
|
"isSearchAndOut": false,
|
|
|
|
|
"isFromLiveCare": true,
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// isFromSearch: widget.isSearch,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
})),
|
|
|
|
|
)
|
|
|
|
|
: Expanded(
|
|
|
|
|
child: AppLoaderWidget(
|
|
|
|
|
containerColor: Colors.transparent,
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
|