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 'dart:sky'; | 5 import 'dart:sky'; |
6 | 6 |
7 import 'package:mojom/intents/intents.mojom.dart'; | 7 import 'package:mojom/intents/intents.mojom.dart'; |
8 import 'package:sky/framework/shell.dart' as shell; | 8 import 'package:sky/framework/shell.dart' as shell; |
9 import 'package:sky/theme/colors.dart' as colors; | 9 import 'package:sky/theme/colors.dart' as colors; |
10 import 'package:sky/theme/edges.dart'; | 10 import 'package:sky/theme/edges.dart'; |
(...skipping 21 matching lines...) Expand all Loading... |
32 String href; | 32 String href; |
33 | 33 |
34 SkyDemo(String text, this.href) : this.text = text, super(key: text); | 34 SkyDemo(String text, this.href) : this.text = text, super(key: text); |
35 | 35 |
36 void _handlePress() { | 36 void _handlePress() { |
37 launch(href); | 37 launch(href); |
38 } | 38 } |
39 | 39 |
40 Widget build() { | 40 Widget build() { |
41 return new ConstrainedBox( | 41 return new ConstrainedBox( |
42 // TOOD(ianh): Fix so we don't need INFINITY here. | 42 constraints: const BoxConstraints.expandWidth(), |
43 constraints: new BoxConstraints.tightFor(width: double.INFINITY), | |
44 child: new RaisedButton( | 43 child: new RaisedButton( |
45 child: new Text(text), | 44 child: new Text(text), |
46 onPressed: _handlePress | 45 onPressed: _handlePress |
47 ) | 46 ) |
48 ); | 47 ); |
49 } | 48 } |
50 } | 49 } |
51 | 50 |
52 class SkyHome extends App { | 51 class SkyHome extends App { |
53 Widget build() { | 52 Widget build() { |
(...skipping 25 matching lines...) Expand all Loading... |
79 justifyContent: FlexJustifyContent.spaceAround | 78 justifyContent: FlexJustifyContent.spaceAround |
80 ) | 79 ) |
81 ) | 80 ) |
82 ); | 81 ); |
83 } | 82 } |
84 } | 83 } |
85 | 84 |
86 void main() { | 85 void main() { |
87 runApp(new SkyHome()); | 86 runApp(new SkyHome()); |
88 } | 87 } |
OLD | NEW |