gpt4 book ai didi

flutter - float 位置 float 按钮中的文字?

转载 作者:行者123 更新时间:2023-12-03 04:35:23 25 4
gpt4 key购买 nike

无论如何,我可以在扩展的 float 操作按钮中放置文本。
例如,我想将文本放置在按钮的右上角。
我怎样才能做到这一点 ?
谢谢您的帮助。

最佳答案

支架中的FloatingActionButton接受一个小部件。因此,您可以执行以下操作:

floatingActionButton: Stack(
children: [
FloatingActionButton.extended(
// label cannot be null, but it's a widget
// so it can be an empty container or something else
label: Text("button"),
icon: Icon(Icons.add),
onPressed: () {},
),
Positioned(right: 0.0, top: 0.0, child: Text("text")),
],
),

关于flutter - float 位置 float 按钮中的文字?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64181949/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com