material-components / material-components-flutter-codelabs

Codelabs for Material Components for Flutter
212 stars 244 forks source link

Inaccurate explanation of the "onPressed" parameter #290

Closed tatsuyafujisaki closed 10 months ago

tatsuyafujisaki commented 11 months ago

https://codelabs.developers.google.com/codelabs/mdc-101-flutter#4

If we passed null, or didn't include the field (which then defaults to null), the buttons would become disabled.

Please consider replacing the above sentence with the following.

If we passed null, the buttons would become disabled.

Because if you don't include the onPressed field, you will get the following error and you won't even see the button disabled.

The named parameter 'onPressed' is required, but there's no corresponding argument.
guidezpl commented 10 months ago

Good idea, will be updated soon.