List<int> emptyList = [];
final list = ['one', 'two', 'three'];
for (var i = 0; i < list.length; i++) {
print('${list[i]}');
}
for (var item in list) {
print('$item');
}
list.forEach((element) {
print('$element');
});
list.add('four');
list.insert(1, '1');
list.removeAt(1);
list.removeLast();
int length = list.length;
var last = list.last;
var first = list.first;
bool isContains = list.contains('one');
bool isEmpty = list.isEmpty;
bool isNotEmpty = list.isNotEmpty;
Map map = {};
map['0'] = 'zero';
map['1'] = 'one';
map.forEach((key, value) {
print('key = $key : value = $value');
});
bool isEmpty = map.isEmpty;
List keys = map.keys.toList();
List value = map.values.toList();
bool isContainsKey = map.containsKey('1');
map.remove('1');
Set set = {'one'};
set.add('two');
set.remove('one');
bool isContains = set.contains('one');
//字符串转浮点数整数
double oneDouble = double.parse('1.1');
int twoInt = int.parse('2');
//浮点数整数转字符串
String oneStr = oneDouble.toString();
String twoStr = twoInt.toString();
//获取最大值 最小值
int maxNum = max(1, 2);
int minNum = min(1, 2);
//获取数组的最大值
int max = [1,2,3,4,5].reduce(max);
//求绝对值
int num = (-1).abs();
//取余数
print(oneDouble % twoInt);
//除法
print(oneDouble / twoInt);
//整除
print(oneDouble ~/ twoInt);
}