syncfusion / flutter-widgets

Syncfusion Flutter widgets libraries include high quality UI widgets and file-format packages to help you create rich, high-quality applications for iOS, Android, and web from a single code base.
1.6k stars 783 forks source link

[syncfusion_flutter_charts][ios] _handlePointerMove in TrackballBehavior throws when parentBox is null #2163

Open flocbit opened 1 week ago

flocbit commented 1 week ago

Bug description

TrackballBehavior's _handlePointerMove force unwraps the parentBox getter which in some rare cases seems to be null. This causes FlutterErrors for some of my users.

Steps to reproduce

Can't reproduce it myself, but some users are experiencing it.

Code sample

Code sample ```dart void _handlePointerMove(PointerMoveEvent details) { if (activationMode == ActivationMode.singleTap) { _showTrackball(parentBox!.globalToLocal(details.position)); } } ```

Screenshots or Video

Screenshots / Video demonstration [Upload media here]

Stack Traces

Stack Traces ```dart Fatal Exception: FlutterError 0 App 0x2ef6a3 TrackballBehavior._handlePointerMove + 526 (trackball.dart:526) 1 App 0x2ef1e7 TrackballBehavior.handleEvent + 514 (trackball.dart:514) 2 App 0x2ef07f RenderBehaviorArea.handleEvent + 385 (behavior.dart:385) 3 App 0x2fa28f RenderChartArea.handleEvent + 483 (base.dart:483) 4 App 0x816f17 GestureBinding.dispatchEvent + 481 (binding.dart:481) 5 App 0x1663af RendererBinding.dispatchEvent + 450 (binding.dart:450) 6 App 0x1662e7 GestureBinding._handlePointerEventImmediately + 426 (binding.dart:426) 7 App 0x165d37 GestureBinding._flushPointerEventQueue (#2) + 389 (binding.dart:389) 8 App 0x8664af GestureBinding._handlePointerDataPacket (#2) + 305 (binding.dart:305) 9 App 0x3bfee7 GestureBinding._handlePointerDataPacket + 299 (binding.dart:299) 10 App 0x4c4b3 invoke1 + 328 (hooks.dart:328) 11 App 0x4da23 PlatformDispatcher._dispatchPointerDataPacket + 442 (platform_dispatcher.dart:442) 12 App 0x4d9b3 dispatchPointerDataPacket + 262 (hooks.dart:262) 13 App 0x4e41b dispatchPointerDataPacket (#2) + 260 (hooks.dart:260) ```

On which target platforms have you observed this bug?

iOS

Flutter Doctor output

Doctor output ```console Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.24.4, on macOS 15.0.1 24A348 darwin-arm64, locale en-DE) [✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 16.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2024.1) [✓] VS Code (version 1.95.0) [✓] Connected device (5 available) [✓] Network resources • No issues found! ```