container.dart 1.46 KB
Newer Older
1 2 3 4
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5
import 'package:flutter/material.dart';
6

7 8
class ContainerApp extends StatelessComponent {
  Widget build(BuildContext context) {
Hixie's avatar
Hixie committed
9
    return new Column(<Widget>[
10 11 12 13 14
        new Container(
          padding: new EdgeDims.all(10.0),
          margin: new EdgeDims.all(10.0),
          decoration: new BoxDecoration(backgroundColor: const Color(0xFFCCCCCC)),
          child: new NetworkImage(
15
            src: "https://raw.githubusercontent.com/dart-lang/logos/master/logos_and_wordmarks/dart-logo.png",
16 17
            width: 300.0,
            height: 300.0
18 19 20 21 22
          )
        ),
        new Container(
          decoration: new BoxDecoration(backgroundColor: const Color(0xFFFFFF00)),
          padding: new EdgeDims.symmetric(horizontal: 50.0, vertical: 75.0),
Hixie's avatar
Hixie committed
23
          child: new Row(<Widget>[
24 25 26 27 28
            new RaisedButton(
              child: new Text('PRESS ME'),
              onPressed: () => print("Hello World")
            ),
            new RaisedButton(
29
              child: new Text('DISABLED')
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
            )
          ])
        ),
        new Flexible(
          child: new Container(
            decoration: new BoxDecoration(backgroundColor: const Color(0xFF00FFFF))
          )
        ),
      ],
      justifyContent: FlexJustifyContent.spaceBetween
    );
  }
}

void main() {
  runApp(new ContainerApp());
}