The third step is to create the items and customize the layout for each item that would be displayed
under each sticky header.
For that, we're going to use items.
And here you can see there is an error.
Type mismatch required and found.
List of string.
It's very simple.
You can use items and list of t.
It's about using the correct import of items function.
Then we need to create a custom composable function.
For that I'm going to create another composable function here.
Let's start creating a card.
And inside this card I'll create a text.
And this function takes into the parameter.
The title item title is of type string and set the text parameter for this text.
Composable as item Title.
Modifier.
Modifier dot padding ATP.
Also, we're going to use font size 24.
SP okay, this is the custom item layout.
Let's go up.
And here let's continue what we've started.
Item.
This is the argument of this lambda expression and my custom item I need to pass the item.
Okay so for the headers we created a custom header composable.
And for each item we created a custom item composable.
Let's call our function in the Setcontent here and run the application.
And here we go.
This is our application.
In order to clarify the sticky functionality for each of these headers, I'm going to increase the size
of this text.
So increase the size from 24 to 32.
Also, I'm going to create some paddings for this card.
So modifier modifier dot padding 16 dpi from all sides.
Run the application again and here we go.
It's better now.
Let's scroll up.
You can see fruits is a sticky header.
We need to replace the vegetables with the fruits.
So for that I'm going to increase the padding.
For example 32 is good.
Let's run again.
And here we go.
Fruits vegetables.
You can see we have this sticky header I'll add another vegetable.
So let's go up I'll add broccoli and P run again.
These are the fruits.
You can see the sticky header.
You can notice that vegetables header is replacing the fruits.
Here we go.
And congratulations guys.
This is our application.