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/theme/colors.dart'; | 5 import 'package:sky/theme/colors.dart'; |
6 import 'package:sky/theme/typography.dart'; | 6 import 'package:sky/theme/typography.dart'; |
7 import 'package:sky/widgets/basic.dart'; | 7 import 'package:sky/widgets/basic.dart'; |
8 import 'package:sky/widgets/material.dart'; | 8 import 'package:sky/widgets/material.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 26 matching lines...) Expand all Loading... |
37 .map((s) => new TabLabel(icon: 'action/search_white')); | 37 .map((s) => new TabLabel(icon: 'action/search_white')); |
38 | 38 |
39 Iterable<TabLabel> textAndIconLabels = items | 39 Iterable<TabLabel> textAndIconLabels = items |
40 .map((s) => new TabLabel(text: "ITEM " + s, icon: 'action/search_white')); | 40 .map((s) => new TabLabel(text: "ITEM " + s, icon: 'action/search_white')); |
41 | 41 |
42 var navigatorIndex = 0; | 42 var navigatorIndex = 0; |
43 Iterable<Widget> tabNavigators = [textLabels, iconLabels, textAndIconLabels] | 43 Iterable<Widget> tabNavigators = [textLabels, iconLabels, textAndIconLabels] |
44 .map((labels) => buildTabNavigator(labels, navigatorIndex++)); | 44 .map((labels) => buildTabNavigator(labels, navigatorIndex++)); |
45 | 45 |
46 ToolBar toolbar = new ToolBar( | 46 ToolBar toolbar = new ToolBar( |
47 center: new Text('Tabbed Navigator', style: white.title), | 47 center: new Text('Tabbed Navigator', style: white.title) |
48 backgroundColor: Blue[500]); | 48 ); |
49 | 49 |
50 return new Scaffold( | 50 return new Scaffold( |
51 toolbar: toolbar, | 51 toolbar: toolbar, |
52 body: new Material( | 52 body: new Material( |
53 child: new Center(child: new Block(tabNavigators.toList())), | 53 child: new Center(child: new Block(tabNavigators.toList())), |
54 color: Grey[500] | 54 color: Grey[500] |
55 ) | 55 ) |
56 ); | 56 ); |
57 } | 57 } |
58 } | 58 } |
59 | 59 |
60 void main() { | 60 void main() { |
61 runApp(new TabbedNavigatorApp()); | 61 runApp(new TabbedNavigatorApp()); |
62 } | 62 } |
OLD | NEW |