my diets have been update

This commit is contained in:
Username1548
2025-02-17 14:40:31 +07:00
parent 070d7e1047
commit 291947bd32
98 changed files with 4969 additions and 2670 deletions

View File

@@ -0,0 +1,59 @@
import 'package:eatvio_app/core/theme/custom_text_style.dart';
import 'package:eatvio_app/core/theme/theme_helper.dart';
import 'package:eatvio_app/core/utils/localization_utils.dart';
import 'package:eatvio_app/core/widgets/main_background_bouble.dart';
import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart';
import 'package:eatvio_app/features/feed/models/recipes_model.dart';
import 'package:eatvio_app/generated/l10n.dart';
import 'package:flutter/material.dart';
class IngredientsWidget extends StatelessWidget {
const IngredientsWidget({super.key, required this.recipe});
final Recipe recipe;
@override
Widget build(BuildContext context) {
final s = S.of(context);
return MainBackgroundBouble(
child: ExpansionTile(
initiallyExpanded: true,
shape: Border(),
title: Text(
s.ingredients,
style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black),
),
children: List.generate(recipe.ingredients!.length, (index) {
return Padding(
padding: const EdgeInsets.only(left: 16, bottom: 8),
child: Row(
children: [
Container(
width: 4,
height: 4,
decoration: BoxDecoration(
color: appTheme.black,
shape: BoxShape.circle,
),
),
SizedBox(width: 4),
Builder(
builder: (context) {
final portion = Portion.getPortionFromValue(recipe.ingredients![index].unit ?? '');
String? portionName;
if (portion != null) {
portionName = getLocalizedMeasurementUnits(s, portion);
}
return Text(
'${recipe.ingredients![index].name} - ${recipe.ingredients![index].portion} ${portionName}',
style: TextStyles.textMMedium.copyWith(color: appTheme.black),
);
},
),
],
),
);
}),
),
);
}
}

View File

@@ -0,0 +1,63 @@
import 'package:eatvio_app/core/const.dart';
import 'package:eatvio_app/core/theme/custom_text_style.dart';
import 'package:eatvio_app/core/theme/theme_helper.dart';
import 'package:eatvio_app/core/widgets/main_background_bouble.dart';
import 'package:eatvio_app/features/feed/models/recipes_model.dart';
import 'package:eatvio_app/generated/l10n.dart';
import 'package:flutter/widgets.dart';
class StepsWidget extends StatelessWidget {
const StepsWidget({super.key, required this.recipe});
final Recipe recipe;
@override
Widget build(BuildContext context) {
final s = S.of(context);
return MainBackgroundBouble(
padding: EdgeInsets.all(16),
child: Column(
spacing: 16,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
s.step_by_step_photo_recipe,
style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black),
),
...List.generate(recipe.steps?.length ?? 0, (index) {
return Column(
spacing: 8,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
decoration: BoxDecoration(
color: appTheme.blueA400,
borderRadius: BorderRadius.circular(8),
),
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 8),
child: Text(
'${s.step} ${index + 1}',
style: TextStyles.textSSemibold.copyWith(color: appTheme.whiteA700),
),
),
if (recipe.steps?[index].image != null && recipe.steps![index].image.isNotEmpty)
AspectRatio(
aspectRatio: 16 / 12,
child: ClipRRect(
borderRadius: BorderRadius.circular(16),
child: Image.network(
baseUrl + '/storage/' + recipe.steps![index].image,
fit: BoxFit.cover,
),
),
),
Text(
recipe.steps![index].description,
style: TextStyles.textMMedium.copyWith(color: appTheme.black),
),
],
);
}),
],
),
);
}
}