Zoom SDK fixes

pull/175/head
Haroon Amjad 1 week ago
parent 4e6d3d3178
commit 537d93915e

@ -52,6 +52,7 @@ import 'package:hmg_patient_app_new/presentation/todo_section/ancillary_procedur
import 'package:hmg_patient_app_new/presentation/todo_section/widgets/ancillary_orders_list.dart';
import 'package:hmg_patient_app_new/routes/app_routes.dart';
import 'package:hmg_patient_app_new/services/cache_service.dart';
import 'package:hmg_patient_app_new/services/zoom_service.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart';

@ -0,0 +1,33 @@
// lib/services/zoom_service.dart
import 'package:flutter_zoom_videosdk/native/zoom_videosdk.dart';
class ZoomService {
static final ZoomService _instance = ZoomService._internal();
factory ZoomService() => _instance;
ZoomService._internal();
ZoomVideoSdk? _zoom;
bool _isInitialized = false;
Future<void> initializeZoomSDK() async {
if (_isInitialized) return;
try {
_zoom = ZoomVideoSdk();
InitConfig initConfig = InitConfig(
domain: "zoom.us",
enableLog: true, // Enable for debugging
);
await _zoom!.initSdk(initConfig);
_isInitialized = true;
print("Zoom SDK initialized successfully");
} catch (e) {
print("Error initializing Zoom SDK: $e");
rethrow;
}
}
ZoomVideoSdk? get zoom => _zoom;
bool get isInitialized => _isInitialized;
}

@ -19,6 +19,7 @@ import 'package:hmg_patient_app_new/presentation/tele_consultation/zoom/call_scr
import 'package:hmg_patient_app_new/services/cache_service.dart';
import 'package:hmg_patient_app_new/services/navigation_service.dart';
import 'package:hmg_patient_app_new/services/notification_service.dart';
import 'package:hmg_patient_app_new/services/zoom_service.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart';
import 'package:lottie/lottie.dart';
@ -55,7 +56,7 @@ class _SplashScreenState extends State<SplashPage> {
await notificationService.initialize(onNotificationClick: (payload) {
// Handle notification click here
});
await ZoomService().initializeZoomSDK();
if (isAppOpenedFromCall) {
navigateToTeleConsult();
} else {
@ -68,12 +69,12 @@ class _SplashScreenState extends State<SplashPage> {
}
}
});
var zoom = ZoomVideoSdk();
InitConfig initConfig = InitConfig(
domain: "zoom.us",
enableLog: false,
);
zoom.initSdk(initConfig);
// var zoom = ZoomVideoSdk();
// InitConfig initConfig = InitConfig(
// domain: "zoom.us",
// enableLog: false,
// );
// zoom.initSdk(initConfig);
}
navigateToTeleConsult() async {

@ -43,7 +43,7 @@ dependencies:
lottie: ^3.3.1
flutter_ios_voip_kit_karmm: ^0.8.0
image_picker: ^1.2.0
file_picker: ^10.3.2
file_picker: 10.3.8
local_auth: ^2.3.0
share_plus: ^11.1.0
device_calendar_plus: ^0.3.1

Loading…
Cancel
Save