title: Understanding Dart private class
body: <p>In Flutter we commonly have something like this:</p>
  
  <pre><code>class MyStatefulWidget extends StatefulWidget {
    @override
    _MyState createState() =&gt; _MyState();
  }
  
  class _MyState extends State&lt;MyStatefulWidget&gt; {
    void doSomething() =&gt; print('hi');
  
    @override
    Widget build(BuildContext context) {
      return Container();
    }
  }
  </code></pre>
  
  <p>So <code>_MyState</code> is declared with a <code>_</code>, which makes it library private.</p>
  
  <p><strong>So how come the Flutter render engine can use <code>_MySate</code> if it's sopposed to be private?</strong></p>
  
  <p>It's funny because I can access <code>doSomething()</code> from other files, but if I make it <code>_doSomething()</code>, I can't access it anymore...So how come I can access a public method from a private class, but I can't access a private method from a private class?</p>