Skip to content

[Mock Canvas] paints...arc() is missing ability to test start and end arc angles. #162317

@TahaTesser

Description

@TahaTesser

Use case

The paints..arc() is missing the ability to test start and end arc angles. You can test total arc rect but cannot test where the arc begins and ends. Testing arc drawn path is crucial. As a workaround, golden tests can be used to capture the arc start and end path visually.

@override
void arc({
Rect? rect,
Color? color,
double? strokeWidth,
bool? hasMaskFilter,
PaintingStyle? style,
StrokeCap? strokeCap,
}) {
_predicates.add(
_ArcPaintPredicate(
rect: rect,
color: color,
strokeWidth: strokeWidth,
hasMaskFilter: hasMaskFilter,
style: style,
strokeCap: strokeCap,
),
);
}

See the arc API for angles parameters :

https://api.flutter.dev/flutter/dart-ui/Canvas/drawArc.html

Proposal

Add ability to test arc start and end angles in paints..arc()

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: tests"flutter test", flutter_test, or one of our testsc: proposalA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions