forked from eatvio/eatvio_app
feat(order info): added order info screen
This commit is contained in:
@@ -39,7 +39,7 @@ class AboutRecipeScreen extends StatefulWidget {
|
||||
final int? index;
|
||||
final bool navigateToComments;
|
||||
|
||||
AboutRecipeScreen({super.key, required this.recipe, required this.index, required this.navigateToComments});
|
||||
const AboutRecipeScreen({super.key, required this.recipe, required this.index, required this.navigateToComments});
|
||||
|
||||
@override
|
||||
State<AboutRecipeScreen> createState() => _AboutRecipeScreenState();
|
||||
@@ -89,7 +89,7 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
||||
return BlocBuilder<AboutRecipeCubit, AboutRecipeState>(
|
||||
builder: (context, recipeState) {
|
||||
if (recipeState is AboutRecipeStateLoaded) {
|
||||
Future.delayed(Duration(milliseconds: 500), () {
|
||||
Future.delayed(const Duration(milliseconds: 500), () {
|
||||
if (widget.navigateToComments && !_jumped) {
|
||||
_scrollToBottom();
|
||||
}
|
||||
@@ -98,7 +98,7 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
||||
backgroundColor: appTheme.gray100,
|
||||
resizeToAvoidBottomInset: true,
|
||||
bottomSheet: Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 12) + (Platform.isIOS ? const EdgeInsets.only(bottom: 16) : EdgeInsets.zero),
|
||||
padding: const EdgeInsets.symmetric(vertical: 12) + (Platform.isIOS ? const EdgeInsets.only(bottom: 16) : EdgeInsets.zero),
|
||||
decoration: BoxDecoration(color: Colors.white, border: Border(top: BorderSide(color: Colors.black.withValues(alpha: 0.1)))),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
@@ -122,13 +122,13 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
||||
decoration: BoxDecoration(color: appTheme.blueA400, shape: BoxShape.circle),
|
||||
height: 32,
|
||||
width: 32,
|
||||
child: Icon(Icons.close_rounded, size: 18, color: Colors.white),
|
||||
child: const Icon(Icons.close_rounded, size: 18, color: Colors.white),
|
||||
),
|
||||
),
|
||||
if (replyId != null) SizedBox(width: 8),
|
||||
if (replyId != null) const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(minHeight: 52),
|
||||
constraints: const BoxConstraints(minHeight: 52),
|
||||
child: TextFormField(
|
||||
textCapitalization: TextCapitalization.sentences,
|
||||
onChanged: (_) {
|
||||
@@ -138,24 +138,24 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
||||
maxLines: 5,
|
||||
minLines: 1,
|
||||
keyboardType: TextInputType.multiline,
|
||||
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w400, color: Colors.black, height: 1.2),
|
||||
style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w400, color: Colors.black, height: 1.2),
|
||||
decoration: InputDecoration(
|
||||
isDense: false, // убираем true, чтобы padding учитывался корректно
|
||||
contentPadding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), // вертикальный паддинг увеличен
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16), // вертикальный паддинг увеличен
|
||||
hintText: 'Комментарий',
|
||||
hintStyle: TextStyle(fontSize: 16, fontWeight: FontWeight.w400, height: 1.2, color: Color(0xFFAEAEB2)),
|
||||
hintStyle: const TextStyle(fontSize: 16, fontWeight: FontWeight.w400, height: 1.2, color: Color(0xFFAEAEB2)),
|
||||
filled: true,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
borderSide: BorderSide(color: Color(0xFFD1D1D6), width: 1),
|
||||
borderSide: const BorderSide(color: Color(0xFFD1D1D6), width: 1),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
borderSide: BorderSide(color: Color(0xFFD1D1D6), width: 1),
|
||||
borderSide: const BorderSide(color: Color(0xFFD1D1D6), width: 1),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
borderSide: BorderSide(color: Color(0xFFD1D1D6), width: 1),
|
||||
borderSide: const BorderSide(color: Color(0xFFD1D1D6), width: 1),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -176,7 +176,7 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
||||
textEditingController.clear();
|
||||
replyId = null;
|
||||
});
|
||||
Future.delayed(Duration(milliseconds: 500), () {
|
||||
Future.delayed(const Duration(milliseconds: 500), () {
|
||||
recipeCubit.getRecipe(widget.recipe.slug, index: widget.index);
|
||||
});
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
@@ -189,7 +189,7 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
||||
),
|
||||
height: 32,
|
||||
width: 32,
|
||||
child: Icon(Icons.send_rounded, size: 18, color: Colors.white),
|
||||
child: const Icon(Icons.send_rounded, size: 18, color: Colors.white),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -216,7 +216,7 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
||||
path: 'recipe/${widget.recipe.slug}',
|
||||
slug: widget.recipe.slug,
|
||||
),
|
||||
anchor: Aligned(shiftToWithinBound: AxisFlag(x: true, y: true), follower: Alignment.topRight, target: Alignment.bottomRight),
|
||||
anchor: const Aligned(shiftToWithinBound: AxisFlag(x: true, y: true), follower: Alignment.topRight, target: Alignment.bottomRight),
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
@@ -230,11 +230,11 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
controller: scrollController,
|
||||
padding: EdgeInsets.only(bottom: 160),
|
||||
padding: const EdgeInsets.only(bottom: 160),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(height: 8),
|
||||
const SizedBox(height: 8),
|
||||
MainBackgroundBouble(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -242,7 +242,7 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
||||
Stack(
|
||||
children: [
|
||||
CachedNetworkImage(
|
||||
imageUrl: baseUrl + '/storage/' + widget.recipe.image,
|
||||
imageUrl: '$baseUrl/storage/${widget.recipe.image}',
|
||||
height: 300,
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
fit: BoxFit.fill,
|
||||
@@ -255,19 +255,20 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
InfoBouble(
|
||||
backgroundColor: appTheme.whiteA700,
|
||||
children: [
|
||||
SvgPicture.asset('assets/icons/eye.svg', width: 18, height: 12),
|
||||
SizedBox(width: 8),
|
||||
const SizedBox(width: 8),
|
||||
Text(widget.recipe.viewsCount.toString(), style: TextStyles.textXSSemibold.copyWith(color: appTheme.black)),
|
||||
],
|
||||
backgroundColor: appTheme.whiteA700,
|
||||
),
|
||||
SizedBox(width: 12),
|
||||
const SizedBox(width: 12),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
recipeCubit.likeRecipe(widget.recipe.slug, widget.index);
|
||||
},
|
||||
child: InfoBouble(
|
||||
backgroundColor: appTheme.whiteA700,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
'assets/icons/heart.svg',
|
||||
@@ -275,26 +276,25 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
||||
height: 12,
|
||||
colorFilter: recipeState.recipe.wasLikedByMe ? ColorFilter.mode(appTheme.blueA400, BlendMode.srcIn) : null,
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
recipeState.recipe.likesCount.toString(),
|
||||
style: TextStyles.textXSSemibold.copyWith(color: appTheme.black),
|
||||
),
|
||||
],
|
||||
backgroundColor: appTheme.whiteA700,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 12),
|
||||
const SizedBox(width: 12),
|
||||
InfoBouble(
|
||||
backgroundColor: appTheme.whiteA700,
|
||||
children: [
|
||||
SvgPicture.asset('assets/icons/comment2.svg', width: 13, height: 12),
|
||||
SizedBox(width: 8),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
recipeState.recipe.commentsCount.toString(),
|
||||
style: TextStyles.textXSSemibold.copyWith(color: appTheme.black),
|
||||
),
|
||||
],
|
||||
backgroundColor: appTheme.whiteA700,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -311,7 +311,7 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
||||
},
|
||||
color: appTheme.whiteA700,
|
||||
isFavorite: recipeState.recipe.isFavorite,
|
||||
borderRadius: BorderRadius.vertical(bottom: Radius.circular(12)),
|
||||
borderRadius: const BorderRadius.vertical(bottom: Radius.circular(12)),
|
||||
width: 40,
|
||||
height: 44,
|
||||
size: 19,
|
||||
@@ -319,12 +319,12 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
const SizedBox(height: 16),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Text(s.about_recipe, style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black)),
|
||||
),
|
||||
SizedBox(height: 12),
|
||||
const SizedBox(height: 12),
|
||||
InfoRow(recipe: widget.recipe, type: ProductType.recipe),
|
||||
if (widget.recipe.videoUrl != null && widget.recipe.videoUrl!.isNotEmpty)
|
||||
Padding(
|
||||
@@ -345,39 +345,39 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(s.check_out_video_recipe, style: TextStyles.textMSemibold.copyWith(color: appTheme.black)),
|
||||
SizedBox(width: 12),
|
||||
const SizedBox(width: 12),
|
||||
SvgPicture.asset('assets/icons/play_icon.svg', width: 16, height: 16),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
ExpandableText(text: widget.recipe.description),
|
||||
SizedBox(height: 20),
|
||||
const SizedBox(height: 20),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: AuthorCard(author: widget.recipe.author, title: s.recipe_author),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
const SizedBox(height: 16),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 12),
|
||||
const SizedBox(height: 12),
|
||||
if (widget.recipe.ingredients?.isNotEmpty == true) IngredientsWidget(recipe: widget.recipe),
|
||||
if (widget.recipe.steps?.isNotEmpty == true) ...[SizedBox(height: 12), StepsWidget(recipe: widget.recipe)],
|
||||
SizedBox(height: 8),
|
||||
if (widget.recipe.steps?.isNotEmpty == true) ...[const SizedBox(height: 12), StepsWidget(recipe: widget.recipe)],
|
||||
const SizedBox(height: 8),
|
||||
MainBackgroundBouble(
|
||||
padding: EdgeInsets.symmetric(vertical: 16),
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
recipeState.recipe.commentsCount.toString() + ' ' + getCommentForm(widget.recipe.commentsCount, s),
|
||||
'${recipeState.recipe.commentsCount} ${getCommentForm(widget.recipe.commentsCount, s)}',
|
||||
style: TextStyles.textMMedium.copyWith(color: appTheme.gray500),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
const SizedBox(height: 16),
|
||||
if (state is CommentsStateLoading) const Loader(),
|
||||
if (state is CommentsStateLoaded)
|
||||
CommentsWidget(id: widget.recipe.slug, commentSourceType: CommentSourceType.recipe, comment: state.comment, replyId: replyId),
|
||||
@@ -409,7 +409,7 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
||||
path: 'recipe/${widget.recipe.slug}',
|
||||
slug: widget.recipe.slug,
|
||||
),
|
||||
anchor: Aligned(shiftToWithinBound: AxisFlag(x: true, y: true), follower: Alignment.topRight, target: Alignment.bottomRight),
|
||||
anchor: const Aligned(shiftToWithinBound: AxisFlag(x: true, y: true), follower: Alignment.topRight, target: Alignment.bottomRight),
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
@@ -443,7 +443,7 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
||||
path: 'recipe/${widget.recipe.slug}',
|
||||
slug: widget.recipe.slug,
|
||||
),
|
||||
anchor: Aligned(shiftToWithinBound: AxisFlag(x: true, y: true), follower: Alignment.topRight, target: Alignment.bottomRight),
|
||||
anchor: const Aligned(shiftToWithinBound: AxisFlag(x: true, y: true), follower: Alignment.topRight, target: Alignment.bottomRight),
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:eatvio_app/features/recipe/presentation/cubit/about_recipe_state
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
class AboutRecipeCubit extends Cubit<AboutRecipeState> {
|
||||
AboutRecipeCubit({required this.recipeRepository, required this.profileRepository}) : super(AboutRecipeState.initial());
|
||||
AboutRecipeCubit({required this.recipeRepository, required this.profileRepository}) : super(const AboutRecipeState.initial());
|
||||
final AboutRecipeRepository recipeRepository;
|
||||
final ProfileRepository profileRepository;
|
||||
bool isCurrentDietStarted = false;
|
||||
@@ -31,7 +31,7 @@ class AboutRecipeCubit extends Cubit<AboutRecipeState> {
|
||||
|
||||
Future<void> initRecipe(String id, {int? index}) async {
|
||||
try {
|
||||
emit(AboutRecipeState.loading());
|
||||
emit(const AboutRecipeState.loading());
|
||||
final recipe = await recipeRepository.getRecipe(id);
|
||||
if (index != null) {
|
||||
recipeRepository.emitCommentsStateToFeed(CommentsState(index: index, totalComments: recipe.commentsCount));
|
||||
@@ -72,7 +72,7 @@ class AboutRecipeCubit extends Cubit<AboutRecipeState> {
|
||||
|
||||
EasyDebounce.debounce(
|
||||
'like_recipe',
|
||||
Duration(seconds: 1),
|
||||
const Duration(seconds: 1),
|
||||
() async {
|
||||
try {
|
||||
await recipeRepository.likeRecipe(id);
|
||||
@@ -103,7 +103,7 @@ class AboutRecipeCubit extends Cubit<AboutRecipeState> {
|
||||
|
||||
EasyDebounce.debounce(
|
||||
'add_or_remove_diet_to_favorites',
|
||||
Duration(seconds: 1),
|
||||
const Duration(seconds: 1),
|
||||
() async {
|
||||
try {
|
||||
await recipeRepository.addToFavorite(id);
|
||||
@@ -134,7 +134,7 @@ class AboutRecipeCubit extends Cubit<AboutRecipeState> {
|
||||
|
||||
EasyDebounce.debounce(
|
||||
'add_or_remove_diet_to_favorites',
|
||||
Duration(seconds: 1),
|
||||
const Duration(seconds: 1),
|
||||
() async {
|
||||
try {
|
||||
await recipeRepository.removeFromFavorite(id);
|
||||
|
||||
@@ -12,8 +12,7 @@ part of 'about_recipe_state.dart';
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
|
||||
);
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$AboutRecipeState {
|
||||
@@ -24,7 +23,8 @@ mixin _$AboutRecipeState {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(Recipe recipe) loaded,
|
||||
required TResult Function(String message) error,
|
||||
}) => throw _privateConstructorUsedError;
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
@@ -32,7 +32,8 @@ mixin _$AboutRecipeState {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(Recipe recipe)? loaded,
|
||||
TResult? Function(String message)? error,
|
||||
}) => throw _privateConstructorUsedError;
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
@@ -41,7 +42,8 @@ mixin _$AboutRecipeState {
|
||||
TResult Function(Recipe recipe)? loaded,
|
||||
TResult Function(String message)? error,
|
||||
required TResult orElse(),
|
||||
}) => throw _privateConstructorUsedError;
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_AboutRecipeState value) $default, {
|
||||
@@ -49,7 +51,8 @@ mixin _$AboutRecipeState {
|
||||
required TResult Function(AboutRecipeStateLoading value) loading,
|
||||
required TResult Function(AboutRecipeStateLoaded value) loaded,
|
||||
required TResult Function(RecipeStateError value) error,
|
||||
}) => throw _privateConstructorUsedError;
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_AboutRecipeState value)? $default, {
|
||||
@@ -57,7 +60,8 @@ mixin _$AboutRecipeState {
|
||||
TResult? Function(AboutRecipeStateLoading value)? loading,
|
||||
TResult? Function(AboutRecipeStateLoaded value)? loaded,
|
||||
TResult? Function(RecipeStateError value)? error,
|
||||
}) => throw _privateConstructorUsedError;
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_AboutRecipeState value)? $default, {
|
||||
@@ -66,15 +70,15 @@ mixin _$AboutRecipeState {
|
||||
TResult Function(AboutRecipeStateLoaded value)? loaded,
|
||||
TResult Function(RecipeStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) => throw _privateConstructorUsedError;
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $AboutRecipeStateCopyWith<$Res> {
|
||||
factory $AboutRecipeStateCopyWith(
|
||||
AboutRecipeState value,
|
||||
$Res Function(AboutRecipeState) then,
|
||||
) = _$AboutRecipeStateCopyWithImpl<$Res, AboutRecipeState>;
|
||||
AboutRecipeState value, $Res Function(AboutRecipeState) then) =
|
||||
_$AboutRecipeStateCopyWithImpl<$Res, AboutRecipeState>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -93,20 +97,18 @@ class _$AboutRecipeStateCopyWithImpl<$Res, $Val extends AboutRecipeState>
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$AboutRecipeStateImplCopyWith<$Res> {
|
||||
factory _$$AboutRecipeStateImplCopyWith(
|
||||
_$AboutRecipeStateImpl value,
|
||||
$Res Function(_$AboutRecipeStateImpl) then,
|
||||
) = __$$AboutRecipeStateImplCopyWithImpl<$Res>;
|
||||
factory _$$AboutRecipeStateImplCopyWith(_$AboutRecipeStateImpl value,
|
||||
$Res Function(_$AboutRecipeStateImpl) then) =
|
||||
__$$AboutRecipeStateImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$AboutRecipeStateImplCopyWithImpl<$Res>
|
||||
extends _$AboutRecipeStateCopyWithImpl<$Res, _$AboutRecipeStateImpl>
|
||||
implements _$$AboutRecipeStateImplCopyWith<$Res> {
|
||||
__$$AboutRecipeStateImplCopyWithImpl(
|
||||
_$AboutRecipeStateImpl _value,
|
||||
$Res Function(_$AboutRecipeStateImpl) _then,
|
||||
) : super(_value, _then);
|
||||
__$$AboutRecipeStateImplCopyWithImpl(_$AboutRecipeStateImpl _value,
|
||||
$Res Function(_$AboutRecipeStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of AboutRecipeState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -219,9 +221,9 @@ abstract class _AboutRecipeState implements AboutRecipeState {
|
||||
/// @nodoc
|
||||
abstract class _$$AboutRecipeStateInitialImplCopyWith<$Res> {
|
||||
factory _$$AboutRecipeStateInitialImplCopyWith(
|
||||
_$AboutRecipeStateInitialImpl value,
|
||||
$Res Function(_$AboutRecipeStateInitialImpl) then,
|
||||
) = __$$AboutRecipeStateInitialImplCopyWithImpl<$Res>;
|
||||
_$AboutRecipeStateInitialImpl value,
|
||||
$Res Function(_$AboutRecipeStateInitialImpl) then) =
|
||||
__$$AboutRecipeStateInitialImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -229,9 +231,9 @@ class __$$AboutRecipeStateInitialImplCopyWithImpl<$Res>
|
||||
extends _$AboutRecipeStateCopyWithImpl<$Res, _$AboutRecipeStateInitialImpl>
|
||||
implements _$$AboutRecipeStateInitialImplCopyWith<$Res> {
|
||||
__$$AboutRecipeStateInitialImplCopyWithImpl(
|
||||
_$AboutRecipeStateInitialImpl _value,
|
||||
$Res Function(_$AboutRecipeStateInitialImpl) _then,
|
||||
) : super(_value, _then);
|
||||
_$AboutRecipeStateInitialImpl _value,
|
||||
$Res Function(_$AboutRecipeStateInitialImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of AboutRecipeState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -345,9 +347,9 @@ abstract class AboutRecipeStateInitial implements AboutRecipeState {
|
||||
/// @nodoc
|
||||
abstract class _$$AboutRecipeStateLoadingImplCopyWith<$Res> {
|
||||
factory _$$AboutRecipeStateLoadingImplCopyWith(
|
||||
_$AboutRecipeStateLoadingImpl value,
|
||||
$Res Function(_$AboutRecipeStateLoadingImpl) then,
|
||||
) = __$$AboutRecipeStateLoadingImplCopyWithImpl<$Res>;
|
||||
_$AboutRecipeStateLoadingImpl value,
|
||||
$Res Function(_$AboutRecipeStateLoadingImpl) then) =
|
||||
__$$AboutRecipeStateLoadingImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -355,9 +357,9 @@ class __$$AboutRecipeStateLoadingImplCopyWithImpl<$Res>
|
||||
extends _$AboutRecipeStateCopyWithImpl<$Res, _$AboutRecipeStateLoadingImpl>
|
||||
implements _$$AboutRecipeStateLoadingImplCopyWith<$Res> {
|
||||
__$$AboutRecipeStateLoadingImplCopyWithImpl(
|
||||
_$AboutRecipeStateLoadingImpl _value,
|
||||
$Res Function(_$AboutRecipeStateLoadingImpl) _then,
|
||||
) : super(_value, _then);
|
||||
_$AboutRecipeStateLoadingImpl _value,
|
||||
$Res Function(_$AboutRecipeStateLoadingImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of AboutRecipeState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -471,9 +473,9 @@ abstract class AboutRecipeStateLoading implements AboutRecipeState {
|
||||
/// @nodoc
|
||||
abstract class _$$AboutRecipeStateLoadedImplCopyWith<$Res> {
|
||||
factory _$$AboutRecipeStateLoadedImplCopyWith(
|
||||
_$AboutRecipeStateLoadedImpl value,
|
||||
$Res Function(_$AboutRecipeStateLoadedImpl) then,
|
||||
) = __$$AboutRecipeStateLoadedImplCopyWithImpl<$Res>;
|
||||
_$AboutRecipeStateLoadedImpl value,
|
||||
$Res Function(_$AboutRecipeStateLoadedImpl) then) =
|
||||
__$$AboutRecipeStateLoadedImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({Recipe recipe});
|
||||
|
||||
@@ -485,24 +487,23 @@ class __$$AboutRecipeStateLoadedImplCopyWithImpl<$Res>
|
||||
extends _$AboutRecipeStateCopyWithImpl<$Res, _$AboutRecipeStateLoadedImpl>
|
||||
implements _$$AboutRecipeStateLoadedImplCopyWith<$Res> {
|
||||
__$$AboutRecipeStateLoadedImplCopyWithImpl(
|
||||
_$AboutRecipeStateLoadedImpl _value,
|
||||
$Res Function(_$AboutRecipeStateLoadedImpl) _then,
|
||||
) : super(_value, _then);
|
||||
_$AboutRecipeStateLoadedImpl _value,
|
||||
$Res Function(_$AboutRecipeStateLoadedImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of AboutRecipeState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({Object? recipe = null}) {
|
||||
return _then(
|
||||
_$AboutRecipeStateLoadedImpl(
|
||||
recipe:
|
||||
null == recipe
|
||||
? _value.recipe
|
||||
: recipe // ignore: cast_nullable_to_non_nullable
|
||||
as Recipe,
|
||||
),
|
||||
);
|
||||
$Res call({
|
||||
Object? recipe = null,
|
||||
}) {
|
||||
return _then(_$AboutRecipeStateLoadedImpl(
|
||||
recipe: null == recipe
|
||||
? _value.recipe
|
||||
: recipe // ignore: cast_nullable_to_non_nullable
|
||||
as Recipe,
|
||||
));
|
||||
}
|
||||
|
||||
/// Create a copy of AboutRecipeState
|
||||
@@ -546,11 +547,8 @@ class _$AboutRecipeStateLoadedImpl implements AboutRecipeStateLoaded {
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$AboutRecipeStateLoadedImplCopyWith<_$AboutRecipeStateLoadedImpl>
|
||||
get copyWith =>
|
||||
__$$AboutRecipeStateLoadedImplCopyWithImpl<_$AboutRecipeStateLoadedImpl>(
|
||||
this,
|
||||
_$identity,
|
||||
);
|
||||
get copyWith => __$$AboutRecipeStateLoadedImplCopyWithImpl<
|
||||
_$AboutRecipeStateLoadedImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
@@ -643,15 +641,14 @@ abstract class AboutRecipeStateLoaded implements AboutRecipeState {
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$AboutRecipeStateLoadedImplCopyWith<_$AboutRecipeStateLoadedImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$RecipeStateErrorImplCopyWith<$Res> {
|
||||
factory _$$RecipeStateErrorImplCopyWith(
|
||||
_$RecipeStateErrorImpl value,
|
||||
$Res Function(_$RecipeStateErrorImpl) then,
|
||||
) = __$$RecipeStateErrorImplCopyWithImpl<$Res>;
|
||||
factory _$$RecipeStateErrorImplCopyWith(_$RecipeStateErrorImpl value,
|
||||
$Res Function(_$RecipeStateErrorImpl) then) =
|
||||
__$$RecipeStateErrorImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({String message});
|
||||
}
|
||||
@@ -660,25 +657,23 @@ abstract class _$$RecipeStateErrorImplCopyWith<$Res> {
|
||||
class __$$RecipeStateErrorImplCopyWithImpl<$Res>
|
||||
extends _$AboutRecipeStateCopyWithImpl<$Res, _$RecipeStateErrorImpl>
|
||||
implements _$$RecipeStateErrorImplCopyWith<$Res> {
|
||||
__$$RecipeStateErrorImplCopyWithImpl(
|
||||
_$RecipeStateErrorImpl _value,
|
||||
$Res Function(_$RecipeStateErrorImpl) _then,
|
||||
) : super(_value, _then);
|
||||
__$$RecipeStateErrorImplCopyWithImpl(_$RecipeStateErrorImpl _value,
|
||||
$Res Function(_$RecipeStateErrorImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of AboutRecipeState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({Object? message = null}) {
|
||||
return _then(
|
||||
_$RecipeStateErrorImpl(
|
||||
message:
|
||||
null == message
|
||||
? _value.message
|
||||
: message // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
),
|
||||
);
|
||||
$Res call({
|
||||
Object? message = null,
|
||||
}) {
|
||||
return _then(_$RecipeStateErrorImpl(
|
||||
message: null == message
|
||||
? _value.message
|
||||
: message // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -713,9 +708,7 @@ class _$RecipeStateErrorImpl implements RecipeStateError {
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$RecipeStateErrorImplCopyWith<_$RecipeStateErrorImpl> get copyWith =>
|
||||
__$$RecipeStateErrorImplCopyWithImpl<_$RecipeStateErrorImpl>(
|
||||
this,
|
||||
_$identity,
|
||||
);
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
|
||||
@@ -16,7 +16,7 @@ class IngredientsWidget extends StatelessWidget {
|
||||
return MainBackgroundBouble(
|
||||
child: ExpansionTile(
|
||||
initiallyExpanded: true,
|
||||
shape: Border(),
|
||||
shape: const Border(),
|
||||
title: Text(
|
||||
s.ingredients,
|
||||
style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black),
|
||||
@@ -34,7 +34,7 @@ class IngredientsWidget extends StatelessWidget {
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 4),
|
||||
const SizedBox(width: 4),
|
||||
Builder(
|
||||
builder: (context) {
|
||||
final portion = Portion.getPortionFromValue(recipe.ingredients![index].unit ?? '');
|
||||
@@ -44,7 +44,7 @@ class IngredientsWidget extends StatelessWidget {
|
||||
portionName = getLocalizedMeasurementUnits(s, portion);
|
||||
}
|
||||
return Text(
|
||||
'${recipe.ingredients![index].name} - ${recipe.ingredients![index].portion} ${portionName}',
|
||||
'${recipe.ingredients![index].name} - ${recipe.ingredients![index].portion} $portionName',
|
||||
style: TextStyles.textMMedium.copyWith(color: appTheme.black),
|
||||
);
|
||||
},
|
||||
|
||||
@@ -13,7 +13,7 @@ class StepsWidget extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final s = S.of(context);
|
||||
return MainBackgroundBouble(
|
||||
padding: EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
spacing: 16,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -32,7 +32,7 @@ class StepsWidget extends StatelessWidget {
|
||||
color: appTheme.blueA400,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||
child: Text(
|
||||
'${s.step} ${index + 1}',
|
||||
style: TextStyles.textSSemibold.copyWith(color: appTheme.whiteA700),
|
||||
@@ -44,7 +44,7 @@ class StepsWidget extends StatelessWidget {
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
child: Image.network(
|
||||
baseUrl + '/storage/' + recipe.steps![index].image,
|
||||
'$baseUrl/storage/${recipe.steps![index].image}',
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user