美文网首页Flutter 实战
Flutter入门(11):Flutter 组件之 Icons

Flutter入门(11):Flutter 组件之 Icons

作者: Maojunhao | 来源:发表于2020-09-10 09:01 被阅读0次

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,
        ),
      ],
    );
  }
}
icons.png

3. 图集预览

Material icons 全图标一览

相关文章

网友评论

    本文标题:Flutter入门(11):Flutter 组件之 Icons

    本文链接:https://www.haomeiwen.com/subject/kgieektx.html