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

Unified Diff: sky/examples/widgets/container.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/examples/stocks2/lib/stock_row.dart ('k') | sky/examples/widgets/spinning_mixed.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/widgets/container.dart
diff --git a/sky/examples/widgets/container.dart b/sky/examples/widgets/container.dart
index 14b5663d13fd8ddee15c4004f82f36ff8907a00c..8c842be0b9b2002002eca9510540332b7305071f 100644
--- a/sky/examples/widgets/container.dart
+++ b/sky/examples/widgets/container.dart
@@ -2,43 +2,38 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-import 'dart:sky' as sky;
-
import 'package:sky/framework/rendering/box.dart';
import 'package:sky/framework/rendering/flex.dart';
-import 'package:sky/framework/widgets/ui_node.dart';
+import 'package:sky/framework/widgets/raised_button.dart';
import 'package:sky/framework/widgets/wrappers.dart';
-class Rectangle extends Component {
-
- Rectangle(this.color, { Object key }) : super(key: key);
-
- final Color color;
-
- UINode build() {
- return new FlexExpandingChild(
- new Container(
- decoration: new BoxDecoration(backgroundColor: color)
- )
- );
- }
-
-}
-
class ContainerApp extends App {
UINode build() {
return new Flex([
- new Rectangle(const Color(0xFF00FFFF), key: 'a'),
new Container(
+ key: 'a',
padding: new EdgeDims.all(10.0),
margin: new EdgeDims.all(10.0),
decoration: new BoxDecoration(backgroundColor: const Color(0xFFCCCCCC)),
- child: new Image(src: "https://www.dartlang.org/logos/dart-logo.png",
- size: new Size(300.0, 300.0),
- key: 1
+ child: new Image(
+ src: "https://www.dartlang.org/logos/dart-logo.png",
+ size: new Size(300.0, 300.0)
+ )
+ ),
+ new Container(
+ key: 'b',
+ decoration: new BoxDecoration(backgroundColor: const Color(0xFFFFFF00)),
+ padding: new EdgeDims.symmetric(horizontal: 50.0, vertical: 75.0),
+ child: new RaisedButton(
+ child: new Text('PRESS ME'),
+ onPressed: () => print("Hello World")
+ )
+ ),
+ new FlexExpandingChild(
+ new Container(
+ decoration: new BoxDecoration(backgroundColor: const Color(0xFF00FFFF))
)
),
- new Rectangle(const Color(0xFFFFFF00), key: 'b'),
],
direction: FlexDirection.vertical,
justifyContent: FlexJustifyContent.spaceBetween
« no previous file with comments | « sky/examples/stocks2/lib/stock_row.dart ('k') | sky/examples/widgets/spinning_mixed.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698