tutorial_coach_mark
tutorial_coach_mark copied to clipboard
TargetContent child width expands to fill space
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:
With ContentAlign.bottom
, the container sits below the target and takes up the full width: