main() {
/*
Future objetoFuturo = Future(() {
print('Tal coisa');
return 22;
}).then((value) => print(value));
*/
chatFunction();
}
Future chatFunction() async {
try {
//throw Exception();
print('João: Bom dia, grupo!');
await Future.delayed(Duration(seconds: 2));
print('Mariana: Bom dia! Tudo bem?');
await Future.delayed(Duration(seconds: 2));
print('João: Suave, e vc?');
await Future.delayed(Duration(seconds: 1));
print('Mariana: Certinho.');
} on Exception catch (e, s) {
print('Ocorreu um erro: $e');
print('StackTrace: $s');
} finally {
print('Acabou');
}
}