eBay / flutter_glove_box

Various eBay tools for Flutter development
BSD 3-Clause "New" or "Revised" License
321 stars 69 forks source link

Font not load when apply TextStyle on TabBar labels #66

Open MizukiAsakura opened 4 years ago

MizukiAsakura commented 4 years ago

Hello,

Font of text label in tabBar widget are not loaded when I attempt to golden test a widget with a style applied on tabBar labels.

Here the widget I attempt to test :

class MyHomePage extends StatelessWidget {
  MyHomePage({Key key, this.title}) : super(key: key);
  final String title;

  @override
  Widget build(BuildContext context) {
    return DefaultTabController(
      length: 3,
      child: Scaffold(
        appBar: AppBar(
          title: Text(title),
          bottom: TabBar(
            labelStyle: TextStyle(fontSize: 20),
            tabs: [
              Text('List'.toUpperCase()),
              Text('News'.toUpperCase()),
              Text('Previews'.toUpperCase()),
            ],
          ),
        ),
        body: TabBarView(
          children: [
            GameList(
              key: Key('gameList'),
              games: GameRepository().games,
            ),
            Text('here news view'),
            Text('here previews view'),
          ],
        ),
      ),
    );
  }
}

When I add a value to the labelStyle parameter, the font of the tab labels are not loaded exactly as the load font issue #31 . And when any label style is specified, everything works fine.

In addition, adding style in the Text widget into the TabBar does not cause any issue. Seems the labelStyle parameter cause this issue. The others TabBar parameters work fine.

c3qo commented 7 months ago

it's still having this issue in golden_toolkit: 0.15.0.

not only labelStyle but also unselectedLabelStyle.

if adding a widget in the TabBar, for example, the Badge widget, the text in Badge will also get the same issue.

bluemon82 commented 7 months ago

I have the same issue when I apply a TextStyle to the AppBarTheme. In a golden the title stays black.

    var appBarTheme = AppBarTheme(
        titleTextStyle: textTheme.titleLarge?.merge(TextStyle(color: colorScheme.onSurface)),
        surfaceTintColor: colorScheme.onSurface,
        scrolledUnderElevation: 1,
        shadowColor: colorScheme.outlineVariant);