| Index: sky/sdk/lib/widgets/tabs.dart
|
| diff --git a/sky/sdk/lib/widgets/tabs.dart b/sky/sdk/lib/widgets/tabs.dart
|
| index f171edf852385275d9372c5423083c980e559063..89917b594e96abbcd213e670ef1320b06254f65c 100644
|
| --- a/sky/sdk/lib/widgets/tabs.dart
|
| +++ b/sky/sdk/lib/widgets/tabs.dart
|
| @@ -12,7 +12,9 @@ import 'package:sky/rendering/box.dart';
|
| import 'package:sky/rendering/object.dart';
|
| import 'package:vector_math/vector_math.dart';
|
| import 'package:sky/theme/colors.dart' as colors;
|
| +import 'package:sky/theme/typography.dart' as typography;
|
| import 'package:sky/widgets/basic.dart';
|
| +import 'package:sky/widgets/default_text_style.dart';
|
| import 'package:sky/widgets/icon.dart';
|
| import 'package:sky/widgets/ink_well.dart';
|
| import 'package:sky/widgets/scrollable.dart';
|
| @@ -301,8 +303,7 @@ class Tab extends Component {
|
|
|
| Widget _buildLabelText() {
|
| assert(label.text != null);
|
| - TextStyle textStyle = Theme.of(this).toolbarText.button.merge(_kTabTextStyle);
|
| - return new Text(label.text, style: textStyle);
|
| + return new Text(label.text, style: _kTabTextStyle);
|
| }
|
|
|
| Widget _buildLabelIcon() {
|
| @@ -434,25 +435,47 @@ class TabBar extends Scrollable {
|
| textAndIcons = true;
|
| }
|
|
|
| - Color backgroundColor = Theme.of(this).primaryColor;
|
| - Color indicatorColor = Theme.of(this).accentColor;
|
| + ThemeData themeData = Theme.of(this);
|
| + Color backgroundColor = themeData.primaryColor;
|
| + Color indicatorColor = themeData.accentColor;
|
| if (indicatorColor == backgroundColor) {
|
| indicatorColor = colors.White;
|
| }
|
|
|
| - TabBarWrapper tabBarWrapper = new TabBarWrapper(
|
| - children: tabs,
|
| - selectedIndex: selectedIndex,
|
| - backgroundColor: backgroundColor,
|
| - indicatorColor: indicatorColor,
|
| - textAndIcons: textAndIcons,
|
| - scrollable: scrollable,
|
| - onLayoutChanged: scrollable ? _layoutChanged : null
|
| - );
|
| + TextStyle textStyle;
|
| + IconThemeColor iconThemeColor;
|
| + switch (themeData.primaryColorBrightness) {
|
| + case ThemeBrightness.light:
|
| + textStyle = typography.black.body1;
|
| + iconThemeColor = IconThemeColor.black;
|
| + break;
|
| + case ThemeBrightness.dark:
|
| + textStyle = typography.white.body1;
|
| + iconThemeColor = IconThemeColor.white;
|
| + break;
|
| + }
|
|
|
| Matrix4 transform = new Matrix4.identity();
|
| transform.translate(-scrollOffset, 0.0);
|
| - return new Transform(child: tabBarWrapper, transform: transform);
|
| +
|
| + return new Transform(
|
| + transform: transform,
|
| + child: new IconTheme(
|
| + data: new IconThemeData(color: iconThemeColor),
|
| + child: new DefaultTextStyle(
|
| + style: textStyle,
|
| + child: new TabBarWrapper(
|
| + children: tabs,
|
| + selectedIndex: selectedIndex,
|
| + backgroundColor: backgroundColor,
|
| + indicatorColor: indicatorColor,
|
| + textAndIcons: textAndIcons,
|
| + scrollable: scrollable,
|
| + onLayoutChanged: scrollable ? _layoutChanged : null
|
| + )
|
| + )
|
| + )
|
| + );
|
| }
|
| }
|
|
|
|
|