forked from eatvio/eatvio_app
feat(feed): add recipes screen
This commit is contained in:
@@ -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),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user