如何在Flutter中构建可扩展列表

时间:2020-11-03 14:01:05

标签: flutter dart flutter-layout flutter-dependencies expand

enter image description here

在应用栏中快速单击图标时如何实现?

1 个答案:

答案 0 :(得分:2)

如果您指的是三个点,那么PopupMenuButton是一种选择:

Scaffold(
      appBar: AppBar(
        title: Text('Chat'),
        actions: <Widget>[
          PopupMenuButton<String>(
            itemBuilder: (context) => [
              PopupMenuItem(
                value: 1,
                child: Text("Do something..."),
              ),
            ],
            onSelected: (value) async => {
              _doSomething(),
            },
          ),
        ],
      ),
      drawer: AppDrawer(),
      body: something here...
    );