关于flutter statusBar 的

statusbar 的另一种写法

/**
 * 这里没有直接用SafeArea,而是用Container包装了一层
 * 因为直接用SafeArea,会把顶部的statusBar区域留出空白
 * 外层Container会填充SafeArea,指定外层Container背景色也会覆盖原来SafeArea的颜色
 */
class _XFileAppbarState extends State<XFileAppbar> {
  @override
  Widget build(BuildContext context) {
    return new Container(
        color: widget.statusBarColor,
        child: new SafeArea(
        top: true,
        child: widget.contentChild,
      ),
    );
  }
  
}

https://www.cnblogs.com/ligun123/p/10985772.html

posted on 2019-12-16 16:39  test1111333  阅读(286)  评论(0)    收藏  举报