Flutter入门学习--(17)卡片控件Card

Card控件内部可以只能放置一个子控件,可以通过SizedBox控件来设置card的高度

 

Flutter入门学习--(17)卡片控件Card_第1张图片

import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        title: 'Flutter Positioned布局控件',
        home: Scaffold(
            appBar: AppBar(
              title: Text("Flutter Card布局控件"),
            ),
            body: new SizedBox(
                height: 500,
                child: new Card(
                  color: Colors.orange,
                  //阴影大小-默认2.0
                  elevation: 3.0,
                  child:  new Column(
                    children: [
                      Image.network("http://pic1.win4000.com/pic/a/0f/00d9564452.jpg",height: 200,),
                      new Divider(),
                     Image.network("http:r//pic1.win4000.com/pic/1/9f/a37f1397062.jpg",height: 200,),
                    ],
                  ))
                )));
  }
}

 

你可能感兴趣的:(Flutter)