From e4bca86b9e6d5e095f2dfc59ec3182e715e5ec12 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 25 Nov 2024 15:47:54 +0300 Subject: [PATCH] fix: youtube_url => video_url --- .../blog_post_create_cubit.dart | 4 +- .../blog_post_create_credentials_model.dart | 2 +- .../pages/blog_post_create_screen.dart | 12 ++-- .../repositories/blog_post_repository.dart | 4 +- .../feed/models/feed_blog_post_model.dart | 2 +- .../models/feed_blog_post_model.freezed.dart | 44 ++++++------- .../feed/models/feed_blog_post_model.g.dart | 4 +- .../bloc/recipe_create_cubit.dart | 4 +- .../bloc/recipe_create_state.dart | 2 +- .../bloc/recipe_create_state.freezed.dart | 62 +++++++++---------- .../pages/recipe_create_screen.dart | 6 +- .../pages/recipe_edit_screen.dart | 6 +- 12 files changed, 76 insertions(+), 76 deletions(-) diff --git a/lib/features/blog_post_create/bloc/blog_post_create_cubit/blog_post_create_cubit.dart b/lib/features/blog_post_create/bloc/blog_post_create_cubit/blog_post_create_cubit.dart index e66401f2..81784e5f 100644 --- a/lib/features/blog_post_create/bloc/blog_post_create_cubit/blog_post_create_cubit.dart +++ b/lib/features/blog_post_create/bloc/blog_post_create_cubit/blog_post_create_cubit.dart @@ -12,14 +12,14 @@ class BlogPostCreateCubit extends Cubit { createBlogPost({ String? title, - String? youtubeURL, + String? videoUrl, String? description, XFile? image, }) async { emit(BlogPostCreateState.loading()); await blogPostRepository.createBlogPost( title, - youtubeURL, + videoUrl, description, image, ); diff --git a/lib/features/blog_post_create/models/blog_post_create_credentials_model.dart b/lib/features/blog_post_create/models/blog_post_create_credentials_model.dart index d935cd62..ab3111c3 100644 --- a/lib/features/blog_post_create/models/blog_post_create_credentials_model.dart +++ b/lib/features/blog_post_create/models/blog_post_create_credentials_model.dart @@ -9,7 +9,7 @@ class BlogPostCreateCredentialsModel with _$BlogPostCreateCredentialsModel { const factory BlogPostCreateCredentialsModel({ required String title, required String description, - @JsonKey(name: 'youtube_url') required String youtubeUrl, + @JsonKey(name: 'video_url') required String videoUrl, @Default('active') String status, }) = _BlogPostCreateCredentialsModel; diff --git a/lib/features/blog_post_create/presentation/pages/blog_post_create_screen.dart b/lib/features/blog_post_create/presentation/pages/blog_post_create_screen.dart index 2dce271e..e8bde070 100644 --- a/lib/features/blog_post_create/presentation/pages/blog_post_create_screen.dart +++ b/lib/features/blog_post_create/presentation/pages/blog_post_create_screen.dart @@ -29,7 +29,7 @@ class _BlogPostCreateScreenState extends State { XFile? image; final titleController = TextEditingController(); final descriptionController = TextEditingController(); - final youtubeUrlController = TextEditingController(); + final videoUrlController = TextEditingController(); bool isLoading = false; @override @@ -141,7 +141,7 @@ class _BlogPostCreateScreenState extends State { blogPostCubit.createBlogPost( title: titleController.text, description: descriptionController.text, - youtubeURL: youtubeUrlController.text, + videoUrl: videoUrlController.text, image: image, ); }, @@ -167,15 +167,15 @@ class _BlogPostCreateScreenState extends State { minLines: 4, ), SizedBox(height: 16), - if (youtubeUrlController.text.isEmpty) Text('Изображение поста'), - if (youtubeUrlController.text.isEmpty) SizedBox(height: 8), - if (youtubeUrlController.text.isEmpty) _buildAddPhoto(), + if (videoUrlController.text.isEmpty) Text('Изображение поста'), + if (videoUrlController.text.isEmpty) SizedBox(height: 8), + if (videoUrlController.text.isEmpty) _buildAddPhoto(), SizedBox(height: 16), if (image == null) Text('Ссылка на видео'), if (image == null) SizedBox(height: 8), if (image == null) CustomTextFormField( - controller: youtubeUrlController, + controller: videoUrlController, ), SizedBox(height: 80), ], diff --git a/lib/features/blog_post_create/repositories/blog_post_repository.dart b/lib/features/blog_post_create/repositories/blog_post_repository.dart index 3c0e9c37..1f6331a0 100644 --- a/lib/features/blog_post_create/repositories/blog_post_repository.dart +++ b/lib/features/blog_post_create/repositories/blog_post_repository.dart @@ -13,7 +13,7 @@ class BlogPostRepository { Future createBlogPost( String? title, - String? youtubeURL, + String? videoUrl, String? description, XFile? image, ) async { @@ -21,7 +21,7 @@ class BlogPostRepository { 'title': title, 'description': description, 'state': 'active', - 'youtube_url': youtubeURL, + 'video_url': videoUrl, 'image': image != null ? await MultipartFile.fromFile((await ImageCompressUtility.compressFile(File(image.path))).path, filename: image.name) : null, }); diff --git a/lib/features/feed/models/feed_blog_post_model.dart b/lib/features/feed/models/feed_blog_post_model.dart index f904032d..f56c2998 100644 --- a/lib/features/feed/models/feed_blog_post_model.dart +++ b/lib/features/feed/models/feed_blog_post_model.dart @@ -12,7 +12,7 @@ class FeedBlogPostModel with _$FeedBlogPostModel { required String image, required String description, required Author author, - @JsonKey(name: "youtube_url") required String youtubeUrl, + @JsonKey(name: "video_url") required String videoUrl, @JsonKey(name: "created_at") required DateTime createdAt, @JsonKey(name: "updated_at") required DateTime updatedAt, required String title, diff --git a/lib/features/feed/models/feed_blog_post_model.freezed.dart b/lib/features/feed/models/feed_blog_post_model.freezed.dart index 89087373..7814df66 100644 --- a/lib/features/feed/models/feed_blog_post_model.freezed.dart +++ b/lib/features/feed/models/feed_blog_post_model.freezed.dart @@ -25,8 +25,8 @@ mixin _$FeedBlogPostModel { String get image => throw _privateConstructorUsedError; String get description => throw _privateConstructorUsedError; Author get author => throw _privateConstructorUsedError; - @JsonKey(name: "youtube_url") - String get youtubeUrl => throw _privateConstructorUsedError; + @JsonKey(name: "video_url") + String get videoUrl => throw _privateConstructorUsedError; @JsonKey(name: "created_at") DateTime get createdAt => throw _privateConstructorUsedError; @JsonKey(name: "updated_at") @@ -63,7 +63,7 @@ abstract class $FeedBlogPostModelCopyWith<$Res> { String image, String description, Author author, - @JsonKey(name: "youtube_url") String youtubeUrl, + @JsonKey(name: "video_url") String videoUrl, @JsonKey(name: "created_at") DateTime createdAt, @JsonKey(name: "updated_at") DateTime updatedAt, String title, @@ -95,7 +95,7 @@ class _$FeedBlogPostModelCopyWithImpl<$Res, $Val extends FeedBlogPostModel> Object? image = null, Object? description = null, Object? author = null, - Object? youtubeUrl = null, + Object? videoUrl = null, Object? createdAt = null, Object? updatedAt = null, Object? title = null, @@ -125,9 +125,9 @@ class _$FeedBlogPostModelCopyWithImpl<$Res, $Val extends FeedBlogPostModel> ? _value.author : author // ignore: cast_nullable_to_non_nullable as Author, - youtubeUrl: null == youtubeUrl - ? _value.youtubeUrl - : youtubeUrl // ignore: cast_nullable_to_non_nullable + videoUrl: null == videoUrl + ? _value.videoUrl + : videoUrl // ignore: cast_nullable_to_non_nullable as String, createdAt: null == createdAt ? _value.createdAt @@ -185,7 +185,7 @@ abstract class _$$FeedBlogPostModelImplCopyWith<$Res> String image, String description, Author author, - @JsonKey(name: "youtube_url") String youtubeUrl, + @JsonKey(name: "video_url") String videoUrl, @JsonKey(name: "created_at") DateTime createdAt, @JsonKey(name: "updated_at") DateTime updatedAt, String title, @@ -216,7 +216,7 @@ class __$$FeedBlogPostModelImplCopyWithImpl<$Res> Object? image = null, Object? description = null, Object? author = null, - Object? youtubeUrl = null, + Object? videoUrl = null, Object? createdAt = null, Object? updatedAt = null, Object? title = null, @@ -246,9 +246,9 @@ class __$$FeedBlogPostModelImplCopyWithImpl<$Res> ? _value.author : author // ignore: cast_nullable_to_non_nullable as Author, - youtubeUrl: null == youtubeUrl - ? _value.youtubeUrl - : youtubeUrl // ignore: cast_nullable_to_non_nullable + videoUrl: null == videoUrl + ? _value.videoUrl + : videoUrl // ignore: cast_nullable_to_non_nullable as String, createdAt: null == createdAt ? _value.createdAt @@ -291,7 +291,7 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel { required this.image, required this.description, required this.author, - @JsonKey(name: "youtube_url") required this.youtubeUrl, + @JsonKey(name: "video_url") required this.videoUrl, @JsonKey(name: "created_at") required this.createdAt, @JsonKey(name: "updated_at") required this.updatedAt, required this.title, @@ -314,8 +314,8 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel { @override final Author author; @override - @JsonKey(name: "youtube_url") - final String youtubeUrl; + @JsonKey(name: "video_url") + final String videoUrl; @override @JsonKey(name: "created_at") final DateTime createdAt; @@ -339,7 +339,7 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel { @override String toString() { - return 'FeedBlogPostModel(id: $id, state: $state, image: $image, description: $description, author: $author, youtubeUrl: $youtubeUrl, createdAt: $createdAt, updatedAt: $updatedAt, title: $title, totalLikes: $totalLikes, totalViews: $totalViews, totalComments: $totalComments, wasLikedByMe: $wasLikedByMe)'; + return 'FeedBlogPostModel(id: $id, state: $state, image: $image, description: $description, author: $author, videoUrl: $videoUrl, createdAt: $createdAt, updatedAt: $updatedAt, title: $title, totalLikes: $totalLikes, totalViews: $totalViews, totalComments: $totalComments, wasLikedByMe: $wasLikedByMe)'; } @override @@ -353,8 +353,8 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel { (identical(other.description, description) || other.description == description) && (identical(other.author, author) || other.author == author) && - (identical(other.youtubeUrl, youtubeUrl) || - other.youtubeUrl == youtubeUrl) && + (identical(other.videoUrl, videoUrl) || + other.videoUrl == videoUrl) && (identical(other.createdAt, createdAt) || other.createdAt == createdAt) && (identical(other.updatedAt, updatedAt) || @@ -379,7 +379,7 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel { image, description, author, - youtubeUrl, + videoUrl, createdAt, updatedAt, title, @@ -412,7 +412,7 @@ abstract class _FeedBlogPostModel implements FeedBlogPostModel { required final String image, required final String description, required final Author author, - @JsonKey(name: "youtube_url") required final String youtubeUrl, + @JsonKey(name: "video_url") required final String videoUrl, @JsonKey(name: "created_at") required final DateTime createdAt, @JsonKey(name: "updated_at") required final DateTime updatedAt, required final String title, @@ -436,8 +436,8 @@ abstract class _FeedBlogPostModel implements FeedBlogPostModel { @override Author get author; @override - @JsonKey(name: "youtube_url") - String get youtubeUrl; + @JsonKey(name: "video_url") + String get videoUrl; @override @JsonKey(name: "created_at") DateTime get createdAt; diff --git a/lib/features/feed/models/feed_blog_post_model.g.dart b/lib/features/feed/models/feed_blog_post_model.g.dart index fadf4302..50511fed 100644 --- a/lib/features/feed/models/feed_blog_post_model.g.dart +++ b/lib/features/feed/models/feed_blog_post_model.g.dart @@ -14,7 +14,7 @@ _$FeedBlogPostModelImpl _$$FeedBlogPostModelImplFromJson( image: json['image'] as String, description: json['description'] as String, author: Author.fromJson(json['author'] as Map), - youtubeUrl: json['youtube_url'] as String, + videoUrl: json['video_url'] as String, createdAt: DateTime.parse(json['created_at'] as String), updatedAt: DateTime.parse(json['updated_at'] as String), title: json['title'] as String, @@ -32,7 +32,7 @@ Map _$$FeedBlogPostModelImplToJson( 'image': instance.image, 'description': instance.description, 'author': instance.author, - 'youtube_url': instance.youtubeUrl, + 'video_url': instance.videoUrl, 'created_at': instance.createdAt.toIso8601String(), 'updated_at': instance.updatedAt.toIso8601String(), 'title': instance.title, diff --git a/lib/features/recipes/presentation/bloc/recipe_create_cubit.dart b/lib/features/recipes/presentation/bloc/recipe_create_cubit.dart index ecc3882a..e0cd0dce 100644 --- a/lib/features/recipes/presentation/bloc/recipe_create_cubit.dart +++ b/lib/features/recipes/presentation/bloc/recipe_create_cubit.dart @@ -76,7 +76,7 @@ class RecipeCreateCubit extends Cubit { productNameController: TextEditingController(), ingredientController: TextEditingController(), stepDescriptionController: TextEditingController(text: recipe.description), - youtubeLinkController: TextEditingController(text: recipe.video_url), + videoLinkController: TextEditingController(text: recipe.video_url), stepControllers: stepControllers ?? [], stepImages: stepImages ?? [], autocompleteList: [], @@ -124,7 +124,7 @@ class RecipeCreateCubit extends Cubit { productNameController: TextEditingController(), ingredientController: TextEditingController(), stepDescriptionController: TextEditingController(), - youtubeLinkController: TextEditingController(), + videoLinkController: TextEditingController(), stepControllers: [TextEditingController()], stepImages: [null], autocompleteList: [], diff --git a/lib/features/recipes/presentation/bloc/recipe_create_state.dart b/lib/features/recipes/presentation/bloc/recipe_create_state.dart index d80630da..8e84b19b 100644 --- a/lib/features/recipes/presentation/bloc/recipe_create_state.dart +++ b/lib/features/recipes/presentation/bloc/recipe_create_state.dart @@ -20,7 +20,7 @@ abstract class RecipeCreateState with _$RecipeCreateState { required TextEditingController productNameController, required TextEditingController ingredientController, required TextEditingController stepDescriptionController, - required TextEditingController youtubeLinkController, + required TextEditingController videoLinkController, required List stepControllers, XFile? recipeImage, required List stepImages, diff --git a/lib/features/recipes/presentation/bloc/recipe_create_state.freezed.dart b/lib/features/recipes/presentation/bloc/recipe_create_state.freezed.dart index e15a1a52..672872e2 100644 --- a/lib/features/recipes/presentation/bloc/recipe_create_state.freezed.dart +++ b/lib/features/recipes/presentation/bloc/recipe_create_state.freezed.dart @@ -27,7 +27,7 @@ mixin _$RecipeCreateState { TextEditingController productNameController, TextEditingController ingredientController, TextEditingController stepDescriptionController, - TextEditingController youtubeLinkController, + TextEditingController videoLinkController, List stepControllers, XFile? recipeImage, List stepImages, @@ -56,7 +56,7 @@ mixin _$RecipeCreateState { TextEditingController productNameController, TextEditingController ingredientController, TextEditingController stepDescriptionController, - TextEditingController youtubeLinkController, + TextEditingController videoLinkController, List stepControllers, XFile? recipeImage, List stepImages, @@ -85,7 +85,7 @@ mixin _$RecipeCreateState { TextEditingController productNameController, TextEditingController ingredientController, TextEditingController stepDescriptionController, - TextEditingController youtubeLinkController, + TextEditingController videoLinkController, List stepControllers, XFile? recipeImage, List stepImages, @@ -202,7 +202,7 @@ class _$RecipeCreateStateImpl implements _RecipeCreateState { TextEditingController productNameController, TextEditingController ingredientController, TextEditingController stepDescriptionController, - TextEditingController youtubeLinkController, + TextEditingController videoLinkController, List stepControllers, XFile? recipeImage, List stepImages, @@ -234,7 +234,7 @@ class _$RecipeCreateStateImpl implements _RecipeCreateState { TextEditingController productNameController, TextEditingController ingredientController, TextEditingController stepDescriptionController, - TextEditingController youtubeLinkController, + TextEditingController videoLinkController, List stepControllers, XFile? recipeImage, List stepImages, @@ -266,7 +266,7 @@ class _$RecipeCreateStateImpl implements _RecipeCreateState { TextEditingController productNameController, TextEditingController ingredientController, TextEditingController stepDescriptionController, - TextEditingController youtubeLinkController, + TextEditingController videoLinkController, List stepControllers, XFile? recipeImage, List stepImages, @@ -386,7 +386,7 @@ class _$RecipeCreateStateLoadingImpl implements RecipeCreateStateLoading { TextEditingController productNameController, TextEditingController ingredientController, TextEditingController stepDescriptionController, - TextEditingController youtubeLinkController, + TextEditingController videoLinkController, List stepControllers, XFile? recipeImage, List stepImages, @@ -418,7 +418,7 @@ class _$RecipeCreateStateLoadingImpl implements RecipeCreateStateLoading { TextEditingController productNameController, TextEditingController ingredientController, TextEditingController stepDescriptionController, - TextEditingController youtubeLinkController, + TextEditingController videoLinkController, List stepControllers, XFile? recipeImage, List stepImages, @@ -450,7 +450,7 @@ class _$RecipeCreateStateLoadingImpl implements RecipeCreateStateLoading { TextEditingController productNameController, TextEditingController ingredientController, TextEditingController stepDescriptionController, - TextEditingController youtubeLinkController, + TextEditingController videoLinkController, List stepControllers, XFile? recipeImage, List stepImages, @@ -530,7 +530,7 @@ abstract class _$$RecipeCreateStateLoadedImplCopyWith<$Res> { TextEditingController productNameController, TextEditingController ingredientController, TextEditingController stepDescriptionController, - TextEditingController youtubeLinkController, + TextEditingController videoLinkController, List stepControllers, XFile? recipeImage, List stepImages, @@ -571,7 +571,7 @@ class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res> Object? productNameController = null, Object? ingredientController = null, Object? stepDescriptionController = null, - Object? youtubeLinkController = null, + Object? videoLinkController = null, Object? stepControllers = null, Object? recipeImage = freezed, Object? stepImages = null, @@ -611,9 +611,9 @@ class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res> ? _value.stepDescriptionController : stepDescriptionController // ignore: cast_nullable_to_non_nullable as TextEditingController, - youtubeLinkController: null == youtubeLinkController - ? _value.youtubeLinkController - : youtubeLinkController // ignore: cast_nullable_to_non_nullable + videoLinkController: null == videoLinkController + ? _value.videoLinkController + : videoLinkController // ignore: cast_nullable_to_non_nullable as TextEditingController, stepControllers: null == stepControllers ? _value._stepControllers @@ -726,7 +726,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { required this.productNameController, required this.ingredientController, required this.stepDescriptionController, - required this.youtubeLinkController, + required this.videoLinkController, required final List stepControllers, this.recipeImage, required final List stepImages, @@ -761,7 +761,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { @override final TextEditingController stepDescriptionController; @override - final TextEditingController youtubeLinkController; + final TextEditingController videoLinkController; final List _stepControllers; @override List get stepControllers { @@ -834,7 +834,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { @override String toString() { - return 'RecipeCreateState.loaded(recipe: $recipe, picker: $picker, titleController: $titleController, productNameController: $productNameController, ingredientController: $ingredientController, stepDescriptionController: $stepDescriptionController, youtubeLinkController: $youtubeLinkController, stepControllers: $stepControllers, recipeImage: $recipeImage, stepImages: $stepImages, ingredients: $ingredients, autocompleteList: $autocompleteList, numberOfSteps: $numberOfSteps, ingredientAsItems: $ingredientAsItems, types: $types, cookingTimes: $cookingTimes, statuses: $statuses, selectedType: $selectedType, selectedCookingTime: $selectedCookingTime, selectedStatus: $selectedStatus)'; + return 'RecipeCreateState.loaded(recipe: $recipe, picker: $picker, titleController: $titleController, productNameController: $productNameController, ingredientController: $ingredientController, stepDescriptionController: $stepDescriptionController, videoLinkController: $videoLinkController, stepControllers: $stepControllers, recipeImage: $recipeImage, stepImages: $stepImages, ingredients: $ingredients, autocompleteList: $autocompleteList, numberOfSteps: $numberOfSteps, ingredientAsItems: $ingredientAsItems, types: $types, cookingTimes: $cookingTimes, statuses: $statuses, selectedType: $selectedType, selectedCookingTime: $selectedCookingTime, selectedStatus: $selectedStatus)'; } @override @@ -853,8 +853,8 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { (identical(other.stepDescriptionController, stepDescriptionController) || other.stepDescriptionController == stepDescriptionController) && - (identical(other.youtubeLinkController, youtubeLinkController) || - other.youtubeLinkController == youtubeLinkController) && + (identical(other.videoLinkController, videoLinkController) || + other.videoLinkController == videoLinkController) && const DeepCollectionEquality() .equals(other._stepControllers, _stepControllers) && (identical(other.recipeImage, recipeImage) || @@ -890,7 +890,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { productNameController, ingredientController, stepDescriptionController, - youtubeLinkController, + videoLinkController, const DeepCollectionEquality().hash(_stepControllers), recipeImage, const DeepCollectionEquality().hash(_stepImages), @@ -927,7 +927,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { TextEditingController productNameController, TextEditingController ingredientController, TextEditingController stepDescriptionController, - TextEditingController youtubeLinkController, + TextEditingController videoLinkController, List stepControllers, XFile? recipeImage, List stepImages, @@ -951,7 +951,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { productNameController, ingredientController, stepDescriptionController, - youtubeLinkController, + videoLinkController, stepControllers, recipeImage, stepImages, @@ -979,7 +979,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { TextEditingController productNameController, TextEditingController ingredientController, TextEditingController stepDescriptionController, - TextEditingController youtubeLinkController, + TextEditingController videoLinkController, List stepControllers, XFile? recipeImage, List stepImages, @@ -1003,7 +1003,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { productNameController, ingredientController, stepDescriptionController, - youtubeLinkController, + videoLinkController, stepControllers, recipeImage, stepImages, @@ -1031,7 +1031,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { TextEditingController productNameController, TextEditingController ingredientController, TextEditingController stepDescriptionController, - TextEditingController youtubeLinkController, + TextEditingController videoLinkController, List stepControllers, XFile? recipeImage, List stepImages, @@ -1057,7 +1057,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { productNameController, ingredientController, stepDescriptionController, - youtubeLinkController, + videoLinkController, stepControllers, recipeImage, stepImages, @@ -1121,7 +1121,7 @@ abstract class RecipeCreateStateLoaded implements RecipeCreateState { required final TextEditingController productNameController, required final TextEditingController ingredientController, required final TextEditingController stepDescriptionController, - required final TextEditingController youtubeLinkController, + required final TextEditingController videoLinkController, required final List stepControllers, final XFile? recipeImage, required final List stepImages, @@ -1143,7 +1143,7 @@ abstract class RecipeCreateStateLoaded implements RecipeCreateState { TextEditingController get productNameController; TextEditingController get ingredientController; TextEditingController get stepDescriptionController; - TextEditingController get youtubeLinkController; + TextEditingController get videoLinkController; List get stepControllers; XFile? get recipeImage; List get stepImages; @@ -1246,7 +1246,7 @@ class _$RecipeCreateStateErrorImpl implements RecipeCreateStateError { TextEditingController productNameController, TextEditingController ingredientController, TextEditingController stepDescriptionController, - TextEditingController youtubeLinkController, + TextEditingController videoLinkController, List stepControllers, XFile? recipeImage, List stepImages, @@ -1278,7 +1278,7 @@ class _$RecipeCreateStateErrorImpl implements RecipeCreateStateError { TextEditingController productNameController, TextEditingController ingredientController, TextEditingController stepDescriptionController, - TextEditingController youtubeLinkController, + TextEditingController videoLinkController, List stepControllers, XFile? recipeImage, List stepImages, @@ -1310,7 +1310,7 @@ class _$RecipeCreateStateErrorImpl implements RecipeCreateStateError { TextEditingController productNameController, TextEditingController ingredientController, TextEditingController stepDescriptionController, - TextEditingController youtubeLinkController, + TextEditingController videoLinkController, List stepControllers, XFile? recipeImage, List stepImages, diff --git a/lib/features/recipes/presentation/pages/recipe_create_screen.dart b/lib/features/recipes/presentation/pages/recipe_create_screen.dart index 08a0dd94..bc95e6c3 100644 --- a/lib/features/recipes/presentation/pages/recipe_create_screen.dart +++ b/lib/features/recipes/presentation/pages/recipe_create_screen.dart @@ -305,12 +305,12 @@ class RecipeCreateScreen extends StatelessWidget { ), ), SizedBox(height: 24), - Text('Ссылка на видео (YouTube)'), + Text('Ссылка на видео (video)'), SizedBox(height: 8), CustomTextFormField( hintText: 'Введите описание шага', fillColor: appTheme.gray50, - controller: state.youtubeLinkController, + controller: state.videoLinkController, ), SizedBox(height: 24), Container( @@ -500,7 +500,7 @@ class RecipeCreateScreen extends StatelessWidget { description: state.stepDescriptionController.text, title: state.titleController.text, image: state.recipeImage?.path, - video_url: state.youtubeLinkController.text.isNotEmpty ? state.youtubeLinkController.text : null, + video_url: state.videoLinkController.text.isNotEmpty ? state.videoLinkController.text : null, ); return recipe; diff --git a/lib/features/recipes/presentation/pages/recipe_edit_screen.dart b/lib/features/recipes/presentation/pages/recipe_edit_screen.dart index 644b581d..dffccf3f 100644 --- a/lib/features/recipes/presentation/pages/recipe_edit_screen.dart +++ b/lib/features/recipes/presentation/pages/recipe_edit_screen.dart @@ -310,12 +310,12 @@ class RecipeEditScreen extends StatelessWidget { ), ), SizedBox(height: 24), - Text('Ссылка на видео (YouTube)'), + Text('Ссылка на видео (video)'), SizedBox(height: 8), CustomTextFormField( hintText: 'Введите описание шага', fillColor: appTheme.gray50, - controller: state.youtubeLinkController, + controller: state.videoLinkController, ), SizedBox(height: 24), Container( @@ -509,7 +509,7 @@ class RecipeEditScreen extends StatelessWidget { description: state.stepDescriptionController.text, title: state.titleController.text, image: state.recipeImage?.path, - video_url: state.youtubeLinkController.text.isNotEmpty ? state.youtubeLinkController.text : null, + video_url: state.videoLinkController.text.isNotEmpty ? state.videoLinkController.text : null, ); return recipe; }