字符串类型
void main() {
String stri1 = "hello world";
String stri2 = 'hello world';
print(stri2);
print(stri1);
print(stri2+stri1);
}
布尔类型
bool isA = true;
bool isB = false;
print(isA);
print(isB);
${} 连接
print("${stri2+stri1}");
字典:Map,键值对
var dic = {"key":"value","ke2":true};
print(dic);
var dicConst = const {"key1":"value1","key2":"value2"};
print(dicConst);
神奇的简写:下面两个居然是等价的
flybyObjects.forEach((element) {
print(element);
});
flybyObjects.forEach(print);
网友评论