diff --git a/lib/cards/card_widget.dart b/lib/cards/card_widget.dart index e37fab1..b4a04c8 100644 --- a/lib/cards/card_widget.dart +++ b/lib/cards/card_widget.dart @@ -325,6 +325,7 @@ class CardWidget extends StatelessWidget { child: GaugeCardBody( min: card.min, max: card.max, + depth: card.depth, severity: card.severity, ), handleTap: true diff --git a/lib/cards/widgets/gauge_card_body.dart b/lib/cards/widgets/gauge_card_body.dart index 2aa5a8f..2ab0804 100644 --- a/lib/cards/widgets/gauge_card_body.dart +++ b/lib/cards/widgets/gauge_card_body.dart @@ -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, ), ), )