Container(
width: 200,
color: Colors.blue,
child: FittedBox(
fit: BoxFit.scaleDown,
child: Text(
'hiiiiii',
overflow: TextOverflow.ellipsis,
),
),
),
I have this widget that looks like
But, I want to set it to the beginning of the container like when I do not use FittedBox
widget.
Is there any way that I can use FittedBox's BoxFit.scaleDown
and put the text in the beginning?
CodePudding user response:
Try this
Container(
alignment : Alignment.leftCenter, //add alignment to fitted box
width: 200,
color: Colors.blue,
child: FittedBox(
fit: BoxFit.scaleDown,
child: Text(
'hiiiiii',
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.start //add left align to text content too
),
),
),