Error While Panning or Zooming

After zooming the chart maximum time it causes error for panning or zooming again, when try to zoom again or even pan it shows this error 
════════ (35) Exception caught by gesture library ═══════════════════════════════════════════════════
'package:flutter/src/gestures/monodrag.dart': Failed assertion: line 407 pos 12: '_initialButtons == kPrimaryButton': is not true.

this is so annoying I am trying to set chart for realtime live data but this error stops everything and I can't do anything further after this error comes, please provide the solution as soon as possible.

Stack Trace when this error occurs :


E/flutter (26720): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: 'package:flutter/src/gestures/monodrag.dart': Failed assertion: line 377 pos 12: '_initialButtons == kPrimaryButton': is not true.
E/flutter (26720): #0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:42:39)
E/flutter (26720): #1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:38:5)
E/flutter (26720): #2      DragGestureRecognizer._checkStart (package:flutter/src/gestures/monodrag.dart:377:12)
E/flutter (26720): #3      DragGestureRecognizer.acceptGesture (package:flutter/src/gestures/monodrag.dart:308:7)
E/flutter (26720): #4      GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:156:27)
E/flutter (26720): #5      GestureArenaManager.release (package:flutter/src/gestures/arena.dart:199:7)
E/flutter (26720): #6      DoubleTapGestureRecognizer._reset (package:flutter/src/gestures/multitap.dart:259:44)
E/flutter (26720): #7      _rootRun (dart:async/zone.dart:1122:38)
E/flutter (26720): #8      _CustomZone.run (dart:async/zone.dart:1023:19)
E/flutter (26720): #9      _CustomZone.runGuarded (dart:async/zone.dart:925:7)
E/flutter (26720): #10     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:965:23)
E/flutter (26720): #11     _rootRun (dart:async/zone.dart:1126:13)
E/flutter (26720): #12     _CustomZone.run (dart:async/zone.dart:1023:19)
E/flutter (26720): #13     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:949:23)
E/flutter (26720): #14     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:23:15)
E/flutter (26720): #15     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:384:19)
E/flutter (26720): #16     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:418:5)
E/flutter (26720): #17     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)
E/flutter (26720): 

════════ Exception caught by gesture library ═══════════════════════════════════════════════════════
The following assertion was thrown while routing a pointer event:
'package:flutter/src/gestures/monodrag.dart': Failed assertion: line 407 pos 12: '_initialButtons == kPrimaryButton': is not true.


Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=BUG.md

When the exception was thrown, this was the stack: 
#2      DragGestureRecognizer._checkEnd (package:flutter/src/gestures/monodrag.dart:407:12)
#3      DragGestureRecognizer.didStopTrackingLastPointer (package:flutter/src/gestures/monodrag.dart:348:9)
#4      OneSequenceGestureRecognizer.stopTrackingPointer (package:flutter/src/gestures/recognizer.dart:336:9)
#5      DragGestureRecognizer._giveUpPointer (package:flutter/src/gestures/monodrag.dart:357:5)
#6      DragGestureRecognizer.handleEvent (package:flutter/src/gestures/monodrag.dart:281:7)
...
Event: PointerUpEvent#a0af7(position: Offset(391.0, 198.7), localPosition: Offset(381.0, 143.7), timeStamp: 23:35:00.741000, pointer: 11, kind: touch, device: 1, down: false, pressureMin: 0.0, size: 0.0, radiusMajor: 1.7, radiusMinor: 1.7, orientation: -1.6)
  position: Offset(391.0, 198.7)
════════════════════════════════════════════════════════════════════════════════════════════════════

════════ (2) Exception caught by gesture library ═══════════════════════════════════════════════════
'package:flutter/src/gestures/monodrag.dart': Failed assertion: line 407 pos 12: '_initialButtons == kPrimaryButton': is not true.
═══════════════════════════════════════════════════════════════════════════════════════════════


3 Replies

DD Dharanidharan Dharmasivam Syncfusion Team April 6, 2020 08:52 AM UTC

Hi Harsh, 

Greetings from Syncfusion. We have tried the replicate the reported scenario and unfortunately, the scenario is not reproduced at our end. The sample used for testing can be found below. 

Since we are not aware of your exact scenario, kindly try to replicate the reported scenario with the above sample. And we would like to know the current version of the chart widget you are using. Our current version is 18.1.42. If you are using older, kindly upgrade your package and ensure the reported scenario is replicating with v18.1.42. Also, if possible share videos for the reported scenario, this will be helpful in providing solution sooner. 

Thanks, 
Dharani. 



JA James July 20, 2020 05:57 PM UTC

I've also got this exact issue. I don't have time to create a minimal reproducible example right but I think it only occurs if the initial zoom port is different to the chart min and max? For example:

primaryXAxis: DateTimeAxis(
  minimum: minimumChartViewport,
  maximum: maximumChartViewport,
  visibleMinimum: initialChartViewportFrom,
  visibleMaximum: initialChartViewportTo,
),

Would be grateful if you can see if this reproduces the issue. I'm using version syncfusion_flutter_charts: '18.1.56'

Thanks

James


SK Sriram Kiran Senthilkumar Syncfusion Team July 21, 2020 10:41 AM UTC

Hi James, 
  
We have analyzed your scenario with the provided code snippet and we tried to replicate the reported exceptions arising while zooming and panning in the chart and we could not able to find a consistent replication process to replicate them as they were arising uncertainly for multiple numbers of cases and due to this, we are not able to find the exact cause of the reported issue. Also, to mention that, on further research, we found that these exceptions are not due to our chart source, they are arising from the flutter framework due to some unknown reasons and this is already logged as an issue in the Flutter GitHub issue page. So, once this issue is resolved in the Flutter framework, we will check and do the changes accordingly at our end. 
  
For reference, please check the logged Flutter GitHub issue from the link below, 
  
Please get in touch with us if you require further assistance. 
  
Regards, 
Sriram Kiran 


Loader.
Up arrow icon