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

TargetContent child width expands to fill space #186

Open
adamkoch opened this issue May 30, 2024 · 0 comments
Open

TargetContent child width expands to fill space #186

adamkoch opened this issue May 30, 2024 · 0 comments

Comments

@adamkoch
Copy link

Not sure if I'm doing something wrong, but I found that all my TargetContent widgets expand to fill the remaining width regardless of what width I set (using say, SizedBox() or Container()). I believe it may have something to do with the fact the tutorial is in an Overlay but I'm not sure.

This is not really noticeable on small screen / mobile devices but once you go to desktop web or ipad/tablet it's noticeable because any text will just be in one long line with no way to limit the width and have the text wrap. Interestingly, setting the height is totally fine and works without issue.

My TargetContent test just looks like this:

TargetContent(
  align: contentAlign,
  child: Container(
    width: 200,
    height: 200,
    color: Colors.red,
  ),
),

With ContentAlign.right, the container sits next to the target and expands right to fill the remaining space:
Simulator Screenshot - iPad Air 11-inch (M2) - 2024-05-30 at 16 57 22

With ContentAlign.bottom, the container sits below the target and takes up the full width:
Simulator Screenshot - iPad Air 11-inch (M2) - 2024-05-30 at 16 57 29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant