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

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