Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add const constructor to None and getOrNull to Option #9

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

eEQK
Copy link

@eEQK eEQK commented May 11, 2022

This PR consists of 2 commits:

  1. Add const constructor to None

Allows for specifying None as default constructor parameter:

class Foo {
  Foo({
    Option<String> param = const None(),
  });
}
  1. Add getOrNull method to Option

This one's pretty self-explanatory, as seen in tests:

/// getOrNull
expect(a.getOrNull(), null);
expect(b.getOrNull(), 2);

@eEQK
Copy link
Author

eEQK commented Sep 3, 2022

Hey @cbyad, is there anything missing? any chance you could merge or reject this PR? Thanks in advance 🥰

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant