Skip to content

Instantly share code, notes, and snippets.

@douglasiacovelli
Created November 5, 2020 19:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save douglasiacovelli/0ff25e5f34a45f7fced4ef82e0edd0e4 to your computer and use it in GitHub Desktop.
Save douglasiacovelli/0ff25e5f34a45f7fced4ef82e0edd0e4 to your computer and use it in GitHub Desktop.
class Credentials {
final String givenName;
final String familyName;
Credentials(this.givenName, this.familyName);
}
void main() {
final credentials1 = Credentials('Doug', 'blabla');
final credentials2 = Credentials(null, null);
final firstName1 = credentials1.givenName ?? '';
final firstName2 = credentials2.givenName ?? '';
print('FirstName for credentials1 is: $firstName1');
print('FirstName for credentials2 is: $firstName2');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment