 Hello guys so in this video we are going to cover about list view so we will be creating different type of list views first of all we will create a static list view. So let's remove this text widget and simply use list view constructor and here you need to use children and inside the children you can pass whatever you want as an element of your list view. So let's simply use a container here just to make it a basic one and you can give it some height let's say 100 and you can give some width let's give it 100 give it some color plus dot let's say green and you can add some child as well. Let's use a child let's say RAM and once it is done what we are missing here so basically we should not use const here since we are using the list view which is not of const type and you can add that const over here in front of text. So once I save it you can see you got one item in a list view so I just change this color to yellow and just to make it a center I just wrap this text widget with a center widget. So here you go and you need to cut this const and paste it before the center just save it. So if you want you can just decrease the height just save it. So same way you need to manually define all the elements in case of static list view and let's give it sham adjust copy this and rewrite same code again and again so I just change from Ram, Sham, Sita, Geeta, Tina and Mina so I just save it. So you got these many elements so basically this is a scrollable list you can see so this list view byte part is consuming the whole space. So if you wanted to consume only the required space then there is one property of list view that is shrink wrap just make it true. So once you pass this row to list view then you can see this list view is consuming only that much space whatever content it is holding. Now another way is I just change the orientation of this phone to show you that it is a scrollable list. So I just scroll up and down let's add one more element so that you can see it is scrollable. I just copy this Mina to let's give it Tina and say and you can see him scrolling it is working. So let's take it back. So once we have done this there is another way sometimes we want to display the list view in different direction like it is coming up and down we want to display it left to right. So for that there is another property of list view that is scroll direction which is taking axis. So axis class provide some constants like horizontal and vertical. So byte part it is vertical if you use horizontal you can see the orientation has been changed. And if you are using it with the horizontal you must have to specify this list view inside a container let's wrap it into some container we should have some specific height let's give it some height of hundred and since we are using a container without color we should not use this we should use icebox just save it and you can see now it is scrollable instead of showing this text you can either show it images and some ads or something else as well. So another way we already have a predefined widget named that is named list type. So this widget you can use which is predefined by a material and you can use the title here and you can pass this widget over here since everything is static just use this const and since we have changed the orientation let's close this and make it back to vertical which is byte part so I just comment it and I just quickly restart it and all done. So you can see the first and one more thing here since we have defined the height so I just remove this size box so that I can consume much space let's remove save it and you can see this is a list view whose first item is coming from this list type same way you can use other as well like arm and you can remove this so if you have this kind of data then you should use this predefined list view like you can add some icon as well but if you have some you know if you have some other kind of data like you want to display some image or other widget then you can take a container and customize it accordingly. Okay that was about a static list view now we will be going with the dynamic list view so dynamic list view is most of the time useful like we are getting data from some database or an API or something else so for creating that list view let's define our data first I just create a final list of spring type that is names equal to I just give some names here let's say Ram, Ram, Meena, Pooja, Meena, Chia, Dya, semicolon and so since we are not using now constant so we are using some other variables as well so let's save it with this now I just remove all this thing from here to the last and this child would be a dynamic list view and to create a dynamic list view we have to use list view dot builder and I just put semicolon over here so this will take an item builder which is basically a function that is passing to arguments context and index by just use this one you can use an arrow function as well that's all we can use comma now you can see we are still facing some error that means we have to pass some other values to the list view builder instead of using item builder so there is another that is item count so that is number of items you want to display so which we are getting from names dot length so once you have done with this and this you can use comma here and we were missing this scaffolds that's all so just save it now and you can see again you have this dynamic list now you don't need to modify this you can add number of entries just copy this and paste it and you can see your list view is working fine so this is another variation for dynamic list view and one more approach is to let's say if you want a little bar between each item so that you can differentiate with the line so for that instead of using this builder we use separated so everything will remain same instead of using builder we need to use separated and there is one additional data we need to pass that is separated builder this builder is again taking one function that is context and index and from here you need to basically return the separator so for that we already have a divider since the divider is constant let's add const in front of it and just save it and you will be able to see a line between each item of the list view so you might not be able to see here this is because of I'm using emulator once you use it on your mobile you will be able to see it properly and if you want to change the color of that divider we have some properties like color you can explore that let's say I just give it blue just match with the theme so this might not look good but you can explore it whatever you want so that's all for this video if you have any doubt or question do comment in the comment section thank you