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

Support for nullable optional parameters #4

Closed
payam-zahedi opened this issue Aug 22, 2021 · 9 comments
Closed

Support for nullable optional parameters #4

payam-zahedi opened this issue Aug 22, 2021 · 9 comments

Comments

@payam-zahedi
Copy link

After working with this package for a while, I have noticed that the package doesn't support for optional parameters.
I think users will have a better experience if they do not have to submit optional parameters.

@FatulM
Copy link
Contributor

FatulM commented Aug 28, 2021

HI,
One way to implement this is to omit required from nullable arguments in constructors.
What's your opinion ?
@SaeedMasoumi

@SaeedMasoumi
Copy link
Contributor

The generated file will be like from

 const factory State.success({
    required A a,
    required B? b,
  }) = StateSuccess;

to

 const factory State.success({
    required A a,
    B? b,
  }) = StateSuccess;

?
It makes sense to be like the second form

@payam-zahedi
Copy link
Author

 const factory State.success({
    required A a,
    B? b,
  }) = StateSuccess;

Yes, that make sense and has better experience.

@payam-zahedi
Copy link
Author

Does the package also support Optional positional parameters? Something like this?

 void success(bool status, [ String? value]);

@FatulM
Copy link
Contributor

FatulM commented Aug 28, 2021

So, I'll change implementation ASAP
😊

@FatulM
Copy link
Contributor

FatulM commented Aug 28, 2021

Does the package also support Optional positional parameters? Something like this?

 void success(bool status, [ String? value]);

No,
All of parameters are named ...
Is this feature needed ?

@payam-zahedi
Copy link
Author

It's not something I need, but others may need it.

@FatulM
Copy link
Contributor

FatulM commented Aug 29, 2021

Hi,
I've published version 1.9.0 which addresses your issue ...

@payam-zahedi
Copy link
Author

That's awesome @FatulM, we can close this issue now.

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

No branches or pull requests

3 participants