수색…


통사론

  • // 한 줄 주석
  • / * 여러 줄 / 인라인 주석 * /
  • /// Dartdoc 주석

비고

코드에 주석을 추가하여 무언가가 수행 된 이유를 설명하거나 무언가가 무엇인지 설명하는 것이 좋습니다. 이렇게하면 향후 독자가 코드를 더 쉽게 이해할 수 있습니다.

StackOverflow에없는 관련 주제 :

행의 끝 Comment

// 같은 줄에있는 // 의 오른쪽에있는 모든 것은 주석 처리됩니다.

int i = 0; // Commented out text

여러 줄 주석

/**/ 사이의 모든 것은 주석 처리됩니다.

void main() {
  for (int i = 0; i < 5; i++) {
    /* This is commented, and
    will not affect code */
    print('hello ${i + 1}');
  }   
}

Dartdoc을 사용하는 문서

dartdoc 은 일반적인 주석 대신에 문서 주석을 사용하여 문서를 찾고 문서를 생성 할 수 있습니다.

/// The number of characters in this chunk when unsplit.
int get length => ...

당신은 문서 주석에서 대부분의 markdown 형식을 사용할 수 있습니다. 그리고 dartdoc은 markdown 패키지를 사용하여 그것을 적절하게 처리 할 것입니다.

/// This is a paragraph of regular text.
///
/// This sentence has *two* _emphasized_ words (i.e. italics) and **two**
/// __strong__ ones (bold).
///
/// A blank line creates another separate paragraph. It has some `inline code`
/// delimited using backticks.
///
/// * Unordered lists.
/// * Look like ASCII bullet lists.
/// * You can also use `-` or `+`.
///
/// Links can be:
///
/// * http://www.just-a-bare-url.com
/// * [with the URL inline](http://google.com)
/// * [or separated out][ref link]
///
/// [ref link]: http://google.com
///
/// # A Header
///
/// ## A subheader


Modified text is an extract of the original Stack Overflow Documentation
아래 라이선스 CC BY-SA 3.0
와 제휴하지 않음 Stack Overflow