buildMetric function
Widget
buildMetric(
- BuildContext context,
- String label,
- String value,
- int index,
- DashboardLocalization localizations,
Implementation
Widget buildMetric(
BuildContext context,
String label,
String value,
int index,
DashboardLocalization localizations,
) {
return Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceAround,
mainAxisSize: MainAxisSize.max,
children: [
if (index > 2)
SizedBox(
width: MediaQuery.of(context).size.width / 3.6,
child: Divider(
indent: 0,
height: spacer1,
endIndent: 0,
thickness: 2,
color: DigitTheme.instance.mobileTheme.colorScheme.outline,
),
),
ConstrainedBox(
constraints:
BoxConstraints(maxWidth: MediaQuery.of(context).size.width / 5),
child: Text(
value,
style: DigitTheme.instance.mobileTheme.textTheme.bodyLarge,
maxLines: 2,
textAlign: TextAlign.center,
),
),
ConstrainedBox(
constraints:
BoxConstraints(maxWidth: MediaQuery.of(context).size.width / 3.6),
child: Align(
alignment: Alignment.center,
child: Text(
localizations.translate(
label,
),
textAlign: TextAlign.center,
style: DigitTheme.instance.mobileTheme.textTheme.bodyMedium,
),
),
),
],
);
}