# dart variables

1 min read, 86 words dartvariable

# Types of variables

  1. top-level, global variables
  2. static
  3. instance, fields of a class
  4. local
static late final int temp = checkTemperature()
  • Number class is minimally named as num

# Differnece b/w final const?

  • constant values != constant variables @compiletime
    • const instance variables are NOT supported
    • use them with static
  • final @runtime

# Explicit Type casting

  • integer.toString()
  • number.parse(34)

# Questions

  • How to correctly declare your variable?

Subscribe to our Newsletter

If you like my work and think it was helpful kindly support my work


Buy Me A Coffee