We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi! Sometimes in Flutter I have to pass a widget only if a variable is not null.
Example:
return personImage == null ? null : Avatar(image: personImage);
I would like to suggest a language feature for this. A syntax sugar that exists in other languages is the elvis operator:
return personImage ?: Avatar(image: personImage);
Maybe we can have the elvil operator:
return x 3:) y;
Or the happy operator:
return x :) y;
Or the inverse if null operator:
return x ¿¿ y;
Just kidding! I wonder what could be a great looking syntax...
The text was updated successfully, but these errors were encountered:
Well, I'd hate to have to type that out!
Here's another issue with exactly the same request (x !! y): #361. How about closing this and subscribing there?
x !! y
Sorry, something went wrong.
Ok, sure
No branches or pull requests
Hi! Sometimes in Flutter I have to pass a widget only if a variable is not null.
Example:
I would like to suggest a language feature for this.
A syntax sugar that exists in other languages is the elvis operator:
Maybe we can have the elvil operator:
return x 3:) y;
Or the happy operator:
return x :) y;
Or the inverse if null operator:
return x ¿¿ y;
Just kidding!
I wonder what could be a great looking syntax...
The text was updated successfully, but these errors were encountered: