簡體   English   中英

如何創建類似 Office 應用程序的浮動操作按鈕 [ Flutter ]

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

我需要創建一個浮動操作按鈕,如 [Office 應用程序中的浮動操作按鈕]

Office 應用程序中的浮動操作按鈕

這是我的第一個問題,抱歉語法問題

我不是微軟的粉絲,實際上我因為高血壓而避免使用微軟的任何東西 :) 但根據你的照片,你可能想要使用抽屜之類的東西

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: () {}),
              ],
            ),
          ],
        ),
      )
)

您必須根據自己的需要對其進行修改。 這只是一個示例

使用堆棧小部件

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

意味着FloatingBar()是帶有所有浮動按鈕的小部件。 並帶有淡入淡出塊。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM