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

@@ -2,7 +2,6 @@ import 'package:eatvio_app/features/profile/models/badge_model.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
part 'profile_model.freezed.dart';
part 'profile_model.g.dart';
@freezed
@@ -11,6 +10,7 @@ class ProfileModel with _$ProfileModel {
@JsonKey(name: "id") required int id,
@JsonKey(name: "name") required String name,
@JsonKey(name: "email") required String email,
@JsonKey(name: "rating_place") int? ratingPlace,
@JsonKey(name: "email_verified_at") DateTime? emailVerifiedAt,
@JsonKey(name: "created_at") DateTime? createdAt,
@JsonKey(name: "updated_at") DateTime? updatedAt,
@@ -22,25 +22,47 @@ class ProfileModel with _$ProfileModel {
@JsonKey(name: "badges") required List<BadgeModel> badges,
@JsonKey(name: "subscriptions") required List<ProfilePreviewModel> subscriptions,
@JsonKey(name: "subscribers") required List<ProfilePreviewModel> subscribers,
@JsonKey(name: "education_resource") EducationResource? educationResource,
@JsonKey(name: "education_resource") EducationModel? educationResource,
@JsonKey(name: "cert_photos") List<DiplomasAndCertificatesModel>? diplomasAndCertificates,
}) = _ProfileModel;
factory ProfileModel.fromJson(Map<String, dynamic> json) => _$ProfileModelFromJson(json);
}
@freezed
class EducationResource with _$EducationResource {
const factory EducationResource({
@JsonKey(name: "has_medical_education") int? hasMedical_Education,
class DiplomasAndCertificatesModel with _$DiplomasAndCertificatesModel {
const factory DiplomasAndCertificatesModel({
required int id,
required String path,
}) = _DiplomasAndCertificatesModel;
factory DiplomasAndCertificatesModel.fromJson(Map<String, dynamic> json) => _$DiplomasAndCertificatesModelFromJson(json);
}
@freezed
class EducationModel with _$EducationModel {
const factory EducationModel({
@JsonKey(name: "has_medical_education") int? hasMedicalEducation,
@JsonKey(name: "completed_cources") Map<String, CompletedCoursesModel>? completedCourses,
@JsonKey(name: "vk_link") String? vkLink,
@JsonKey(name: "insta_link") String? instaLink,
@JsonKey(name: "fb_link") String? fbLink,
@JsonKey(name: "tg_link") String? tgLink,
@JsonKey(name: "personal_site_link") String? personalSiteLink,
@JsonKey(name: "request_state") String? requestState,
}) = _EducationResource;
}) = _EducationModel;
factory EducationResource.fromJson(Map<String, dynamic> json) => _$EducationResourceFromJson(json);
factory EducationModel.fromJson(Map<String, dynamic> json) => _$EducationModelFromJson(json);
}
@freezed
class CompletedCoursesModel with _$CompletedCoursesModel {
const factory CompletedCoursesModel({
required String date,
required String title,
}) = _CompletedCoursesModel;
factory CompletedCoursesModel.fromJson(Map<String, dynamic> json) => _$CompletedCoursesModelFromJson(json);
}
@freezed

View File

@@ -26,6 +26,8 @@ mixin _$ProfileModel {
String get name => throw _privateConstructorUsedError;
@JsonKey(name: "email")
String get email => throw _privateConstructorUsedError;
@JsonKey(name: "rating_place")
int? get ratingPlace => throw _privateConstructorUsedError;
@JsonKey(name: "email_verified_at")
DateTime? get emailVerifiedAt => throw _privateConstructorUsedError;
@JsonKey(name: "created_at")
@@ -51,7 +53,9 @@ mixin _$ProfileModel {
List<ProfilePreviewModel> get subscribers =>
throw _privateConstructorUsedError;
@JsonKey(name: "education_resource")
EducationResource? get educationResource =>
EducationModel? get educationResource => throw _privateConstructorUsedError;
@JsonKey(name: "cert_photos")
List<DiplomasAndCertificatesModel>? get diplomasAndCertificates =>
throw _privateConstructorUsedError;
/// Serializes this ProfileModel to a JSON map.
@@ -74,6 +78,7 @@ abstract class $ProfileModelCopyWith<$Res> {
{@JsonKey(name: "id") int id,
@JsonKey(name: "name") String name,
@JsonKey(name: "email") String email,
@JsonKey(name: "rating_place") int? ratingPlace,
@JsonKey(name: "email_verified_at") DateTime? emailVerifiedAt,
@JsonKey(name: "created_at") DateTime? createdAt,
@JsonKey(name: "updated_at") DateTime? updatedAt,
@@ -85,10 +90,11 @@ abstract class $ProfileModelCopyWith<$Res> {
@JsonKey(name: "badges") List<BadgeModel> badges,
@JsonKey(name: "subscriptions") List<ProfilePreviewModel> subscriptions,
@JsonKey(name: "subscribers") List<ProfilePreviewModel> subscribers,
@JsonKey(name: "education_resource")
EducationResource? educationResource});
@JsonKey(name: "education_resource") EducationModel? educationResource,
@JsonKey(name: "cert_photos")
List<DiplomasAndCertificatesModel>? diplomasAndCertificates});
$EducationResourceCopyWith<$Res>? get educationResource;
$EducationModelCopyWith<$Res>? get educationResource;
}
/// @nodoc
@@ -109,6 +115,7 @@ class _$ProfileModelCopyWithImpl<$Res, $Val extends ProfileModel>
Object? id = null,
Object? name = null,
Object? email = null,
Object? ratingPlace = freezed,
Object? emailVerifiedAt = freezed,
Object? createdAt = freezed,
Object? updatedAt = freezed,
@@ -121,6 +128,7 @@ class _$ProfileModelCopyWithImpl<$Res, $Val extends ProfileModel>
Object? subscriptions = null,
Object? subscribers = null,
Object? educationResource = freezed,
Object? diplomasAndCertificates = freezed,
}) {
return _then(_value.copyWith(
id: null == id
@@ -135,6 +143,10 @@ class _$ProfileModelCopyWithImpl<$Res, $Val extends ProfileModel>
? _value.email
: email // ignore: cast_nullable_to_non_nullable
as String,
ratingPlace: freezed == ratingPlace
? _value.ratingPlace
: ratingPlace // ignore: cast_nullable_to_non_nullable
as int?,
emailVerifiedAt: freezed == emailVerifiedAt
? _value.emailVerifiedAt
: emailVerifiedAt // ignore: cast_nullable_to_non_nullable
@@ -182,7 +194,11 @@ class _$ProfileModelCopyWithImpl<$Res, $Val extends ProfileModel>
educationResource: freezed == educationResource
? _value.educationResource
: educationResource // ignore: cast_nullable_to_non_nullable
as EducationResource?,
as EducationModel?,
diplomasAndCertificates: freezed == diplomasAndCertificates
? _value.diplomasAndCertificates
: diplomasAndCertificates // ignore: cast_nullable_to_non_nullable
as List<DiplomasAndCertificatesModel>?,
) as $Val);
}
@@ -190,12 +206,12 @@ class _$ProfileModelCopyWithImpl<$Res, $Val extends ProfileModel>
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$EducationResourceCopyWith<$Res>? get educationResource {
$EducationModelCopyWith<$Res>? get educationResource {
if (_value.educationResource == null) {
return null;
}
return $EducationResourceCopyWith<$Res>(_value.educationResource!, (value) {
return $EducationModelCopyWith<$Res>(_value.educationResource!, (value) {
return _then(_value.copyWith(educationResource: value) as $Val);
});
}
@@ -213,6 +229,7 @@ abstract class _$$ProfileModelImplCopyWith<$Res>
{@JsonKey(name: "id") int id,
@JsonKey(name: "name") String name,
@JsonKey(name: "email") String email,
@JsonKey(name: "rating_place") int? ratingPlace,
@JsonKey(name: "email_verified_at") DateTime? emailVerifiedAt,
@JsonKey(name: "created_at") DateTime? createdAt,
@JsonKey(name: "updated_at") DateTime? updatedAt,
@@ -224,11 +241,12 @@ abstract class _$$ProfileModelImplCopyWith<$Res>
@JsonKey(name: "badges") List<BadgeModel> badges,
@JsonKey(name: "subscriptions") List<ProfilePreviewModel> subscriptions,
@JsonKey(name: "subscribers") List<ProfilePreviewModel> subscribers,
@JsonKey(name: "education_resource")
EducationResource? educationResource});
@JsonKey(name: "education_resource") EducationModel? educationResource,
@JsonKey(name: "cert_photos")
List<DiplomasAndCertificatesModel>? diplomasAndCertificates});
@override
$EducationResourceCopyWith<$Res>? get educationResource;
$EducationModelCopyWith<$Res>? get educationResource;
}
/// @nodoc
@@ -247,6 +265,7 @@ class __$$ProfileModelImplCopyWithImpl<$Res>
Object? id = null,
Object? name = null,
Object? email = null,
Object? ratingPlace = freezed,
Object? emailVerifiedAt = freezed,
Object? createdAt = freezed,
Object? updatedAt = freezed,
@@ -259,6 +278,7 @@ class __$$ProfileModelImplCopyWithImpl<$Res>
Object? subscriptions = null,
Object? subscribers = null,
Object? educationResource = freezed,
Object? diplomasAndCertificates = freezed,
}) {
return _then(_$ProfileModelImpl(
id: null == id
@@ -273,6 +293,10 @@ class __$$ProfileModelImplCopyWithImpl<$Res>
? _value.email
: email // ignore: cast_nullable_to_non_nullable
as String,
ratingPlace: freezed == ratingPlace
? _value.ratingPlace
: ratingPlace // ignore: cast_nullable_to_non_nullable
as int?,
emailVerifiedAt: freezed == emailVerifiedAt
? _value.emailVerifiedAt
: emailVerifiedAt // ignore: cast_nullable_to_non_nullable
@@ -320,7 +344,11 @@ class __$$ProfileModelImplCopyWithImpl<$Res>
educationResource: freezed == educationResource
? _value.educationResource
: educationResource // ignore: cast_nullable_to_non_nullable
as EducationResource?,
as EducationModel?,
diplomasAndCertificates: freezed == diplomasAndCertificates
? _value._diplomasAndCertificates
: diplomasAndCertificates // ignore: cast_nullable_to_non_nullable
as List<DiplomasAndCertificatesModel>?,
));
}
}
@@ -332,6 +360,7 @@ class _$ProfileModelImpl implements _ProfileModel {
{@JsonKey(name: "id") required this.id,
@JsonKey(name: "name") required this.name,
@JsonKey(name: "email") required this.email,
@JsonKey(name: "rating_place") this.ratingPlace,
@JsonKey(name: "email_verified_at") this.emailVerifiedAt,
@JsonKey(name: "created_at") this.createdAt,
@JsonKey(name: "updated_at") this.updatedAt,
@@ -346,10 +375,13 @@ class _$ProfileModelImpl implements _ProfileModel {
required final List<ProfilePreviewModel> subscriptions,
@JsonKey(name: "subscribers")
required final List<ProfilePreviewModel> subscribers,
@JsonKey(name: "education_resource") this.educationResource})
@JsonKey(name: "education_resource") this.educationResource,
@JsonKey(name: "cert_photos")
final List<DiplomasAndCertificatesModel>? diplomasAndCertificates})
: _badges = badges,
_subscriptions = subscriptions,
_subscribers = subscribers;
_subscribers = subscribers,
_diplomasAndCertificates = diplomasAndCertificates;
factory _$ProfileModelImpl.fromJson(Map<String, dynamic> json) =>
_$$ProfileModelImplFromJson(json);
@@ -364,6 +396,9 @@ class _$ProfileModelImpl implements _ProfileModel {
@JsonKey(name: "email")
final String email;
@override
@JsonKey(name: "rating_place")
final int? ratingPlace;
@override
@JsonKey(name: "email_verified_at")
final DateTime? emailVerifiedAt;
@override
@@ -416,11 +451,22 @@ class _$ProfileModelImpl implements _ProfileModel {
@override
@JsonKey(name: "education_resource")
final EducationResource? educationResource;
final EducationModel? educationResource;
final List<DiplomasAndCertificatesModel>? _diplomasAndCertificates;
@override
@JsonKey(name: "cert_photos")
List<DiplomasAndCertificatesModel>? get diplomasAndCertificates {
final value = _diplomasAndCertificates;
if (value == null) return null;
if (_diplomasAndCertificates is EqualUnmodifiableListView)
return _diplomasAndCertificates;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(value);
}
@override
String toString() {
return 'ProfileModel(id: $id, name: $name, email: $email, emailVerifiedAt: $emailVerifiedAt, createdAt: $createdAt, updatedAt: $updatedAt, isPublicProfile: $isPublicProfile, isEntitySubscribedByMe: $isEntitySubscribedByMe, slug: $slug, profilePhotoUrl: $profilePhotoUrl, role: $role, badges: $badges, subscriptions: $subscriptions, subscribers: $subscribers, educationResource: $educationResource)';
return 'ProfileModel(id: $id, name: $name, email: $email, ratingPlace: $ratingPlace, emailVerifiedAt: $emailVerifiedAt, createdAt: $createdAt, updatedAt: $updatedAt, isPublicProfile: $isPublicProfile, isEntitySubscribedByMe: $isEntitySubscribedByMe, slug: $slug, profilePhotoUrl: $profilePhotoUrl, role: $role, badges: $badges, subscriptions: $subscriptions, subscribers: $subscribers, educationResource: $educationResource, diplomasAndCertificates: $diplomasAndCertificates)';
}
@override
@@ -431,6 +477,8 @@ class _$ProfileModelImpl implements _ProfileModel {
(identical(other.id, id) || other.id == id) &&
(identical(other.name, name) || other.name == name) &&
(identical(other.email, email) || other.email == email) &&
(identical(other.ratingPlace, ratingPlace) ||
other.ratingPlace == ratingPlace) &&
(identical(other.emailVerifiedAt, emailVerifiedAt) ||
other.emailVerifiedAt == emailVerifiedAt) &&
(identical(other.createdAt, createdAt) ||
@@ -451,7 +499,9 @@ class _$ProfileModelImpl implements _ProfileModel {
const DeepCollectionEquality()
.equals(other._subscribers, _subscribers) &&
(identical(other.educationResource, educationResource) ||
other.educationResource == educationResource));
other.educationResource == educationResource) &&
const DeepCollectionEquality().equals(
other._diplomasAndCertificates, _diplomasAndCertificates));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@@ -461,6 +511,7 @@ class _$ProfileModelImpl implements _ProfileModel {
id,
name,
email,
ratingPlace,
emailVerifiedAt,
createdAt,
updatedAt,
@@ -472,7 +523,8 @@ class _$ProfileModelImpl implements _ProfileModel {
const DeepCollectionEquality().hash(_badges),
const DeepCollectionEquality().hash(_subscriptions),
const DeepCollectionEquality().hash(_subscribers),
educationResource);
educationResource,
const DeepCollectionEquality().hash(_diplomasAndCertificates));
/// Create a copy of ProfileModel
/// with the given fields replaced by the non-null parameter values.
@@ -495,6 +547,7 @@ abstract class _ProfileModel implements ProfileModel {
{@JsonKey(name: "id") required final int id,
@JsonKey(name: "name") required final String name,
@JsonKey(name: "email") required final String email,
@JsonKey(name: "rating_place") final int? ratingPlace,
@JsonKey(name: "email_verified_at") final DateTime? emailVerifiedAt,
@JsonKey(name: "created_at") final DateTime? createdAt,
@JsonKey(name: "updated_at") final DateTime? updatedAt,
@@ -510,7 +563,10 @@ abstract class _ProfileModel implements ProfileModel {
@JsonKey(name: "subscribers")
required final List<ProfilePreviewModel> subscribers,
@JsonKey(name: "education_resource")
final EducationResource? educationResource}) = _$ProfileModelImpl;
final EducationModel? educationResource,
@JsonKey(name: "cert_photos")
final List<DiplomasAndCertificatesModel>?
diplomasAndCertificates}) = _$ProfileModelImpl;
factory _ProfileModel.fromJson(Map<String, dynamic> json) =
_$ProfileModelImpl.fromJson;
@@ -525,6 +581,9 @@ abstract class _ProfileModel implements ProfileModel {
@JsonKey(name: "email")
String get email;
@override
@JsonKey(name: "rating_place")
int? get ratingPlace;
@override
@JsonKey(name: "email_verified_at")
DateTime? get emailVerifiedAt;
@override
@@ -559,7 +618,10 @@ abstract class _ProfileModel implements ProfileModel {
List<ProfilePreviewModel> get subscribers;
@override
@JsonKey(name: "education_resource")
EducationResource? get educationResource;
EducationModel? get educationResource;
@override
@JsonKey(name: "cert_photos")
List<DiplomasAndCertificatesModel>? get diplomasAndCertificates;
/// Create a copy of ProfileModel
/// with the given fields replaced by the non-null parameter values.
@@ -569,14 +631,198 @@ abstract class _ProfileModel implements ProfileModel {
throw _privateConstructorUsedError;
}
EducationResource _$EducationResourceFromJson(Map<String, dynamic> json) {
return _EducationResource.fromJson(json);
DiplomasAndCertificatesModel _$DiplomasAndCertificatesModelFromJson(
Map<String, dynamic> json) {
return _DiplomasAndCertificatesModel.fromJson(json);
}
/// @nodoc
mixin _$EducationResource {
mixin _$DiplomasAndCertificatesModel {
int get id => throw _privateConstructorUsedError;
String get path => throw _privateConstructorUsedError;
/// Serializes this DiplomasAndCertificatesModel to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of DiplomasAndCertificatesModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$DiplomasAndCertificatesModelCopyWith<DiplomasAndCertificatesModel>
get copyWith => throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $DiplomasAndCertificatesModelCopyWith<$Res> {
factory $DiplomasAndCertificatesModelCopyWith(
DiplomasAndCertificatesModel value,
$Res Function(DiplomasAndCertificatesModel) then) =
_$DiplomasAndCertificatesModelCopyWithImpl<$Res,
DiplomasAndCertificatesModel>;
@useResult
$Res call({int id, String path});
}
/// @nodoc
class _$DiplomasAndCertificatesModelCopyWithImpl<$Res,
$Val extends DiplomasAndCertificatesModel>
implements $DiplomasAndCertificatesModelCopyWith<$Res> {
_$DiplomasAndCertificatesModelCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of DiplomasAndCertificatesModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? id = null,
Object? path = null,
}) {
return _then(_value.copyWith(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
path: null == path
? _value.path
: path // ignore: cast_nullable_to_non_nullable
as String,
) as $Val);
}
}
/// @nodoc
abstract class _$$DiplomasAndCertificatesModelImplCopyWith<$Res>
implements $DiplomasAndCertificatesModelCopyWith<$Res> {
factory _$$DiplomasAndCertificatesModelImplCopyWith(
_$DiplomasAndCertificatesModelImpl value,
$Res Function(_$DiplomasAndCertificatesModelImpl) then) =
__$$DiplomasAndCertificatesModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({int id, String path});
}
/// @nodoc
class __$$DiplomasAndCertificatesModelImplCopyWithImpl<$Res>
extends _$DiplomasAndCertificatesModelCopyWithImpl<$Res,
_$DiplomasAndCertificatesModelImpl>
implements _$$DiplomasAndCertificatesModelImplCopyWith<$Res> {
__$$DiplomasAndCertificatesModelImplCopyWithImpl(
_$DiplomasAndCertificatesModelImpl _value,
$Res Function(_$DiplomasAndCertificatesModelImpl) _then)
: super(_value, _then);
/// Create a copy of DiplomasAndCertificatesModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? id = null,
Object? path = null,
}) {
return _then(_$DiplomasAndCertificatesModelImpl(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
path: null == path
? _value.path
: path // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// @nodoc
@JsonSerializable()
class _$DiplomasAndCertificatesModelImpl
implements _DiplomasAndCertificatesModel {
const _$DiplomasAndCertificatesModelImpl(
{required this.id, required this.path});
factory _$DiplomasAndCertificatesModelImpl.fromJson(
Map<String, dynamic> json) =>
_$$DiplomasAndCertificatesModelImplFromJson(json);
@override
final int id;
@override
final String path;
@override
String toString() {
return 'DiplomasAndCertificatesModel(id: $id, path: $path)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$DiplomasAndCertificatesModelImpl &&
(identical(other.id, id) || other.id == id) &&
(identical(other.path, path) || other.path == path));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, id, path);
/// Create a copy of DiplomasAndCertificatesModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$DiplomasAndCertificatesModelImplCopyWith<
_$DiplomasAndCertificatesModelImpl>
get copyWith => __$$DiplomasAndCertificatesModelImplCopyWithImpl<
_$DiplomasAndCertificatesModelImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$DiplomasAndCertificatesModelImplToJson(
this,
);
}
}
abstract class _DiplomasAndCertificatesModel
implements DiplomasAndCertificatesModel {
const factory _DiplomasAndCertificatesModel(
{required final int id,
required final String path}) = _$DiplomasAndCertificatesModelImpl;
factory _DiplomasAndCertificatesModel.fromJson(Map<String, dynamic> json) =
_$DiplomasAndCertificatesModelImpl.fromJson;
@override
int get id;
@override
String get path;
/// Create a copy of DiplomasAndCertificatesModel
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$DiplomasAndCertificatesModelImplCopyWith<
_$DiplomasAndCertificatesModelImpl>
get copyWith => throw _privateConstructorUsedError;
}
EducationModel _$EducationModelFromJson(Map<String, dynamic> json) {
return _EducationModel.fromJson(json);
}
/// @nodoc
mixin _$EducationModel {
@JsonKey(name: "has_medical_education")
int? get hasMedical_Education => throw _privateConstructorUsedError;
int? get hasMedicalEducation => throw _privateConstructorUsedError;
@JsonKey(name: "completed_cources")
Map<String, CompletedCoursesModel>? get completedCourses =>
throw _privateConstructorUsedError;
@JsonKey(name: "vk_link")
String? get vkLink => throw _privateConstructorUsedError;
@JsonKey(name: "insta_link")
@@ -590,24 +836,26 @@ mixin _$EducationResource {
@JsonKey(name: "request_state")
String? get requestState => throw _privateConstructorUsedError;
/// Serializes this EducationResource to a JSON map.
/// Serializes this EducationModel to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of EducationResource
/// Create a copy of EducationModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$EducationResourceCopyWith<EducationResource> get copyWith =>
$EducationModelCopyWith<EducationModel> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $EducationResourceCopyWith<$Res> {
factory $EducationResourceCopyWith(
EducationResource value, $Res Function(EducationResource) then) =
_$EducationResourceCopyWithImpl<$Res, EducationResource>;
abstract class $EducationModelCopyWith<$Res> {
factory $EducationModelCopyWith(
EducationModel value, $Res Function(EducationModel) then) =
_$EducationModelCopyWithImpl<$Res, EducationModel>;
@useResult
$Res call(
{@JsonKey(name: "has_medical_education") int? hasMedical_Education,
{@JsonKey(name: "has_medical_education") int? hasMedicalEducation,
@JsonKey(name: "completed_cources")
Map<String, CompletedCoursesModel>? completedCourses,
@JsonKey(name: "vk_link") String? vkLink,
@JsonKey(name: "insta_link") String? instaLink,
@JsonKey(name: "fb_link") String? fbLink,
@@ -617,21 +865,22 @@ abstract class $EducationResourceCopyWith<$Res> {
}
/// @nodoc
class _$EducationResourceCopyWithImpl<$Res, $Val extends EducationResource>
implements $EducationResourceCopyWith<$Res> {
_$EducationResourceCopyWithImpl(this._value, this._then);
class _$EducationModelCopyWithImpl<$Res, $Val extends EducationModel>
implements $EducationModelCopyWith<$Res> {
_$EducationModelCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of EducationResource
/// Create a copy of EducationModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? hasMedical_Education = freezed,
Object? hasMedicalEducation = freezed,
Object? completedCourses = freezed,
Object? vkLink = freezed,
Object? instaLink = freezed,
Object? fbLink = freezed,
@@ -640,10 +889,14 @@ class _$EducationResourceCopyWithImpl<$Res, $Val extends EducationResource>
Object? requestState = freezed,
}) {
return _then(_value.copyWith(
hasMedical_Education: freezed == hasMedical_Education
? _value.hasMedical_Education
: hasMedical_Education // ignore: cast_nullable_to_non_nullable
hasMedicalEducation: freezed == hasMedicalEducation
? _value.hasMedicalEducation
: hasMedicalEducation // ignore: cast_nullable_to_non_nullable
as int?,
completedCourses: freezed == completedCourses
? _value.completedCourses
: completedCourses // ignore: cast_nullable_to_non_nullable
as Map<String, CompletedCoursesModel>?,
vkLink: freezed == vkLink
? _value.vkLink
: vkLink // ignore: cast_nullable_to_non_nullable
@@ -673,15 +926,17 @@ class _$EducationResourceCopyWithImpl<$Res, $Val extends EducationResource>
}
/// @nodoc
abstract class _$$EducationResourceImplCopyWith<$Res>
implements $EducationResourceCopyWith<$Res> {
factory _$$EducationResourceImplCopyWith(_$EducationResourceImpl value,
$Res Function(_$EducationResourceImpl) then) =
__$$EducationResourceImplCopyWithImpl<$Res>;
abstract class _$$EducationModelImplCopyWith<$Res>
implements $EducationModelCopyWith<$Res> {
factory _$$EducationModelImplCopyWith(_$EducationModelImpl value,
$Res Function(_$EducationModelImpl) then) =
__$$EducationModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call(
{@JsonKey(name: "has_medical_education") int? hasMedical_Education,
{@JsonKey(name: "has_medical_education") int? hasMedicalEducation,
@JsonKey(name: "completed_cources")
Map<String, CompletedCoursesModel>? completedCourses,
@JsonKey(name: "vk_link") String? vkLink,
@JsonKey(name: "insta_link") String? instaLink,
@JsonKey(name: "fb_link") String? fbLink,
@@ -691,19 +946,20 @@ abstract class _$$EducationResourceImplCopyWith<$Res>
}
/// @nodoc
class __$$EducationResourceImplCopyWithImpl<$Res>
extends _$EducationResourceCopyWithImpl<$Res, _$EducationResourceImpl>
implements _$$EducationResourceImplCopyWith<$Res> {
__$$EducationResourceImplCopyWithImpl(_$EducationResourceImpl _value,
$Res Function(_$EducationResourceImpl) _then)
class __$$EducationModelImplCopyWithImpl<$Res>
extends _$EducationModelCopyWithImpl<$Res, _$EducationModelImpl>
implements _$$EducationModelImplCopyWith<$Res> {
__$$EducationModelImplCopyWithImpl(
_$EducationModelImpl _value, $Res Function(_$EducationModelImpl) _then)
: super(_value, _then);
/// Create a copy of EducationResource
/// Create a copy of EducationModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? hasMedical_Education = freezed,
Object? hasMedicalEducation = freezed,
Object? completedCourses = freezed,
Object? vkLink = freezed,
Object? instaLink = freezed,
Object? fbLink = freezed,
@@ -711,11 +967,15 @@ class __$$EducationResourceImplCopyWithImpl<$Res>
Object? personalSiteLink = freezed,
Object? requestState = freezed,
}) {
return _then(_$EducationResourceImpl(
hasMedical_Education: freezed == hasMedical_Education
? _value.hasMedical_Education
: hasMedical_Education // ignore: cast_nullable_to_non_nullable
return _then(_$EducationModelImpl(
hasMedicalEducation: freezed == hasMedicalEducation
? _value.hasMedicalEducation
: hasMedicalEducation // ignore: cast_nullable_to_non_nullable
as int?,
completedCourses: freezed == completedCourses
? _value._completedCourses
: completedCourses // ignore: cast_nullable_to_non_nullable
as Map<String, CompletedCoursesModel>?,
vkLink: freezed == vkLink
? _value.vkLink
: vkLink // ignore: cast_nullable_to_non_nullable
@@ -746,22 +1006,36 @@ class __$$EducationResourceImplCopyWithImpl<$Res>
/// @nodoc
@JsonSerializable()
class _$EducationResourceImpl implements _EducationResource {
const _$EducationResourceImpl(
{@JsonKey(name: "has_medical_education") this.hasMedical_Education,
class _$EducationModelImpl implements _EducationModel {
const _$EducationModelImpl(
{@JsonKey(name: "has_medical_education") this.hasMedicalEducation,
@JsonKey(name: "completed_cources")
final Map<String, CompletedCoursesModel>? completedCourses,
@JsonKey(name: "vk_link") this.vkLink,
@JsonKey(name: "insta_link") this.instaLink,
@JsonKey(name: "fb_link") this.fbLink,
@JsonKey(name: "tg_link") this.tgLink,
@JsonKey(name: "personal_site_link") this.personalSiteLink,
@JsonKey(name: "request_state") this.requestState});
@JsonKey(name: "request_state") this.requestState})
: _completedCourses = completedCourses;
factory _$EducationResourceImpl.fromJson(Map<String, dynamic> json) =>
_$$EducationResourceImplFromJson(json);
factory _$EducationModelImpl.fromJson(Map<String, dynamic> json) =>
_$$EducationModelImplFromJson(json);
@override
@JsonKey(name: "has_medical_education")
final int? hasMedical_Education;
final int? hasMedicalEducation;
final Map<String, CompletedCoursesModel>? _completedCourses;
@override
@JsonKey(name: "completed_cources")
Map<String, CompletedCoursesModel>? get completedCourses {
final value = _completedCourses;
if (value == null) return null;
if (_completedCourses is EqualUnmodifiableMapView) return _completedCourses;
// ignore: implicit_dynamic_type
return EqualUnmodifiableMapView(value);
}
@override
@JsonKey(name: "vk_link")
final String? vkLink;
@@ -783,16 +1057,18 @@ class _$EducationResourceImpl implements _EducationResource {
@override
String toString() {
return 'EducationResource(hasMedical_Education: $hasMedical_Education, vkLink: $vkLink, instaLink: $instaLink, fbLink: $fbLink, tgLink: $tgLink, personalSiteLink: $personalSiteLink, requestState: $requestState)';
return 'EducationModel(hasMedicalEducation: $hasMedicalEducation, completedCourses: $completedCourses, vkLink: $vkLink, instaLink: $instaLink, fbLink: $fbLink, tgLink: $tgLink, personalSiteLink: $personalSiteLink, requestState: $requestState)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$EducationResourceImpl &&
(identical(other.hasMedical_Education, hasMedical_Education) ||
other.hasMedical_Education == hasMedical_Education) &&
other is _$EducationModelImpl &&
(identical(other.hasMedicalEducation, hasMedicalEducation) ||
other.hasMedicalEducation == hasMedicalEducation) &&
const DeepCollectionEquality()
.equals(other._completedCourses, _completedCourses) &&
(identical(other.vkLink, vkLink) || other.vkLink == vkLink) &&
(identical(other.instaLink, instaLink) ||
other.instaLink == instaLink) &&
@@ -806,43 +1082,56 @@ class _$EducationResourceImpl implements _EducationResource {
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, hasMedical_Education, vkLink,
instaLink, fbLink, tgLink, personalSiteLink, requestState);
int get hashCode => Object.hash(
runtimeType,
hasMedicalEducation,
const DeepCollectionEquality().hash(_completedCourses),
vkLink,
instaLink,
fbLink,
tgLink,
personalSiteLink,
requestState);
/// Create a copy of EducationResource
/// Create a copy of EducationModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$EducationResourceImplCopyWith<_$EducationResourceImpl> get copyWith =>
__$$EducationResourceImplCopyWithImpl<_$EducationResourceImpl>(
_$$EducationModelImplCopyWith<_$EducationModelImpl> get copyWith =>
__$$EducationModelImplCopyWithImpl<_$EducationModelImpl>(
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$EducationResourceImplToJson(
return _$$EducationModelImplToJson(
this,
);
}
}
abstract class _EducationResource implements EducationResource {
const factory _EducationResource(
{@JsonKey(name: "has_medical_education") final int? hasMedical_Education,
abstract class _EducationModel implements EducationModel {
const factory _EducationModel(
{@JsonKey(name: "has_medical_education") final int? hasMedicalEducation,
@JsonKey(name: "completed_cources")
final Map<String, CompletedCoursesModel>? completedCourses,
@JsonKey(name: "vk_link") final String? vkLink,
@JsonKey(name: "insta_link") final String? instaLink,
@JsonKey(name: "fb_link") final String? fbLink,
@JsonKey(name: "tg_link") final String? tgLink,
@JsonKey(name: "personal_site_link") final String? personalSiteLink,
@JsonKey(name: "request_state")
final String? requestState}) = _$EducationResourceImpl;
final String? requestState}) = _$EducationModelImpl;
factory _EducationResource.fromJson(Map<String, dynamic> json) =
_$EducationResourceImpl.fromJson;
factory _EducationModel.fromJson(Map<String, dynamic> json) =
_$EducationModelImpl.fromJson;
@override
@JsonKey(name: "has_medical_education")
int? get hasMedical_Education;
int? get hasMedicalEducation;
@override
@JsonKey(name: "completed_cources")
Map<String, CompletedCoursesModel>? get completedCourses;
@override
@JsonKey(name: "vk_link")
String? get vkLink;
@@ -862,14 +1151,186 @@ abstract class _EducationResource implements EducationResource {
@JsonKey(name: "request_state")
String? get requestState;
/// Create a copy of EducationResource
/// Create a copy of EducationModel
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$EducationResourceImplCopyWith<_$EducationResourceImpl> get copyWith =>
_$$EducationModelImplCopyWith<_$EducationModelImpl> get copyWith =>
throw _privateConstructorUsedError;
}
CompletedCoursesModel _$CompletedCoursesModelFromJson(
Map<String, dynamic> json) {
return _CompletedCoursesModel.fromJson(json);
}
/// @nodoc
mixin _$CompletedCoursesModel {
String get date => throw _privateConstructorUsedError;
String get title => throw _privateConstructorUsedError;
/// Serializes this CompletedCoursesModel to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of CompletedCoursesModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$CompletedCoursesModelCopyWith<CompletedCoursesModel> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $CompletedCoursesModelCopyWith<$Res> {
factory $CompletedCoursesModelCopyWith(CompletedCoursesModel value,
$Res Function(CompletedCoursesModel) then) =
_$CompletedCoursesModelCopyWithImpl<$Res, CompletedCoursesModel>;
@useResult
$Res call({String date, String title});
}
/// @nodoc
class _$CompletedCoursesModelCopyWithImpl<$Res,
$Val extends CompletedCoursesModel>
implements $CompletedCoursesModelCopyWith<$Res> {
_$CompletedCoursesModelCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of CompletedCoursesModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? date = null,
Object? title = null,
}) {
return _then(_value.copyWith(
date: null == date
? _value.date
: date // ignore: cast_nullable_to_non_nullable
as String,
title: null == title
? _value.title
: title // ignore: cast_nullable_to_non_nullable
as String,
) as $Val);
}
}
/// @nodoc
abstract class _$$CompletedCoursesModelImplCopyWith<$Res>
implements $CompletedCoursesModelCopyWith<$Res> {
factory _$$CompletedCoursesModelImplCopyWith(
_$CompletedCoursesModelImpl value,
$Res Function(_$CompletedCoursesModelImpl) then) =
__$$CompletedCoursesModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({String date, String title});
}
/// @nodoc
class __$$CompletedCoursesModelImplCopyWithImpl<$Res>
extends _$CompletedCoursesModelCopyWithImpl<$Res,
_$CompletedCoursesModelImpl>
implements _$$CompletedCoursesModelImplCopyWith<$Res> {
__$$CompletedCoursesModelImplCopyWithImpl(_$CompletedCoursesModelImpl _value,
$Res Function(_$CompletedCoursesModelImpl) _then)
: super(_value, _then);
/// Create a copy of CompletedCoursesModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? date = null,
Object? title = null,
}) {
return _then(_$CompletedCoursesModelImpl(
date: null == date
? _value.date
: date // ignore: cast_nullable_to_non_nullable
as String,
title: null == title
? _value.title
: title // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// @nodoc
@JsonSerializable()
class _$CompletedCoursesModelImpl implements _CompletedCoursesModel {
const _$CompletedCoursesModelImpl({required this.date, required this.title});
factory _$CompletedCoursesModelImpl.fromJson(Map<String, dynamic> json) =>
_$$CompletedCoursesModelImplFromJson(json);
@override
final String date;
@override
final String title;
@override
String toString() {
return 'CompletedCoursesModel(date: $date, title: $title)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$CompletedCoursesModelImpl &&
(identical(other.date, date) || other.date == date) &&
(identical(other.title, title) || other.title == title));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, date, title);
/// Create a copy of CompletedCoursesModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$CompletedCoursesModelImplCopyWith<_$CompletedCoursesModelImpl>
get copyWith => __$$CompletedCoursesModelImplCopyWithImpl<
_$CompletedCoursesModelImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$CompletedCoursesModelImplToJson(
this,
);
}
}
abstract class _CompletedCoursesModel implements CompletedCoursesModel {
const factory _CompletedCoursesModel(
{required final String date,
required final String title}) = _$CompletedCoursesModelImpl;
factory _CompletedCoursesModel.fromJson(Map<String, dynamic> json) =
_$CompletedCoursesModelImpl.fromJson;
@override
String get date;
@override
String get title;
/// Create a copy of CompletedCoursesModel
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$CompletedCoursesModelImplCopyWith<_$CompletedCoursesModelImpl>
get copyWith => throw _privateConstructorUsedError;
}
ProfileDetailsModel _$ProfileDetailsModelFromJson(Map<String, dynamic> json) {
return _ProfileDetailsModel.fromJson(json);
}

View File

@@ -11,6 +11,7 @@ _$ProfileModelImpl _$$ProfileModelImplFromJson(Map<String, dynamic> json) =>
id: (json['id'] as num).toInt(),
name: json['name'] as String,
email: json['email'] as String,
ratingPlace: (json['rating_place'] as num?)?.toInt(),
emailVerifiedAt: json['email_verified_at'] == null
? null
: DateTime.parse(json['email_verified_at'] as String),
@@ -36,8 +37,12 @@ _$ProfileModelImpl _$$ProfileModelImplFromJson(Map<String, dynamic> json) =>
.toList(),
educationResource: json['education_resource'] == null
? null
: EducationResource.fromJson(
: EducationModel.fromJson(
json['education_resource'] as Map<String, dynamic>),
diplomasAndCertificates: (json['cert_photos'] as List<dynamic>?)
?.map((e) =>
DiplomasAndCertificatesModel.fromJson(e as Map<String, dynamic>))
.toList(),
);
Map<String, dynamic> _$$ProfileModelImplToJson(_$ProfileModelImpl instance) =>
@@ -45,6 +50,7 @@ Map<String, dynamic> _$$ProfileModelImplToJson(_$ProfileModelImpl instance) =>
'id': instance.id,
'name': instance.name,
'email': instance.email,
'rating_place': instance.ratingPlace,
'email_verified_at': instance.emailVerifiedAt?.toIso8601String(),
'created_at': instance.createdAt?.toIso8601String(),
'updated_at': instance.updatedAt?.toIso8601String(),
@@ -57,12 +63,31 @@ Map<String, dynamic> _$$ProfileModelImplToJson(_$ProfileModelImpl instance) =>
'subscriptions': instance.subscriptions,
'subscribers': instance.subscribers,
'education_resource': instance.educationResource,
'cert_photos': instance.diplomasAndCertificates,
};
_$EducationResourceImpl _$$EducationResourceImplFromJson(
_$DiplomasAndCertificatesModelImpl _$$DiplomasAndCertificatesModelImplFromJson(
Map<String, dynamic> json) =>
_$EducationResourceImpl(
hasMedical_Education: (json['has_medical_education'] as num?)?.toInt(),
_$DiplomasAndCertificatesModelImpl(
id: (json['id'] as num).toInt(),
path: json['path'] as String,
);
Map<String, dynamic> _$$DiplomasAndCertificatesModelImplToJson(
_$DiplomasAndCertificatesModelImpl instance) =>
<String, dynamic>{
'id': instance.id,
'path': instance.path,
};
_$EducationModelImpl _$$EducationModelImplFromJson(Map<String, dynamic> json) =>
_$EducationModelImpl(
hasMedicalEducation: (json['has_medical_education'] as num?)?.toInt(),
completedCourses:
(json['completed_cources'] as Map<String, dynamic>?)?.map(
(k, e) => MapEntry(
k, CompletedCoursesModel.fromJson(e as Map<String, dynamic>)),
),
vkLink: json['vk_link'] as String?,
instaLink: json['insta_link'] as String?,
fbLink: json['fb_link'] as String?,
@@ -71,10 +96,11 @@ _$EducationResourceImpl _$$EducationResourceImplFromJson(
requestState: json['request_state'] as String?,
);
Map<String, dynamic> _$$EducationResourceImplToJson(
_$EducationResourceImpl instance) =>
Map<String, dynamic> _$$EducationModelImplToJson(
_$EducationModelImpl instance) =>
<String, dynamic>{
'has_medical_education': instance.hasMedical_Education,
'has_medical_education': instance.hasMedicalEducation,
'completed_cources': instance.completedCourses,
'vk_link': instance.vkLink,
'insta_link': instance.instaLink,
'fb_link': instance.fbLink,
@@ -83,6 +109,20 @@ Map<String, dynamic> _$$EducationResourceImplToJson(
'request_state': instance.requestState,
};
_$CompletedCoursesModelImpl _$$CompletedCoursesModelImplFromJson(
Map<String, dynamic> json) =>
_$CompletedCoursesModelImpl(
date: json['date'] as String,
title: json['title'] as String,
);
Map<String, dynamic> _$$CompletedCoursesModelImplToJson(
_$CompletedCoursesModelImpl instance) =>
<String, dynamic>{
'date': instance.date,
'title': instance.title,
};
_$ProfileDetailsModelImpl _$$ProfileDetailsModelImplFromJson(
Map<String, dynamic> json) =>
_$ProfileDetailsModelImpl(