无论如何,我可以在扩展的 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/