title: Import from parent directory in Flutter
body: <p>I want to make a couple of complicated widgets in their own files in another folder, which will be imported and configured by a helper script. Here is the file tree: </p>
  
  <pre>
  - lib/
    - constants.dart
    - file1.dart
    - file2.dart
    - main.dart
    - utils.dart
    - utils/
      - complex_widget1.dart
      - complex_widget2.dart
      - complex_widget3.dart
  </pre>
  
  <p>Here is what is in <code>utils.dart</code></p>
  
  <pre><code>import "utils/complex_widget1.dart";
  import "utils/complex_widget2.dart";
  import "utils/complex_widget3.dart";
  
  class Utils {
      final Widget1 widget1;
      final Widget2 widget2;
      final Widget3 widget3;
      final String data_needed_by_widgets;
      Utils (this.data_needed_by_widgets) : 
          widget1 = Widget1(data_needed_by_widgets),
          widget2 = Widget2(data_needed_by_widgets),
          widget3 = Widget3(data_needed_by_widgets);
  }
  </code></pre>
  
  <p>This should work fine. But the problem comes when I want to access <code>constants.dart</code> in my widgets (It holds a bunch of <code>const</code> Strings and other stuff that I use across all my files):</p>
  
  <p><code>utils/complex_widget1.dart</code>: </p>
  
  <pre><code>// Pretend this has actually complicated stuff
  import "constants.dart";  // How do I import this?
  class Widget1 extends StatelessWidget {
      @override
      Widget build (BuildContext context) =&gt; Center (
          child: Text (TITLE_TEXT)  // From constants.dart
      );
  }
  </code></pre>
  
  <p>I can't just import the individual variables from <code>constants.dart</code>, they're all global and there are no classes or functions to pass as arguments. How do I access values from <code>constants.dart</code> from <code>Widget1</code> (or any other <code>complex_widget</code>, for that matter)?</p>