mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-21 23:10: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,20 +50,30 @@ 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
|
||||||
value.toString(),
|
? AutoSizeText(
|
||||||
stepGranularity: 0.5,
|
value.toString(),
|
||||||
style: labelTextStyle(context).copyWith(color: Theme.of(context).colorScheme.onBackground),
|
stepGranularity: 0.5,
|
||||||
softWrap: false,
|
minFontSize: 10,
|
||||||
overflow: TextOverflow.fade,
|
style: labelTextStyle(context).copyWith(color: Theme.of(context).colorScheme.onBackground),
|
||||||
maxLines: 1,
|
softWrap: false,
|
||||||
),
|
overflow: TextOverflow.fade,
|
||||||
|
maxLines: 1,
|
||||||
|
)
|
||||||
|
: Text(
|
||||||
|
value.toString(),
|
||||||
|
style: labelTextStyle(context).copyWith(color: Theme.of(context).colorScheme.onBackground),
|
||||||
|
softWrap: false,
|
||||||
|
overflow: TextOverflow.fade,
|
||||||
|
maxLines: 1,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue