title: Dart - Need explanation of library/part and import/export
body: <p>Yes, I read <a href="https://stackoverflow.com/questions/17238279/dart-import-and-part-of-directives-in-same-file">dart import and part of directives in same file</a></p>
  
  <p>I have this structure:</p>
  
  <ul>
  <li>lib/
  
  <ul>
  <li>src/
  
  <ul>
  <li>one/
  
  <ul>
  <li>SomeClass.dart</li>
  <li>one.dart</li>
  </ul></li>
  </ul></li>
  <li>mylib.dart</li>
  </ul></li>
  <li>main.dart</li>
  </ul>
  
  <p>I'm trying to achieve this behavior:</p>
  
  <ol>
  <li>All public and hidden variables are fully accessible inside library.</li>
  <li>All public variables from library are accessible to main.dart.</li>
  </ol>
  
  <p>There is a problem. For some weird reason I can't use any directive with 'part of'. So I can't use this in the <code>one.dart</code>:</p>
  
  <pre><code>part of mylib;
  import 'SomeClass.dart';
  
  //somecode
  </code></pre>
  
  <p>So I either need to move class definition from <code>SomeClass.dart</code> to <code>one.dart</code> (and that will make code less readable and mixed up) or I need to move 'import' in the <code>mylib.dart</code>.</p>
  
  <pre><code>library mylib;
  import 'SomeClass.dart';
  part ..
  </code></pre>
  
  <p>I don't like either of the options. In the second case I will need to parse all modules then and move import/exports. Which will definitely break something.</p>
  
  <p>It may sound weird but the project will build from various modules automatically. And <code>one/</code> is one of them.</p>
  
  <p>This app design is bad, I know. But either I need to find a better way or just make all variables public and don't bother.</p>