一, 变量声明
note: 变量的声明必须使用 ‘const’, ‘final’, ‘var’ 或者 其他type name
a = 123 //error
1. var
1.1 与swift的var相同, 类型一旦确定, 不能再修改
1.2 当var声明一个变量后, Dart在编译时会根据第一次赋值数据的类型来推断其类型,编译结束后其类型就已经被确定
var a = 1000;
a = 'aaaaa'; /**Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.