Skip to content

Improve assertion message in AlignmentDirectional.resolve #172096

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

SalehTZ
Copy link
Contributor

@SalehTZ SalehTZ commented Jul 14, 2025

Replaces the generic assertion in AlignmentDirectional.resolve and _MixedAlignment.resolve with
debugCheckCanResolveTextDirection.

This change provides a more helpful and descriptive error message when the TextDirection is null, improving the developer experience by clearly stating why the resolution failed and how to fix it.

Fixes: #171813, Fixes: #171814, also fixes: #171812

Pre-launch Checklist

SalehTZ added 2 commits July 14, 2025 12:26
Replaces the generic assertion in `AlignmentDirectional.resolve` and `_MixedAlignment.resolve` with
`debugCheckCanResolveTextDirection`.

This change provides a more helpful and descriptive error message when the `TextDirection` is null, improving the developer
experience by clearly stating why the resolution failed and how to fix it.

Fixes: flutter#171813
Adds a test case to ensure that calling `AlignmentDirectional.resolve` with a null `TextDirection` throws a `FlutterError`
with the expected improved message.
@github-actions github-actions bot added the framework flutter/packages/flutter repository. See also f: labels. label Jul 14, 2025
SalehTZ added 2 commits July 14, 2025 15:26
…olve`

Adds a test case that uses `add()` method to ensure that calling `_MixedAlignment.resolve` with a null `TextDirection` throws a `FlutterError`
with the expected improved message.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy