skip to Main Content

I am using a Gridview inside that gridview i am using Column and Some text after that a Row for some buttons but i want the alignment from left side of button and text would be same so it looks nice UI but row is giving unusual space from left so it does match the text alignment and buttons looks uneven

i tried expanded and stack but that space is still there and the alignment from left is not matching enter image description here

2

Answers


  1. Instead of using a Column and Row widget, I assume you can just use the GridView class to create the UI you want (which is 2 columns and n rows). You would set the crossAxisCount to 2. Check this link to read more.

    Also, making a custom widget for the fruit options might make it easier for the UI to look more consistent.

    Furthermore, you have pixels overflowing. Please share the specific error message and your code if possible.

    Login or Signup to reply.
  2. Since you haven’t shared any code I can only guess.

    I assume you are using a Button widget. These widgets come with minimum touch target sizes, which likely is the reason why you are experiencing the undesired space to the left.

    If you want to remove this touch target you can update the MaterialTapTargetSize (docs here) from using .padded to .shrinkWrap.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search