Reputation: 61
I'm trying to put some space or a SizedBox() as the last item of the ListView, because the FloatingActionButton() is hiding some information from the last ListTile.
I want to scroll to the space/SizeBox() like WhatsApp for example.
body: ListView.builder(
itemCount: cardsList.length,
itemBuilder: (context, i) {
return Column(
children: [
ListTile( ... ),
Divider( ... ),
],
);
},
),
Upvotes: 3
Views: 2017
Reputation: 63749
I think you want this
ListView.builder(
itemCount: cardsList.length + 1,
itemBuilder: (context, index) =>
index < items.length ? myListTile() : SizedBox(),
),
Upvotes: 0
Reputation: 2088
ListView
has padding property
body: ListView.builder(
padding: const EdgeInsets.only(bottom: 100),
itemCount: cardsList.length,
itemBuilder: (context, i) {
return Column(
children: [
ListTile( ... ),
Divider( ... ),
],
);
},
),
Upvotes: 5
Reputation: 1200
You can wrap your ListView
with the Column
widget. In that widget add the SizedBox
. Like this:
body: Column(
children: [
ListView.builder(
itemCount: cardsList.length,
itemBuilder: (context, i) {
return Column(
children: [
ListTile( ... ),
Divider( ... ),
],
);
},
),
SizedBox(height: 50.0)
]
)
Upvotes: 1