title: Dart : How to Check if a variable type is String
body: <p>I have this code . The class is generic and when I instantiate it by passing a String Type. The variable becomes a string type. However the statement</p>
  
  <pre><code>if(_val is String){
  }
  </code></pre>
  
  <p>doesnt seem to be true. Any idea why ?</p>
  
  <p>This is the full code:</p>
  
  <pre><code>    class foo&lt;T&gt;{
      T _val;
      QVar()
      {
           //Read the value from preferences
           if(_val is String){
              ... //Does not come in here!!
           }
      }
    }
  
   a   = new foo&lt;String&gt;();
  </code></pre>