| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 import 'dart:math' as math; | 5 import 'dart:math' as math; |
| 6 | 6 |
| 7 import 'package:sky/animation/scroll_behavior.dart'; | 7 import 'package:sky/animation/scroll_behavior.dart'; |
| 8 import 'package:sky/painting/text_style.dart'; | 8 import 'package:sky/painting/text_style.dart'; |
| 9 import 'package:sky/rendering/box.dart'; | 9 import 'package:sky/rendering/box.dart'; |
| 10 import 'package:sky/rendering/object.dart'; | 10 import 'package:sky/rendering/object.dart'; |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 for (TabLabel label in labels) { | 409 for (TabLabel label in labels) { |
| 410 tabs.add(_toTab(label, tabIndex++)); | 410 tabs.add(_toTab(label, tabIndex++)); |
| 411 if (label.text != null && label.icon != null) | 411 if (label.text != null && label.icon != null) |
| 412 textAndIcons = true; | 412 textAndIcons = true; |
| 413 } | 413 } |
| 414 | 414 |
| 415 ThemeData themeData = Theme.of(this); | 415 ThemeData themeData = Theme.of(this); |
| 416 Color backgroundColor = themeData.primaryColor; | 416 Color backgroundColor = themeData.primaryColor; |
| 417 Color indicatorColor = themeData.accentColor; | 417 Color indicatorColor = themeData.accentColor; |
| 418 if (indicatorColor == backgroundColor) { | 418 if (indicatorColor == backgroundColor) { |
| 419 indicatorColor = colors.White; | 419 indicatorColor = colors.white; |
| 420 } | 420 } |
| 421 | 421 |
| 422 TextStyle textStyle; | 422 TextStyle textStyle; |
| 423 IconThemeColor iconThemeColor; | 423 IconThemeColor iconThemeColor; |
| 424 switch (themeData.primaryColorBrightness) { | 424 switch (themeData.primaryColorBrightness) { |
| 425 case ThemeBrightness.light: | 425 case ThemeBrightness.light: |
| 426 textStyle = typography.black.body1; | 426 textStyle = typography.black.body1; |
| 427 iconThemeColor = IconThemeColor.black; | 427 iconThemeColor = IconThemeColor.black; |
| 428 break; | 428 break; |
| 429 case ThemeBrightness.dark: | 429 case ThemeBrightness.dark: |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 selectedIndex: selectedIndex, | 499 selectedIndex: selectedIndex, |
| 500 scrollable: scrollable | 500 scrollable: scrollable |
| 501 ); | 501 ); |
| 502 | 502 |
| 503 Widget content = views[selectedIndex].buildContent(); | 503 Widget content = views[selectedIndex].buildContent(); |
| 504 return new Flex([tabBar, new Flexible(child: content)], | 504 return new Flex([tabBar, new Flexible(child: content)], |
| 505 direction: FlexDirection.vertical | 505 direction: FlexDirection.vertical |
| 506 ); | 506 ); |
| 507 } | 507 } |
| 508 } | 508 } |
| OLD | NEW |