Skip to content
0:00 / 0:00

#dart#flutter#const

const, final, dynamic, var... when and why? | Dart & Flutter tutorial

David Serrano

6.1K subscribers • 3 videos on Hallway

YouTube
  • Recommended by 1 person: 1 in engineering communities.
  • Presented by David Serrano

Beginner. No background in the topic needed.

3.1K views4 years ago1 recommendation

Programming languagesLanguage design and type systems

David Serrano explains the differences between const, final, dynamic, and var in Dart and when to use each.

One of the first things explained in most tutorials is the declaration of variables. In Dart, you could declare those with const, final, dynamic, var, and by using the type itself; but what are their differences and when should we use each one? In this video I'll try to define each of them and give you some tips to know which one to use depending on the context. 🔔 Subscribe to my channel to see more videos like this: youtube.com/channel/UCnpRX7bDrgOajeuhlgJ3wyA?sub_confirmatio… 📖 Useful resources: - "Flutter: Performance analysis of `const` constructor" by Crizant Lai: medium.com/nerd-for-tech/flutter-performance-analysis-of-con… - Dart language tour: dart.dev/guides/language/language-tour 🔤 Text version of the video: davidserrano.io/const-final-dynamic-var-when-and-why-dart-fl… 🔵 Follow me for more content like this: davidserrano.io/ twitter.com/svprdga hashnode.com/@svprdga dev.to/svprdga mastodon.social/@svprdga ⏳ Timecodes: - Introduction - var - dynamic - final - const - const in the context of Flutter - Final words

Why it's here

1 person recommends this

What people say. Recommended as a clear explanation of variable declaration keywords in Dart.

u/svprdgain r/FlutterDev • Recommends

const, final, dynamic, var... when and why?