## Dart编程实例 - 导入和使用库```dartimport dart:math;void main() { print(Square root of 36 is: ${sqrt(36)});}```
## Dart编程实例 - 封装错误```dartlibrary loggerlib; void _log(msg) { print(Log method called in loggerlib msg:$msg); }```
## Dart编程实例 - 异步```dartimport dart:io;void main() { print(Enter your name :); // prompt for user input String name = stdin.readLineSync(); // this i
## Dart编程实例 - 同步```dartimport dart:isolate; void foo(var message){ print(execution from foo ... the message is :${message});} void main(){ Isolate.spawn(foo,Hello
## Dart编程实例 - 条件表达式```dartvoid main() { var a = 10; var res = a 12 ? value greater than 10:value lesser than or equal to 10; print(res);}```
## Dart编程实例 - null值```dartvoid main() { int num; print(num);}```
## Dart编程实例 - 位运算符```dartvoid main() { var a = 2; // Bit presentation 10 var b = 3; // Bit presentation 11 var result = (a b); print((a b) = ${result});
## Dart编程实例 - 更新一个列表```dartvoid main() { List l = [1, 2, 3,4,5,6,7,8,9]; print(The value of list before replacing ${l}); l.replaceRange(0,3,[11,23,24]); print(The