feat(feed, profile): добавлен переход на страинцу автора в посте, рецепте и дете. при нажатии на изображение в рецепте и диеты теперь переход на страницу с подробнее.

This commit is contained in:
mso7nueh
2024-08-14 11:34:29 +03:00
parent 1e992e9dd6
commit 919035a455
77 changed files with 3943 additions and 2745 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -6,19 +6,13 @@ part of 'diets_pagination_model.dart';
// JsonSerializableGenerator
// **************************************************************************
_$DietsPaginationImpl _$$DietsPaginationImplFromJson(
Map<String, dynamic> json) =>
_$DietsPaginationImpl(
data: (json['data'] as List<dynamic>)
.map((e) => Datum.fromJson(e as Map<String, dynamic>))
.toList(),
_$DietsPaginationImpl _$$DietsPaginationImplFromJson(Map<String, dynamic> json) => _$DietsPaginationImpl(
data: (json['data'] as List<dynamic>).map((e) => Datum.fromJson(e as Map<String, dynamic>)).toList(),
links: Links.fromJson(json['links'] as Map<String, dynamic>),
meta: Meta.fromJson(json['meta'] as Map<String, dynamic>),
);
Map<String, dynamic> _$$DietsPaginationImplToJson(
_$DietsPaginationImpl instance) =>
<String, dynamic>{
Map<String, dynamic> _$$DietsPaginationImplToJson(_$DietsPaginationImpl instance) => <String, dynamic>{
'data': instance.data,
'links': instance.links,
'meta': instance.meta,
@@ -33,11 +27,7 @@ _$DatumImpl _$$DatumImplFromJson(Map<String, dynamic> json) => _$DatumImpl(
type: Type.fromJson(json['type'] as Map<String, dynamic>),
details: json['details'] as String,
dailySchedule: (json['daily_schedule'] as List<dynamic>)
.map((e) => (e as List<dynamic>)
.map((e) => (e as List<dynamic>)
.map((e) => DailySchedule.fromJson(e as Map<String, dynamic>))
.toList())
.toList())
.map((e) => (e as List<dynamic>).map((e) => (e as List<dynamic>).map((e) => DailySchedule.fromJson(e as Map<String, dynamic>)).toList()).toList())
.toList(),
author: Author.fromJson(json['author'] as Map<String, dynamic>),
totalLikes: (json['total_likes'] as num).toInt(),
@@ -45,8 +35,7 @@ _$DatumImpl _$$DatumImplFromJson(Map<String, dynamic> json) => _$DatumImpl(
totalComments: (json['total_comments'] as num).toInt(),
);
Map<String, dynamic> _$$DatumImplToJson(_$DatumImpl instance) =>
<String, dynamic>{
Map<String, dynamic> _$$DatumImplToJson(_$DatumImpl instance) => <String, dynamic>{
'id': instance.id,
'name': instance.name,
'image': instance.image,
@@ -68,24 +57,21 @@ _$AuthorImpl _$$AuthorImplFromJson(Map<String, dynamic> json) => _$AuthorImpl(
authorIsMe: json['author_is_me'] as bool,
);
Map<String, dynamic> _$$AuthorImplToJson(_$AuthorImpl instance) =>
<String, dynamic>{
Map<String, dynamic> _$$AuthorImplToJson(_$AuthorImpl instance) => <String, dynamic>{
'author_slug': instance.authorSlug,
'author_name': instance.authorName,
'author_profile_icon': instance.authorProfileIcon,
'author_is_me': instance.authorIsMe,
};
_$DailyScheduleImpl _$$DailyScheduleImplFromJson(Map<String, dynamic> json) =>
_$DailyScheduleImpl(
_$DailyScheduleImpl _$$DailyScheduleImplFromJson(Map<String, dynamic> json) => _$DailyScheduleImpl(
name: json['name'] as String,
uniq: json['uniq'] as String,
portion: $enumDecode(_$PortionEnumMap, json['portion']),
quantity: (json['quantity'] as num).toInt(),
);
Map<String, dynamic> _$$DailyScheduleImplToJson(_$DailyScheduleImpl instance) =>
<String, dynamic>{
Map<String, dynamic> _$$DailyScheduleImplToJson(_$DailyScheduleImpl instance) => <String, dynamic>{
'name': instance.name,
'uniq': instance.uniq,
'portion': _$PortionEnumMap[instance.portion]!,
@@ -105,8 +91,7 @@ _$TypeImpl _$$TypeImplFromJson(Map<String, dynamic> json) => _$TypeImpl(
meat: json['meat'] as bool?,
);
Map<String, dynamic> _$$TypeImplToJson(_$TypeImpl instance) =>
<String, dynamic>{
Map<String, dynamic> _$$TypeImplToJson(_$TypeImpl instance) => <String, dynamic>{
'alko': instance.alko,
'veg': instance.veg,
'corb': instance.corb,
@@ -120,8 +105,7 @@ _$LinksImpl _$$LinksImplFromJson(Map<String, dynamic> json) => _$LinksImpl(
next: json['next'],
);
Map<String, dynamic> _$$LinksImplToJson(_$LinksImpl instance) =>
<String, dynamic>{
Map<String, dynamic> _$$LinksImplToJson(_$LinksImpl instance) => <String, dynamic>{
'first': instance.first,
'last': instance.last,
'prev': instance.prev,
@@ -132,17 +116,14 @@ _$MetaImpl _$$MetaImplFromJson(Map<String, dynamic> json) => _$MetaImpl(
currentPage: (json['current_page'] as num).toInt(),
from: (json['from'] as num).toInt(),
lastPage: (json['last_page'] as num).toInt(),
links: (json['links'] as List<dynamic>)
.map((e) => Link.fromJson(e as Map<String, dynamic>))
.toList(),
links: (json['links'] as List<dynamic>).map((e) => Link.fromJson(e as Map<String, dynamic>)).toList(),
path: json['path'] as String,
perPage: (json['per_page'] as num).toInt(),
to: (json['to'] as num).toInt(),
total: (json['total'] as num).toInt(),
);
Map<String, dynamic> _$$MetaImplToJson(_$MetaImpl instance) =>
<String, dynamic>{
Map<String, dynamic> _$$MetaImplToJson(_$MetaImpl instance) => <String, dynamic>{
'current_page': instance.currentPage,
'from': instance.from,
'last_page': instance.lastPage,
@@ -159,8 +140,7 @@ _$LinkImpl _$$LinkImplFromJson(Map<String, dynamic> json) => _$LinkImpl(
active: json['active'] as bool,
);
Map<String, dynamic> _$$LinkImplToJson(_$LinkImpl instance) =>
<String, dynamic>{
Map<String, dynamic> _$$LinkImplToJson(_$LinkImpl instance) => <String, dynamic>{
'url': instance.url,
'label': instance.label,
'active': instance.active,

View File

@@ -1,3 +1,4 @@
import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
part 'feed_blog_post_model.freezed.dart';
@@ -10,6 +11,7 @@ class FeedBlogPostModel with _$FeedBlogPostModel {
required String state,
required String image,
required String description,
required Author author,
@JsonKey(name: "youtube_url") required String youtubeUrl,
@JsonKey(name: "created_at") required DateTime createdAt,
@JsonKey(name: "updated_at") required DateTime updatedAt,

View File

@@ -24,6 +24,7 @@ mixin _$FeedBlogPostModel {
String get state => throw _privateConstructorUsedError;
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: "created_at")
@@ -49,10 +50,13 @@ abstract class $FeedBlogPostModelCopyWith<$Res> {
String state,
String image,
String description,
Author author,
@JsonKey(name: "youtube_url") String youtubeUrl,
@JsonKey(name: "created_at") DateTime createdAt,
@JsonKey(name: "updated_at") DateTime updatedAt,
String title});
$AuthorCopyWith<$Res> get author;
}
/// @nodoc
@@ -72,6 +76,7 @@ class _$FeedBlogPostModelCopyWithImpl<$Res, $Val extends FeedBlogPostModel>
Object? state = null,
Object? image = null,
Object? description = null,
Object? author = null,
Object? youtubeUrl = null,
Object? createdAt = null,
Object? updatedAt = null,
@@ -94,6 +99,10 @@ class _$FeedBlogPostModelCopyWithImpl<$Res, $Val extends FeedBlogPostModel>
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String,
author: null == author
? _value.author
: author // ignore: cast_nullable_to_non_nullable
as Author,
youtubeUrl: null == youtubeUrl
? _value.youtubeUrl
: youtubeUrl // ignore: cast_nullable_to_non_nullable
@@ -112,6 +121,14 @@ class _$FeedBlogPostModelCopyWithImpl<$Res, $Val extends FeedBlogPostModel>
as String,
) as $Val);
}
@override
@pragma('vm:prefer-inline')
$AuthorCopyWith<$Res> get author {
return $AuthorCopyWith<$Res>(_value.author, (value) {
return _then(_value.copyWith(author: value) as $Val);
});
}
}
/// @nodoc
@@ -127,10 +144,14 @@ abstract class _$$FeedBlogPostModelImplCopyWith<$Res>
String state,
String image,
String description,
Author author,
@JsonKey(name: "youtube_url") String youtubeUrl,
@JsonKey(name: "created_at") DateTime createdAt,
@JsonKey(name: "updated_at") DateTime updatedAt,
String title});
@override
$AuthorCopyWith<$Res> get author;
}
/// @nodoc
@@ -148,6 +169,7 @@ class __$$FeedBlogPostModelImplCopyWithImpl<$Res>
Object? state = null,
Object? image = null,
Object? description = null,
Object? author = null,
Object? youtubeUrl = null,
Object? createdAt = null,
Object? updatedAt = null,
@@ -170,6 +192,10 @@ class __$$FeedBlogPostModelImplCopyWithImpl<$Res>
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String,
author: null == author
? _value.author
: author // ignore: cast_nullable_to_non_nullable
as Author,
youtubeUrl: null == youtubeUrl
? _value.youtubeUrl
: youtubeUrl // ignore: cast_nullable_to_non_nullable
@@ -198,6 +224,7 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel {
required this.state,
required this.image,
required this.description,
required this.author,
@JsonKey(name: "youtube_url") required this.youtubeUrl,
@JsonKey(name: "created_at") required this.createdAt,
@JsonKey(name: "updated_at") required this.updatedAt,
@@ -215,6 +242,8 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel {
@override
final String description;
@override
final Author author;
@override
@JsonKey(name: "youtube_url")
final String youtubeUrl;
@override
@@ -228,7 +257,7 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel {
@override
String toString() {
return 'FeedBlogPostModel(id: $id, state: $state, image: $image, description: $description, youtubeUrl: $youtubeUrl, createdAt: $createdAt, updatedAt: $updatedAt, title: $title)';
return 'FeedBlogPostModel(id: $id, state: $state, image: $image, description: $description, author: $author, youtubeUrl: $youtubeUrl, createdAt: $createdAt, updatedAt: $updatedAt, title: $title)';
}
@override
@@ -241,6 +270,7 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel {
(identical(other.image, image) || other.image == image) &&
(identical(other.description, description) ||
other.description == description) &&
(identical(other.author, author) || other.author == author) &&
(identical(other.youtubeUrl, youtubeUrl) ||
other.youtubeUrl == youtubeUrl) &&
(identical(other.createdAt, createdAt) ||
@@ -253,7 +283,7 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel {
@JsonKey(ignore: true)
@override
int get hashCode => Object.hash(runtimeType, id, state, image, description,
youtubeUrl, createdAt, updatedAt, title);
author, youtubeUrl, createdAt, updatedAt, title);
@JsonKey(ignore: true)
@override
@@ -276,6 +306,7 @@ abstract class _FeedBlogPostModel implements FeedBlogPostModel {
required final String state,
required final String image,
required final String description,
required final Author author,
@JsonKey(name: "youtube_url") required final String youtubeUrl,
@JsonKey(name: "created_at") required final DateTime createdAt,
@JsonKey(name: "updated_at") required final DateTime updatedAt,
@@ -293,6 +324,8 @@ abstract class _FeedBlogPostModel implements FeedBlogPostModel {
@override
String get description;
@override
Author get author;
@override
@JsonKey(name: "youtube_url")
String get youtubeUrl;
@override

View File

@@ -13,6 +13,7 @@ _$FeedBlogPostModelImpl _$$FeedBlogPostModelImplFromJson(
state: json['state'] as String,
image: json['image'] as String,
description: json['description'] as String,
author: Author.fromJson(json['author'] as Map<String, dynamic>),
youtubeUrl: json['youtube_url'] as String,
createdAt: DateTime.parse(json['created_at'] as String),
updatedAt: DateTime.parse(json['updated_at'] as String),
@@ -26,6 +27,7 @@ Map<String, dynamic> _$$FeedBlogPostModelImplToJson(
'state': instance.state,
'image': instance.image,
'description': instance.description,
'author': instance.author,
'youtube_url': instance.youtubeUrl,
'created_at': instance.createdAt.toIso8601String(),
'updated_at': instance.updatedAt.toIso8601String(),

View File

@@ -2,7 +2,6 @@ import 'package:eatvio_app/features/feed/models/feed_blog_post_model.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
part 'feed_blog_post_settings_model.freezed.dart';
part 'feed_blog_post_settings_model.g.dart';
@freezed

View File

@@ -1,3 +1,4 @@
import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
part 'recipes_model.freezed.dart';
@@ -22,6 +23,7 @@ class Recipes with _$Recipes {
@JsonKey(name: 'total_comments') required int commentsCount,
@JsonKey(name: 'total_likes') required int likesCount,
@JsonKey(name: 'total_views') required int viewsCount,
required Author author,
}) = _Recipes;
factory Recipes.fromJson(Map<String, Object?> json) => _$RecipesFromJson(json);

View File

@@ -43,6 +43,7 @@ mixin _$Recipes {
int get likesCount => throw _privateConstructorUsedError;
@JsonKey(name: 'total_views')
int get viewsCount => throw _privateConstructorUsedError;
Author get author => throw _privateConstructorUsedError;
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
@@ -70,7 +71,10 @@ abstract class $RecipesCopyWith<$Res> {
String slug,
@JsonKey(name: 'total_comments') int commentsCount,
@JsonKey(name: 'total_likes') int likesCount,
@JsonKey(name: 'total_views') int viewsCount});
@JsonKey(name: 'total_views') int viewsCount,
Author author});
$AuthorCopyWith<$Res> get author;
}
/// @nodoc
@@ -102,6 +106,7 @@ class _$RecipesCopyWithImpl<$Res, $Val extends Recipes>
Object? commentsCount = null,
Object? likesCount = null,
Object? viewsCount = null,
Object? author = null,
}) {
return _then(_value.copyWith(
id: null == id
@@ -168,8 +173,20 @@ class _$RecipesCopyWithImpl<$Res, $Val extends Recipes>
? _value.viewsCount
: viewsCount // ignore: cast_nullable_to_non_nullable
as int,
author: null == author
? _value.author
: author // ignore: cast_nullable_to_non_nullable
as Author,
) as $Val);
}
@override
@pragma('vm:prefer-inline')
$AuthorCopyWith<$Res> get author {
return $AuthorCopyWith<$Res>(_value.author, (value) {
return _then(_value.copyWith(author: value) as $Val);
});
}
}
/// @nodoc
@@ -195,7 +212,11 @@ abstract class _$$RecipesImplCopyWith<$Res> implements $RecipesCopyWith<$Res> {
String slug,
@JsonKey(name: 'total_comments') int commentsCount,
@JsonKey(name: 'total_likes') int likesCount,
@JsonKey(name: 'total_views') int viewsCount});
@JsonKey(name: 'total_views') int viewsCount,
Author author});
@override
$AuthorCopyWith<$Res> get author;
}
/// @nodoc
@@ -225,6 +246,7 @@ class __$$RecipesImplCopyWithImpl<$Res>
Object? commentsCount = null,
Object? likesCount = null,
Object? viewsCount = null,
Object? author = null,
}) {
return _then(_$RecipesImpl(
id: null == id
@@ -291,6 +313,10 @@ class __$$RecipesImplCopyWithImpl<$Res>
? _value.viewsCount
: viewsCount // ignore: cast_nullable_to_non_nullable
as int,
author: null == author
? _value.author
: author // ignore: cast_nullable_to_non_nullable
as Author,
));
}
}
@@ -314,7 +340,8 @@ class _$RecipesImpl implements _Recipes {
required this.slug,
@JsonKey(name: 'total_comments') required this.commentsCount,
@JsonKey(name: 'total_likes') required this.likesCount,
@JsonKey(name: 'total_views') required this.viewsCount})
@JsonKey(name: 'total_views') required this.viewsCount,
required this.author})
: _ingredients = ingredients,
_steps = steps;
@@ -372,10 +399,12 @@ class _$RecipesImpl implements _Recipes {
@override
@JsonKey(name: 'total_views')
final int viewsCount;
@override
final Author author;
@override
String toString() {
return 'Recipes(id: $id, image: $image, state: $state, cookingTime: $cookingTime, ingredients: $ingredients, description: $description, steps: $steps, videoUrl: $videoUrl, createdAt: $createdAt, updatedAt: $updatedAt, title: $title, type: $type, slug: $slug, commentsCount: $commentsCount, likesCount: $likesCount, viewsCount: $viewsCount)';
return 'Recipes(id: $id, image: $image, state: $state, cookingTime: $cookingTime, ingredients: $ingredients, description: $description, steps: $steps, videoUrl: $videoUrl, createdAt: $createdAt, updatedAt: $updatedAt, title: $title, type: $type, slug: $slug, commentsCount: $commentsCount, likesCount: $likesCount, viewsCount: $viewsCount, author: $author)';
}
@override
@@ -407,7 +436,8 @@ class _$RecipesImpl implements _Recipes {
(identical(other.likesCount, likesCount) ||
other.likesCount == likesCount) &&
(identical(other.viewsCount, viewsCount) ||
other.viewsCount == viewsCount));
other.viewsCount == viewsCount) &&
(identical(other.author, author) || other.author == author));
}
@JsonKey(ignore: true)
@@ -429,7 +459,8 @@ class _$RecipesImpl implements _Recipes {
slug,
commentsCount,
likesCount,
viewsCount);
viewsCount,
author);
@JsonKey(ignore: true)
@override
@@ -447,23 +478,23 @@ class _$RecipesImpl implements _Recipes {
abstract class _Recipes implements Recipes {
const factory _Recipes(
{required final int id,
required final String image,
required final String state,
@JsonKey(name: 'cooking_time') required final int cookingTime,
required final List<Ingredient> ingredients,
required final String description,
required final List<Step> steps,
@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,
required final String type,
required final String slug,
@JsonKey(name: 'total_comments') required final int commentsCount,
@JsonKey(name: 'total_likes') required final int likesCount,
@JsonKey(name: 'total_views') required final int viewsCount}) =
_$RecipesImpl;
{required final int id,
required final String image,
required final String state,
@JsonKey(name: 'cooking_time') required final int cookingTime,
required final List<Ingredient> ingredients,
required final String description,
required final List<Step> steps,
@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,
required final String type,
required final String slug,
@JsonKey(name: 'total_comments') required final int commentsCount,
@JsonKey(name: 'total_likes') required final int likesCount,
@JsonKey(name: 'total_views') required final int viewsCount,
required final Author author}) = _$RecipesImpl;
factory _Recipes.fromJson(Map<String, dynamic> json) = _$RecipesImpl.fromJson;
@@ -507,6 +538,8 @@ abstract class _Recipes implements Recipes {
@JsonKey(name: 'total_views')
int get viewsCount;
@override
Author get author;
@override
@JsonKey(ignore: true)
_$$RecipesImplCopyWith<_$RecipesImpl> get copyWith =>
throw _privateConstructorUsedError;

View File

@@ -28,6 +28,7 @@ _$RecipesImpl _$$RecipesImplFromJson(Map<String, dynamic> json) =>
commentsCount: (json['total_comments'] as num).toInt(),
likesCount: (json['total_likes'] as num).toInt(),
viewsCount: (json['total_views'] as num).toInt(),
author: Author.fromJson(json['author'] as Map<String, dynamic>),
);
Map<String, dynamic> _$$RecipesImplToJson(_$RecipesImpl instance) =>
@@ -48,6 +49,7 @@ Map<String, dynamic> _$$RecipesImplToJson(_$RecipesImpl instance) =>
'total_comments': instance.commentsCount,
'total_likes': instance.likesCount,
'total_views': instance.viewsCount,
'author': instance.author,
};
_$IngredientImpl _$$IngredientImplFromJson(Map<String, dynamic> json) =>