Skip to content

Duplicate package prefix in TextStyle's fontFamilyFallback #118392

@IchordeDionysos

Description

@IchordeDionysos

Steps to Reproduce

  1. Run the code snippet
  2. The fontFamilyFallback is different even though it should be the same.

Expected results:

In both TextStyle the fontFamilyFallback should be the same: ['packages/a/Roboto']

See also the test case of the PR: https://github.com/flutter/flutter/pull/118393/files#diff-c4bd56f1a544c160283efcdd6c1c98176a81779dd8a07ec752a6d088f83c3b8c

Actual results:

The first In both fontFamilyFallback looks like this: ['packages/a/Roboto']
while the second like this: ['packages/a/packages/a/Roboto']

Code sample
const TextStyle style = TextStyle(fontFamilyFallback: <String>['Roboto'], package: 'a');
print(style.fontFamilyFallback); // ['packages/a/Roboto']

final copiedStyle = style.copyWith();
print(style.fontFamilyFallback); // ['packages/a/packages/a/Roboto'];

final copiedStyle = style.apply();
print(style.fontFamilyFallback); // ['packages/a/packages/a/Roboto'];

Ran on the latest main commit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    found in release: 3.3Found to occur in 3.3found in release: 3.7Found to occur in 3.7frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions