| 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'; | 6 import 'package:sky/theme/colors.dart' as colors; |
| 7 import 'package:sky/theme/typography.dart' as typography; |
| 7 import 'package:sky/widgets/basic.dart'; | 8 import 'package:sky/widgets/basic.dart'; |
| 8 import 'package:sky/widgets/material.dart'; | 9 import 'package:sky/widgets/material.dart'; |
| 9 import 'package:sky/widgets/scaffold.dart'; | 10 import 'package:sky/widgets/scaffold.dart'; |
| 10 import 'package:sky/widgets/tabs.dart'; | 11 import 'package:sky/widgets/tabs.dart'; |
| 11 import 'package:sky/widgets/tool_bar.dart'; | 12 import 'package:sky/widgets/tool_bar.dart'; |
| 12 import 'package:sky/widgets/widget.dart'; | 13 import 'package:sky/widgets/widget.dart'; |
| 13 | 14 |
| 14 class TabbedNavigatorApp extends App { | 15 class TabbedNavigatorApp extends App { |
| 15 int selectedIndex = 0; | 16 int selectedIndex = 0; |
| 16 | 17 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 38 | 39 |
| 39 TabNavigator tabNavigator = new TabNavigator( | 40 TabNavigator tabNavigator = new TabNavigator( |
| 40 views: views, | 41 views: views, |
| 41 selectedIndex: selectedIndex, | 42 selectedIndex: selectedIndex, |
| 42 onChanged: (tabIndex) { | 43 onChanged: (tabIndex) { |
| 43 setState(() { selectedIndex = tabIndex; } ); | 44 setState(() { selectedIndex = tabIndex; } ); |
| 44 } | 45 } |
| 45 ); | 46 ); |
| 46 | 47 |
| 47 ToolBar toolbar = new ToolBar( | 48 ToolBar toolbar = new ToolBar( |
| 48 center: new Text('Tabbed Navigator', style: white.title) | 49 center: new Text('Tabbed Navigator', style: typography.white.title) |
| 49 ); | 50 ); |
| 50 | 51 |
| 51 return new Scaffold( | 52 return new Scaffold( |
| 52 toolbar: toolbar, | 53 toolbar: toolbar, |
| 53 body: new Material(child: tabNavigator) | 54 body: new Material( |
| 55 color: colors.Grey[50], |
| 56 child: tabNavigator |
| 57 ) |
| 54 ); | 58 ); |
| 55 } | 59 } |
| 56 } | 60 } |
| 57 | 61 |
| 58 void main() { | 62 void main() { |
| 59 runApp(new TabbedNavigatorApp()); | 63 runApp(new TabbedNavigatorApp()); |
| 60 } | 64 } |
| OLD | NEW |