title: In Dart is there a quick way to convert int to double?
body: <p>Very simple issue. I have the useless class:</p>
  
  <pre class="lang-dart prettyprint-override"><code>class Useless{
    double field;
    Useless(this.field);
  }
  </code></pre>
  <p>I then commit the mortal sin and call <code>new Useless(0);</code>
  In checked mode (which is how I run my tests) that blows up, because <em>'int' is not a subtype of type 'double'</em>.</p>
  <p>Now, it works if I use <code>new Useless(0.0)</code> , but honestly I spend a lot of time correcting my tests putting .0s everywhere and I feel pretty dumb doing that.</p>
  <p>As a temporary measure I rewrote the constructor as:</p>
  <pre class="lang-dart prettyprint-override"><code>    class Useless{
        double field;
        Useless(num input){
            field = input.toDouble();
        }
      }
  </code></pre>
  <p>But that's ugly and I am afraid slow if called often. Is there a better way to do this?</p>