ZEGOCLOUD / zego_uikit_prebuilt_call_flutter

MIT License
16 stars 13 forks source link

Null pointer exception on clicking overlay widget, not opening the call screen #20

Closed manumathew17 closed 1 year ago

manumathew17 commented 1 year ago

Getting null pointer exception when clicked on minimized overlay

I/PLogger ( 9157): {call} {overlay machine} {change state outside to PrebuiltCallMiniOverlayPageState.minimizing} {20/07/2023 11:28:24} {INFO} I/PLogger ( 9157): {call} {overlay machine} {data: null} {20/07/2023 11:28:24} {INFO} I/PLogger ( 9157): {call} {overlay machine} {mini overlay, from State[PrebuiltCallMiniOverlayPageState.idle] to State[PrebuiltCallMiniOverlayPageState.minimizing]} {20/07/2023 11:28:24} {INFO} D/ZEGO ( 9157): [Flutter] [DartCall] [updateTextureRendererSize] D/ZEGO ( 9157): [Flutter] [updateTextureRendererSize][Result] w: 360, h: 640, textureID: 5, success: true D/ZEGO ( 9157): [Flutter] [onApiCalledResult] errorCode: 0, funcName: startPreview, info: Execution successful. I/flutter ( 9157): getPlugin: ZegoUIKitPluginType.beauty I/PLogger ( 9157): {call} {controller_p} {un-init by prebuilt} {20/07/2023 11:28:24} {INFO} I/PLogger ( 9157): {call} {prebuilt} {mini machine state is minimizing, room will not be leave} {20/07/2023 11:28:24} {INFO} I/NDOP ( 9157): listening using window listener I/PLogger ( 9157): {uikit} {core} {app orientation is equal} {20/07/2023 11:28:25} {INFO} I/NDOP ( 9157): listening using window listener I/PLogger ( 9157): {uikit} {core} {app orientation is equal} {20/07/2023 11:28:26} {INFO} I/PLogger ( 9157): {uikit} {core} {app orientation is equal} {20/07/2023 11:28:26} {INFO} I/NDOP ( 9157): listening using window listener I/PLogger ( 9157): {uikit} {core} {app orientation is equal} {20/07/2023 11:28:27} {INFO} I/PLogger ( 9157): {uikit} {core} {app orientation is equal} {20/07/2023 11:28:27} {INFO} I/NDOP ( 9157): listening using window listener I/PLogger ( 9157): {uikit} {core} {app orientation is equal} {20/07/2023 11:28:28} {INFO} I/PLogger ( 9157): {uikit} {core} {app orientation is equal} {20/07/2023 11:28:28} {INFO} I/PLogger ( 9157): {call} {overlay machine} {change state outside to PrebuiltCallMiniOverlayPageState.calling} {20/07/2023 11:28:28} {INFO} I/PLogger ( 9157): {call} {overlay machine} {mini overlay, from State[PrebuiltCallMiniOverlayPageState.minimizing] to State[PrebuiltCallMiniOverlayPageState.calling]} {20/07/2023 11:28:28} {INFO}

======== Exception caught by gesture =============================================================== The following _TypeError was thrown while handling a gesture: Null check operator used on a null value

When the exception was thrown, this was the stack:

`#0 MyAppState.build... (package:lively_studio/main.dart:46:58)

1 ZegoUIKitPrebuiltCallMiniOverlayPageState.overlayItem. (package:zego_uikit_prebuilt_call/src/minimizing/mini_overlay_page.dart:172:45)

2 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:275:24)

3 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:654:11)

4 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:311:5)

5 BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:281:7)

6 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:167:27)

7 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:469:20)

8 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:445:22)

9 RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:331:11)

10 GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:400:7)

11 GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:363:5)

12 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:320:7)

13 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:293:9)

14 _invoke1 (dart:ui/hooks.dart:158:13)

15 PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:382:7)

16 _dispatchPointerDataPacket (dart:ui/hooks.dart:91:31)`

Handler: "onTap" Recognizer: TapGestureRecognizer#7c6db debugOwner: GestureDetector state: ready won arena finalPosition: Offset(124.8, 187.4) finalLocalPosition: Offset(24.8, 87.4) button: 1 sent tap down

====================================================================================================

yoer commented 1 year ago

image

had you init the navigatorKey of MaterialApp?

yoer commented 1 year ago

image

package:zego_uikit_prebuilt_call/src/minimizing/mini_overlay_page.dart:172:45 is try to get context by navigatorKey of MaterialApp

manumathew17 commented 1 year ago

Thanks this solved the issue.