PhysicalModel ,主要的功能就是设置widget四边圆角,可以设置阴影颜色,和z轴高度

PhysicalModel({
    //裁剪模式
    this.clipBehavior = Clip.none,
    //四角圆度半径
    this.borderRadius,
    //z轴高度
    this.elevation = 0.0,
   //设置阴影颜色
    this.shadowColor = const Color(0xFF000000),
  })

  

class ServiceMenu extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return PhysicalModel(
      color: Colors.white,
      borderRadius: BorderRadius.all(Radius.circular(6)),
      clipBehavior: Clip.antiAlias,
      elevation: 6.0,
      shadowColor: Colors.grey,
      child: GridView.count(
        crossAxisCount: 5,
        physics: NeverScrollableScrollPhysics(),
        shrinkWrap: true,
        children: getWidgetList(),
      ),
    );
  }

  原文链接:https://blog.csdn.net/senkai123/java/article/details/102638968

相关文章:

  • 2022-12-23
  • 2021-12-19
  • 2021-05-15
  • 2022-12-23
  • 2022-01-01
  • 2021-05-05
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案