Gauge font size fix

This commit is contained in:
Yegor Vialov
2020-04-25 14:33:54 +00:00
parent a90eb5c4db
commit 50d3280803
2 changed files with 6 additions and 3 deletions

View File

@ -325,6 +325,7 @@ class CardWidget extends StatelessWidget {
child: GaugeCardBody(
min: card.min,
max: card.max,
depth: card.depth,
severity: card.severity,
),
handleTap: true

View File

@ -5,8 +5,9 @@ class GaugeCardBody extends StatelessWidget {
final int min;
final int max;
final Map severity;
final int depth;
GaugeCardBody({Key key, this.min, this.max, this.severity}) : super(key: key);
GaugeCardBody({Key key, this.min, this.max, this.severity, @required this.depth}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -88,6 +89,7 @@ class GaugeCardBody extends StatelessWidget {
];
}
double fontSize = 30 / depth;
return InkWell(
onTap: () => entityWrapper.handleTap(),
onLongPress: () => entityWrapper.handleHold(),
@ -116,7 +118,7 @@ class GaugeCardBody extends StatelessWidget {
//verticalAlignment: GaugeAlignment.far,
widget: EntityName(
textStyle: Theme.of(context).textTheme.body1.copyWith(
fontSize: Theme.of(context).textTheme.body1.fontSize
fontSize: fontSize
),
),
),
@ -129,7 +131,7 @@ class GaugeCardBody extends StatelessWidget {
maxLines: 1,
textAlign: TextAlign.center,
textStyle: Theme.of(context).textTheme.title.copyWith(
fontSize: Theme.of(context).textTheme.title.fontSize,
fontSize: fontSize,
),
),
)