Files
eatvio_app/lib/core/widgets/cpfc_container.dart
2024-12-02 15:55:57 +07:00

51 lines
2.0 KiB
Dart

import 'package:eatvio_app/generated/l10n.dart';
import 'package:eatvio_app/core/theme/custom_text_style.dart';
import 'package:eatvio_app/core/theme/theme_helper.dart';
import 'package:flutter/material.dart';
class CpfcContainer extends StatelessWidget {
const CpfcContainer({super.key, required this.calories, required this.proteins, required this.fats, required this.carbohydrates});
final double calories;
final double proteins;
final double fats;
final double carbohydrates;
final int roundDigit = 1;
@override
Widget build(BuildContext context) {
final s = S.of(context);
return Container(
color: appTheme.cardBackground,
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 12),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
children: [
Text('${calories.toStringAsFixed(roundDigit)}', style: TextStyles.textMSemibold.copyWith(color: appTheme.black)),
Text(s.calories, style: TextStyles.textXSSemibold.copyWith(color: appTheme.black)),
],
),
Column(
children: [
Text('${proteins.toStringAsFixed(roundDigit)}', style: TextStyles.textMSemibold.copyWith(color: appTheme.black)),
Text(s.proteins, style: TextStyles.textXSSemibold.copyWith(color: appTheme.black)),
],
),
Column(
children: [
Text('${fats.toStringAsFixed(roundDigit)}', style: TextStyles.textMSemibold.copyWith(color: appTheme.black)),
Text(s.fats, style: TextStyles.textXSSemibold.copyWith(color: appTheme.black)),
],
),
Column(
children: [
Text('${carbohydrates.toStringAsFixed(roundDigit)}', style: TextStyles.textMSemibold.copyWith(color: appTheme.black)),
Text(s.carbohydrates, style: TextStyles.textXSSemibold.copyWith(color: appTheme.black)),
],
),
],
),
);
}
}