如何在Flutter中从TextButton中移除边框半径

5
我是 Flutter 的新手,我的 TextButton 有一个小边框半径问题。有人知道如何从 TextButton 中删除边框半径吗?
我的输出。

app output

抱歉之前没有提供,以下是我的代码: 我的代码

你能否包含产生此问题的代码片段? - Yeasin Sheikh
请提供足够的代码,以便他人更好地理解或重现问题。 - Community
我已经添加了一张我的代码图片。 - Logic
@Logic,如果我的回答解决了你的问题,请接受它吧 :) 谢谢。 - Danny Rufus
2个回答

18

您可以为您的TextButton添加一个shape参数

TextButton(
      style: TextButton.styleFrom(
          backgroundColor: Colors.yellow,
          shape: const RoundedRectangleBorder(
              borderRadius: BorderRadius.all(Radius.zero))),
      child: const Text("BUtton"),
      onPressed: () {},
    )

0

在你的TextButton()函数中添加这行代码

style: TextButton.styleFrom(
              shape: const BeveledRectangleBorder(borderRadius: BorderRadius.zero),
            ),

你的回答可以通过提供更多支持信息来改进。请编辑以添加进一步的细节,例如引用或文档,以便他人可以确认你的答案是正确的。您可以在帮助中心找到有关如何编写良好答案的更多信息。 - Community

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接