Unverified Commit dd943fef authored by Chris Bracken's avatar Chris Bracken Committed by GitHub

Apply media padding in Cupertino Navigation demo (#13585)

Adds safe areas around:
1. The body of the colour swatch view (tab 1)
2. The chat header (tab 2)
3. The chat bubbles (tab 2)
4. The 'Sign In' launcher button (tab 3)
parent 8a77036b
......@@ -132,8 +132,13 @@ class CupertinoDemoTab1 extends StatelessWidget {
trailing: const ExitButton(),
),
new SliverPadding(
// Top media query padding already consumed by CupertinoSliverNavigationBar.
padding: MediaQuery.of(context).removePadding(removeTop: true).padding,
// Top media padding consumed by CupertinoSliverNavigationBar.
// Left/Right media padding consumed by Tab1RowItem.
padding: MediaQuery.of(context).removePadding(
removeTop: true,
removeLeft: true,
removeRight: true,
).padding,
sliver: new SliverList(
delegate: new SliverChildBuilderDelegate(
(BuildContext context, int index) {
......@@ -175,6 +180,9 @@ class Tab1RowItem extends StatelessWidget {
),
));
},
child: new SafeArea(
top: false,
bottom: false,
child: new Padding(
padding: const EdgeInsets.only(left: 16.0, top: 8.0, bottom: 8.0, right: 8.0),
child: new Row(
......@@ -220,6 +228,7 @@ class Tab1RowItem extends StatelessWidget {
],
),
),
),
);
if (lastItem) {
......@@ -273,6 +282,9 @@ class Tab1ItemPageState extends State<Tab1ItemPage> {
middle: new Text(widget.colorName),
trailing: const ExitButton(),
),
child: new SafeArea(
top: false,
bottom: false,
child: new ListView(
children: <Widget>[
const Padding(padding: const EdgeInsets.only(top: 16.0)),
......@@ -386,6 +398,7 @@ class Tab1ItemPageState extends State<Tab1ItemPage> {
),
],
),
),
);
}
}
......@@ -412,6 +425,9 @@ class Tab2Header extends StatelessWidget {
Widget build(BuildContext context) {
return new Padding(
padding: const EdgeInsets.all(16.0),
child: new SafeArea(
top: false,
bottom: false,
child: new ClipRRect(
borderRadius: const BorderRadius.all(const Radius.circular(16.0)),
child: new Column(
......@@ -520,6 +536,7 @@ class Tab2Header extends StatelessWidget {
],
),
),
),
);
}
}
......@@ -623,11 +640,13 @@ class Tab2ConversationRow extends StatelessWidget {
: Tab2ConversationBubbleColor.gray,
),
);
return new Row(
return new SafeArea(
child: new Row(
mainAxisAlignment: isSelf ? MainAxisAlignment.end : MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: isSelf ? CrossAxisAlignment.center : CrossAxisAlignment.end,
children: children,
),
);
}
}
......@@ -703,6 +722,9 @@ class CupertinoDemoTab3 extends StatelessWidget {
height: 44.0,
child: new Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
child: new SafeArea(
top: false,
bottom: false,
child: new Row(children: <Widget>[ const Text(
'Sign in',
style: const TextStyle(color: CupertinoColors.activeBlue),
......@@ -710,6 +732,7 @@ class CupertinoDemoTab3 extends StatelessWidget {
),
),
),
),
],
),
),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment