Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Side by Side Diff: sky/sdk/example/widgets/tabs.dart

Issue 1226113007: Add @override annotation to known overriden methods (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
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",
80 "THIS TAB IS PRETTY WIDE TOO", 80 "THIS TAB IS PRETTY WIDE TOO",
81 "MORE", 81 "MORE",
82 "TABS", 82 "TABS",
83 "TO", 83 "TO",
84 "STRETCH", 84 "STRETCH",
85 "OUT", 85 "OUT",
86 "THE", 86 "THE",
87 "TAB BAR" 87 "TAB BAR"
88 ] 88 ]
89 .map((text) { 89 .map((text) {
90 return new TabNavigatorView( 90 return new TabNavigatorView(
91 label: new TabLabel(text: text), 91 label: new TabLabel(text: text),
92 builder: () => _buildContent(text) 92 builder: () => _buildContent(text)
93 ); 93 );
94 }); 94 });
95 return _buildTabNavigator(n, views.toList(), scrollable: true); 95 return _buildTabNavigator(n, views.toList(), scrollable: true);
96 } 96 }
97 97
98 98
99 Container _buildCard(TabNavigator tabNavigator) { 99 Container _buildCard(TabNavigator tabNavigator) {
100 return new Container( 100 return new Container(
101 child: new Card(child: new Padding(child: tabNavigator, padding: const Edge Dims.all(8.0))), 101 child: new Card(child: new Padding(child: tabNavigator, padding: const Edge Dims.all(8.0))),
102 padding: const EdgeDims.all(12.0), 102 padding: const EdgeDims.all(12.0),
103 decoration: new BoxDecoration(backgroundColor: Theme.of(this).primarySwatch [50]) 103 decoration: new BoxDecoration(backgroundColor: Theme.of(this).primarySwatch [50])
104 ); 104 );
105 } 105 }
106 106
107 @override
107 Widget build() { 108 Widget build() {
108 List<TabNavigatorView> views = <TabNavigatorView>[ 109 List<TabNavigatorView> views = <TabNavigatorView>[
109 new TabNavigatorView( 110 new TabNavigatorView(
110 label: const TabLabel(text: 'TEXT'), 111 label: const TabLabel(text: 'TEXT'),
111 builder: () => _buildCard(_buildTextLabelsTabNavigator(0)) 112 builder: () => _buildCard(_buildTextLabelsTabNavigator(0))
112 ), 113 ),
113 new TabNavigatorView( 114 new TabNavigatorView(
114 label: const TabLabel(text: 'ICONS'), 115 label: const TabLabel(text: 'ICONS'),
115 builder: () => _buildCard(_buildIconLabelsTabNavigator(1)) 116 builder: () => _buildCard(_buildIconLabelsTabNavigator(1))
116 ), 117 ),
(...skipping 17 matching lines...) Expand all
134 return new Scaffold( 135 return new Scaffold(
135 toolbar: toolbar, 136 toolbar: toolbar,
136 body: tabNavigator 137 body: tabNavigator
137 ); 138 );
138 } 139 }
139 } 140 }
140 141
141 void main() { 142 void main() {
142 runApp(new TabbedNavigatorApp()); 143 runApp(new TabbedNavigatorApp());
143 } 144 }
OLDNEW
« no previous file with comments | « sky/sdk/example/widgets/styled_text.dart ('k') | sky/sdk/lib/animation/animation_performance.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698