Closed shanthosh2910 closed 4 years ago
@shanthosh2910 What have you tried so far and what is not working?
I tried this. Getting NoSuchMethodError
Widget _buildApps(songs) => GroupedListView(
elements: songs,
groupBy: (song) => song.album,
itemBuilder: (context, song) => _buildRow(song));
@shanthosh2910
As mentioned in the readme, you neeed to specify groupSeparatorBuilder
which is a function which returns a widget for the group header (equal to itemBuilder
for items). There you can customize the group header as you like.
In your case a very basic solution would be something like this:
groupSeparatorBuilder: (album) => Text('$album'),
Thank you!!!
I have a list of map
List<SongInfo> songs;
This is how I will use the normal
ListView
Now I want to group all the songs by
song.album
.