Skip to content
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

How to replace Text.textHeightBehavior? #81

Open
131e55 opened this issue Dec 30, 2020 · 0 comments
Open

How to replace Text.textHeightBehavior? #81

131e55 opened this issue Dec 30, 2020 · 0 comments
Assignees
Labels
question Further information is requested

Comments

@131e55
Copy link

131e55 commented Dec 30, 2020

Question
I had used Text.style.height and Text.textHeightBehavior for line-spacing. (not line-height)
However AutoSizeText.textHeightBehavior isn't defined.

How to replace Text.textHeightBehavior?
or
How to express line-spacing using AutoSizeText?

Code sample
Text

const Text(
    'Line 1\nLine2',
    style: TextStyle(
        fontSize: 18,
        height: 1.25,
        color: Colors.black,
    ),
    textAlign: TextAlign.center,
    textHeightBehavior: TextHeightBehavior(
        applyHeightToFirstAscent: false,
        applyHeightToLastDescent: false,
    ),
);

AutoSizeText (can't build)

const AutoSizeText(
    'Line 1\nLine2',
    style: TextStyle(
        fontSize: 18,
        height: 1.25,
        color: Colors.black,
    ),
    maxLines: 2,
    minFontSize: 10,
    textAlign: TextAlign.center,
    // ❌ The named parameter 'textHeightBehavior' isn't defined.
    textHeightBehavior: TextHeightBehavior(
        applyHeightToFirstAscent: false,
        applyHeightToLastDescent: false,
    ),
);

Version

  • Flutter version: 1.22.5
  • auto_size_text version: 2.1.0
@131e55 131e55 added the question Further information is requested label Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants