Skip to content

Instantly share code, notes, and snippets.

@marcossevilla
Created February 10, 2021 17:13
Show Gist options
  • Save marcossevilla/6023a648bcb2eb03ed0302ff3f6be784 to your computer and use it in GitHub Desktop.
Save marcossevilla/6023a648bcb2eb03ed0302ff3f6be784 to your computer and use it in GitHub Desktop.
void main() {
final me = Person(21, 'Marcos');
final either = getPersonData(me);
either.fold(
(age) => print('Your age is $age'),
(name) => print('Your name is $name'),
);
}
// Your age is 21
// Your name is Marcos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment