buildMetric function

Widget buildMetric(
  1. BuildContext context,
  2. String label,
  3. String value,
  4. int index,
  5. 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,
          ),
        ),
      ),
    ],
  );
}