flutter——card组件,卡片组件设置

项目card0222

import 'package:flutter/material.dart';

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


class MyApp extends StatelessWidget {

  var mycard =Card(
    child: Column(
      children: [
        ListTile(
          leading: Icon(Icons.add_box,color: Colors.lightBlueAccent,),
          title: Text("北京",style: TextStyle(fontWeight:FontWeight.w500),),
          subtitle: Text("beijing") ,
        ),
        //添加分割线组件
        new Divider(),
        ListTile(
          leading: Icon(Icons.add_box,color: Colors.lightBlueAccent,),
          title: Text("上海"),
          subtitle: Text("beijing") ,
        ),
        new Divider(),
        ListTile(
          leading: Icon(Icons.add_box,color: Colors.lightBlueAccent,),
          title: Text("天津"),
          subtitle: Text("beijing") ,
        ),
        new Divider(),
      ],
    ),
  );
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      home: Scaffold(
        appBar: AppBar(title: Text("CARD导航"),),
        body: Center(child: mycard,),
      ),
    );
  }
}








/**
 * Card() 组件
 * 
 * Divider() 分割线组件
 * 
 * 
 */

 

你可能感兴趣的:(flutter)