本文介绍了Flutter:如何将FloatingActionButton附加到AppBar?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Scaffold -Widget仅允许将FloatingActionButton放置在右下角或底部中心.我如何像这样在AppBarbody之间放置它?

The Scaffold-Widget only allows to place a FloatingActionButton at the bottom right or the bottom center. How can I place it between AppBar and body like here?

[

推荐答案

现在可以使用:

Scaffold(
      appBar: AppBar(title: Text('Title'),),
      body: ...,
      floatingActionButtonLocation: FloatingActionButtonLocation.endTop,
      floatingActionButton: FloatingActionButton(...),
    ),

这篇关于Flutter:如何将FloatingActionButton附加到AppBar?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-11 02:23