小编Lak*_*ara的帖子

有没有办法在 Flutter 上添加两种不同颜色的 Iphone x SafeArea

我想知道有没有什么办法可以给 iPhone X SafeArea 添加两种不同的颜色?

React Native此可以通过增加两个固定SafeAreaView。有谁知道如何在颤振上解决这个问题?

谢谢

  @override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.blue,
      child: SafeArea(
        left: true,
        top: true,
        right: true,
        bottom: true,
        child: Scaffold(
          resizeToAvoidBottomInset: false,
          appBar: AppBar(
            title: Text(widget.title),
          ),
          body: Center(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[
                Text(
                  'You have pushed the button this many times:',
                ),
                Text(
                  '$_counter',
                  style: Theme.of(context).textTheme.display1,
                ),
              ],
            ),
          ),
          floatingActionButton: FloatingActionButton(
            onPressed: _incrementCounter,
            tooltip: 'Increment',
            child: Icon(Icons.add),
          ), 
        ),
      ),
    );
  }
Run Code Online (Sandbox Code Playgroud)

flutter iphone-x flutter-layout safeareaview

3
推荐指数
1
解决办法
1602
查看次数

标签 统计

flutter ×1

flutter-layout ×1

iphone-x ×1

safeareaview ×1