Flutter入门(11):Flutter 组件之 Icons
2020-09-10 本文已影响0人
Maojunhao
1. 示例代码
代码下载地址。如果对你有帮助的话记得给个关注,代码会根据我的 Flutter 专题不断更新。
2. Icons 使用
我们先创建一个 icons.dart 文件。
import 'package:flutter/material.dart';
class FMIconVC extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
child: Scaffold(
appBar: AppBar(
title: Text(
"Icon",
),
backgroundColor: Colors.lightBlue,
),
body: Container(
child: _column(),
),
),
);
}
Column _column(){
return Column(
children: [
Icon(
Icons.face,
size: 40,
color: Colors.red,
),
Icon(
Icons.face,
size: 40,
),
Icon(
Icons.favorite,
size: 40,
color: Colors.red,
),
Icon(
Icons.favorite_border,
size: 40,
color: Colors.grey,
),
Icon(
Icons.add,
size: 40,
),
Icon(
Icons.ac_unit,
size: 40,
),
Icon(
Icons.access_alarm,
size: 40,
),
Icon(
Icons.access_time,
size: 40,
),
Icon(
Icons.accessible,
size: 40,
),
Icon(
Icons.account_balance,
size: 40,
),
],
);
}
}
