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

Does not auto size the text with bounded constraints #15

Closed
baoxiehao opened this issue Apr 16, 2019 · 1 comment
Closed

Does not auto size the text with bounded constraints #15

baoxiehao opened this issue Apr 16, 2019 · 1 comment

Comments

@baoxiehao
Copy link

Hi, I've tried the wrong and right code section to add constraints to the text widget, but it doesn't work, the font size is not scaled down, but just missing the later part of the text not shown.

      Widget _buildRepayRow() {
        return Row(
          children: <Widget>[
            Expanded(
              child: TextWidget(
                '${StringUtils.formatAmount(LoanUtils.equalPrincipalAndInterest(
                  creditTrialAmount,
                  vm.response.rateAnnualMin,
                  creditTrialTerm,
                ))} - ${StringUtils.formatAmount(LoanUtils.equalPrincipalAndInterest(
                  creditTrialAmount,
                  vm.response.rateAnnualMax,
                  creditTrialTerm,
                ))}',
                style: L.tsNumberHeaderDark,
                maxLines: 1,
                presetFontSizes: [L.f32, L.f24, L.f16, L.f14, L.f12],
              ),
            ),
          ],
        );
      }
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v1.3.8, on Mac OS X 10.14.4 18E226, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.2)
[✓] Android Studio (version 3.2)
[✓] Android Studio (version 3.3)
[✓] IntelliJ IDEA Community Edition (version 2017.2.5)
[✓] VS Code (version 1.33.1)
[✓] Connected device (2 available)
@baoxiehao
Copy link
Author

Sorry, my mistakes. I've wrap it inside a custom text widget, but forgot to set the isAutoSize attribute...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant