Reputation: 55
I want a listview whose bottom ends just above the bottom navigation bar, except my listview's bottom overflows under the navigation bar. Is there a way to constrain the listview to be sandwiched between the appbar and bottom navigation bar?
I have a widget hierarchy that looks like this:
Scaffold(
appbar: ...
body: Column(
children: [
...
ListView(...)
]
)
bottomNavigationBar: ...
)
Upvotes: 5
Views: 2720
Reputation: 131
Try to set the scaffold's extendBody extendBody property value to false.
Scaffold(
appBar: AppBar(...),
extendBody: false,
body: Column(...),
bottomNavigationBar: BottomNavigationBar(...)
)
Upvotes: 3
Reputation: 7601
Try to use Expanded for largest widget in Column:
Scaffold(
appbar: ...
body: Column(
children: [
...
Expanded(child:ListView(...)),
]
)
bottomNavigationBar: ...
)
Upvotes: 6
Reputation: 11
I hope it might work in your case.
Use SingleChildScrollView in the ListView. Don't forget to mention the Scroll Direction.
Scaffold(
appbar: ...
body: Column(
children: [
...
SingleChildScrollView(
child: ListView(...)
)
]
)
bottomNavigationBar: ...
)
Upvotes: 0