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 241 forks source link

Not getting expected maxFontSize when I change the device font size to largest. #53

Open newajthevillager opened 4 years ago

newajthevillager commented 4 years ago

Steps to Reproduce I have a TabBar with some tabs. AutoSizeText is used as Tab. I've used maxFontSize here. Then I changed the device font size to the largest. At that time, I expected the fontsize to be the given maxFontSize which is 20.0, but it is not. Font size crosses maxFontSize limit when I change the device font size to the largest.

Code sample

return DefaultTabController(
      length: 4,
      child: Scaffold(
          bottom: TabBar(
            tabs: <Widget>[
              AutoSizeText(
                "TAB ONE",
                maxLines: 1,
                maxFontSize: 20.0,
              ),
              AutoSizeText(
                "TAB TWO",
                maxLines: 1,
                maxFontSize: 20.0,
              ),
              AutoSizeText(
                "TAB THREE",
                maxLines: 1,
                maxFontSize: 20.0,
              ),
              AutoSizeText(
                "TAB FOUR",
                maxLines: 1,
                maxFontSize: 20.0,
              ),
            ],
          ),
        ),
      ),
    );

Themedata for tabs :

tabBarTheme: TabBarTheme(
          labelPadding: EdgeInsets.symmetric(vertical: 10.0),
          labelColor: Colors.blue,
          labelStyle: TextStyle(
            color: Colors.blue,
            fontSize: 15.0,
            fontWeight: FontWeight.bold,
          ),
          unselectedLabelColor: Colors.grey,
          unselectedLabelStyle: TextStyle(
            color: Colors.grey,
            fontSize: 15.0,
          ),
        ),

Version