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

Side by Side Diff: sky/examples/widgets/tabs.dart

Issue 1205953002: Version 0 of TabLabel, Tab, and TabBar components (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Updates per Ian's feedback Created 5 years, 6 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
« no previous file with comments | « no previous file | sky/sdk/BUILD.gn » ('j') | sky/sdk/lib/widgets/tabs.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 import 'package:sky/rendering/sky_binding.dart';
6 import 'package:sky/theme/colors.dart';
7 import 'package:sky/theme/typography.dart';
8 import 'package:sky/widgets/basic.dart';
9 import 'package:sky/widgets/material.dart';
10 import 'package:sky/widgets/scaffold.dart';
11 import 'package:sky/widgets/tabs.dart';
12 import 'package:sky/widgets/tool_bar.dart';
13 import 'package:sky/widgets/widget.dart';
14
15 class TabbedNavigatorApp extends App {
16 Widget build() {
17 Iterable<String> items = <String>["ONE", "TWO", "FREE", "FOUR"];
18
19 Iterable<TabLabel> textLabels = items
20 .map((s) => new TabLabel(text: "ITEM " + s));
21
22 Iterable<TabLabel> iconLabels = items
23 .map((s) => new TabLabel(icon: 'action/search_white'));
24
25 Iterable<TabLabel> textAndIconLabels = items
26 .map((s) => new TabLabel(text: "ITEM " + s, icon: 'action/search_white'));
27
28 Iterable<Widget> tabNavigators = [textLabels, iconLabels, textAndIconLabels]
29 .map((labels) {
30 return new Container(
31 child: new TabBar(labels: labels.toList()),
32 margin: new EdgeDims.only(bottom: 16.0)
33 );
34 });
35
36 ToolBar toolbar = new ToolBar(
37 center: new Text('Tabbed Navigator', style: white.title),
38 backgroundColor: Blue[500]);
39
40 return new Scaffold(
41 toolbar: toolbar,
42 body: new Material(
43 child: new Center(child: new Block(tabNavigators.toList())),
44 color: Grey[500]
45 )
46 );
47 }
48 }
49
50 void main() {
51 runApp(new TabbedNavigatorApp());
52 SkyBinding.instance.onFrame = () {
53 // uncomment this for debugging:
54 // SkyBinding.instance.debugDumpRenderTree();
55 };
56 }
OLDNEW
« no previous file with comments | « no previous file | sky/sdk/BUILD.gn » ('j') | sky/sdk/lib/widgets/tabs.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698