Android Native Change For Call

update_flutter_3.16.0_voipcall
Aamir Muhammad 2 years ago
parent 83737dc5a7
commit 79446a20e8

@ -996,7 +996,7 @@ class VideoStreamFloatingWidgetService : BaseMovingFloatingWidget(), Session.Ses
Intent(this, VideoStreamFloatingWidgetService::class.java)
.let { notificationIntent ->
notificationIntent.action = ACTION_MINIMIZE_CALL
PendingIntent.getService(this, 0, notificationIntent, 0)
PendingIntent.getService(this, 0, notificationIntent, PendingIntent.FLAG_MUTABLE )
}
// 4. Create additional Actions (Intents) for the Notification.
@ -1006,7 +1006,7 @@ class VideoStreamFloatingWidgetService : BaseMovingFloatingWidget(), Session.Ses
action = ACTION_END_CALL
}
.let { notificationIntent ->
PendingIntent.getService(this, 0, notificationIntent, 0)
PendingIntent.getService(this, 0, notificationIntent, PendingIntent.FLAG_MUTABLE)
}
val endCallAction = NotificationCompat.Action.Builder(
R.drawable.ic_end_call,

@ -31,9 +31,9 @@ class VideoCallService extends BaseService {
kToken: startCallRes.openTokenID,
kSessionId: startCallRes.openSessionID,
//
// kToken: "T1==cGFydG5lcl9pZD00NjIwOTk2MiZzaWc9NzE0MGE4YzM0ZTU2YjQ5NmQzOTgwOTNkYmU1NzEzMmQxYTdkMDliZTpzZXNzaW9uX2lkPTFfTVg0ME5qSXdPVGsyTW41LU1UWTVNakkxTkRjMU1EUTRObjVCVFZsM2MwODFNV1ZhTjFsUlEyZGxiRFZxZVZjNWNHMS1mbjQmY3JlYXRlX3RpbWU9MTY5MjI1NDc1MCZub25jZT0wLjY5OTQyNzkzMTg1NDg4NSZyb2xlPW1vZGVyYXRvciZleHBpcmVfdGltZT0xNjkyMjU2NTUwJmluaXRpYWxfbGF5b3V0X2NsYXNzX2xpc3Q9",
// kSessionId: "1_MX40NjIwOTk2Mn5-MTY5MjI1NDc1MDQ4Nn5BTVl3c081MWVaN1lRQ2dlbDVqeVc5cG1-fn4",
// kToken:
// "T1==cGFydG5lcl9pZD00NjIwOTk2MiZzaWc9Y2YwYWY5YWMyNjg5ZTljODUyN2QwMmI5YzVhZmQxMTE4M2M3OGNmNDpzZXNzaW9uX2lkPTJfTVg0ME5qSXdPVGsyTW41LU1UY3dNamc0TmpjNU5qa3hPWDVuVTFCcmRDOTRVbk5MUTBoYVJYUjVWVE5xWkRGdVl5dC1mbjQmY3JlYXRlX3RpbWU9MTcwMjg4Njc5NyZub25jZT0wLjE5NDM0MzQyMTAyOTg4MjY3JnJvbGU9bW9kZXJhdG9yJmV4cGlyZV90aW1lPTE3MDM0OTE1OTcmaW5pdGlhbF9sYXlvdXRfY2xhc3NfbGlzdD0=",
// kSessionId: "2_MX40NjIwOTk2Mn5-MTcwMjg4Njc5NjkxOX5nU1BrdC94UnNLQ0haRXR5VTNqZDFuYyt-fn4",
vcId: patient.vcId!,
isRecording: isRecording,
patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"),

@ -1,23 +1,21 @@
import 'dart:async';
import 'dart:convert';
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/service/VideoCallService.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/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/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/shared/app_loader_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:flutter/material.dart';
import '../../utils/translations_delegate_base_utils.dart';
import '../../widgets/shared/errors/error_message.dart';
class LiveCarePatientScreen extends StatefulWidget {
@override
_LiveCarePatientScreenState createState() => _LiveCarePatientScreenState();
@ -93,16 +91,20 @@ class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> {
model.state == ViewState.Idle
? Expanded(
child: Container(
child: model.filterData.isEmpty
? Center(
child: ErrorMessage(
error: TranslationBase.of(context).youDontHaveAnyPatient,
),
)
: ListView.builder(
child:
//
// model.filterData.isEmpty
// ? Center(
// child: ErrorMessage(
// error: TranslationBase.of(context).youDontHaveAnyPatient,
// ),
// )
// :
ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model.filterData.length,
itemCount: 1, // model.filterData.length,
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(
padding: EdgeInsets.all(8.0),
child: PatientCard(
patientInfo: PatiantInformtion.fromJson(model.filterData[index].toJson()),
patientInfo: PatiantInformtion.fromJson(jsonObject
// model.filterData[index].toJson()
),
patientType: "0",
arrivalType: "0",
isFromSearch: false,
@ -183,22 +187,22 @@ class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> {
isFromLiveCare: true,
onTap: () {
// TODO change the parameter to daynamic
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": PatiantInformtion.fromJson(model.filterData[index].toJson()),
"patientType": "0",
"isSearch": false,
"isInpatient": false,
"arrivalType": "0",
"isSearchAndOut": false,
"isFromLiveCare": true,
});
// AppPermissionsUtils.requestVideoCallPermission(
// context: context,
// onTapGrant: () {
// locator<VideoCallService>().openVideo(model.startCallRes!, PatiantInformtion.fromJson(model.filterData[index].toJson()),
// model.startCallRes != null ? model.startCallRes!.isRecording! : true, callConnected, callDisconnected);
// Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
// "patient": PatiantInformtion.fromJson(model.filterData[index].toJson()),
// "patientType": "0",
// "isSearch": false,
// "isInpatient": false,
// "arrivalType": "0",
// "isSearchAndOut": false,
// "isFromLiveCare": true,
// });
AppPermissionsUtils.requestVideoCallPermission(
context: context,
onTapGrant: () {
locator<VideoCallService>().openVideo(model.startCallRes!, PatiantInformtion.fromJson(jsonObject),
model.startCallRes != null ? model.startCallRes!.isRecording! : true, callConnected, callDisconnected);
});
},
// isFromSearch: widget.isSearch,
),

@ -48,7 +48,7 @@ class _ShowTimerState extends State<ShowTimer> {
generateShowTimerString() {
DateTime now = DateTime.now();
DateTime liveCareDate = DateTime.parse(widget.patientInfo.arrivalTime!);
DateTime liveCareDate = DateTime.parse(widget.patientInfo.arrivalTime);
String timer = AppDateUtils.differenceBetweenDateAndCurrent(liveCareDate, context, isShowSecond: true, isShowDays: false);
return timer;

Loading…
Cancel
Save