WEBVTT

00:02.090 --> 00:03.740
Congratulations, guys.

00:03.740 --> 00:06.380
This is our current application.

00:06.380 --> 00:08.030
It's working smoothly.

00:08.060 --> 00:15.860
We're going to update this app to be more and more professional and hold complex UI composables.

00:15.860 --> 00:23.570
For that, I'm going to create for each item a card that holds an image and two texts.

00:23.570 --> 00:28.730
And to be more professional, I want from you to focus with me in these steps.

00:28.730 --> 00:33.560
Here I'm going to create a new data class.

00:33.560 --> 00:37.280
I'll name it as item in Kotlin.

00:37.310 --> 00:44.990
Add data class is a special kind of class intended to hold data by declaring a class as a data class,

00:44.990 --> 00:48.650
Kotlin provides several useful methods automatically.

00:48.680 --> 00:51.770
Here I'll include val title.

00:51.800 --> 00:55.280
It's of type string val description.

00:55.310 --> 00:59.180
It's of type string and val image url.

00:59.180 --> 01:00.890
It's of type int.

01:02.120 --> 01:06.680
The primary constructor needs to have at least one parameter.

01:06.680 --> 01:12.740
In this item class we have three parameters the title, description, and image.

01:12.740 --> 01:19.520
The parameters of primary constructor are automatically properties of the class, meaning that can be

01:19.550 --> 01:23.210
accessed directly on instances of this class.

01:23.210 --> 01:28.820
So at data class can be defined to hold data without much boilerplate code.

01:28.820 --> 01:30.650
This is our data class.

01:30.650 --> 01:37.460
In the next videos, we're going to continue with our app to use this data class for each item in our

01:37.460 --> 01:38.390
application.
