Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 浮动动作按钮中的颤振位置文本?_Flutter_Dart - Fatal编程技术网

Flutter 浮动动作按钮中的颤振位置文本?

Flutter 浮动动作按钮中的颤振位置文本?,flutter,dart,Flutter,Dart,我是否可以在扩展浮动操作按钮中定位文本 例如,我想将文本放置在按钮的右角 我该怎么做 感谢您的帮助。脚手架中的FloatingAction按钮接受一个小部件。所以你可以这样做: floatingActionButton: Stack( children: [ FloatingActionButton.extended( // label cannot be null, but it's a widget // s

我是否可以在扩展浮动操作按钮中定位文本

例如,我想将文本放置在按钮的右角

我该怎么做


感谢您的帮助。

脚手架中的FloatingAction按钮接受一个小部件。所以你可以这样做:

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")),
        ],
      ),

Scaffold中的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")),
        ],
      ),

尝试将文本小部件包装为带填充或将填充设置为浮动操作按钮。

尝试将文本小部件包装为带填充或将填充设置为浮动操作按钮。

您的问题解决了吗?:)您的问题解决了吗?:)