Var Data Type in Dart Programming - A Dynamic Data Type
Hello everyone!
Today I am here to share with you an interesting datatype used in dart. That is a dynamic datatype which can hold any type of value whether that is an integer, double, string, list, hasp map values.

It is used when you are not certain about the data. It can hold any value that is stored in it. It is very useful in the dart programming language. We know that we cannot store an double value in an integer variable or a string variable. But the plus point of the var datatype is that we can store any kind of value in it.

Here you can see I have set a double value to an integer variable but it is showing an error because the integer variable cannot hold a double value. Similarly the double is unable to hold string value.

Here I have shown the usage of the var datatype. You can see that the var datatype is able to hold all types of variable whether they are integer, double, string, list and key value pairs.

It gives completely accurate and exact results. I have tried to get the sum of these two numbers where one is an integer and the other is a double value. Generally the sum of these two numbers become a double value. The var datatype has managed everything dynamically and correctly.

On the other hand if I declare each value with respect to their datatype and then I try to store the sum in the integer then it gives an error but requires to store the sum in a double variable because the sum will become a double value. So in order to avoid this problem in the dynamic data we can use var datatype variables which make the working easy and error free.
https://www.linkedin.com/posts/muhammad-faisal-302836175_var-data-type-in-dart-programming-a-dynamic-activity-7416771962007437312-YoQ9?utm_source=share&utm_medium=member_desktop&rcm=ACoAACmXjTIBdKRkcnEw33ikfBkAnm9bSKMmQHk
🎉 Congratulations!
Your post has been manually upvoted by the SteemX Team! 🚀
SteemX is a modern, user-friendly and powerful platform built for the Steem ecosystem.
🔗 Visit us: www.steemx.org
✅ Support our work — Vote for our witness: bountyking5