forked from eatvio/eatvio_app
feat(feed): add diets api and create blog post screen, fix status bar
This commit is contained in:
@@ -65,14 +65,55 @@ class AboutRecipesScreen extends StatelessWidget {
|
||||
imageUrl: baseUrl + '/storage/' + recipes.image,
|
||||
),
|
||||
SizedBox(height: 12),
|
||||
Text(recipes.ingredients.toString()),
|
||||
Text('Пошаговый рецепт'),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Text(
|
||||
'Ингредиенты',
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
height: 1,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 12),
|
||||
ListView.separated(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
shrinkWrap: true,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
itemBuilder: (context, index) => _ingredient(recipes.ingredients[index]),
|
||||
separatorBuilder: (context, index) => SizedBox(height: 4),
|
||||
itemCount: recipes.ingredients.length,
|
||||
),
|
||||
SizedBox(height: 12),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Text(
|
||||
'Пошаговый рецепт',
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
height: 1,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 12),
|
||||
ListView.separated(
|
||||
shrinkWrap: true,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
itemBuilder: (context, index) =>
|
||||
_step(recipes.steps[index], index + 1),
|
||||
separatorBuilder: (context, index) => SizedBox(height: 16),
|
||||
itemBuilder: (context, index) => _step(recipes.steps[index], index + 1),
|
||||
separatorBuilder: (context, index) => Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Container(
|
||||
height: 0.4,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
),
|
||||
),
|
||||
itemCount: recipes.steps.length,
|
||||
),
|
||||
],
|
||||
@@ -81,14 +122,26 @@ class AboutRecipesScreen extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
_step(step.Step step, int stepNubmer) {
|
||||
_ingredient(Ingredient ingredient) {
|
||||
return Text(
|
||||
'• '+ ingredient.name + ' ' + ingredient.portion + ' ' + (ingredient.unit ?? ''),
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w400,
|
||||
height: 1.2,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_step(step.Step step, int stepNumber) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Text(
|
||||
'Шаг ' + stepNubmer.toString(),
|
||||
'Шаг ' + stepNumber.toString(),
|
||||
style: TextStyle(
|
||||
color: Colors.black54,
|
||||
fontSize: 14,
|
||||
@@ -112,7 +165,13 @@ class AboutRecipesScreen extends StatelessWidget {
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
if (step.image.length > 1)
|
||||
CachedNetworkImage(imageUrl: baseUrl + '/storage/' + step.image),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
child: CachedNetworkImage(imageUrl: baseUrl + '/storage/' + step.image),
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user