前言
终有一天,学习变得很慢,坚持变得很难。希望心底的那团火能让你浴火重生。觉醒吧,不屈的少年!前面星辰大海,前面是诗和远方!
环境
Dart因Flutter而生,自然也伴随Flutter一路。安装好Flutter环境后,便可开始学习Dart之旅。
// ethan@B85MK:~/Flutter/Dart$ cat hello_world.dart
var name = 'I am nobody.';
void main() {
print('Hello,World!');
print( name );
}
ethan@B85MK:~/Flutter/Dart$ dart run hello_world.dart
Hello,World!
I am nobody.
杂记
shorthand arrow
举例
int sum_traditional(int x, int y) {
return x + y;
}
int sum_shorthand_arrow(int x, int y) => x + y;
void main() {
print('traditional : 1 + 1 = ' + sum_traditional(1, 1).toString());
print(&#
|