| 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/rendering/box.dart'; | 7 import 'package:sky/rendering/box.dart'; |
| 8 import 'package:sky/rendering/object.dart'; | 8 import 'package:sky/rendering/object.dart'; |
| 9 import 'package:sky/widgets/basic.dart'; | 9 import 'package:sky/widgets/basic.dart'; |
| 10 import 'package:sky/widgets/icon.dart'; | 10 import 'package:sky/widgets/icon.dart'; |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 bool textAndIcons = false; | 288 bool textAndIcons = false; |
| 289 int tabIndex = 0; | 289 int tabIndex = 0; |
| 290 for (TabLabel label in labels) { | 290 for (TabLabel label in labels) { |
| 291 tabs.add(_toTab(label, tabIndex++)); | 291 tabs.add(_toTab(label, tabIndex++)); |
| 292 if (label.text != null && label.icon != null) | 292 if (label.text != null && label.icon != null) |
| 293 textAndIcons = true; | 293 textAndIcons = true; |
| 294 } | 294 } |
| 295 return new TabBarWrapper( | 295 return new TabBarWrapper( |
| 296 children: tabs, | 296 children: tabs, |
| 297 selectedIndex: selectedIndex, | 297 selectedIndex: selectedIndex, |
| 298 backgroundColor: Theme.of(this).primary[500], | 298 backgroundColor: Theme.of(this).primaryColor, |
| 299 indicatorColor: Theme.of(this).accent[200], | 299 indicatorColor: Theme.of(this).accentColor, |
| 300 textAndIcons: textAndIcons | 300 textAndIcons: textAndIcons |
| 301 ); | 301 ); |
| 302 } | 302 } |
| 303 } | 303 } |
| 304 | 304 |
| 305 class TabNavigatorView { | 305 class TabNavigatorView { |
| 306 TabNavigatorView({ this.label, this.builder }); | 306 TabNavigatorView({ this.label, this.builder }); |
| 307 | 307 |
| 308 final TabLabel label; | 308 final TabLabel label; |
| 309 final Builder builder; | 309 final Builder builder; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 onChanged: _handleSelectedIndexChanged, | 342 onChanged: _handleSelectedIndexChanged, |
| 343 selectedIndex: selectedIndex | 343 selectedIndex: selectedIndex |
| 344 ); | 344 ); |
| 345 | 345 |
| 346 Widget content = views[selectedIndex].buildContent(); | 346 Widget content = views[selectedIndex].buildContent(); |
| 347 return new Flex([tabBar, new Flexible(child: content)], | 347 return new Flex([tabBar, new Flexible(child: content)], |
| 348 direction: FlexDirection.vertical | 348 direction: FlexDirection.vertical |
| 349 ); | 349 ); |
| 350 } | 350 } |
| 351 } | 351 } |
| OLD | NEW |