@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
child: CustomScrollView(
slivers: <Widget>[
CupertinoSliverNavigationBar(
largeTitle: Container(height:0.0),
trailing:
IconButton(
icon: Icon(
IconData(0xe900, fontFamily: 'message6'),
color: Colors.black,
size: 25.0,
),
onPressed: () {
// Navigator.pushNamed(context, '/chat');
},
),
middle: Text('Search',style: TextStyle(fontSize: 15.5,
),)
),
],
),
);
}
}
Am trying to get rid of the collapsible space in the CupertinoSliverNavigationBar in the code snippet. I do not want the largeTitle property to be there but unfortunately the CupertinoSliverNavigationBar requires it. Thus I have worked around it by putting an empty Container widget with a height of 0.0 like you would set expandable height to 0.0 in a sliver App Bar for an android design to give it a non expandable height. However, for The CupertinoSliverNavigationBar it doesn't work as it leaves an empty expandable space. I am trying to achieve a slim Cupertino styled Navigation Bar. I can't use CupertinoNavigationBar because I am using a CustomScrollView widget because of scrolling content and flutter requires the CupertinoSliverNavigationBar in such a use case.
Does anyone know a work around this constraint? I want a slim bar/non-collapsible with scrollable content in the body.