【问题标题】:I want make like a this Floating action button我想要像这样的浮动操作按钮
【发布时间】:2022-11-27 01:38:33
【问题描述】:

但我做不到。

我想知道怎么做 也许它需要阴影或偏移

现在我的代码

 floatingActionButton: _videoController?.value.isInitialized != null
          ? FloatingActionButton(
              backgroundColor: Colors.lightBlue[400],
              onPressed: () {
                setState(() {
                  _videoController!.value.isPlaying
                      ? _videoController!.pause()
                      : _videoController!.play();
                });
              },
              child: (_videoController!.value.isPlaying
                  ? Icon(
                      Icons.pause,
                      color: Colors.black,
                    )
                  : Icon(
                      Icons.play_arrow,
                      color: Colors.black,
                    )),
            )
          : Container(),
    );

【问题讨论】:

    标签: flutter flutter-widget flutter-design


    【解决方案1】:

    尝试这个:

    floatingActionButton: FloatingActionButton(
        onPressed: () {},
        child: Container(
          height: 50,
          decoration: BoxDecoration(
            color: Color(0xff92fcd1),
            border: Border.all(color: Colors.black),
            borderRadius: BorderRadius.circular(100),
            boxShadow: <BoxShadow>[
              BoxShadow(
                  color: Colors.black,
                  offset: Offset(2.5, 2.5),
                  spreadRadius: 0.1)
            ],
          ),
          child: Center(
            child: Icon(
              Icons.chevron_left,
              color: Colors.black,
            ),
          ),
        ),
      ),
    

    【讨论】:

      猜你喜欢
      • 2020-05-27
      • 1970-01-01
      • 2021-06-20
      • 2015-06-25
      • 2015-08-07
      • 2018-10-18
      • 2015-09-01
      • 1970-01-01
      • 2016-11-26
      相关资源
      最近更新 更多