Flutter 中的 FaIcon 有奇怪的填充/边距

发布于 2025-01-09 09:57:03 字数 465 浏览 2 评论 0原文

有没有办法去除 Flutter 中 FaIcon 上方和下方的多余空间?

有一个带有 TextFormField 的行和一个带有美元符号和插入符号图标的列。

输入图片这里的描述

我想要的是将图标进一步向上移动,以便它位于美元符号的正下方,但它显示了一些奇怪的垂直填充,我不明白如何删除。

有人遇到同样的问题吗?

输入图片此处描述

Is there a way to remove the extra space above and below the FaIcon in Flutter?

There is a Row with a TextFormField and a Column with a dollar sign and caretDown icon.

enter image description here

What I want is to move the icon more up, so that it's right below the dollar sign, but it shows some strange vertical padding, that I don't understand how to remove.

Anybody had the same problem?

enter image description here

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

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

发布评论

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

评论(1

孤单情人 2025-01-16 09:57:03

您可以使用带有 suffix 属性的 InputDecoration 类。

decoration: InputDecoration(
                                      contentPadding: EdgeInsets.all(
                                          kIsWeb || isTab ? 10 : 5),
                                      hintText: widget.isRemoveMoney
                                          ? "Why?"
                                          : "What’s it for?",
                                      hintStyle: CommonStyles().textStyle(
                                          textColor: colorConstant.colorBDBDBD),
                                      errorStyle: CommonStyles().textStyle(
                                        textColor: colorConstant.colorE86A3D,
                                      ),
                                      suffix: Column(children: [
                                        Icon(Icons.settings),
                                        Icon(Icons.settings)
                                      ],), //add suffix property
                                      errorMaxLines: 2,
                                      border: InputBorder.none,
                                      //OutlineInputBorder(borderRadius: BorderRadius.circular(0))
                                    ),

You can use InputDecoration class with suffix property.

decoration: InputDecoration(
                                      contentPadding: EdgeInsets.all(
                                          kIsWeb || isTab ? 10 : 5),
                                      hintText: widget.isRemoveMoney
                                          ? "Why?"
                                          : "What’s it for?",
                                      hintStyle: CommonStyles().textStyle(
                                          textColor: colorConstant.colorBDBDBD),
                                      errorStyle: CommonStyles().textStyle(
                                        textColor: colorConstant.colorE86A3D,
                                      ),
                                      suffix: Column(children: [
                                        Icon(Icons.settings),
                                        Icon(Icons.settings)
                                      ],), //add suffix property
                                      errorMaxLines: 2,
                                      border: InputBorder.none,
                                      //OutlineInputBorder(borderRadius: BorderRadius.circular(0))
                                    ),

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文