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.44k stars 672 forks source link

there is new issue with trackball #1827

Closed mahdiqdi closed 1 week ago

mahdiqdi commented 3 weeks ago

Bug description

when i upgraded my package this bug happened. the bug is happening when i touch last and first apce of my chart

Steps to reproduce

when i touch selected places in screenshot this error hapens

Code sample

Code sample ```dart trackballBehavior = TrackballBehavior( tooltipSettings: const InteractiveTooltip( enable: false, ), tooltipDisplayMode: TrackballDisplayMode.groupAllPoints, builder: (BuildContext context, TrackballDetails trackballDetails) { return ClipRRect( borderRadius: BorderRadius.circular(12.0), child: BackdropFilter( filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), child: Container( height: 84, width: 168, padding: const EdgeInsets.all(8.0), decoration: BoxDecoration( borderRadius: BorderRadius.circular(12.0), color: Theme.of(context).colorScheme.neutral2.withOpacity(0.6), ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ FittedBox( fit: BoxFit.scaleDown, child: Row( children: [ const CustomBadge( color: primary1, isCountBadge: false, size: 16, ), const SizedBox(width: 4.0), Text( '${Formatter.fiatFormatter(trackballDetails.groupingModeInfo!.points[0].y.toString(), 1)} تتر', style: Theme.of(context).textTheme.labelMedium?.copyWith( color: primary1, ), ), ], ), ), const SizedBox(height: 4.0), FittedBox( fit: BoxFit.scaleDown, child: Row( children: [ const CustomBadge( color: success1, isCountBadge: false, size: 16, ), const SizedBox(width: 4.0), Text( '${Formatter.fiatFormatter(trackballDetails.groupingModeInfo!.points[2].y.toString(), 1)} تتر', style: Theme.of(context).textTheme.labelMedium?.copyWith( color: success1, ), ), ], ), ), const SizedBox(height: 4.0), Row( children: [ CustomBadge( color: Theme.of(context).colorScheme.neutral4, isCountBadge: false, size: 16, ), const SizedBox(width: 4.0), Text( trackballDetails.groupingModeInfo!.points[0].x, style: Theme.of(context).textTheme.labelMedium?.copyWith( color: Theme.of(context).colorScheme.neutral4, ), ), ], ), ], ), ), ), ); }, lineDashArray: const [4, 3], enable: true, activationMode: ActivationMode.singleTap, hideDelay: 4000, lineColor: Colors.transparent, ); ```

Screenshots or Video

Screenshots / Video demonstration [Upload ![IMG_20240423_170427_514](https://github.com/syncfusion/flutter-widgets/assets/67858014/29f0e84c-6c42-42f5-80d5-af512b8d93a0) media here]

Stack Traces

Stack Traces ```dart The following RangeError was thrown while dispatching a pointer event: RangeError (index): Invalid value: Valid value range is empty: 0 When the exception was thrown, this was the stack: #0 List.[] (dart:core-patch/growable_array.dart:264:36) #1 SfCartesianChartState._buildTrackballWidget. (package:syncfusion_flutter_charts/src/charts/cartesian_chart.dart:1340:53) #2 new _GrowableList.generate (dart:core-patch/growable_array.dart:136:28) #3 SfCartesianChartState._buildTrackballWidget (package:syncfusion_flutter_charts/src/charts/cartesian_chart.dart:1337:19) #4 TrackballBehavior._show (package:syncfusion_flutter_charts/src/charts/behaviors/trackball.dart:665:31) #5 TrackballBehavior.show (package:syncfusion_flutter_charts/src/charts/behaviors/trackball.dart:474:5) #6 TrackballBehavior._showTrackball (package:syncfusion_flutter_charts/src/charts/behaviors/trackball.dart:597:7) #7 TrackballBehavior._handlePointerMove (package:syncfusion_flutter_charts/src/charts/behaviors/trackball.dart:523:7) #8 TrackballBehavior.handleEvent (package:syncfusion_flutter_charts/src/charts/behaviors/trackball.dart:511:7) #9 RenderBehaviorArea.handleEvent (package:syncfusion_flutter_charts/src/charts/interactions/behavior.dart:390:24) #10 RenderChartArea.handleEvent (package:syncfusion_flutter_charts/src/charts/base.dart:401:22) #11 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:475:22) #12 RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:430:11) #13 GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:420:7) #14 GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:383:5) #15 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:330:7) #16 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:299:9) #17 _invoke1 (dart:ui/hooks.dart:328:13) #18 PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:429:7) #19 _dispatchPointerDataPacket (dart:ui/hooks.dart:262:31) Event: PointerMoveEvent#7e8dd(position: Offset(364.4, 522.2)) position: Offset(364.4, 522.2) Target: RenderCartesianChartArea#99602 relayoutBoundary=up11 needs compositing parentData: offset=Offset(0.0, 0.0) (can use size) constraints: BoxConstraints(0.0<=w<=372.7, 0.0<=h<=188.0) layer: OffsetLayer#f7d19 size: Size(372.7, 188.0) ```

On which target platforms have you observed this bug?

Android

Flutter Doctor output

Doctor output ```console [✓] Flutter (Channel stable, 3.19.5, on Ubuntu 22.04.3 LTS 6.5.0-28-generic, locale en_US.UTF-8) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Chrome - develop for the web [✓] Linux toolchain - develop for Linux desktop [✓] Android Studio (version 2023.3) [✓] Connected device (3 available) [✓] Network resources ```
LokeshPalani commented 3 weeks ago

Hi @mahdiqdi,

The reported issue is already fixed and rolled out in our weekly patch release. Therefore, we kindly request that you upgrade the syncfusion_flutter_charts package to the latest version below to avoid this issue.

Version: https://pub.dev/packages/syncfusion_flutter_charts/versions/25.1.41+1

Root cause: Missed to ensure the length of the trackball info list before getting a list of index values.

Regards, Lokesh P.

mahdiqdi commented 3 weeks ago

thanks for tour response.you are perfect.

LokeshPalani commented 2 weeks ago

Hi @mahdiqdi,

Most Welcome. Kindly get back to us if you have further queries. We are always happy to assist you.

Regards, Lokesh P.