flet icon indicating copy to clipboard operation
flet copied to clipboard

Possible LineChart bug

Open SIRGPrice opened this issue 1 year ago • 1 comments

This log cat error raises, once apk done, at random point when a chart has a big x limit points and you manipulate te positions of existent points in real time:

E [ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: RangeError: Invalid value: Not in inclusive range 0..81: 82 #0 List.insert (dart:core-patch/growable_array.dart:11) #1 addControls (package:flet/src/reducers.dart:452) #2 appReducer (package:flet/src/reducers.dart:365) #3 Store._createReduceAndNotify. (package:redux/src/store.dart:235) #4 Store.dispatch (package:redux/src/store.dart:267) #5 FletServer._onMessage (package:flet/src/flet_server.dart:265) #6 FletTcpSocketServerProtocol._onMessage (package:flet/src/flet_server_protocol_tcp_socket.dart:125) #7 FletTcpSocketServerProtocol.connect.<anonymous closure (package:flet/src/flet_server_protocol_tcp_socket.dart:94) #8 _RootZone.runUnaryGuarded (dart:async/zone.dart:1778) #9 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:381) #10 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:312) #11 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:798) #12 _StreamController._add (dart:async/stream_controller.dart:663) #13 _StreamController.add (dart:async/stream_controller.dart:618) #14 _Socket._onData (dart:io-patch/socket_patch.dart:2904) #15 _RootZone.runUnaryGuarded (dart:async/zone.dart:1778) #16 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:381) #17 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:312) #18 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:798) #19 _StreamController._add (dart:async/stream_controller.dart:663) #20 _StreamController.add (dart:async/stream_controller.dart:618) #21 new _RawSocket. (dart:io-patch/socket_patch.dart:2323) #22 _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1646) #23 _microtaskLoop (dart:async/schedule_microtask.dart:40) #24 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49)

Flet: 0.27.6.

SIRGPrice avatar Apr 25 '25 13:04 SIRGPrice

Only needed to put page.update() before and after the section of code that modify charts. Updating a complete view and 3 thousands of points charts at the same time is too much.

SIRGPrice avatar May 26 '25 08:05 SIRGPrice