Skip to content

Instantly share code, notes, and snippets.

@marcossevilla
Created February 10, 2021 17:13
Show Gist options
  • Save marcossevilla/aaf9f65426a146623bf0ea7a94ab1eae to your computer and use it in GitHub Desktop.
Save marcossevilla/aaf9f65426a146623bf0ea7a94ab1eae to your computer and use it in GitHub Desktop.
Either<int, String> getPersonData(Person person) {
final returnName = Random().nextBool();
if (returnName) {
return Right(person.name);
} else {
return Left(person.age);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment