Skip to content

Variables

AlperZM edited this page Oct 13, 2022 · 1 revision
    1. How to declare a variable
      1. var
First `var` and a name and a value... `var name = "Dart";`

"var" : general type decleration variable (int, String, List...)

  • "String" : use for a string variable.
String myStr = "This is a string variable.";
  • int : use for an integer variables.
int myInt = 10;
  • double : use for a floating number.
double myDbl = 3.14;
  • num : can use both int and double.
num myNum = 10; num myNum2 = 3.14;
  • List : use for arrays.
List myList = [1,2,3];
    • iMPORTANT**
List <int></int>[1,2,3]; List ["a","b","c"]; List <dynamic></dynamic>[1,"a",2,"b"];

Also `var name = "Dart"` is equal to `String name = 'Dart'`

Clone this wiki locally