title: Creating a Non-Instantiable, Non-Extendable Class
body: <p>I want to make a class to group some <code>static const</code> values. </p>
  
  <pre class="lang-dart prettyprint-override"><code>// SomeClass.dart
  class SomeClass {
    static const SOME_CONST = 'some value';
  }
  </code></pre>
  
  <p>What is the idiomatic way in dart to prevent dependent code from instantiating this class? I would also like to prevent extension to this class. In <code>Java</code> I would do the following:</p>
  
  <pre class="lang-java prettyprint-override"><code>// SomeClass.java
  public final class SomeClass {
      private SomeClass () {}
      public static final String SOME_CONST = 'some value';
  }
  </code></pre>
  
  <p>So far all I can think of is throwing an <code>Exception</code>, but I'd like to have compile safety as opposed to halting code in run-time.</p>
  
  <pre class="lang-dart prettyprint-override"><code>class SomeClass {
    SomeClass() {
      throw new Exception("Instantiation of consts class not permitted");
    }
    ...
  </code></pre>