MobilApp/lib/widgets/quality_mini_value.dart

51 lines
1.3 KiB
Dart

import 'package:flutter/material.dart';
class QualityMiniValue extends StatelessWidget {
final String label;
final String value;
final Color color;
final bool emphasized;
const QualityMiniValue({
required this.label,
required this.value,
required this.color,
this.emphasized = false,
});
@override
Widget build(BuildContext context) {
final colorScheme = Theme.of(context).colorScheme;
return Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
label,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: Theme.of(context).textTheme.labelSmall?.copyWith(
color: colorScheme.onSurface.withOpacity(0.65),
fontWeight: FontWeight.w600,
height: 1.0,
),
),
const SizedBox(height: 2),
Text(
value,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: Theme.of(context).textTheme.bodySmall?.copyWith(
color: color,
fontWeight: emphasized ? FontWeight.w800 : FontWeight.w700,
height: 1.05,
fontFeatures: const [
FontFeature.tabularFigures(),
],
),
),
],
);
}
}