Open DaemonInc opened 3 years ago
Steps to Reproduce Text is not resizing when it is only a single character.
Code sample
LayoutBuilder( builder: (context, constraints) { return Container( padding: EdgeInsets.symmetric( vertical: 0.05 * constraints.biggest.height, horizontal: 0.08 * constraints.biggest.width, ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.end, children: [ Expanded( child: Container( color: Colors.blue, child: Align( alignment: Alignment.center, child: AutoSizeText( "W", style: Theme.of(context).textTheme.bodyText2.copyWith(fontSize: 30.0.sp, fontWeight: FontWeight.normal), textAlign: TextAlign.center, minFontSize: 1, maxLines: 1, wrapWords: false, softWrap: false, ), ), ), ), Container( color: Colors.red, alignment: Alignment.bottomRight, height: constraints.biggest.height * 0.35, child: AutoSizeText( "10", textAlign: TextAlign.end, minFontSize: 3.0.sp, style: theme.textTheme.bodyText2.copyWith(fontSize: 30.0.sp, fontWeight: FontWeight.normal), wrapWords: false, softWrap: false, overflow: false, ), ), ], ), ); }, )
Screenshots
Version
Same issue here, the issue is because textPainter.didExceedMaxLines always return true for single character.
textPainter.didExceedMaxLines
Steps to Reproduce Text is not resizing when it is only a single character.
Code sample
Screenshots
Version