In this article we are going to implement and manage snackbars using dart in flutter.


We are first going to check if the list is empty or not. If its True then we are just going to implement a Text() widget and return some text mesages. Then we will call it in mainbody.




Now we will modify the removeExpense method as declared in the onRemoveExpense parameter. Using ScaffoldMessenger and SnackBar widget we will make sure that after removing the item from list it asks for an option if we want to ' undo ' the operation or not. 



If we undo the operation by tapping the Undo button in the app as shown in fig. We can get back the itemlist back in position and in the same index position.




So , finally showing the and managing the snackBars are successfully implemented. 


Final Thoughts
I hope you find this article helpful and worth it.  Feel free to share it with your developer friend.
Happy Coding 🙌