feat(feed): add recipes screen

This commit is contained in:
mso7nueh
2024-08-02 11:52:10 +03:00
parent c78f8dacdf
commit 904adbba2f
111 changed files with 1511 additions and 1784 deletions

View File

@@ -0,0 +1,49 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:eatvio_app/core/app_export.dart';
import 'package:eatvio_app/features/feed/models/recipes_model.dart' as step;
import 'package:eatvio_app/features/feed/models/recipes_model.dart';
import 'package:flutter/material.dart';
class AboutRecipesScreen extends StatelessWidget {
final Recipes recipes;
const AboutRecipesScreen({super.key, required this.recipes});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: SingleChildScrollView(
padding: EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(recipes.title),
Row(
children: [
Text(recipes.cookingTime.toString() + ' минут'),
SizedBox(width: 16),
Text(recipes.steps.length.toString() + ' этапов'),
],
),
Text(recipes.videoUrl),
CachedNetworkImage(imageUrl: baseUrl + '/storage/' + recipes.image),
Text(recipes.ingredients.toString()),
Text('Пошаговый рецепт'),
for (int i = 0; i < recipes.steps.length; i++) ...[_step(recipes.steps[i])],
],
),
),
);
}
_step(step.Step step) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(step.description),
if (step.image.length > 1) CachedNetworkImage(imageUrl: baseUrl + '/storage/' + step.image),
],
);
}
}