CupertinoNavigationBar padding if not transition

200 views
Skip to first unread message

Marc Andrew

unread,
Nov 28, 2018, 12:02:12 AM11/28/18
to Flutter Dev
Hi,

I have a CupertinoNavigationBar with a white background. Because of the white background my ListView has a padding on top and I don't know how to remove this.

Below is my code:

Widget build(BuildContext context) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
backgroundColor: CupertinoColors.white,
border: Border(
bottom:
BorderSide(width: 1.0, color: primaryColorLight),
),
middle: Text('Feed'),
),
child: ListView(
children: <Widget>[
Container(
color: Colors.red,
height: 500.0,
),
Container(
color: Colors.blue,
height: 400.0,
),
],
),
);
}

Below you can see the spacing between the NavigationBar and red Container

Screenshot 2018-11-28 at 11.56.18.png



Hope anyone can help me with this.


Thank you,
Marc

Từ Phương Danh

unread,
Nov 28, 2018, 3:07:46 AM11/28/18
to marc4...@gmail.com, flutt...@googlegroups.com
Replace it to:
child: ListView(
      padding: EdgeInset.only(top: 0.0),

children: <Widget>[
Container(
color: Colors.red,
height: 500.0,
),
Container(
color: Colors.blue,
height: 400.0,
),
],
),
--
You received this message because you are subscribed to the Google Groups "Flutter Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages