简体   繁体   English

如何创建类似 Office 应用程序的浮动操作按钮 [ Flutter ]

[英]How to create a Floating action button like Office application [ Flutter ]

I need to create a floating action button like [Floating action button in Office application]我需要创建一个浮动操作按钮,如 [Office 应用程序中的浮动操作按钮]

Office 应用程序中的浮动操作按钮

It's my first question, sorry about the grammar这是我的第一个问题,抱歉语法问题

I'm not a Microsoft fan actually I'm avoiding anything Microsoft maiden because of my high blood pressure :) but according to your picture you probably want to use something like drawer我不是微软的粉丝,实际上我因为高血压而避免使用微软的任何东西 :) 但根据你的照片,你可能想要使用抽屉之类的东西

Scafold(
    appBar: AppBar(
       title: Text('Example'),
     drawer: Padding(
        padding: const EdgeInsets.all(20.0),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.end,
          children: <Widget>[
            Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[
                IconButton(
                  icon: Icon(Icons.category),
                  onPressed: () {},
                ),
                IconButton(icon: Icon(Icons.title), onPressed: () {}),
                IconButton(icon: Icon(Icons.print), onPressed: () {})
              ],
            ),
            Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[
                IconButton(
                    icon: Icon(
                      Icons.close,
                    ),
                    onPressed: () {}),
              ],
            ),
          ],
        ),
      )
)

You will have to modify it to your needs.您必须根据自己的需要对其进行修改。 This is just a sample这只是一个示例

use Stack widget使用堆栈小部件

Stack(
  children:<Widget>[
      ...renderOtherWidgets(),
      FloatingBar()
   ]
);

means FloatingBar() is the widget with the all floating buttons.意味着FloatingBar()是带有所有浮动按钮的小部件。 and with Fade block as well.并带有淡入淡出块。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM