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

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

Issue 1179713004: Material and RaisedButton. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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 | « sky/examples/widgets/container.dart ('k') | sky/sdk/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 'dart:sky' as sky; 5 import 'dart:sky' as sky;
6 6
7 import 'package:sky/framework/rendering/box.dart'; 7 import 'package:sky/framework/rendering/box.dart';
8 import 'package:sky/framework/rendering/flex.dart'; 8 import 'package:sky/framework/rendering/flex.dart';
9 import 'package:sky/framework/scheduler.dart'; 9 import 'package:sky/framework/scheduler.dart';
10 import 'package:sky/framework/widgets/raised_button.dart';
10 import 'package:sky/framework/widgets/ui_node.dart'; 11 import 'package:sky/framework/widgets/ui_node.dart';
11 import 'package:sky/framework/widgets/wrappers.dart'; 12 import 'package:sky/framework/widgets/wrappers.dart';
12 import 'package:vector_math/vector_math.dart'; 13 import 'package:vector_math/vector_math.dart';
13 14
14 import '../lib/solid_color_box.dart'; 15 import '../lib/solid_color_box.dart';
15 16
16 // Solid colour, RenderObject version 17 // Solid colour, RenderObject version
17 void addFlexChildSolidColor(RenderFlex parent, sky.Color backgroundColor, { int flex: 0 }) { 18 void addFlexChildSolidColor(RenderFlex parent, sky.Color backgroundColor, { int flex: 0 }) {
18 RenderSolidColorBox child = new RenderSolidColorBox(backgroundColor); 19 RenderSolidColorBox child = new RenderSolidColorBox(backgroundColor);
19 parent.add(child); 20 parent.add(child);
(...skipping 13 matching lines...) Expand all
33 } 34 }
34 } 35 }
35 36
36 UINode builder() { 37 UINode builder() {
37 return new Flex([ 38 return new Flex([
38 new Rectangle(const Color(0xFF00FFFF), key: 'a'), 39 new Rectangle(const Color(0xFF00FFFF), key: 'a'),
39 new Container( 40 new Container(
40 padding: new EdgeDims.all(10.0), 41 padding: new EdgeDims.all(10.0),
41 margin: new EdgeDims.all(10.0), 42 margin: new EdgeDims.all(10.0),
42 decoration: new BoxDecoration(backgroundColor: const Color(0xFFCCCCCC)), 43 decoration: new BoxDecoration(backgroundColor: const Color(0xFFCCCCCC)),
43 child: new Image(src: "https://www.dartlang.org/logos/dart-logo.png", 44 child: new RaisedButton(
44 size: new Size(300.0, 300.0), 45 child: new Flex([
45 key: 1 46 new Image(src: "https://www.dartlang.org/logos/dart-logo.png"),
47 new Text('PRESS ME'),
48 ]),
49 onPressed: () => print("Hello World")
46 ) 50 )
47 ), 51 ),
48 new Rectangle(const Color(0xFFFFFF00), key: 'b'), 52 new Rectangle(const Color(0xFFFFFF00), key: 'b'),
49 ], 53 ],
50 direction: FlexDirection.vertical, 54 direction: FlexDirection.vertical,
51 justifyContent: FlexJustifyContent.spaceBetween 55 justifyContent: FlexJustifyContent.spaceBetween
52 ); 56 );
53 } 57 }
54 58
55 double timeBase; 59 double timeBase;
(...skipping 26 matching lines...) Expand all
82 // Because we're going to use UINodes, we want to initialise its 86 // Because we're going to use UINodes, we want to initialise its
83 // AppView, not use the default one. We don't really need to do 87 // AppView, not use the default one. We don't really need to do
84 // this, because RenderObjectToUINodeAdapter does it for us, but 88 // this, because RenderObjectToUINodeAdapter does it for us, but
85 // it's good practice in case we happen to not have a 89 // it's good practice in case we happen to not have a
86 // RenderObjectToUINodeAdapter in our tree at startup. 90 // RenderObjectToUINodeAdapter in our tree at startup.
87 UINodeAppView.initUINodeAppView(); 91 UINodeAppView.initUINodeAppView();
88 UINodeAppView.appView.root = root; 92 UINodeAppView.appView.root = root;
89 93
90 addPersistentFrameCallback(rotate); 94 addPersistentFrameCallback(rotate);
91 } 95 }
OLDNEW
« no previous file with comments | « sky/examples/widgets/container.dart ('k') | sky/sdk/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698