Dart by Example: Comments

Dartdoc parses comments starting with ///.Multiple-line comments and single-line comments use / / and //, respectively

  1. /// Represents a two-dimensional position
  2. /// has [x] and [y] properties
  3. ///
  4. /// example code can be defined using a four-space indent:
  5. ///
  6. /// var p = new Position();
  7. ///
  8. class Position {
  9. /*
  10. multi-line comments
  11. */
  12. int x;
  13. // A regular comment
  14. int y;
  15. }
  16. main() {
  17. print(new Position().runtimeType);
  18. }
  19.  
  1. $ dart comments.dart
  2. Position

by @jryanio | source | license