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

Unified Diff: sky/sdk/example/address_book/lib/main.dart

Issue 1227093010: Add an AspectRatio widget for doing proportional height sizing (Closed) Base URL: git@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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sky/sdk/lib/rendering/box.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/example/address_book/lib/main.dart
diff --git a/sky/sdk/example/address_book/lib/main.dart b/sky/sdk/example/address_book/lib/main.dart
index 43f1c9253623fc569fa37c0105e43b93854bcd34..0b75f11055aa7a9958e0e8bcd49bf94a3d318ddc 100644
--- a/sky/sdk/example/address_book/lib/main.dart
+++ b/sky/sdk/example/address_book/lib/main.dart
@@ -16,8 +16,9 @@ import 'package:sky/widgets/floating_action_button.dart';
import 'package:sky/widgets/icon.dart';
import 'package:sky/widgets/material.dart';
import 'package:sky/editing/input.dart';
+import 'package:sky/widgets/scrollable_viewport.dart';
-class Field extends Container {
+class Field extends Component {
Field({this.icon: null, this.placeholder: null});
String icon;
@@ -29,14 +30,13 @@ class Field extends Container {
padding: const EdgeDims.symmetric(horizontal: 16.0),
child: new Icon(type:icon, size:24)
),
- new Flexible(child:new Input(placeholder:placeholder))
+ new Flexible(child:new Input(placeholder:placeholder, focused:false))
],
direction: FlexDirection.horizontal
);
}
}
-
class AddressBookApp extends App {
Widget buildToolBar() {
@@ -55,7 +55,13 @@ class AddressBookApp extends App {
Widget buildBody() {
return new Material(
- child:new Block([
+ child: new ScrollableBlock([
+ new AspectRatio(
+ aspectRatio: 16 / 9,
abarth-chromium 2015/07/14 20:17:02 Does this need to be 16.0 / 9.0 to get floating po
Cutch 2015/07/14 20:33:44 16 / 9 will be a floating point division on two in
+ child: new Container(
+ decoration: new BoxDecoration(backgroundColor: colors.Purple[300])
+ )
+ ),
new Field(icon:"social/person", placeholder:"Name"),
new Field(icon: "communication/phone", placeholder:"Phone"),
new Field(icon: "communication/email", placeholder:"Email"),
« no previous file with comments | « no previous file | sky/sdk/lib/rendering/box.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698