Flutter Tutorial - Create Dismissible ListView

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
this is flutter Basics from the flutter Guys YouTube channel the dismissable widget is an essential component when building lists in a flutter app this widget enables users to dismiss items from a list by swiping them horizontally a typical use case for the flutter dismissable is an email or chat applications where users can quickly swipe away messages or emails they don't need we will make a basic list view where the item can be dismissed the first step is to define the list items so I Define a list of string called items with test values the next step is to create a list view builder in the body now here first I set the item count value equal to the item's length that we defined above also using padding I create space from the top and bottom vertically in the item Builder we must return the dismissable widget this widget has two required parameters named key and child without keys the default behavior is to sync widgets based on their index in the list which means the item after the dismissed item would be synced with the state of the dismissed item using keys causes the widgets to sync according to their keys and avoids this Pitfall therefore we can set its value using value key like this also I put container in the child argument and set items text in the center dismissable has an argument called background that is stacked behind the child if secondary background is also specified then this widget only appears when the child has been dragged down or to the right for example I set a red container with delete text in the background and a blue container with save text in the secondary background the dismissable widget has a method called confirm dismiss in this method we can specify what to do when it is dragged to the left or right for example we Define a condition that if it is dragged to the right a dialog will be displayed otherwise if it is dragged to the left this dialog will be displayed now if we click on yes the item will disappear and finally when the item is dismissed we must remove that item from the list we defined above for this we can use the on dismiss method in this method we can determine what to do when it is dragged to the left or right because we want to remove from the list in any case so we do not Define a condition and remove from the list like this and make the sure hit the Subscribe button to get next video [Music]
Info
Channel: Flutter Guys
Views: 3,134
Rating: undefined out of 5
Keywords: flutter tutorial, flutter widgets, flutter for beginners, learn flutter, flutter listview, flutter listview builder, flutter swipe cards, flutter dismissible, dart, flutter list, flutter learning roadmap, flutter learning, kotlin tutorial, kotlin android tutorial, kotlin full course, android app development, android development full course, ios development, ios development tutorial for beginners, swift tutorial, learn swift, learn react native, programming, coding
Id: bblJC7nkkTM
Channel Id: undefined
Length: 2min 31sec (151 seconds)
Published: Mon Jul 10 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.