Skip to content

Better directionality error messages for painting library #171812

@nt4f04uNd

Description

@nt4f04uNd

Disclaimer - this issue was picked for an entertaining educational project inside Yandex mobile schools. Please contact @nt4f04uNd that you are willing to work on it.

Use case

Some calls inside painting library require non-null text direction.

This typically means that a widget that uses them needs to be wrapped in Directionality.

Right now when someone forgets to do that, we show this error message, which is not very informative

════════ Exception caught by rendering library ═════════════════════════════════
The following assertion was thrown during paint():
'package:flutter/src/painting/border_radius.dart': Failed assertion: line 727 pos 12: 'direction != null': is not true.
2

Proposal

It would be better if we showed something more detailed and guiding

Context
First issue of its kind #88644

In this PR we provide a generic helper for this #171805

Sub-issues

Metadata

Metadata

Assignees

Labels

P3Issues that are less important to the Flutter projecta: error messageError messages from the Flutter frameworka: qualityA truly polished experiencec: proposalA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.good first issueRelatively approachable for first-time contributorsr: 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