Skip to content

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

@newajthevillager

Description

@newajthevillager

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

  • Flutter version: 1.12.13+hotfix.5 • channel stable
  • auto_size_text version: auto_size_text: ^2.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions