var const final
num:int 和 double extends num
String:单引号或者双引号创建字符串
三引号或者双引号创建多行字符串
r 原始raw字符串
List:
var list = [1,2,3];
var list = const[1,2,3];
var list = new List();
Map:
var language = {'first':'Dart', 'second':'Java'};
var language = const{'first':'Dart', 'second':'Java'};
var language = new Map();
dynamic:
赋值运算符: ??=
int a = 10;
int b;
b ?? = 10;//b如果是空的,那就b就是10,b不空就用原来的值
//现在b是10
b ?? = 100;
//现在b还是10
网友评论