title: Is there a Goto function in Dart?
body: <p>Is there a function in Dart which acts as an equivalent to the Goto function, wherein I could transfer the programs control to a specified label.</p>
  
  <p>For example:</p>
  
  <pre><code>var prefs = await SharedPreferences.getInstance();
  if (prefs.getString("TimetableCache") == null || refreshing) {
      var response = await http.get(
      Uri.encodeFull("A website",);
      data = JsonDecoder().convert(response.body);
      try {
          if (response != null) {
              prefs.setString("TimetableCache", response.body);
          }
      } catch (Exception) {
          debugPrint(Exception);
      }
     } else {
  data = prefs.getString("TimetableCache");
  }
  
  if (data != null) {
      try {
         //Cool stuff happens here
      } catch (Exception) {
      prefs.setString("TimetableCache", null);
      }
  }
  </code></pre>
  
  <p>I have an http request and before I want to move on with my 'cool stuff' I have a try catch which sees if anything is in the <code>TimetableCache</code> location of the <code>SharedPreferences</code> of the machine. When it catches the exception I would ideal have a goto method to send it back to the top line again to retry getting the data.</p>
  
  <p>In c# you can use <code>goto refresh;</code>, for example, and the code will then start executing wherever the identifier <code>refresh:</code> is.</p>
  
  <p>Is there a dart version of this?</p>