小编Leo*_*o M的帖子

我如何将卡片放入条形应用栏

我做了一个sliverappbar,我想在这个sliverappbar上放一张卡片。我如何将卡片放在sliverappbar上,而该卡片随sliverappbar折叠?

卡应留在appbar的一半,而在“ body”的一半

CustomScrollView(
      slivers: <Widget>[
        SliverAppBar(
          expandedHeight: 100.0,
          floating: true,
          snap: true,
          backgroundColor: Colors.green,
          elevation: 0.0,
          flexibleSpace: FlexibleSpaceBar(
            title: const Text(
              "test",
              style: TextStyle(color: Colors.white, fontSize: 20.0),
            ),
            centerTitle: true,
            background: Column(
              mainAxisAlignment: MainAxisAlignment.end,
              children: <Widget>[
                Stack(
                  children: <Widget>[
                    Container(
                      height: 60.0,
                      color: Colors.black,
                    )
                  ],
                )
              ],
            )
          ),
        SliverFillRemaining(
          child: new Text("data"),
        )
      ],
    ),
Run Code Online (Sandbox Code Playgroud)

dart flutter

6
推荐指数
1
解决办法
1297
查看次数

如何更改 FloatingActionButton 扩展中的图标位置

FloatingActionButton 扩展上的图标在左侧,如何将图标放在右侧?正文之后

floatingActionButton: FloatingActionButton.extended(   
            onPressed: (){},
            label: Text("Next",),
            icon: Icon(Icons.arrow_forward,
            ),
      ),
      floatingActionButtonLocation: FloatingActionButtonLocation.endFloat 
Run Code Online (Sandbox Code Playgroud)

dart flutter

2
推荐指数
1
解决办法
2456
查看次数

标签 统计

dart ×2

flutter ×2