feat(profile): consultant

This commit is contained in:
Alex
2024-12-06 13:46:15 +03:00
parent f30663a4e9
commit 6f03d279e9
21 changed files with 1957 additions and 285 deletions

View File

@@ -46,7 +46,7 @@ class Author with _$Author {
@JsonKey(name: "author_name") required String authorName,
@JsonKey(name: "author_profile_icon") required String authorProfileIcon,
@JsonKey(name: "author_is_me") required bool authorIsMe,
@JsonKey(name: "is_entity_subscribed_by_me") required bool isEntitySubscribedByMe,
@JsonKey(name: "is_entity_subscribed_by_me") bool? isEntitySubscribedByMe,
}) = _Author;
factory Author.fromJson(Map<String, dynamic> json) => _$AuthorFromJson(json);

View File

@@ -813,7 +813,7 @@ mixin _$Author {
@JsonKey(name: "author_is_me")
bool get authorIsMe => throw _privateConstructorUsedError;
@JsonKey(name: "is_entity_subscribed_by_me")
bool get isEntitySubscribedByMe => throw _privateConstructorUsedError;
bool? get isEntitySubscribedByMe => throw _privateConstructorUsedError;
/// Serializes this Author to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@@ -835,7 +835,7 @@ abstract class $AuthorCopyWith<$Res> {
@JsonKey(name: "author_profile_icon") String authorProfileIcon,
@JsonKey(name: "author_is_me") bool authorIsMe,
@JsonKey(name: "is_entity_subscribed_by_me")
bool isEntitySubscribedByMe});
bool? isEntitySubscribedByMe});
}
/// @nodoc
@@ -857,7 +857,7 @@ class _$AuthorCopyWithImpl<$Res, $Val extends Author>
Object? authorName = null,
Object? authorProfileIcon = null,
Object? authorIsMe = null,
Object? isEntitySubscribedByMe = null,
Object? isEntitySubscribedByMe = freezed,
}) {
return _then(_value.copyWith(
authorSlug: null == authorSlug
@@ -876,10 +876,10 @@ class _$AuthorCopyWithImpl<$Res, $Val extends Author>
? _value.authorIsMe
: authorIsMe // ignore: cast_nullable_to_non_nullable
as bool,
isEntitySubscribedByMe: null == isEntitySubscribedByMe
isEntitySubscribedByMe: freezed == isEntitySubscribedByMe
? _value.isEntitySubscribedByMe
: isEntitySubscribedByMe // ignore: cast_nullable_to_non_nullable
as bool,
as bool?,
) as $Val);
}
}
@@ -897,7 +897,7 @@ abstract class _$$AuthorImplCopyWith<$Res> implements $AuthorCopyWith<$Res> {
@JsonKey(name: "author_profile_icon") String authorProfileIcon,
@JsonKey(name: "author_is_me") bool authorIsMe,
@JsonKey(name: "is_entity_subscribed_by_me")
bool isEntitySubscribedByMe});
bool? isEntitySubscribedByMe});
}
/// @nodoc
@@ -917,7 +917,7 @@ class __$$AuthorImplCopyWithImpl<$Res>
Object? authorName = null,
Object? authorProfileIcon = null,
Object? authorIsMe = null,
Object? isEntitySubscribedByMe = null,
Object? isEntitySubscribedByMe = freezed,
}) {
return _then(_$AuthorImpl(
authorSlug: null == authorSlug
@@ -936,10 +936,10 @@ class __$$AuthorImplCopyWithImpl<$Res>
? _value.authorIsMe
: authorIsMe // ignore: cast_nullable_to_non_nullable
as bool,
isEntitySubscribedByMe: null == isEntitySubscribedByMe
isEntitySubscribedByMe: freezed == isEntitySubscribedByMe
? _value.isEntitySubscribedByMe
: isEntitySubscribedByMe // ignore: cast_nullable_to_non_nullable
as bool,
as bool?,
));
}
}
@@ -953,7 +953,7 @@ class _$AuthorImpl implements _Author {
@JsonKey(name: "author_profile_icon") required this.authorProfileIcon,
@JsonKey(name: "author_is_me") required this.authorIsMe,
@JsonKey(name: "is_entity_subscribed_by_me")
required this.isEntitySubscribedByMe});
this.isEntitySubscribedByMe});
factory _$AuthorImpl.fromJson(Map<String, dynamic> json) =>
_$$AuthorImplFromJson(json);
@@ -972,7 +972,7 @@ class _$AuthorImpl implements _Author {
final bool authorIsMe;
@override
@JsonKey(name: "is_entity_subscribed_by_me")
final bool isEntitySubscribedByMe;
final bool? isEntitySubscribedByMe;
@override
String toString() {
@@ -1025,7 +1025,7 @@ abstract class _Author implements Author {
required final String authorProfileIcon,
@JsonKey(name: "author_is_me") required final bool authorIsMe,
@JsonKey(name: "is_entity_subscribed_by_me")
required final bool isEntitySubscribedByMe}) = _$AuthorImpl;
final bool? isEntitySubscribedByMe}) = _$AuthorImpl;
factory _Author.fromJson(Map<String, dynamic> json) = _$AuthorImpl.fromJson;
@@ -1043,7 +1043,7 @@ abstract class _Author implements Author {
bool get authorIsMe;
@override
@JsonKey(name: "is_entity_subscribed_by_me")
bool get isEntitySubscribedByMe;
bool? get isEntitySubscribedByMe;
/// Create a copy of Author
/// with the given fields replaced by the non-null parameter values.

View File

@@ -74,7 +74,7 @@ _$AuthorImpl _$$AuthorImplFromJson(Map<String, dynamic> json) => _$AuthorImpl(
authorName: json['author_name'] as String,
authorProfileIcon: json['author_profile_icon'] as String,
authorIsMe: json['author_is_me'] as bool,
isEntitySubscribedByMe: json['is_entity_subscribed_by_me'] as bool,
isEntitySubscribedByMe: json['is_entity_subscribed_by_me'] as bool?,
);
Map<String, dynamic> _$$AuthorImplToJson(_$AuthorImpl instance) =>

View File

@@ -57,10 +57,10 @@ class PacketOptions with _$PacketOptions {
@freezed
class PlanType with _$PlanType {
const factory PlanType({
@JsonKey(name: "fit") required bool fit,
@JsonKey(name: "slim") required bool slim,
@JsonKey(name: "behavior") required bool behavior,
@JsonKey(name: "wellness") required bool wellness,
@JsonKey(name: "fit") bool? fit,
@JsonKey(name: "slim") bool? slim,
@JsonKey(name: "behavior") bool? behavior,
@JsonKey(name: "wellness") bool? wellness,
}) = _PlanType;
factory PlanType.fromJson(Map<String, dynamic> json) => _$PlanTypeFromJson(json);

View File

@@ -1030,13 +1030,13 @@ PlanType _$PlanTypeFromJson(Map<String, dynamic> json) {
/// @nodoc
mixin _$PlanType {
@JsonKey(name: "fit")
bool get fit => throw _privateConstructorUsedError;
bool? get fit => throw _privateConstructorUsedError;
@JsonKey(name: "slim")
bool get slim => throw _privateConstructorUsedError;
bool? get slim => throw _privateConstructorUsedError;
@JsonKey(name: "behavior")
bool get behavior => throw _privateConstructorUsedError;
bool? get behavior => throw _privateConstructorUsedError;
@JsonKey(name: "wellness")
bool get wellness => throw _privateConstructorUsedError;
bool? get wellness => throw _privateConstructorUsedError;
/// Serializes this PlanType to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@@ -1054,10 +1054,10 @@ abstract class $PlanTypeCopyWith<$Res> {
_$PlanTypeCopyWithImpl<$Res, PlanType>;
@useResult
$Res call(
{@JsonKey(name: "fit") bool fit,
@JsonKey(name: "slim") bool slim,
@JsonKey(name: "behavior") bool behavior,
@JsonKey(name: "wellness") bool wellness});
{@JsonKey(name: "fit") bool? fit,
@JsonKey(name: "slim") bool? slim,
@JsonKey(name: "behavior") bool? behavior,
@JsonKey(name: "wellness") bool? wellness});
}
/// @nodoc
@@ -1075,28 +1075,28 @@ class _$PlanTypeCopyWithImpl<$Res, $Val extends PlanType>
@pragma('vm:prefer-inline')
@override
$Res call({
Object? fit = null,
Object? slim = null,
Object? behavior = null,
Object? wellness = null,
Object? fit = freezed,
Object? slim = freezed,
Object? behavior = freezed,
Object? wellness = freezed,
}) {
return _then(_value.copyWith(
fit: null == fit
fit: freezed == fit
? _value.fit
: fit // ignore: cast_nullable_to_non_nullable
as bool,
slim: null == slim
as bool?,
slim: freezed == slim
? _value.slim
: slim // ignore: cast_nullable_to_non_nullable
as bool,
behavior: null == behavior
as bool?,
behavior: freezed == behavior
? _value.behavior
: behavior // ignore: cast_nullable_to_non_nullable
as bool,
wellness: null == wellness
as bool?,
wellness: freezed == wellness
? _value.wellness
: wellness // ignore: cast_nullable_to_non_nullable
as bool,
as bool?,
) as $Val);
}
}
@@ -1110,10 +1110,10 @@ abstract class _$$PlanTypeImplCopyWith<$Res>
@override
@useResult
$Res call(
{@JsonKey(name: "fit") bool fit,
@JsonKey(name: "slim") bool slim,
@JsonKey(name: "behavior") bool behavior,
@JsonKey(name: "wellness") bool wellness});
{@JsonKey(name: "fit") bool? fit,
@JsonKey(name: "slim") bool? slim,
@JsonKey(name: "behavior") bool? behavior,
@JsonKey(name: "wellness") bool? wellness});
}
/// @nodoc
@@ -1129,28 +1129,28 @@ class __$$PlanTypeImplCopyWithImpl<$Res>
@pragma('vm:prefer-inline')
@override
$Res call({
Object? fit = null,
Object? slim = null,
Object? behavior = null,
Object? wellness = null,
Object? fit = freezed,
Object? slim = freezed,
Object? behavior = freezed,
Object? wellness = freezed,
}) {
return _then(_$PlanTypeImpl(
fit: null == fit
fit: freezed == fit
? _value.fit
: fit // ignore: cast_nullable_to_non_nullable
as bool,
slim: null == slim
as bool?,
slim: freezed == slim
? _value.slim
: slim // ignore: cast_nullable_to_non_nullable
as bool,
behavior: null == behavior
as bool?,
behavior: freezed == behavior
? _value.behavior
: behavior // ignore: cast_nullable_to_non_nullable
as bool,
wellness: null == wellness
as bool?,
wellness: freezed == wellness
? _value.wellness
: wellness // ignore: cast_nullable_to_non_nullable
as bool,
as bool?,
));
}
}
@@ -1159,26 +1159,26 @@ class __$$PlanTypeImplCopyWithImpl<$Res>
@JsonSerializable()
class _$PlanTypeImpl implements _PlanType {
const _$PlanTypeImpl(
{@JsonKey(name: "fit") required this.fit,
@JsonKey(name: "slim") required this.slim,
@JsonKey(name: "behavior") required this.behavior,
@JsonKey(name: "wellness") required this.wellness});
{@JsonKey(name: "fit") this.fit,
@JsonKey(name: "slim") this.slim,
@JsonKey(name: "behavior") this.behavior,
@JsonKey(name: "wellness") this.wellness});
factory _$PlanTypeImpl.fromJson(Map<String, dynamic> json) =>
_$$PlanTypeImplFromJson(json);
@override
@JsonKey(name: "fit")
final bool fit;
final bool? fit;
@override
@JsonKey(name: "slim")
final bool slim;
final bool? slim;
@override
@JsonKey(name: "behavior")
final bool behavior;
final bool? behavior;
@override
@JsonKey(name: "wellness")
final bool wellness;
final bool? wellness;
@override
String toString() {
@@ -1220,27 +1220,26 @@ class _$PlanTypeImpl implements _PlanType {
abstract class _PlanType implements PlanType {
const factory _PlanType(
{@JsonKey(name: "fit") required final bool fit,
@JsonKey(name: "slim") required final bool slim,
@JsonKey(name: "behavior") required final bool behavior,
@JsonKey(name: "wellness") required final bool wellness}) =
_$PlanTypeImpl;
{@JsonKey(name: "fit") final bool? fit,
@JsonKey(name: "slim") final bool? slim,
@JsonKey(name: "behavior") final bool? behavior,
@JsonKey(name: "wellness") final bool? wellness}) = _$PlanTypeImpl;
factory _PlanType.fromJson(Map<String, dynamic> json) =
_$PlanTypeImpl.fromJson;
@override
@JsonKey(name: "fit")
bool get fit;
bool? get fit;
@override
@JsonKey(name: "slim")
bool get slim;
bool? get slim;
@override
@JsonKey(name: "behavior")
bool get behavior;
bool? get behavior;
@override
@JsonKey(name: "wellness")
bool get wellness;
bool? get wellness;
/// Create a copy of PlanType
/// with the given fields replaced by the non-null parameter values.

View File

@@ -80,10 +80,10 @@ Map<String, dynamic> _$$PacketOptionsImplToJson(_$PacketOptionsImpl instance) =>
_$PlanTypeImpl _$$PlanTypeImplFromJson(Map<String, dynamic> json) =>
_$PlanTypeImpl(
fit: json['fit'] as bool,
slim: json['slim'] as bool,
behavior: json['behavior'] as bool,
wellness: json['wellness'] as bool,
fit: json['fit'] as bool?,
slim: json['slim'] as bool?,
behavior: json['behavior'] as bool?,
wellness: json['wellness'] as bool?,
);
Map<String, dynamic> _$$PlanTypeImplToJson(_$PlanTypeImpl instance) =>

View File

@@ -88,7 +88,7 @@ class _BlogPostWidgetState extends State<BlogPostWidget> {
],
),
const Spacer(),
if (!state.feedBlogPostList[widget.index].author.isEntitySubscribedByMe && !state.feedBlogPostList[widget.index].author.authorIsMe)
if (!state.feedBlogPostList[widget.index].author.isEntitySubscribedByMe! && !state.feedBlogPostList[widget.index].author.authorIsMe)
SubscribeButtonWidget(
slug: state.feedBlogPostList[widget.index].author.authorSlug,
),