Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG (v7)] Dotted polyline throws exception: Bad state: No element #1874

Closed
josxha opened this issue May 6, 2024 · 1 comment · Fixed by #1875
Closed

[BUG (v7)] Dotted polyline throws exception: Bad state: No element #1874

josxha opened this issue May 6, 2024 · 1 comment · Fixed by #1875
Labels
bug This issue reports broken functionality or another error S: core Scoped to the core flutter_map functionality
Milestone

Comments

@josxha
Copy link
Contributor

josxha commented May 6, 2024

What is the bug?

While moving around on the polyline example page an exception gets thrown in the console. I'm using a pr branch in the video but this behaviour happens as well on master.

Aufzeichnung.2024-05-06.165323.mp4
======== Exception caught by rendering library =====================================================
The following StateError was thrown during paint():
Bad state: No element

The relevant error-causing widget was: 
  CustomPaint CustomPaint:file:///C:/.../flutter_map/lib/src/layer/polyline_layer/polyline_layer.dart:146:14
When the exception was thrown, this was the stack: 
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 297:3       throw_
dart-sdk/lib/_internal/js_dev_runtime/private/js_array.dart 356:5                 last]
packages/flutter_map/src/layer/misc/line_patterns/pixel_hiker.dart 55:28          getAllVisibleDots
packages/flutter_map/src/layer/polyline_layer/painter.dart 226:39                 paint
packages/flutter/src/rendering/custom_paint.dart 588:12                           [_paintWithPainter]
packages/flutter/src/rendering/custom_paint.dart 630:7                            paint
packages/flutter/src/rendering/object.dart 3237:7                                 [_paintWithContext]
packages/flutter/src/rendering/object.dart 250:12                                 paintChild
packages/flutter/src/rendering/proxy_box.dart 130:12                              paint
packages/flutter/src/rendering/proxy_box.dart 2549:17                             paint
packages/flutter/src/rendering/object.dart 3237:7                                 [_paintWithContext]
packages/flutter/src/rendering/object.dart 250:12                                 paintChild
packages/flutter/src/rendering/shifted_box.dart 74:14                             paint
packages/flutter/src/rendering/object.dart 3237:7                                 [_paintWithContext]
packages/flutter/src/rendering/object.dart 250:12                                 paintChild
packages/flutter/src/rendering/proxy_box.dart 130:12                              paint
packages/flutter/src/rendering/object.dart 3237:7                                 [_paintWithContext]
packages/flutter/src/rendering/object.dart 250:12                                 paintChild
packages/flutter/src/rendering/proxy_box.dart 130:12                              paint
packages/flutter/src/rendering/object.dart 3237:7                                 [_paintWithContext]
packages/flutter/src/rendering/object.dart 250:12                                 paintChild
packages/flutter/src/rendering/proxy_box.dart 130:12                              paint
packages/flutter/src/rendering/object.dart 3237:7                                 [_paintWithContext]
packages/flutter/src/rendering/object.dart 250:12                                 paintChild
packages/flutter/src/rendering/box.dart 2882:14                                   defaultPaint
packages/flutter/src/rendering/stack.dart 641:5                                   paintStack
packages/flutter/src/rendering/stack.dart 657:7                                   paint
packages/flutter/src/rendering/object.dart 3237:7                                 [_paintWithContext]
packages/flutter/src/rendering/object.dart 250:12                                 paintChild
packages/flutter/src/rendering/proxy_box.dart 130:12                              paint
packages/flutter/src/rendering/object.dart 549:83                                 <fn>
packages/flutter/src/painting/clip.dart 25:5                                      [_clipAndPaint]
packages/flutter/src/painting/clip.dart 53:5                                      clipRectAndPaint
packages/flutter/src/rendering/object.dart 549:7                                  pushClipRect
packages/flutter/src/rendering/proxy_box.dart 1538:24                             paint
packages/flutter/src/rendering/object.dart 3237:7                                 [_paintWithContext]
packages/flutter/src/rendering/object.dart 250:12                                 paintChild
packages/flutter/src/rendering/proxy_box.dart 130:12                              paint
packages/flutter/src/rendering/object.dart 3237:7                                 [_paintWithContext]
packages/flutter/src/rendering/object.dart 250:12                                 paintChild
packages/flutter/src/rendering/proxy_box.dart 130:12                              paint
packages/flutter/src/rendering/object.dart 3237:7                                 [_paintWithContext]
packages/flutter/src/rendering/object.dart 250:12                                 paintChild
packages/flutter/src/rendering/proxy_box.dart 130:12                              paint
packages/flutter/src/rendering/object.dart 3237:7                                 [_paintWithContext]
packages/flutter/src/rendering/object.dart 250:12                                 paintChild
packages/flutter/src/widgets/layout_builder.dart 356:14                           paint
packages/flutter/src/rendering/object.dart 3237:7                                 [_paintWithContext]
packages/flutter/src/rendering/object.dart 250:12                                 paintChild
packages/flutter/src/rendering/proxy_box.dart 130:12                              paint
packages/flutter/src/rendering/object.dart 3237:7                                 [_paintWithContext]
packages/flutter/src/rendering/object.dart 166:10                                 _repaintCompositedChild
packages/flutter/src/rendering/object.dart 109:5                                  repaintCompositedChild
packages/flutter/src/rendering/object.dart 1182:31                                flushPaint
packages/flutter/src/rendering/object.dart 1192:14                                flushPaint
packages/flutter/src/rendering/binding.dart 584:5                                 drawFrame
packages/flutter/src/widgets/binding.dart 991:13                                  drawFrame
packages/flutter/src/rendering/binding.dart 448:5                                 [_handlePersistentFrameCallback]
packages/flutter/src/scheduler/binding.dart 1386:7                                [_invokeFrameCallback]
packages/flutter/src/scheduler/binding.dart 1311:9                                handleDrawFrame
packages/flutter/src/scheduler/binding.dart 1169:5                                [_handleDrawFrame]
lib/_engine/engine/platform_dispatcher.dart 1346:5                                invoke
lib/_engine/engine/platform_dispatcher.dart 260:5                                 invokeOnDrawFrame
lib/_engine/engine/initialization.dart 185:36                                     <fn>
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 550:37  _checkAndCall
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 555:39  dcall
The following RenderObject was being processed when the exception was fired: RenderCustomPaint#8fcfd
...  parentData: <none> (can use size)
...  constraints: BoxConstraints(w=1029.0, h=753.0)
...  size: Size(1029.0, 753.0)
...  painter: _PolylinePainter<({String subtitle, String title})>#32d95()
...  preferredSize: Size(1029.0, 753.0)
RenderObject: RenderCustomPaint#8fcfd
  parentData: <none> (can use size)
  constraints: BoxConstraints(w=1029.0, h=753.0)
  size: Size(1029.0, 753.0)
  painter: _PolylinePainter<({String subtitle, String title})>#32d95()
  preferredSize: Size(1029.0, 753.0)

How can we reproduce it?

  1. launch the example app (I used web as platform)
  2. open the polyline page
  3. move the dotted polyline in and out of the viewable area

Do you have a potential solution?

No response

Platforms

probably all

Severity

Minimum: Allows normal functioning

@josxha josxha added bug This issue reports broken functionality or another error S: core Scoped to the core flutter_map functionality labels May 6, 2024
@josxha josxha added this to the v7.0 milestone May 6, 2024
@monsieurtanuki
Copy link
Contributor

@josxha Sorry about that, it's a side effect. As you can see on your video, the problem occurs when eventually there are no visible dots.
I'm about to fix and PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue reports broken functionality or another error S: core Scoped to the core flutter_map functionality
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants