美文网首页
Flutter快速上手1.9:基础控件之Placeholder

Flutter快速上手1.9:基础控件之Placeholder

作者: 十二栗子 | 来源:发表于2022-04-24 08:43 被阅读0次

这是一个占位控件

const Placeholder({
    Key? key,
    this.color = const Color(0xFF455A64), // Blue Grey 700//控件颜色
    this.strokeWidth = 2.0,//线条宽
    this.fallbackWidth = 400.0,//宽
    this.fallbackHeight = 400.0,//高
  }) 
Row(
              children: [
                Container(
                  margin:  const EdgeInsets.all(20),
                  child: const Placeholder(
                    fallbackHeight: 60,
                    fallbackWidth: 50,
                    color: Colors.red,
                  ),
                ),
                Container(
                  margin:  const EdgeInsets.all(20),
                  child: const Placeholder(
                    fallbackHeight: 80,
                    fallbackWidth: 150,
                    strokeWidth: 5,
                  ),
                ),
              ],
            ),
WX20220419-170246.png

本地Flutter 2.10.1,Mac版Android Studio Bumblebee | 2021.1.1 Patch 2
我是小栗子,初学Flutter ,文章会根据学习进度不定时更新,请多多指教~~

相关文章

网友评论

      本文标题:Flutter快速上手1.9:基础控件之Placeholder

      本文链接:https://www.haomeiwen.com/subject/esdsertx.html