title: How do I use Dart extension functions?
body: <p>Dart 2.6 introduces a new language feature called "<strong><a href="https://github.com/dart-lang/language/blob/master/accepted/2.6/static-extension-members/feature-specification.md" rel="noreferrer">static extension members</a></strong>".<br>
  However, I do not quite understand how to use it.</p>
  
  <p>I would like to easily get the <code>childCount</code> of a <code>Row</code> or <code>Column</code>, i.e. use <code>row.childCount</code> instead of <code>row.children.length</code>:</p>
  
  <pre class="lang-dart prettyprint-override"><code>void main() {
    final row = Row(children: const [Text('one'), Text('two')]), 
        column = Column(children: const [Text('one'), Text('two'), Text('three')]);
  
    print(row.childCount); // Should print "2".
  
    print(column.childCount); // Should print "3".
  }
  </code></pre>
  
  <p>I tried to do the following, but it is a syntax error:</p>
  
  <pre class="lang-dart prettyprint-override"><code>Row.childCount() =&gt; this.children.length;
  
  Column.childCount() =&gt; this.children.length;
  </code></pre>