From 8a9a913420dbb0aee50e088e6f816ec4d13bf56e Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 2 Jun 2025 13:38:19 +0300 Subject: [PATCH] fix(recipe): infinity loading recipe edit --- .../bloc/create_recipe_cubit/create_recipe_cubit.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/features/create_recipe/presentation/bloc/create_recipe_cubit/create_recipe_cubit.dart b/lib/features/create_recipe/presentation/bloc/create_recipe_cubit/create_recipe_cubit.dart index 43273ae6..f13d3d02 100644 --- a/lib/features/create_recipe/presentation/bloc/create_recipe_cubit/create_recipe_cubit.dart +++ b/lib/features/create_recipe/presentation/bloc/create_recipe_cubit/create_recipe_cubit.dart @@ -16,6 +16,7 @@ import 'package:path_provider/path_provider.dart'; class CreateRecipeCubit extends Cubit { final RecipeRepository recipeRepository; final GlossaryRepository glossaryRepository; + CreateRecipeCubit({ required this.recipeRepository, required this.glossaryRepository, @@ -192,7 +193,7 @@ class CreateRecipeCubit extends Cubit { recipe.steps!.map( (e) async => StepEntity( description: e.description, - image: await downloadImageAsFile('$baseUrl/storage/${e.image}'), + image: e.image.isEmpty ? null : await downloadImageAsFile('$baseUrl/storage/${e.image}'), ), ), );