PhysicalModel(每日Flutter 小部件)


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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM