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
MenuItemButton error if child is null #147479
Comments
but it's
|
child cannot be null.
|
Hi @javaone199 |
No compilation error if passing null to child. I am using different types of buttons by checking if icon or text is null. |
This issue is minor and can be closed. |
From VSC, the child parameter is defined as { required Widget? child}. Should it be {required Widget child}? If this is the case, this issue should be re-opened. :) |
Fix #147479 Pre-launch Checklist
Steps to reproduce
MenuItemButton(
onPressed: () {},
leadingIcon: Icon(Icons.any),
child: null,
);
Null check operator used on a null value
Expected results
The child is nullable. If it is null, the MenuItemButton should be the same as IconButton.
Actual results
Null check operator used on a null value
Code sample
Code sample
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
[Paste your logs here]
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: