|
|
|
|
@ -1,10 +1,12 @@
|
|
|
|
|
import 'dart:async';
|
|
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/livecare_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/livecare/get_pending_res_list.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/livecare/session_status_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/livecare/start_call_res.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/VideoChannel.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/helpers.dart';
|
|
|
|
|
@ -13,9 +15,10 @@ import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
class VideoCallPage extends StatefulWidget {
|
|
|
|
|
final LiveCarePendingListResponse patientData;
|
|
|
|
|
final PatiantInformtion patientData;
|
|
|
|
|
final listContext;
|
|
|
|
|
VideoCallPage(this.patientData, this.listContext);
|
|
|
|
|
final LiveCarePatientViewModel model;
|
|
|
|
|
VideoCallPage({this.patientData, this.listContext, this.model});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_VideoCallPageState createState() => _VideoCallPageState();
|
|
|
|
|
@ -41,7 +44,8 @@ class _VideoCallPageState extends State<VideoCallPage> {
|
|
|
|
|
super.didChangeDependencies();
|
|
|
|
|
if (_isInit) {
|
|
|
|
|
_liveCareProvider = Provider.of<LiveCareViewModel>(context);
|
|
|
|
|
startCall(false);
|
|
|
|
|
connectOpenTok(widget.model.startCallRes);
|
|
|
|
|
// widget.model.startCall(vCID: widget.patientData.vcId, isReCall: false);
|
|
|
|
|
}
|
|
|
|
|
_isInit = false;
|
|
|
|
|
}
|
|
|
|
|
@ -61,7 +65,7 @@ class _VideoCallPageState extends State<VideoCallPage> {
|
|
|
|
|
kSessionId: tokenData.openSessionID,
|
|
|
|
|
//'1_MX40NjgwMzIyNH5-MTU5MzY4MzYzODYwM35ucExWYVRVSm5Hcy9uWGZmM1lOa3czZHV-fg',
|
|
|
|
|
kApiKey: '46209962',
|
|
|
|
|
vcId: widget.patientData.vCID,
|
|
|
|
|
vcId: widget.patientData.vcId,
|
|
|
|
|
tokenID: token, //"hfkjshdf347r8743",
|
|
|
|
|
generalId: "Cs2020@2016\$2958",
|
|
|
|
|
doctorId: doctorprofile['DoctorID'],
|
|
|
|
|
@ -130,7 +134,7 @@ class _VideoCallPageState extends State<VideoCallPage> {
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.02,
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
widget.patientData.patientName,
|
|
|
|
|
widget.patientData.fullName,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.deepPurpleAccent,
|
|
|
|
|
fontWeight: FontWeight.w900,
|
|
|
|
|
@ -319,7 +323,7 @@ class _VideoCallPageState extends State<VideoCallPage> {
|
|
|
|
|
|
|
|
|
|
endCallWithCharge() {
|
|
|
|
|
_liveCareProvider
|
|
|
|
|
.endCallWithCharge(widget.patientData.vCID, doctorprofile['DoctorID'])
|
|
|
|
|
.endCallWithCharge(widget.patientData.vcId, doctorprofile['DoctorID'])
|
|
|
|
|
.then((result) {
|
|
|
|
|
closeRoute();
|
|
|
|
|
print('end callwith charge');
|
|
|
|
|
|