Skip to content

Instantly share code, notes, and snippets.

@nsmirosh
Last active August 14, 2020 16:25
Show Gist options
  • Select an option

  • Save nsmirosh/0e2e308b3e963d3e3397c9e83cb0d298 to your computer and use it in GitHub Desktop.

Select an option

Save nsmirosh/0e2e308b3e963d3e3397c9e83cb0d298 to your computer and use it in GitHub Desktop.
Dart's asynchronous Future callback demonstration
void main() {
print('print statement before invoking the future');
Future.delayed(Duration(seconds: 2), () {
print('Future completed!');
return 12;
});
print('print statement after invoking the future');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment