mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-21 15:00:40 +00:00
downsize text only for long values
This commit is contained in:
parent
6ee6c81164
commit
e8785b234a
1 changed files with 19 additions and 9 deletions
|
@ -50,15 +50,25 @@ class ExposurePairsListItem<T extends PhotographyStopValue> extends StatelessWid
|
||||||
|
|
||||||
class _Title<T extends PhotographyStopValue> extends StatelessWidget {
|
class _Title<T extends PhotographyStopValue> extends StatelessWidget {
|
||||||
final T value;
|
final T value;
|
||||||
|
late final String _title = value.toString();
|
||||||
|
|
||||||
const _Title(this.value, {super.key});
|
_Title(this.value, {super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Flexible(
|
return Flexible(
|
||||||
child: AutoSizeText(
|
child: _title.length > 5 // downsize text only for long values like 1/4000
|
||||||
|
? AutoSizeText(
|
||||||
value.toString(),
|
value.toString(),
|
||||||
stepGranularity: 0.5,
|
stepGranularity: 0.5,
|
||||||
|
minFontSize: 10,
|
||||||
|
style: labelTextStyle(context).copyWith(color: Theme.of(context).colorScheme.onBackground),
|
||||||
|
softWrap: false,
|
||||||
|
overflow: TextOverflow.fade,
|
||||||
|
maxLines: 1,
|
||||||
|
)
|
||||||
|
: Text(
|
||||||
|
value.toString(),
|
||||||
style: labelTextStyle(context).copyWith(color: Theme.of(context).colorScheme.onBackground),
|
style: labelTextStyle(context).copyWith(color: Theme.of(context).colorScheme.onBackground),
|
||||||
softWrap: false,
|
softWrap: false,
|
||||||
overflow: TextOverflow.fade,
|
overflow: TextOverflow.fade,
|
||||||
|
|
Loading…
Reference in a new issue