美文网首页
Fullter学习

Fullter学习

作者: 白水灬煮一切 | 来源:发表于2020-08-03 14:23 被阅读0次

 Fullter中文网

1、变量

1> 关键字 var 、dynamic & Object:修饰的变量,类型可以变 

2> final和const 修饰变量则不可变

3>函数 ——> 类型 Function ,返回类型为void,则可以省略

返回类型Object  xxxxx(类型1  参数1,类型2  参数2){   }

bool   isNoble(int atomicNumber) {  return _nobleGases[atomicNumber] != null; }

4> 函数简写:对于只包含一个表达式的函数,可以使用简写语法

bool isNoble (int atomicNumber)=> _nobleGases [ atomicNumber ] != null ;

5> 函数做参数 

var say = (str){ print(str); }; 

say("hi world");  //调用函数

相关文章

网友评论

      本文标题:Fullter学习

      本文链接:https://www.haomeiwen.com/subject/wnmvrktx.html