-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
RaisedButton not expose MaterialButton's constructor parameters minWidth and height. #62882
Comments
Also found in @HansMuller based on #61664 (comment) do you think it is worth my time to send a PR for this? I'm asking because this widget is one of the widgets being deprecated by thhe New Button Universe PR. flutter doctor -v
|
@pedromassango - that's correct. We'd prefer for developers to use ElevatedButton, whose minimumSize can be overridden like this: ElevatedButton(
style: ElevatedButton.styleFrom(
minimumSize: Size(200, 200),
),
onPressed: () { },
child: Text('Larger'),
), Or for all buttons in an app, like this: MaterialApp(
theme: ThemeData.from(colorScheme: ColorScheme.light()).copyWith(
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
minimumSize: Size(200, 200),
),
),
),
home: ...
) |
I think people would still prefer a single parameter to changer the button width/height because the approach above requires both width and height to be provided. Do you agree with that? |
You don't need to provide both the width and height, e.g.: ElevatedButton(
style: ElevatedButton.styleFrom(
minimumSize: Size.fromWidth(200), // only constrains the button's minimum width
),
onPressed: () { },
child: Text('Larger'),
), |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
It's very common to change RaisedButton's minWidth and height over buttonTheme settings.
Why Flutter team limit this little behavior, forgot it ? It cause UI design being limited.
BTW why named height instead of minHeight ?
THX!
The text was updated successfully, but these errors were encountered: