forked from eatvio/eatvio_app
plan creation screen added
This commit is contained in:
@@ -11,7 +11,7 @@ import 'package:eatvio_app/core/widgets/loader.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';
|
||||
import 'package:eatvio_app/features/diets/presentation/widgets/cpfc_container.dart';
|
||||
import 'package:eatvio_app/core/widgets/cpfc_container.dart';
|
||||
import 'package:eatvio_app/features/diets/presentation/widgets/expandable_text.dart';
|
||||
import 'package:eatvio_app/features/diets/presentation/widgets/info_bouble.dart';
|
||||
import 'package:eatvio_app/core/widgets/main_background_bouble.dart';
|
||||
@@ -132,7 +132,12 @@ class _AboutDietScreenState extends State<AboutDietScreen> {
|
||||
),
|
||||
backgroundColor: appTheme.greenA700,
|
||||
onPressed: () {
|
||||
showModalBottomSheet(context: context, builder: (context) => StartDietBottomSheet(aboutDietCubit: context.read<AboutDietCubit>(),));
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
builder: (context) => StartDietBottomSheet(
|
||||
aboutDietCubit: context.read<AboutDietCubit>(),
|
||||
),
|
||||
);
|
||||
},
|
||||
label: Text(
|
||||
s.startDiet,
|
||||
@@ -320,6 +325,9 @@ class _AboutDietScreenState extends State<AboutDietScreen> {
|
||||
children: [
|
||||
CachedNetworkImage(
|
||||
imageUrl: baseUrl + '/storage/' + widget.diet.image,
|
||||
height: 300,
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
Positioned(
|
||||
bottom: 16,
|
||||
@@ -440,8 +448,7 @@ class _AboutDietScreenState extends State<AboutDietScreen> {
|
||||
),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
if (state is CommentsStateLoading)
|
||||
const Loader(),
|
||||
if (state is CommentsStateLoading) const Loader(),
|
||||
if (state is CommentsStateLoaded)
|
||||
CommentsWidget(
|
||||
id: widget.diet.id.toString(),
|
||||
@@ -545,8 +552,8 @@ class _AboutDietScreenState extends State<AboutDietScreen> {
|
||||
),
|
||||
CpfcContainer(
|
||||
calories: widget.diet.dailyNutrition[dayNumber].energy,
|
||||
protein: widget.diet.dailyNutrition[dayNumber].proteins,
|
||||
fat: widget.diet.dailyNutrition[dayNumber].fats,
|
||||
proteins: widget.diet.dailyNutrition[dayNumber].proteins,
|
||||
fats: widget.diet.dailyNutrition[dayNumber].fats,
|
||||
carbohydrates: widget.diet.dailyNutrition[dayNumber].carbohydrates,
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
import 'package:eatvio_app/generated/l10n.dart';
|
||||
import 'package:eatvio_app/core/theme/custom_text_style.dart';
|
||||
import 'package:eatvio_app/core/theme/theme_helper.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CpfcContainer extends StatelessWidget {
|
||||
const CpfcContainer({super.key, required this.calories, required this.protein, required this.fat, required this.carbohydrates});
|
||||
final double calories;
|
||||
final double protein;
|
||||
final double fat;
|
||||
final double carbohydrates;
|
||||
final int roundDigit = 1;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final s = S.of(context);
|
||||
return Container(
|
||||
color: appTheme.cardBackground,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
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.toStringAsFixed(roundDigit)}', style: TextStyles.textMSemibold.copyWith(color: appTheme.black)),
|
||||
Text(s.proteins, style: TextStyles.textXSSemibold.copyWith(color: appTheme.black)),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
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.toStringAsFixed(roundDigit)}', style: TextStyles.textMSemibold.copyWith(color: appTheme.black)),
|
||||
Text(s.carbohydrates, style: TextStyles.textXSSemibold.copyWith(color: appTheme.black)),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -12,8 +12,9 @@ import 'package:go_router/go_router.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
|
||||
class MoreOptions extends StatelessWidget {
|
||||
const MoreOptions({super.key, required this.id});
|
||||
const MoreOptions({super.key, required this.id, this.disableActions});
|
||||
final int id;
|
||||
final bool? disableActions;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final s = S.of(context);
|
||||
@@ -25,7 +26,7 @@ class MoreOptions extends StatelessWidget {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
onTap:disableActions == true ? null : () {
|
||||
Clipboard.setData(ClipboardData(text: baseUrl + '/ru/diet/' + id.toString()));
|
||||
showInfoToast(s.link_was_copied);
|
||||
},
|
||||
@@ -34,7 +35,6 @@ class MoreOptions extends StatelessWidget {
|
||||
Text(
|
||||
s.copy_link,
|
||||
style: TextStyles.textMMedium.copyWith(
|
||||
|
||||
color: appTheme.black,
|
||||
),
|
||||
),
|
||||
@@ -48,7 +48,7 @@ class MoreOptions extends StatelessWidget {
|
||||
child: CustomDivider(),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () => Share.shareUri(
|
||||
onTap: disableActions == true ? null : () => Share.shareUri(
|
||||
Uri.parse(
|
||||
baseUrl + '/ru/diet/' + id.toString(),
|
||||
),
|
||||
@@ -58,7 +58,6 @@ class MoreOptions extends StatelessWidget {
|
||||
Text(
|
||||
s.share,
|
||||
style: TextStyles.textMMedium.copyWith(
|
||||
|
||||
color: appTheme.black,
|
||||
),
|
||||
),
|
||||
@@ -72,7 +71,7 @@ class MoreOptions extends StatelessWidget {
|
||||
child: CustomDivider(),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
onTap: disableActions == true ? null : () {
|
||||
context.push('complainingScreen');
|
||||
},
|
||||
child: Row(
|
||||
|
||||
Reference in New Issue
Block a user