|
|
|
@ -1,23 +1,21 @@
|
|
|
|
import 'dart:async';
|
|
|
|
import 'dart:async';
|
|
|
|
|
|
|
|
import 'dart:convert';
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/core/enum/view_state.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/enum/view_state.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/core/service/VideoCallService.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart';
|
|
|
|
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
|
|
|
|
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
|
|
|
|
import 'package:doctor_app_flutter/routes.dart';
|
|
|
|
import 'package:doctor_app_flutter/locator.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
|
|
|
|
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
|
|
|
|
import 'package:doctor_app_flutter/utils/notification_permission_utils.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_custom_serach.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_custom_serach.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
|
|
import '../../utils/translations_delegate_base_utils.dart';
|
|
|
|
|
|
|
|
import '../../widgets/shared/errors/error_message.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class LiveCarePatientScreen extends StatefulWidget {
|
|
|
|
class LiveCarePatientScreen extends StatefulWidget {
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
_LiveCarePatientScreenState createState() => _LiveCarePatientScreenState();
|
|
|
|
_LiveCarePatientScreenState createState() => _LiveCarePatientScreenState();
|
|
|
|
@ -93,16 +91,20 @@ class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> {
|
|
|
|
model.state == ViewState.Idle
|
|
|
|
model.state == ViewState.Idle
|
|
|
|
? Expanded(
|
|
|
|
? Expanded(
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
child: model.filterData.isEmpty
|
|
|
|
child:
|
|
|
|
? Center(
|
|
|
|
//
|
|
|
|
child: ErrorMessage(
|
|
|
|
// model.filterData.isEmpty
|
|
|
|
error: TranslationBase.of(context).youDontHaveAnyPatient,
|
|
|
|
// ? Center(
|
|
|
|
),
|
|
|
|
// child: ErrorMessage(
|
|
|
|
)
|
|
|
|
// error: TranslationBase.of(context).youDontHaveAnyPatient,
|
|
|
|
: ListView.builder(
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// )
|
|
|
|
|
|
|
|
// :
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ListView.builder(
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
shrinkWrap: true,
|
|
|
|
shrinkWrap: true,
|
|
|
|
itemCount: model.filterData.length,
|
|
|
|
itemCount: 1, // model.filterData.length,
|
|
|
|
itemBuilder: (BuildContext ctxt, int index) {
|
|
|
|
itemBuilder: (BuildContext ctxt, int index) {
|
|
|
|
//
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
@ -168,14 +170,16 @@ class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
''';
|
|
|
|
''';
|
|
|
|
|
|
|
|
|
|
|
|
// Map<String, dynamic> jsonObject = json.decode(jsonString);
|
|
|
|
Map<String, dynamic> jsonObject = json.decode(jsonString);
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
return Padding(
|
|
|
|
return Padding(
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
child: PatientCard(
|
|
|
|
child: PatientCard(
|
|
|
|
patientInfo: PatiantInformtion.fromJson(model.filterData[index].toJson()),
|
|
|
|
patientInfo: PatiantInformtion.fromJson(jsonObject
|
|
|
|
|
|
|
|
// model.filterData[index].toJson()
|
|
|
|
|
|
|
|
),
|
|
|
|
patientType: "0",
|
|
|
|
patientType: "0",
|
|
|
|
arrivalType: "0",
|
|
|
|
arrivalType: "0",
|
|
|
|
isFromSearch: false,
|
|
|
|
isFromSearch: false,
|
|
|
|
@ -183,22 +187,22 @@ class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> {
|
|
|
|
isFromLiveCare: true,
|
|
|
|
isFromLiveCare: true,
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
// TODO change the parameter to daynamic
|
|
|
|
// TODO change the parameter to daynamic
|
|
|
|
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
|
|
|
|
// Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
|
|
|
|
"patient": PatiantInformtion.fromJson(model.filterData[index].toJson()),
|
|
|
|
// "patient": PatiantInformtion.fromJson(model.filterData[index].toJson()),
|
|
|
|
"patientType": "0",
|
|
|
|
// "patientType": "0",
|
|
|
|
"isSearch": false,
|
|
|
|
// "isSearch": false,
|
|
|
|
"isInpatient": false,
|
|
|
|
// "isInpatient": false,
|
|
|
|
"arrivalType": "0",
|
|
|
|
// "arrivalType": "0",
|
|
|
|
"isSearchAndOut": false,
|
|
|
|
// "isSearchAndOut": false,
|
|
|
|
"isFromLiveCare": true,
|
|
|
|
// "isFromLiveCare": true,
|
|
|
|
});
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
// AppPermissionsUtils.requestVideoCallPermission(
|
|
|
|
AppPermissionsUtils.requestVideoCallPermission(
|
|
|
|
// context: context,
|
|
|
|
context: context,
|
|
|
|
// onTapGrant: () {
|
|
|
|
onTapGrant: () {
|
|
|
|
// locator<VideoCallService>().openVideo(model.startCallRes!, PatiantInformtion.fromJson(model.filterData[index].toJson()),
|
|
|
|
locator<VideoCallService>().openVideo(model.startCallRes!, PatiantInformtion.fromJson(jsonObject),
|
|
|
|
// model.startCallRes != null ? model.startCallRes!.isRecording! : true, callConnected, callDisconnected);
|
|
|
|
model.startCallRes != null ? model.startCallRes!.isRecording! : true, callConnected, callDisconnected);
|
|
|
|
// });
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// isFromSearch: widget.isSearch,
|
|
|
|
// isFromSearch: widget.isSearch,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|