2019年11月24日 星期日

[windows/flutter]ListView ListTile


1.

ListTile _tile(String title, String subtitle, IconData icon) => ListTile(
    title: Text(
    title,
    style: TextStyle(
        fontWeight: FontWeight.w500,
        fontSize: 20.0
    ),
    ),
    subtitle: Text(subtitle),
    leading: Icon(
    icon,
    color: Colors.blue[500]
    )
);

Widget _buildList() => ListView(
    children: [
        _tile('CineArts at the Empire', '85 W Portal Ave', Icons.theaters),
        _tile('The Castro Theater', '429 Castro St', Icons.theaters),
        _tile('Alamo Drafthouse Cinema', '2550 Mission St', Icons.theaters),
        Divider(),
        _tile('K\'s Kitchen', '757 Monterey Blvd', Icons.restaurant),
        _tile('Emmy\'s Restaurant', '1923 Ocean Ave', Icons.restaurant),
    ]
);

return
        _buildList();

1-1. leading就是最前面的東西,填Icon可以,Text也可以

沒有留言:

張貼留言