If you want to add auto scale down a font in a Text widget to fit the max number of lines? An easy drop-in solution is to use FittedBox with fit: BoxFit.scaleDown:
1 2 3 4 5 6 7 8 9 10 | Container( width: 100.0, child: FittedBox( fit: BoxFit.scaleDown, // Optionally apply `alignment` to position the text inside the box: //alignment: Alignment.topRight, child: SizedBox( child: Text('\$1,299.99'), ) ) |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.