From 537d93915e50beee2fefadf6af57c4df546161a4 Mon Sep 17 00:00:00 2001 From: Haroon Amjad <> Date: Tue, 27 Jan 2026 23:10:27 +0300 Subject: [PATCH] Zoom SDK fixes --- lib/presentation/home/landing_page.dart | 1 + lib/services/zoom_service.dart | 33 +++++++++++++++++++++++++ lib/splashPage.dart | 15 +++++------ pubspec.yaml | 2 +- 4 files changed, 43 insertions(+), 8 deletions(-) create mode 100644 lib/services/zoom_service.dart diff --git a/lib/presentation/home/landing_page.dart b/lib/presentation/home/landing_page.dart index ab0d247..eca4eb7 100644 --- a/lib/presentation/home/landing_page.dart +++ b/lib/presentation/home/landing_page.dart @@ -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'; diff --git a/lib/services/zoom_service.dart b/lib/services/zoom_service.dart new file mode 100644 index 0000000..9af543d --- /dev/null +++ b/lib/services/zoom_service.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 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; +} \ No newline at end of file diff --git a/lib/splashPage.dart b/lib/splashPage.dart index b536661..33d3d23 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -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 { await notificationService.initialize(onNotificationClick: (payload) { // Handle notification click here }); - + await ZoomService().initializeZoomSDK(); if (isAppOpenedFromCall) { navigateToTeleConsult(); } else { @@ -68,12 +69,12 @@ class _SplashScreenState extends State { } } }); - 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 { diff --git a/pubspec.yaml b/pubspec.yaml index 26903b6..491cf9a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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