在扑朔迷离中,什么是什么选中(✅)和cross/x(❌)图标?

发布于 2025-02-11 21:19:09 字数 1006 浏览 1 评论 0 原文

我正在尝试使用颤动显示tick(✅)和交叉(❌)图标。我有此代码:

child: SlideAction(
    sliderButtonIconPadding: 8,
    text: Slidewords,
    textStyle: TextStyle(
        fontWeight: FontWeight.bold,
        fontSize: (18),
        color: Colors.white),
    key: key,
    submittedIcon: formvalid
          ? const Icon(Icons.visibility) // tick icon
          : const Icon(Icons.visibility_off), // cross icon
    onSubmit: () async {
        Future.delayed(
          Duration(seconds: 1),
          () => key.currentState!.reset(),
        );
        _trySubmitForm();
    })

显然 icons.visibility icons.visibility_off 值不起作用,但是我找不到正确的在文档中 ctrl + f 似乎在该页面上搜索不起作用,而且响应速度不是。

我还尝试了 icon.tick icon.correct icon.cross.cross ;这些都没有给我我想要的结果。

I'm trying to display tick (✅) and cross (❌) icons using Flutter. I have this code:

child: SlideAction(
    sliderButtonIconPadding: 8,
    text: Slidewords,
    textStyle: TextStyle(
        fontWeight: FontWeight.bold,
        fontSize: (18),
        color: Colors.white),
    key: key,
    submittedIcon: formvalid
          ? const Icon(Icons.visibility) // tick icon
          : const Icon(Icons.visibility_off), // cross icon
    onSubmit: () async {
        Future.delayed(
          Duration(seconds: 1),
          () => key.currentState!.reset(),
        );
        _trySubmitForm();
    })

Clearly the Icons.visibility and Icons.visibility_off values don't work, but I can't find the right ones in the documentation. Ctrl+F doesn't seem to work to search on that page and it isn't very responsive.

I also tried Icon.tick, Icon.correct, and Icon.cross; none of these give me the result I want.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

好多鱼好多余 2025-02-18 21:19:09

对于十字架,请使用 icons.close ,对于tick, icons.check

For a cross, use Icons.close, and for a tick, Icons.check.

三人与歌 2025-02-18 21:19:09

您要寻找的图标是 icons.check_check_box_box icons.close.close.close 。要查看图标,没有周围的填充框,请使用 图标。检查


如果很难在扑波文档中搜索图标,则可以使用材料符号和图标来自Google字体的页面。

找到图标后,您可以单击它,侧边栏将出现在右侧。转到“ Android”选项卡,图标代码将与 Icons 类中的图标相同。例如,如果您单击“复选框”图标:

此图标的代码为“ check_box”

Icon(Icons.check_box)

“ https://i.sstatic.net/xrjhl.png” alt = “ 该页面中有一些图标,但在 belity_symbols_icons_icons package。现在,您可以使用图标 符号

// Import the package
import 'package:material_symbols_icons/symbols.dart';

// In your widget, use it as the IconData the same way as Icons
Icon(Symbols.add_task)

The icons you're looking for are Icons.check_box and Icons.close. For check icon without the filled box around it, use Icons.check.

Icons screenshot


If it's hard to search for icons in the Flutter docs, you can use the Material Symbols and Icons page from Google Fonts.

After finding the icon, you can click on it and a sidebar will appear on the right side. Go to the "Android" tab, the icon code will be the same as the one from the Icons class. For example, here's what you'll get if you click on the "Check Box" icon:

Material Symbols icon example

The code for this icon is "check_box", so you can use it in Flutter like this:

Icon(Icons.check_box)

In case there are icons you find in that page but not available in the Icons class, you can use the material_symbols_icons package. Now instead of using Icons, you can use Symbols:

// Import the package
import 'package:material_symbols_icons/symbols.dart';

// In your widget, use it as the IconData the same way as Icons
Icon(Symbols.add_task)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文