simc / auto_size_text

Flutter widget that automatically resizes text to fit perfectly within its bounds.
https://pub.dev/packages/auto_size_text
MIT License
2.06k stars 240 forks source link

Auto_size_text doesn't work correctly #71

Open DenisKen opened 4 years ago

DenisKen commented 4 years ago

My auto_size_text doesn't work correctly. I tried with Container and SizedBox with fixed height.

image

 SizedBox(
            height: SizeConfig.blockSizeVertical * 20,
            child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  AutoSizeText(
                    "buy-premium-verion_subtitle_1".tr(),
                    style: ThemeText.roboto_medium_18_white,
                    minFontSize: 0,
                  ),
                  AutoSizeText(
                    "buy-premium-verion_subtitle_1_1".tr(),
                    style: ThemeText.roboto_medium_26_brightgreen,
                    minFontSize: 0,
                  ),
                  AutoSizeText(
                    "buy-premium-verion_subtitle_2".tr(),
                    style: ThemeText.roboto_medium_18_white,
                    minFontSize: 0,
                  ),
                  AutoSizeText(
                    "buy-premium-verion_subtitle_2_1".tr(),
                    style: ThemeText.roboto_medium_26_brightgreen,
                    minFontSize: 0,
                  )
                ]),
            )

Am I doing something wrong?

I tried to eliminate others Widget and the result is the same.

image

Also tried to create a Container with fixed Height and a Expanded inside of it. Isn't work too.

Container(
        height: SizeConfig.blockSizeVertical * 100,
        padding: EdgeInsets.symmetric(horizontal: 21, vertical: 15),
        child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
          Expanded(
            child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  AutoSizeText(
                      "buy-premium-verion_subtitle_1".tr(),
                      style: ThemeText.roboto_medium_18_white,
                      minFontSize: 0,
                    ),
                  AutoSizeText(
                      "buy-premium-verion_subtitle_1_1".tr(),
                      style: ThemeText.roboto_medium_26_brightgreen,
                      minFontSize: 0,
                    ),
                  AutoSizeText(
                      "buy-premium-verion_subtitle_2".tr(),
                      style: ThemeText.roboto_medium_18_white,
                      minFontSize: 0,
                    ),
                  AutoSizeText(
                      "buy-premium-verion_subtitle_2_1".tr(),
                      style: ThemeText.roboto_medium_26_brightgreen,
                      minFontSize: 0,
                    )
                ]),
            )
      ])
   )

Flutter doctor -------------------------------------

[√] Flutter (Channel master, 1.22.0-10.0.pre.443, on Microsoft Windows [versão 10.0.18363.1082], locale pt-BR)

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2) [√] Android Studio (version 4.0) [√] Connected device (1 available)


EducatedDeer commented 4 years ago

try entering maxLines:1, this should be default imo but it is not