title: Dart switch statement - Case expressions must be constant
body: <p>I looked at a few questions regarding this for other languages and some suggest using <code>final</code> but that doesn't seem to work with Dart.</p>
  
  <p>I'm passing in arguments so surely the switch statement cannot contain constants only? A switch statement, much like an if statement is asking <em>if</em> it is or not..ie it's unknown so I don't see how a switch statement can be useful if they have to be constants...?</p>
  
  <pre><code>  setCategory(arga, argb) {
      int result;
      switch (true) {
        case (arga &gt;= 0 &amp;&amp; arga &lt; 3 &amp;&amp; argb &lt; 35):
          result = 16;
          break;
        case (arga &gt;= 0 &amp;&amp; arga &lt; 3 &amp;&amp; argb &gt;= 35):
          result = 15;
          break;
          etc
  </code></pre>
  
  <p>It's returning the error <code>Case expressions must be constant</code> regarding the values arga and argb in the case expressions. What's the best way to remedy this or do I have to use an if statement?</p>