liutong 2020-01-12
DartPad
https://dart.dev/
https://dart.dev/tools/dartpad
DartPad中文的地址:
https://dartpad.cn
dartpad.cn默认的展示。
void main() { for (int i = 0; i < 5; i++) { print(‘hello ${i + 1}‘); } }
必须要写在入口main中才可以正确的输出
main(){ print("Hello World!"); }
main(){ String name = ‘dart‘; var otherName=‘Dart‘; print(name + otherName); }
main(){ var myNull=null; if(myNull == null){ print(‘use "== null" to check null‘); } var zero = 0; if(zero == 0){ print(‘use "== 0" to check zero‘); } }