I would like to know is there any way to add two different colors to iPhone X SafeArea?
On React Native this can be fixed by adding two SafeAreaView. Does anyone know how to fix this one on flutter?
Thanks
@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),
),
),
),
);
}

You can do one simple thing => Mark top property of
SafeAreato false so the top area of the phone will take the background color of theAppBarand the bottom SafeArea will take the color of the parentcontainer. Ideally, I would suggest if you are bounding yourscaffoldinsideSafeAreathen it's topSafeAreacolor should be the same asAppBarbackground color and bottom SafeArea color is as per your requirement(parent container's color).I modified your code with two different colors:
Option 2: If you are using a scaffold then you can simply bind your body widget inside and it will fix your problem.