Skip to content

TextStyle: debugLabel param ignored in copyWith unless receiver already has a debugLabel #141140

@chrisbobbe

Description

@chrisbobbe

See implementation of TextStyle.copyWith:

String? newDebugLabel;
assert(() {
if (this.debugLabel != null) {
newDebugLabel = debugLabel ?? '(${this.debugLabel}).copyWith';
}
return true;
}());

(where debugLabel is a copyWith param).

The debugLabel param is ignored unless the receiver (the TextStyle you're calling copyWith on) already has a debugLabel. This is problematic when you have a text style without a debug label and you want to make a copy that has a debug label.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: typographyText rendering, possibly libtxtframeworkflutter/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