forked from eatvio/eatvio_app
diet creation page
This commit is contained in:
@@ -2,11 +2,13 @@ import 'dart:io';
|
||||
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:eatvio_app/core/const.dart';
|
||||
import 'package:eatvio_app/core/utils/date_time_utils.dart';
|
||||
import 'package:eatvio_app/core/utils/localization_utils.dart';
|
||||
import 'package:eatvio_app/core/utils/string_extentions.dart';
|
||||
import 'package:eatvio_app/core/widgets/bookmark_button.dart';
|
||||
import 'package:eatvio_app/core/widgets/custom_divider.dart';
|
||||
import 'package:eatvio_app/core/widgets/diet_info_row.dart';
|
||||
import 'package:eatvio_app/features/blog_post/presentation/pages/blog_post_screen.dart';
|
||||
import 'package:eatvio_app/features/diets/presentation/bloc/about_diet_cubit.dart';
|
||||
import 'package:eatvio_app/features/diets/presentation/bloc/about_diet_state.dart';
|
||||
import 'package:eatvio_app/features/diets/presentation/widgets/author_card.dart';
|
||||
@@ -560,7 +562,12 @@ class _AboutDietScreenState extends State<AboutDietScreen> {
|
||||
],
|
||||
),
|
||||
),
|
||||
CpfcContainer(calories: 0, protein: 0, fat: 0, carbohydrates: 0),
|
||||
CpfcContainer(
|
||||
calories: widget.diet.dailyNutrition[dayNumber].energy,
|
||||
protein: widget.diet.dailyNutrition[dayNumber].proteins,
|
||||
fat: widget.diet.dailyNutrition[dayNumber].fats,
|
||||
carbohydrates: widget.diet.dailyNutrition[dayNumber].carbohydrates,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -9,7 +9,7 @@ class CpfcContainer extends StatelessWidget {
|
||||
final double protein;
|
||||
final double fat;
|
||||
final double carbohydrates;
|
||||
|
||||
final int roundDigit = 1;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final s = S.of(context);
|
||||
@@ -21,25 +21,25 @@ class CpfcContainer extends StatelessWidget {
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Text('$calories', style: TextStyles.textMSemibold.copyWith(color: appTheme.black)),
|
||||
Text('${calories.toStringAsFixed(roundDigit)}', style: TextStyles.textMSemibold.copyWith(color: appTheme.black)),
|
||||
Text(s.calories, style: TextStyles.textXSSemibold.copyWith(color: appTheme.black)),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Text('$protein', style: TextStyles.textMSemibold.copyWith(color: appTheme.black)),
|
||||
Text('${protein.toStringAsFixed(roundDigit)}', style: TextStyles.textMSemibold.copyWith(color: appTheme.black)),
|
||||
Text(s.proteins, style: TextStyles.textXSSemibold.copyWith(color: appTheme.black)),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Text('$fat', style: TextStyles.textMSemibold.copyWith(color: appTheme.black)),
|
||||
Text('${fat.toStringAsFixed(roundDigit)}', style: TextStyles.textMSemibold.copyWith(color: appTheme.black)),
|
||||
Text(s.fats, style: TextStyles.textXSSemibold.copyWith(color: appTheme.black)),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Text('$carbohydrates', style: TextStyles.textMSemibold.copyWith(color: appTheme.black)),
|
||||
Text('${carbohydrates.toStringAsFixed(roundDigit)}', style: TextStyles.textMSemibold.copyWith(color: appTheme.black)),
|
||||
Text(s.carbohydrates, style: TextStyles.textXSSemibold.copyWith(color: appTheme.black)),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user