title: Is there a way in Dart to mark a function as throwing an exception?
body: <p>I was trying to find a way in Flutter/Dart to mark a function that may throw an exception during its execution. After some time searching in the documentation and Google I did not find any way of doing this.</p>
  
  <p>In other language, for example Swift, Java, Kotlin, etc I know we have such mechanism.
  Sample code in Swift is:</p>
  
  <pre><code>func doSomething() throws { ... }
  </code></pre>
  
  <p>Does anyone know if this exists in Dart?
  I think it will be useful.</p>
  
  <p>If it does not exist due to Dart language desing then maybe anyone can explain the reason behind this decision.</p>
  
  <p>Thanks in advance!</p>