-
Notifications
You must be signed in to change notification settings - Fork 38
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
Margin is different than what I would expect #208
Comments
@bernaferrari This is not the behavior of Flutter, so I think a new widget will have to be created to have this behavior. I am working on a presentation using Mix as a demo to bring |
Flutter barely has the margin concept. If you want a Button with a margin, the official way is Padding(child: Button). |
It does through the |
There is another aspect to this and it is ensuring minimal touch target for the UX. Playing with the margin is one of the simpler implicit ways to ensure that for visually small interactive components eg CheckBox and Radio you can actually ensure that the finger can actually hit it with comfort without affecting the visual size of the widget. From my own experience using margin for layout purposes should be kept as last resort as there always better or more readable alternatives for layout or to achieve spacing. |
I disagree. The minimum touch target is super bad UX that only flutter
does. You won't see in Android, iOS, web, macOS, anywhere.
…On Sat, Jun 8, 2024, 08:47 Harry Sild ***@***.***> wrote:
There is another aspect to this and it is ensuring minimal touch target
for the UX. Playing with the margin is one of the simpler implicit ways to
ensure that for visually small interactive components eg CheckBox and Radio
you can actually ensure that the finger can actually hit it with comfort
without affecting the visual size of the widget. From my own experience
using margin for layout purposes should be kept as last resort as there
always better or more readable alternatives for layout or to achieve
spacing.
—
Reply to this email directly, view it on GitHub
<#208 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACVXFMXXOHKEJPZIWNF5HTZGLVNXAVCNFSM6AAAAABDFAJAFCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJWGAYDENJQG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Eh? Every touch interface makes some sort of affordance to increase touch area for interactables. Otherwise you would be hard pressed to ever hit those 12x12 checkboxes and radios. Or any sort of close button with X icon. Android, |
This shows layout bounds. That does not have to mean that is the extent of the touch area. The menu items on that screenshot function as one big touch area. The left arrow and the magnifying glass "buttons" are the real showcase of having to adjust components to meet the touch area target. Whether it's done by padding/margin, flex components with left or right alignment props or any other way is kind of beside the point, one way or other hoops are being jumped through to hit the minimal touch target. If you are talking about Flutter making use of this crap in many components, then I agree with you. Yet one more example of Flutter team being very clueless or idealistic about scalable layouts. |
Package version
No response
Flutter version
No response
Steps to reproduce
Screen.Recording.2024-02-12.at.13.11.49.mov
Expected results
I expect margin to not be included in the GestureListener, just like the web (
<a href="https://tailwindcss.com/docs" class="text-sky-500 hover:text-sky-600 bg-red-500 m-16">Read the docs →</a>
)Actual results
.
Code sample
Style(margin(16))
The text was updated successfully, but these errors were encountered: