需求:使用forEach打印下面List里面的数据,分别使用普通写法和Dart箭头函数的写法
 List list=['苹果','香蕉','西瓜'];
 list.forEach((value){
	  print(value);
 });
 
 list.forEach((value)=>print(value));  //dart箭头函数
 
 list.forEach((value)=>{  //dart箭头函数
    print(value)
  });
注意和方法的区别: 箭头函数内只能写一条语句,并且语句后面没有分号(;)
需求:修改下面List里面的数据,让数组中大于2的值乘以2
方法1:
  List list=[4,1,2,3,4];
  var newList=list.map((value){
      if(value>2){
        return value*2;
      }
      return value;
  });
  
  print(newList.toList());
  
  
  
方法二:使用dart中的箭头函数
  List list=[4,1,2,3,4];
  var newList=list.map((value)=>value>2?value*2:value);
  print(newList.toList());