title: Dart extension function visible only if is in the same file where it is called
body: <p>Let's say I create two files. In first I create an extension function and call it from class in another file.</p>
  
  <p>File <strong>date_extensions.dart</strong>:</p>
  
  <pre class="lang-dart prettyprint-override"><code>import 'package:date_format/date_format.dart';
  
  extension on DateTime {
    String getSQLFriendly() =&gt; formatDate(this, ["yyyy", "-", "MM", "-", "dd", " ", "HH", ":", "mm", ":", "ss"]);
  }
  
  </code></pre>
  
  <p>and file <strong>some_date_class.dart</strong>:</p>
  
  <pre class="lang-dart prettyprint-override"><code>import 'date_extensions.dart';
  
  class SomeClassWithDate{
  
    DateTime dateTime;
  
    SomeClassWithDate(this.dateTime);
  
    toString() =&gt; dateTime.getSQLFriendly();
  
  }
  </code></pre>
  
  <p>Now, I get an error:</p>
  
  <pre><code>lib/test/some_date_class.dart:9:26: Error: The method 'getSQLFriendly' isn't defined for the class 'DateTime'.
   - 'DateTime' is from 'dart:core'.
  Try correcting the name to the name of an existing method, or defining a method named 'getSQLFriendly'.
    toString() =&gt; dateTime.getSQLFriendly();
  </code></pre>
  
  <p>Now, when I put extension function in the same file where I call it, everything works fine. </p>
  
  <p>Is this a bug, a feature or am I doing something wrong? I would like that the latter is the answer. :)</p>