title: How to safely unwrap optional variables in dart?
body: <p>I couldn't find a way to safely unwrap an optional variable as we do in swift</p>
  <pre><code>var myString: String?
  if let myString = myString {
    print(myString) // myString is a string
  }
  </code></pre>
  <p>or in Kotlin</p>
  <pre><code>var myString: String?
  if (myString != null) {
     print(myString) // myString is not null
  }
  
  // or
  myString?.let {
     print(it) // myString is not null
  }
  </code></pre>
  <p>In Dart I'm having to do the following, which doesn't look good:</p>
  <pre><code>String? myString;
  if (myString != null) {
     print(myString); // myString still an optional
     print(myString!); // myString is now a String! (because of the force unwrap)
  }
  </code></pre>
  <p>Is there a way to safely unwrap in a clean way like other null-safety languages? Or we have to always force unwrap variables after a null-check?</p>