I am trying to use CupertinoSliverNavigationBar
, actually it's great, but for some reason I can't place the trailing right on the end of navigation bar. I looked up and I (guess, I) found that there's Padding
inside it
this is my code
new CupertinoPageScaffold(
child: new CustomScrollView(
slivers: <Widget>[
new CupertinoSliverNavigationBar(
largeTitle: new Text('Tasks'),
trailing: new CupertinoButton(
child: new Icon(AdditionalCupertinoIcons.compose, size: 32.0),
onPressed: () {
showDialog(
context: context,
builder: (BuildContext context) {
return new CupertinoAlertDialog();
});
},
padding: EdgeInsets.all(0.0),
),
)
],
),
),
Sadly, no can-do.
Looking at this line of source code, you can see that they are using a Padding
at the end, which is _kNavBarEdgePadding
, i.e. 16.0
. Same for the start
.
This means that with the CupertinoSliverNavigationBar
you will not be able to remove that Padding
because there is no access point to change it. You will have to create your own widget for that.
The _CupertinoPersistentNavigationBar
widget contains the Padding
and is used by CupertinoSliverNavigationBar
, as can be seen here and for completion here.