Skip to content

Path.computeMetrics inconsistency #179668

@pskink

Description

@pskink

Steps to reproduce

  1. run the attached code

Expected results

the returned Iterable should have length == 1

Actual results

the second Iterable is empty

this is what two prints show:

p0.computeMetrics(): (PathMetric(length: 1.0, isClosed: false, contourIndex: 0))
p1.computeMetrics(): ()

Code sample

Code sample
final p0 = Path()
  ..lineTo(1, 0);
print('p0.computeMetrics(): ${p0.computeMetrics()}');
final p1 = Path()
  ..lineTo(0, 0);
print('p1.computeMetrics(): ${p1.computeMetrics()}');

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
p0.computeMetrics(): (PathMetric(length: 1.0, isClosed: false, contourIndex: 0))
p1.computeMetrics(): ()

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.35.6, on Arch Linux 6.16.8-arch3-1, locale C.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
    ! Unable to access driver information using 'eglinfo'.
      It is likely available from your distribution (e.g.: apt install mesa-utils)
[✓] Android Studio (version 2025.1.4)
[✓] Android Studio (version 2024.2)
[✓] IntelliJ IDEA Community Edition (version 2024.2)
[✓] IntelliJ IDEA Community Edition (version 2025.2)
[✓] Connected device (2 available)
[✓] Network resources

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listd: api docsIssues with https://api.flutter.dev/engineflutter/engine related. See also e: labels.found in release: 3.38Found to occur in 3.38found in release: 3.40Found to occur in 3.40frameworkflutter/packages/flutter repository. See also f: labels.good first issueRelatively approachable for first-time contributorshas reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionteam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions