import 'package:flutter/material.dart';
void main() => runApp(new MainAPP());
enum Department { treasury, state }
class MainAPP extends StatelessWidget {
@override
Widget build(BuildContext context) {
// TODO: implement build
return new MyApp();
}
}
class MyApp extends StatefulWidget {
@override
State<StatefulWidget> createState() {
// TODO: implement createState
return new MyState();
}
}
class MyState extends State<MyApp> {
var card = new SizedBox(
height: 250,
child: new Card(
child: new Column(
children: <Widget>[
new ListTile(
title: new Text("深圳市南山区"),
subtitle: new Text("百度大厦"),
leading: new Icon(
Icons.home,
color: Colors.blue,
),
),
new Divider(),
new ListTile(
title: new Text("深圳市南山区"),
subtitle: new Text("百度大厦"),
leading: new Icon(
Icons.home,
color: Colors.blue,
),
),
new Divider(),
],
),
),
);
@override
Widget build(BuildContext context) {
return new MaterialApp(
home: new Scaffold(
appBar: new AppBar(
title: new Text("Card demo"),
),
body: new Center(
child: card,
),
),
);
}
}
参考:Flutter 技术入门与实战