fix: youtube_url => video_url

This commit is contained in:
mso7nueh
2024-11-25 15:47:54 +03:00
parent 35d3855613
commit e4bca86b9e
12 changed files with 76 additions and 76 deletions

View File

@@ -12,14 +12,14 @@ class BlogPostCreateCubit extends Cubit<BlogPostCreateState> {
createBlogPost({ createBlogPost({
String? title, String? title,
String? youtubeURL, String? videoUrl,
String? description, String? description,
XFile? image, XFile? image,
}) async { }) async {
emit(BlogPostCreateState.loading()); emit(BlogPostCreateState.loading());
await blogPostRepository.createBlogPost( await blogPostRepository.createBlogPost(
title, title,
youtubeURL, videoUrl,
description, description,
image, image,
); );

View File

@@ -9,7 +9,7 @@ class BlogPostCreateCredentialsModel with _$BlogPostCreateCredentialsModel {
const factory BlogPostCreateCredentialsModel({ const factory BlogPostCreateCredentialsModel({
required String title, required String title,
required String description, required String description,
@JsonKey(name: 'youtube_url') required String youtubeUrl, @JsonKey(name: 'video_url') required String videoUrl,
@Default('active') String status, @Default('active') String status,
}) = _BlogPostCreateCredentialsModel; }) = _BlogPostCreateCredentialsModel;

View File

@@ -29,7 +29,7 @@ class _BlogPostCreateScreenState extends State<BlogPostCreateScreen> {
XFile? image; XFile? image;
final titleController = TextEditingController(); final titleController = TextEditingController();
final descriptionController = TextEditingController(); final descriptionController = TextEditingController();
final youtubeUrlController = TextEditingController(); final videoUrlController = TextEditingController();
bool isLoading = false; bool isLoading = false;
@override @override
@@ -141,7 +141,7 @@ class _BlogPostCreateScreenState extends State<BlogPostCreateScreen> {
blogPostCubit.createBlogPost( blogPostCubit.createBlogPost(
title: titleController.text, title: titleController.text,
description: descriptionController.text, description: descriptionController.text,
youtubeURL: youtubeUrlController.text, videoUrl: videoUrlController.text,
image: image, image: image,
); );
}, },
@@ -167,15 +167,15 @@ class _BlogPostCreateScreenState extends State<BlogPostCreateScreen> {
minLines: 4, minLines: 4,
), ),
SizedBox(height: 16), SizedBox(height: 16),
if (youtubeUrlController.text.isEmpty) Text('Изображение поста'), if (videoUrlController.text.isEmpty) Text('Изображение поста'),
if (youtubeUrlController.text.isEmpty) SizedBox(height: 8), if (videoUrlController.text.isEmpty) SizedBox(height: 8),
if (youtubeUrlController.text.isEmpty) _buildAddPhoto(), if (videoUrlController.text.isEmpty) _buildAddPhoto(),
SizedBox(height: 16), SizedBox(height: 16),
if (image == null) Text('Ссылка на видео'), if (image == null) Text('Ссылка на видео'),
if (image == null) SizedBox(height: 8), if (image == null) SizedBox(height: 8),
if (image == null) if (image == null)
CustomTextFormField( CustomTextFormField(
controller: youtubeUrlController, controller: videoUrlController,
), ),
SizedBox(height: 80), SizedBox(height: 80),
], ],

View File

@@ -13,7 +13,7 @@ class BlogPostRepository {
Future<void> createBlogPost( Future<void> createBlogPost(
String? title, String? title,
String? youtubeURL, String? videoUrl,
String? description, String? description,
XFile? image, XFile? image,
) async { ) async {
@@ -21,7 +21,7 @@ class BlogPostRepository {
'title': title, 'title': title,
'description': description, 'description': description,
'state': 'active', '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, 'image': image != null ? await MultipartFile.fromFile((await ImageCompressUtility.compressFile(File(image.path))).path, filename: image.name) : null,
}); });

View File

@@ -12,7 +12,7 @@ class FeedBlogPostModel with _$FeedBlogPostModel {
required String image, required String image,
required String description, required String description,
required Author author, 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: "created_at") required DateTime createdAt,
@JsonKey(name: "updated_at") required DateTime updatedAt, @JsonKey(name: "updated_at") required DateTime updatedAt,
required String title, required String title,

View File

@@ -25,8 +25,8 @@ mixin _$FeedBlogPostModel {
String get image => throw _privateConstructorUsedError; String get image => throw _privateConstructorUsedError;
String get description => throw _privateConstructorUsedError; String get description => throw _privateConstructorUsedError;
Author get author => throw _privateConstructorUsedError; Author get author => throw _privateConstructorUsedError;
@JsonKey(name: "youtube_url") @JsonKey(name: "video_url")
String get youtubeUrl => throw _privateConstructorUsedError; String get videoUrl => throw _privateConstructorUsedError;
@JsonKey(name: "created_at") @JsonKey(name: "created_at")
DateTime get createdAt => throw _privateConstructorUsedError; DateTime get createdAt => throw _privateConstructorUsedError;
@JsonKey(name: "updated_at") @JsonKey(name: "updated_at")
@@ -63,7 +63,7 @@ abstract class $FeedBlogPostModelCopyWith<$Res> {
String image, String image,
String description, String description,
Author author, Author author,
@JsonKey(name: "youtube_url") String youtubeUrl, @JsonKey(name: "video_url") String videoUrl,
@JsonKey(name: "created_at") DateTime createdAt, @JsonKey(name: "created_at") DateTime createdAt,
@JsonKey(name: "updated_at") DateTime updatedAt, @JsonKey(name: "updated_at") DateTime updatedAt,
String title, String title,
@@ -95,7 +95,7 @@ class _$FeedBlogPostModelCopyWithImpl<$Res, $Val extends FeedBlogPostModel>
Object? image = null, Object? image = null,
Object? description = null, Object? description = null,
Object? author = null, Object? author = null,
Object? youtubeUrl = null, Object? videoUrl = null,
Object? createdAt = null, Object? createdAt = null,
Object? updatedAt = null, Object? updatedAt = null,
Object? title = null, Object? title = null,
@@ -125,9 +125,9 @@ class _$FeedBlogPostModelCopyWithImpl<$Res, $Val extends FeedBlogPostModel>
? _value.author ? _value.author
: author // ignore: cast_nullable_to_non_nullable : author // ignore: cast_nullable_to_non_nullable
as Author, as Author,
youtubeUrl: null == youtubeUrl videoUrl: null == videoUrl
? _value.youtubeUrl ? _value.videoUrl
: youtubeUrl // ignore: cast_nullable_to_non_nullable : videoUrl // ignore: cast_nullable_to_non_nullable
as String, as String,
createdAt: null == createdAt createdAt: null == createdAt
? _value.createdAt ? _value.createdAt
@@ -185,7 +185,7 @@ abstract class _$$FeedBlogPostModelImplCopyWith<$Res>
String image, String image,
String description, String description,
Author author, Author author,
@JsonKey(name: "youtube_url") String youtubeUrl, @JsonKey(name: "video_url") String videoUrl,
@JsonKey(name: "created_at") DateTime createdAt, @JsonKey(name: "created_at") DateTime createdAt,
@JsonKey(name: "updated_at") DateTime updatedAt, @JsonKey(name: "updated_at") DateTime updatedAt,
String title, String title,
@@ -216,7 +216,7 @@ class __$$FeedBlogPostModelImplCopyWithImpl<$Res>
Object? image = null, Object? image = null,
Object? description = null, Object? description = null,
Object? author = null, Object? author = null,
Object? youtubeUrl = null, Object? videoUrl = null,
Object? createdAt = null, Object? createdAt = null,
Object? updatedAt = null, Object? updatedAt = null,
Object? title = null, Object? title = null,
@@ -246,9 +246,9 @@ class __$$FeedBlogPostModelImplCopyWithImpl<$Res>
? _value.author ? _value.author
: author // ignore: cast_nullable_to_non_nullable : author // ignore: cast_nullable_to_non_nullable
as Author, as Author,
youtubeUrl: null == youtubeUrl videoUrl: null == videoUrl
? _value.youtubeUrl ? _value.videoUrl
: youtubeUrl // ignore: cast_nullable_to_non_nullable : videoUrl // ignore: cast_nullable_to_non_nullable
as String, as String,
createdAt: null == createdAt createdAt: null == createdAt
? _value.createdAt ? _value.createdAt
@@ -291,7 +291,7 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel {
required this.image, required this.image,
required this.description, required this.description,
required this.author, 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: "created_at") required this.createdAt,
@JsonKey(name: "updated_at") required this.updatedAt, @JsonKey(name: "updated_at") required this.updatedAt,
required this.title, required this.title,
@@ -314,8 +314,8 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel {
@override @override
final Author author; final Author author;
@override @override
@JsonKey(name: "youtube_url") @JsonKey(name: "video_url")
final String youtubeUrl; final String videoUrl;
@override @override
@JsonKey(name: "created_at") @JsonKey(name: "created_at")
final DateTime createdAt; final DateTime createdAt;
@@ -339,7 +339,7 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel {
@override @override
String toString() { 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 @override
@@ -353,8 +353,8 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel {
(identical(other.description, description) || (identical(other.description, description) ||
other.description == description) && other.description == description) &&
(identical(other.author, author) || other.author == author) && (identical(other.author, author) || other.author == author) &&
(identical(other.youtubeUrl, youtubeUrl) || (identical(other.videoUrl, videoUrl) ||
other.youtubeUrl == youtubeUrl) && other.videoUrl == videoUrl) &&
(identical(other.createdAt, createdAt) || (identical(other.createdAt, createdAt) ||
other.createdAt == createdAt) && other.createdAt == createdAt) &&
(identical(other.updatedAt, updatedAt) || (identical(other.updatedAt, updatedAt) ||
@@ -379,7 +379,7 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel {
image, image,
description, description,
author, author,
youtubeUrl, videoUrl,
createdAt, createdAt,
updatedAt, updatedAt,
title, title,
@@ -412,7 +412,7 @@ abstract class _FeedBlogPostModel implements FeedBlogPostModel {
required final String image, required final String image,
required final String description, required final String description,
required final Author author, 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: "created_at") required final DateTime createdAt,
@JsonKey(name: "updated_at") required final DateTime updatedAt, @JsonKey(name: "updated_at") required final DateTime updatedAt,
required final String title, required final String title,
@@ -436,8 +436,8 @@ abstract class _FeedBlogPostModel implements FeedBlogPostModel {
@override @override
Author get author; Author get author;
@override @override
@JsonKey(name: "youtube_url") @JsonKey(name: "video_url")
String get youtubeUrl; String get videoUrl;
@override @override
@JsonKey(name: "created_at") @JsonKey(name: "created_at")
DateTime get createdAt; DateTime get createdAt;

View File

@@ -14,7 +14,7 @@ _$FeedBlogPostModelImpl _$$FeedBlogPostModelImplFromJson(
image: json['image'] as String, image: json['image'] as String,
description: json['description'] as String, description: json['description'] as String,
author: Author.fromJson(json['author'] as Map<String, dynamic>), author: Author.fromJson(json['author'] as Map<String, dynamic>),
youtubeUrl: json['youtube_url'] as String, videoUrl: json['video_url'] as String,
createdAt: DateTime.parse(json['created_at'] as String), createdAt: DateTime.parse(json['created_at'] as String),
updatedAt: DateTime.parse(json['updated_at'] as String), updatedAt: DateTime.parse(json['updated_at'] as String),
title: json['title'] as String, title: json['title'] as String,
@@ -32,7 +32,7 @@ Map<String, dynamic> _$$FeedBlogPostModelImplToJson(
'image': instance.image, 'image': instance.image,
'description': instance.description, 'description': instance.description,
'author': instance.author, 'author': instance.author,
'youtube_url': instance.youtubeUrl, 'video_url': instance.videoUrl,
'created_at': instance.createdAt.toIso8601String(), 'created_at': instance.createdAt.toIso8601String(),
'updated_at': instance.updatedAt.toIso8601String(), 'updated_at': instance.updatedAt.toIso8601String(),
'title': instance.title, 'title': instance.title,

View File

@@ -76,7 +76,7 @@ class RecipeCreateCubit extends Cubit<RecipeCreateState> {
productNameController: TextEditingController(), productNameController: TextEditingController(),
ingredientController: TextEditingController(), ingredientController: TextEditingController(),
stepDescriptionController: TextEditingController(text: recipe.description), stepDescriptionController: TextEditingController(text: recipe.description),
youtubeLinkController: TextEditingController(text: recipe.video_url), videoLinkController: TextEditingController(text: recipe.video_url),
stepControllers: stepControllers ?? [], stepControllers: stepControllers ?? [],
stepImages: stepImages ?? [], stepImages: stepImages ?? [],
autocompleteList: [], autocompleteList: [],
@@ -124,7 +124,7 @@ class RecipeCreateCubit extends Cubit<RecipeCreateState> {
productNameController: TextEditingController(), productNameController: TextEditingController(),
ingredientController: TextEditingController(), ingredientController: TextEditingController(),
stepDescriptionController: TextEditingController(), stepDescriptionController: TextEditingController(),
youtubeLinkController: TextEditingController(), videoLinkController: TextEditingController(),
stepControllers: [TextEditingController()], stepControllers: [TextEditingController()],
stepImages: [null], stepImages: [null],
autocompleteList: [], autocompleteList: [],

View File

@@ -20,7 +20,7 @@ abstract class RecipeCreateState with _$RecipeCreateState {
required TextEditingController productNameController, required TextEditingController productNameController,
required TextEditingController ingredientController, required TextEditingController ingredientController,
required TextEditingController stepDescriptionController, required TextEditingController stepDescriptionController,
required TextEditingController youtubeLinkController, required TextEditingController videoLinkController,
required List<TextEditingController> stepControllers, required List<TextEditingController> stepControllers,
XFile? recipeImage, XFile? recipeImage,
required List<XFile?> stepImages, required List<XFile?> stepImages,

View File

@@ -27,7 +27,7 @@ mixin _$RecipeCreateState {
TextEditingController productNameController, TextEditingController productNameController,
TextEditingController ingredientController, TextEditingController ingredientController,
TextEditingController stepDescriptionController, TextEditingController stepDescriptionController,
TextEditingController youtubeLinkController, TextEditingController videoLinkController,
List<TextEditingController> stepControllers, List<TextEditingController> stepControllers,
XFile? recipeImage, XFile? recipeImage,
List<XFile?> stepImages, List<XFile?> stepImages,
@@ -56,7 +56,7 @@ mixin _$RecipeCreateState {
TextEditingController productNameController, TextEditingController productNameController,
TextEditingController ingredientController, TextEditingController ingredientController,
TextEditingController stepDescriptionController, TextEditingController stepDescriptionController,
TextEditingController youtubeLinkController, TextEditingController videoLinkController,
List<TextEditingController> stepControllers, List<TextEditingController> stepControllers,
XFile? recipeImage, XFile? recipeImage,
List<XFile?> stepImages, List<XFile?> stepImages,
@@ -85,7 +85,7 @@ mixin _$RecipeCreateState {
TextEditingController productNameController, TextEditingController productNameController,
TextEditingController ingredientController, TextEditingController ingredientController,
TextEditingController stepDescriptionController, TextEditingController stepDescriptionController,
TextEditingController youtubeLinkController, TextEditingController videoLinkController,
List<TextEditingController> stepControllers, List<TextEditingController> stepControllers,
XFile? recipeImage, XFile? recipeImage,
List<XFile?> stepImages, List<XFile?> stepImages,
@@ -202,7 +202,7 @@ class _$RecipeCreateStateImpl implements _RecipeCreateState {
TextEditingController productNameController, TextEditingController productNameController,
TextEditingController ingredientController, TextEditingController ingredientController,
TextEditingController stepDescriptionController, TextEditingController stepDescriptionController,
TextEditingController youtubeLinkController, TextEditingController videoLinkController,
List<TextEditingController> stepControllers, List<TextEditingController> stepControllers,
XFile? recipeImage, XFile? recipeImage,
List<XFile?> stepImages, List<XFile?> stepImages,
@@ -234,7 +234,7 @@ class _$RecipeCreateStateImpl implements _RecipeCreateState {
TextEditingController productNameController, TextEditingController productNameController,
TextEditingController ingredientController, TextEditingController ingredientController,
TextEditingController stepDescriptionController, TextEditingController stepDescriptionController,
TextEditingController youtubeLinkController, TextEditingController videoLinkController,
List<TextEditingController> stepControllers, List<TextEditingController> stepControllers,
XFile? recipeImage, XFile? recipeImage,
List<XFile?> stepImages, List<XFile?> stepImages,
@@ -266,7 +266,7 @@ class _$RecipeCreateStateImpl implements _RecipeCreateState {
TextEditingController productNameController, TextEditingController productNameController,
TextEditingController ingredientController, TextEditingController ingredientController,
TextEditingController stepDescriptionController, TextEditingController stepDescriptionController,
TextEditingController youtubeLinkController, TextEditingController videoLinkController,
List<TextEditingController> stepControllers, List<TextEditingController> stepControllers,
XFile? recipeImage, XFile? recipeImage,
List<XFile?> stepImages, List<XFile?> stepImages,
@@ -386,7 +386,7 @@ class _$RecipeCreateStateLoadingImpl implements RecipeCreateStateLoading {
TextEditingController productNameController, TextEditingController productNameController,
TextEditingController ingredientController, TextEditingController ingredientController,
TextEditingController stepDescriptionController, TextEditingController stepDescriptionController,
TextEditingController youtubeLinkController, TextEditingController videoLinkController,
List<TextEditingController> stepControllers, List<TextEditingController> stepControllers,
XFile? recipeImage, XFile? recipeImage,
List<XFile?> stepImages, List<XFile?> stepImages,
@@ -418,7 +418,7 @@ class _$RecipeCreateStateLoadingImpl implements RecipeCreateStateLoading {
TextEditingController productNameController, TextEditingController productNameController,
TextEditingController ingredientController, TextEditingController ingredientController,
TextEditingController stepDescriptionController, TextEditingController stepDescriptionController,
TextEditingController youtubeLinkController, TextEditingController videoLinkController,
List<TextEditingController> stepControllers, List<TextEditingController> stepControllers,
XFile? recipeImage, XFile? recipeImage,
List<XFile?> stepImages, List<XFile?> stepImages,
@@ -450,7 +450,7 @@ class _$RecipeCreateStateLoadingImpl implements RecipeCreateStateLoading {
TextEditingController productNameController, TextEditingController productNameController,
TextEditingController ingredientController, TextEditingController ingredientController,
TextEditingController stepDescriptionController, TextEditingController stepDescriptionController,
TextEditingController youtubeLinkController, TextEditingController videoLinkController,
List<TextEditingController> stepControllers, List<TextEditingController> stepControllers,
XFile? recipeImage, XFile? recipeImage,
List<XFile?> stepImages, List<XFile?> stepImages,
@@ -530,7 +530,7 @@ abstract class _$$RecipeCreateStateLoadedImplCopyWith<$Res> {
TextEditingController productNameController, TextEditingController productNameController,
TextEditingController ingredientController, TextEditingController ingredientController,
TextEditingController stepDescriptionController, TextEditingController stepDescriptionController,
TextEditingController youtubeLinkController, TextEditingController videoLinkController,
List<TextEditingController> stepControllers, List<TextEditingController> stepControllers,
XFile? recipeImage, XFile? recipeImage,
List<XFile?> stepImages, List<XFile?> stepImages,
@@ -571,7 +571,7 @@ class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res>
Object? productNameController = null, Object? productNameController = null,
Object? ingredientController = null, Object? ingredientController = null,
Object? stepDescriptionController = null, Object? stepDescriptionController = null,
Object? youtubeLinkController = null, Object? videoLinkController = null,
Object? stepControllers = null, Object? stepControllers = null,
Object? recipeImage = freezed, Object? recipeImage = freezed,
Object? stepImages = null, Object? stepImages = null,
@@ -611,9 +611,9 @@ class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res>
? _value.stepDescriptionController ? _value.stepDescriptionController
: stepDescriptionController // ignore: cast_nullable_to_non_nullable : stepDescriptionController // ignore: cast_nullable_to_non_nullable
as TextEditingController, as TextEditingController,
youtubeLinkController: null == youtubeLinkController videoLinkController: null == videoLinkController
? _value.youtubeLinkController ? _value.videoLinkController
: youtubeLinkController // ignore: cast_nullable_to_non_nullable : videoLinkController // ignore: cast_nullable_to_non_nullable
as TextEditingController, as TextEditingController,
stepControllers: null == stepControllers stepControllers: null == stepControllers
? _value._stepControllers ? _value._stepControllers
@@ -726,7 +726,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded {
required this.productNameController, required this.productNameController,
required this.ingredientController, required this.ingredientController,
required this.stepDescriptionController, required this.stepDescriptionController,
required this.youtubeLinkController, required this.videoLinkController,
required final List<TextEditingController> stepControllers, required final List<TextEditingController> stepControllers,
this.recipeImage, this.recipeImage,
required final List<XFile?> stepImages, required final List<XFile?> stepImages,
@@ -761,7 +761,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded {
@override @override
final TextEditingController stepDescriptionController; final TextEditingController stepDescriptionController;
@override @override
final TextEditingController youtubeLinkController; final TextEditingController videoLinkController;
final List<TextEditingController> _stepControllers; final List<TextEditingController> _stepControllers;
@override @override
List<TextEditingController> get stepControllers { List<TextEditingController> get stepControllers {
@@ -834,7 +834,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded {
@override @override
String toString() { 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 @override
@@ -853,8 +853,8 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded {
(identical(other.stepDescriptionController, (identical(other.stepDescriptionController,
stepDescriptionController) || stepDescriptionController) ||
other.stepDescriptionController == stepDescriptionController) && other.stepDescriptionController == stepDescriptionController) &&
(identical(other.youtubeLinkController, youtubeLinkController) || (identical(other.videoLinkController, videoLinkController) ||
other.youtubeLinkController == youtubeLinkController) && other.videoLinkController == videoLinkController) &&
const DeepCollectionEquality() const DeepCollectionEquality()
.equals(other._stepControllers, _stepControllers) && .equals(other._stepControllers, _stepControllers) &&
(identical(other.recipeImage, recipeImage) || (identical(other.recipeImage, recipeImage) ||
@@ -890,7 +890,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded {
productNameController, productNameController,
ingredientController, ingredientController,
stepDescriptionController, stepDescriptionController,
youtubeLinkController, videoLinkController,
const DeepCollectionEquality().hash(_stepControllers), const DeepCollectionEquality().hash(_stepControllers),
recipeImage, recipeImage,
const DeepCollectionEquality().hash(_stepImages), const DeepCollectionEquality().hash(_stepImages),
@@ -927,7 +927,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded {
TextEditingController productNameController, TextEditingController productNameController,
TextEditingController ingredientController, TextEditingController ingredientController,
TextEditingController stepDescriptionController, TextEditingController stepDescriptionController,
TextEditingController youtubeLinkController, TextEditingController videoLinkController,
List<TextEditingController> stepControllers, List<TextEditingController> stepControllers,
XFile? recipeImage, XFile? recipeImage,
List<XFile?> stepImages, List<XFile?> stepImages,
@@ -951,7 +951,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded {
productNameController, productNameController,
ingredientController, ingredientController,
stepDescriptionController, stepDescriptionController,
youtubeLinkController, videoLinkController,
stepControllers, stepControllers,
recipeImage, recipeImage,
stepImages, stepImages,
@@ -979,7 +979,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded {
TextEditingController productNameController, TextEditingController productNameController,
TextEditingController ingredientController, TextEditingController ingredientController,
TextEditingController stepDescriptionController, TextEditingController stepDescriptionController,
TextEditingController youtubeLinkController, TextEditingController videoLinkController,
List<TextEditingController> stepControllers, List<TextEditingController> stepControllers,
XFile? recipeImage, XFile? recipeImage,
List<XFile?> stepImages, List<XFile?> stepImages,
@@ -1003,7 +1003,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded {
productNameController, productNameController,
ingredientController, ingredientController,
stepDescriptionController, stepDescriptionController,
youtubeLinkController, videoLinkController,
stepControllers, stepControllers,
recipeImage, recipeImage,
stepImages, stepImages,
@@ -1031,7 +1031,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded {
TextEditingController productNameController, TextEditingController productNameController,
TextEditingController ingredientController, TextEditingController ingredientController,
TextEditingController stepDescriptionController, TextEditingController stepDescriptionController,
TextEditingController youtubeLinkController, TextEditingController videoLinkController,
List<TextEditingController> stepControllers, List<TextEditingController> stepControllers,
XFile? recipeImage, XFile? recipeImage,
List<XFile?> stepImages, List<XFile?> stepImages,
@@ -1057,7 +1057,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded {
productNameController, productNameController,
ingredientController, ingredientController,
stepDescriptionController, stepDescriptionController,
youtubeLinkController, videoLinkController,
stepControllers, stepControllers,
recipeImage, recipeImage,
stepImages, stepImages,
@@ -1121,7 +1121,7 @@ abstract class RecipeCreateStateLoaded implements RecipeCreateState {
required final TextEditingController productNameController, required final TextEditingController productNameController,
required final TextEditingController ingredientController, required final TextEditingController ingredientController,
required final TextEditingController stepDescriptionController, required final TextEditingController stepDescriptionController,
required final TextEditingController youtubeLinkController, required final TextEditingController videoLinkController,
required final List<TextEditingController> stepControllers, required final List<TextEditingController> stepControllers,
final XFile? recipeImage, final XFile? recipeImage,
required final List<XFile?> stepImages, required final List<XFile?> stepImages,
@@ -1143,7 +1143,7 @@ abstract class RecipeCreateStateLoaded implements RecipeCreateState {
TextEditingController get productNameController; TextEditingController get productNameController;
TextEditingController get ingredientController; TextEditingController get ingredientController;
TextEditingController get stepDescriptionController; TextEditingController get stepDescriptionController;
TextEditingController get youtubeLinkController; TextEditingController get videoLinkController;
List<TextEditingController> get stepControllers; List<TextEditingController> get stepControllers;
XFile? get recipeImage; XFile? get recipeImage;
List<XFile?> get stepImages; List<XFile?> get stepImages;
@@ -1246,7 +1246,7 @@ class _$RecipeCreateStateErrorImpl implements RecipeCreateStateError {
TextEditingController productNameController, TextEditingController productNameController,
TextEditingController ingredientController, TextEditingController ingredientController,
TextEditingController stepDescriptionController, TextEditingController stepDescriptionController,
TextEditingController youtubeLinkController, TextEditingController videoLinkController,
List<TextEditingController> stepControllers, List<TextEditingController> stepControllers,
XFile? recipeImage, XFile? recipeImage,
List<XFile?> stepImages, List<XFile?> stepImages,
@@ -1278,7 +1278,7 @@ class _$RecipeCreateStateErrorImpl implements RecipeCreateStateError {
TextEditingController productNameController, TextEditingController productNameController,
TextEditingController ingredientController, TextEditingController ingredientController,
TextEditingController stepDescriptionController, TextEditingController stepDescriptionController,
TextEditingController youtubeLinkController, TextEditingController videoLinkController,
List<TextEditingController> stepControllers, List<TextEditingController> stepControllers,
XFile? recipeImage, XFile? recipeImage,
List<XFile?> stepImages, List<XFile?> stepImages,
@@ -1310,7 +1310,7 @@ class _$RecipeCreateStateErrorImpl implements RecipeCreateStateError {
TextEditingController productNameController, TextEditingController productNameController,
TextEditingController ingredientController, TextEditingController ingredientController,
TextEditingController stepDescriptionController, TextEditingController stepDescriptionController,
TextEditingController youtubeLinkController, TextEditingController videoLinkController,
List<TextEditingController> stepControllers, List<TextEditingController> stepControllers,
XFile? recipeImage, XFile? recipeImage,
List<XFile?> stepImages, List<XFile?> stepImages,

View File

@@ -305,12 +305,12 @@ class RecipeCreateScreen extends StatelessWidget {
), ),
), ),
SizedBox(height: 24), SizedBox(height: 24),
Text('Ссылка на видео (YouTube)'), Text('Ссылка на видео (video)'),
SizedBox(height: 8), SizedBox(height: 8),
CustomTextFormField( CustomTextFormField(
hintText: 'Введите описание шага', hintText: 'Введите описание шага',
fillColor: appTheme.gray50, fillColor: appTheme.gray50,
controller: state.youtubeLinkController, controller: state.videoLinkController,
), ),
SizedBox(height: 24), SizedBox(height: 24),
Container( Container(
@@ -500,7 +500,7 @@ class RecipeCreateScreen extends StatelessWidget {
description: state.stepDescriptionController.text, description: state.stepDescriptionController.text,
title: state.titleController.text, title: state.titleController.text,
image: state.recipeImage?.path, 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; return recipe;

View File

@@ -310,12 +310,12 @@ class RecipeEditScreen extends StatelessWidget {
), ),
), ),
SizedBox(height: 24), SizedBox(height: 24),
Text('Ссылка на видео (YouTube)'), Text('Ссылка на видео (video)'),
SizedBox(height: 8), SizedBox(height: 8),
CustomTextFormField( CustomTextFormField(
hintText: 'Введите описание шага', hintText: 'Введите описание шага',
fillColor: appTheme.gray50, fillColor: appTheme.gray50,
controller: state.youtubeLinkController, controller: state.videoLinkController,
), ),
SizedBox(height: 24), SizedBox(height: 24),
Container( Container(
@@ -509,7 +509,7 @@ class RecipeEditScreen extends StatelessWidget {
description: state.stepDescriptionController.text, description: state.stepDescriptionController.text,
title: state.titleController.text, title: state.titleController.text,
image: state.recipeImage?.path, 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; return recipe;
} }