| 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 'package:sky/painting/text_style.dart'; | 5 import 'package:sky/painting/text_style.dart'; |
| 6 import 'package:sky/theme/typography.dart' as typography; | 6 import 'package:sky/theme/typography.dart' as typography; |
| 7 import 'package:sky/widgets/basic.dart'; | 7 import 'package:sky/widgets/basic.dart'; |
| 8 import 'package:sky/widgets/card.dart'; | 8 import 'package:sky/widgets/card.dart'; |
| 9 import 'package:sky/widgets/scaffold.dart'; | 9 import 'package:sky/widgets/scaffold.dart'; |
| 10 import 'package:sky/widgets/tabs.dart'; | 10 import 'package:sky/widgets/tabs.dart'; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 builder: () => _buildContent(text) | 41 builder: () => _buildContent(text) |
| 42 ); | 42 ); |
| 43 }); | 43 }); |
| 44 return _buildTabNavigator(n, views.toList()); | 44 return _buildTabNavigator(n, views.toList()); |
| 45 } | 45 } |
| 46 | 46 |
| 47 TabNavigator _buildIconLabelsTabNavigator(int n) { | 47 TabNavigator _buildIconLabelsTabNavigator(int n) { |
| 48 Iterable<TabNavigatorView> views = ["event", "home", "android", "alarm", "fa
ce", "language"] | 48 Iterable<TabNavigatorView> views = ["event", "home", "android", "alarm", "fa
ce", "language"] |
| 49 .map((icon_name) { | 49 .map((icon_name) { |
| 50 return new TabNavigatorView( | 50 return new TabNavigatorView( |
| 51 label: new TabLabel(icon: "action/${icon_name}_white"), | 51 label: new TabLabel(icon: "action/${icon_name}"), |
| 52 builder: () => _buildContent(icon_name) | 52 builder: () => _buildContent(icon_name) |
| 53 ); | 53 ); |
| 54 }); | 54 }); |
| 55 return _buildTabNavigator(n, views.toList()); | 55 return _buildTabNavigator(n, views.toList()); |
| 56 } | 56 } |
| 57 | 57 |
| 58 TabNavigator _buildTextAndIconLabelsTabNavigator(int n) { | 58 TabNavigator _buildTextAndIconLabelsTabNavigator(int n) { |
| 59 List<TabNavigatorView> views = <TabNavigatorView>[ | 59 List<TabNavigatorView> views = <TabNavigatorView>[ |
| 60 new TabNavigatorView( | 60 new TabNavigatorView( |
| 61 label: const TabLabel(text: 'STOCKS', icon: 'action/list_white'), | 61 label: const TabLabel(text: 'STOCKS', icon: 'action/list'), |
| 62 builder: () => _buildContent("Stocks") | 62 builder: () => _buildContent("Stocks") |
| 63 ), | 63 ), |
| 64 new TabNavigatorView( | 64 new TabNavigatorView( |
| 65 label: const TabLabel(text: 'PORTFOLIO', icon: 'action/account_circle_wh
ite'), | 65 label: const TabLabel(text: 'PORTFOLIO', icon: 'action/account_circle'), |
| 66 builder: () => _buildContent("Portfolio") | 66 builder: () => _buildContent("Portfolio") |
| 67 ), | 67 ), |
| 68 new TabNavigatorView( | 68 new TabNavigatorView( |
| 69 label: const TabLabel(text: 'SUMMARY', icon: 'action/assessment_white'), | 69 label: const TabLabel(text: 'SUMMARY', icon: 'action/assessment'), |
| 70 builder: () => _buildContent("Summary") | 70 builder: () => _buildContent("Summary") |
| 71 ) | 71 ) |
| 72 ]; | 72 ]; |
| 73 return _buildTabNavigator(n, views); | 73 return _buildTabNavigator(n, views); |
| 74 } | 74 } |
| 75 | 75 |
| 76 TabNavigator _buildScrollableTabNavigator(int n) { | 76 TabNavigator _buildScrollableTabNavigator(int n) { |
| 77 Iterable<TabNavigatorView> views = [ | 77 Iterable<TabNavigatorView> views = [ |
| 78 "MIN WIDTH", | 78 "MIN WIDTH", |
| 79 "THIS TAB LABEL IS SO WIDE THAT IT OCCUPIES TWO LINES", | 79 "THIS TAB LABEL IS SO WIDE THAT IT OCCUPIES TWO LINES", |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 return new Scaffold( | 134 return new Scaffold( |
| 135 toolbar: toolbar, | 135 toolbar: toolbar, |
| 136 body: tabNavigator | 136 body: tabNavigator |
| 137 ); | 137 ); |
| 138 } | 138 } |
| 139 } | 139 } |
| 140 | 140 |
| 141 void main() { | 141 void main() { |
| 142 runApp(new TabbedNavigatorApp()); | 142 runApp(new TabbedNavigatorApp()); |
| 143 } | 143 } |
| OLD | NEW |