【问题标题】:How do I add Social Media Links/Buttons To My App in Flutter?如何在 Flutter 中将社交媒体链接/按钮添加到我的应用程序?
【发布时间】:2021-07-02 12:17:30
【问题描述】:

我想将图片中电子邮件卡片下方的按钮更改为社交媒体链接。但是,我很难找到这些图标。我希望能够操作图标并更改颜色。

Here's My App

我想出的一个解决方案是在内部使用图像资源而不是图标,但这样做我无法更改颜色。

这是我的代码:

Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Padding(
                padding: const EdgeInsets.all(10.0),
                child: Container(
                  color: Colors.white,
                  child: IconButton(
                    onPressed: null,
                    icon: Icon(
                      Icons.ac_unit,
                      color: Colors.black,
                    ),
                  ),
                ),
              ),
              Padding(
                padding: const EdgeInsets.all(10.0),
                child: Container(
                  color: Colors.white,
                  child: IconButton(
                    onPressed: null,
                    icon: Icon(
                      Icons.ac_unit,
                      color: Colors.black,
                    ),
                  ),
                ),
              ),
              Padding(
                padding: const EdgeInsets.all(10.0),
                child: Container(
                  color: Colors.white,
                  child: IconButton(
                    onPressed: null,
                    icon: Icon(
                      Icons.ac_unit,
                      color: Colors.black,
                    ),
                  ),
                ),
              ),
              Padding(
                padding: const EdgeInsets.all(10.0),
                child: Container(
                  color: Colors.white,
                  child: IconButton(
                    onPressed: null,
                    icon: Icon(
                      Icons.ac_unit,
                      color: Colors.black,
                    ),
                  ),
                ),
              ),
            ],
          ),

【问题讨论】:

    标签: flutter flutter-layout


    【解决方案1】:

    你可以使用这个包:https://pub.dev/packages/font_awesome_flutter

    有了这个,您可以轻松地为图标设置样式:

    Icon(FontAwesomeIcons.facebook, color: widget.color, size: 16.0)

    图标名称可以在这里找到:https://fontawesome.com/v5.15/icons?d=gallery&p=2

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-10-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-05
      • 1970-01-01
      相关资源
      最近更新 更多