1. 示例代碼
代碼下載地址。如果對你有幫助的話記得給個關(guān)注金赦,代碼會根據(jù)我的 Flutter 專題不斷更新拭宁。
2. Icons 使用
我們先創(chuàng)建一個 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,
),
],
);
}
}