Created
October 24, 2019 22:59
-
-
Save savioserra/ef76b066a7eb60b63ac03404e7f78e54 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() async { | |
Future<String> processamento = processamentoAsyncrono(); | |
print("calculo que nao depende do resultado acima eh executado imediatamente"); | |
String resultado = await processamento; // ele vai esperar nesse ponto! | |
print(resultado); | |
} | |
Future<String> processamentoAsyncrono() { | |
return Future.delayed(Duration(seconds: 5), () => "oi"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment