Dynamic Keyword

Dynamic Keyword

Dynamic

dynamic is used to declare a dynamic variable that can store any value in it be it string or int.

void main() {
  //dynamic
  dynamic a = 10;

  var b = 20;
  print(b);

  print(a);

  a = '20';
  print(a);

  a = '30.4';
  print(a);

  a = 'jeet';
  print(a);
}