Skip to content

Instantly share code, notes, and snippets.

@felipecastrosales
Created April 27, 2022 01:27
Show Gist options
  • Save felipecastrosales/16cfebd84b5de83d1d0831bdad98e711 to your computer and use it in GitHub Desktop.
Save felipecastrosales/16cfebd84b5de83d1d0831bdad98e711 to your computer and use it in GitHub Desktop.
Resolving exercise
String addHello(String user) => 'Hello $user';
Future<String> greetUser() async {
var username = await fetchUsername();
return addHello(username);
}
Future<String> sayGoodbye() async {
try {
var result = await logoutUser();
return '$result Thanks, see you next time';
} catch (e) {
return 'User have error $e';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment