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

FlatButton introduces phantom padding #3678

Closed
DaveShuckerow opened this issue May 2, 2016 · 7 comments
Closed

FlatButton introduces phantom padding #3678

DaveShuckerow opened this issue May 2, 2016 · 7 comments
Assignees
Labels
c: API break Backwards-incompatible API changes d: api docs Issues with https://api.flutter.dev/ framework flutter/packages/flutter repository. See also f: labels.

Comments

@DaveShuckerow
Copy link
Contributor

DaveShuckerow commented May 2, 2016

Problem

I've built a card that highlights the 3 most- and least-exemplary leaves in the leafy app, which consists of showing the leaf's name and the leaf's value. This works very nicely -- I have a short list of Rows with a left- and right-aligned pair of text views for the leaf name and leaf value.

However, when I added support for clicking into the leaf to see details on its value, the FlatButton I wrapped each row in padded the row, which breaks the nice alignment I had.

My ask

A way to give a Widget an onPressed event without Flutter padding it.

@Hixie
Copy link
Contributor

Hixie commented May 2, 2016

You want to use InkWell rather than FlatButton.

@Hixie
Copy link
Contributor

Hixie commented May 2, 2016

(Leaving this open to see if there's a way we can make that more obvious in the code, maybe limiting FlatButton to Text or something. See also #3681 for docs clarification.)

@DaveShuckerow
Copy link
Contributor Author

InkWell works excellently for this, thanks!

I think it would be more obvious if the Widget's name included "Button" in it. My decision process for figuring out what widget to use for my use case was to look up everything with Button in its name in Flutter's material library.

@Hixie Hixie modified the milestone: Flutter 1.0 May 20, 2016
@Hixie Hixie modified the milestones: 2: Make Early Adopters happy, 5: Make Hixie proud Jan 28, 2017
@Hixie Hixie added the c: API break Backwards-incompatible API changes label Jan 28, 2017
@Hixie
Copy link
Contributor

Hixie commented Jan 28, 2017

Moving this to API stability so we can make a determination of what to do. It might just be docs improvements and/or no change, though.

@Hixie Hixie added the framework flutter/packages/flutter repository. See also f: labels. label Mar 9, 2017
@sethladd sethladd added d: api docs Issues with https://api.flutter.dev/ and removed dev: docs labels Mar 10, 2017
@abarth abarth self-assigned this Mar 14, 2017
@abarth
Copy link
Contributor

abarth commented Mar 14, 2017

IMHO, the solution here is to improve the button docs to point to InkWell and GestureDetector for these use cases.

@abarth
Copy link
Contributor

abarth commented Mar 14, 2017

Looks like we have these docs now.

@abarth abarth closed this as completed Mar 14, 2017
@github-actions
Copy link

github-actions bot commented Sep 5, 2021

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 flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: API break Backwards-incompatible API changes d: api docs Issues with https://api.flutter.dev/ framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

No branches or pull requests

5 participants