颤振:FloatingActionButton阴影

时间:2018-07-29 18:12:12

标签: dart material-design flutter floating-action-button

您是否有能力或有办法更改FloatingActionButton.extended或任何其他浮动按钮产生的阴影的颜色?

1 个答案:

答案 0 :(得分:1)

enter image description here

您可以尝试这种方式:

floatingActionButton: FloatingActionButton(
      onPressed: () {},
      backgroundColor: Colors.red,
      elevation: 0,
      child: Container(
        decoration: BoxDecoration(
          color: Colors.transparent,
          borderRadius: BorderRadius.all(
            Radius.circular(100),
          ),
          boxShadow: [
            BoxShadow(
              color: Colors.purple.withOpacity(0.3),
              spreadRadius: 7,
              blurRadius: 7,
              offset: Offset(3, 5),
            ),
          ],
        ),
      ),
    ),