Merge remote-tracking branch 'upstream/main'

This commit is contained in:
Username1548
2024-12-11 19:24:23 +07:00
29 changed files with 2487 additions and 333 deletions

View File

@@ -18,7 +18,7 @@ pluginManagement {
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.7.2" apply false
id "com.android.application" version "8.7.3" apply false
id "org.jetbrains.kotlin.android" version "2.0.21" apply false
}

View File

@@ -87,13 +87,17 @@ class InitializationCubit extends Cubit<InitializationState> {
await subscribeNotifications(wsUrl.userId, client);
await subscribeChatMessages(wsUrl.userId, client);
emit(InitializationState.success(
client: client,
),);
emit(
InitializationState.success(
client: client,
),
);
} catch (e) {
emit(InitializationState.error(
errorMessage: e.toString(),
),);
emit(
InitializationState.error(
errorMessage: e.toString(),
),
);
rethrow;
}
}

View File

@@ -37,6 +37,8 @@ import 'package:eatvio_app/features/feed/services/feed_service.dart';
import 'package:eatvio_app/features/glossary/repositories/glossary_repository.dart';
import 'package:eatvio_app/features/glossary/services/glossary_service.dart';
import 'package:eatvio_app/features/feed/presentation/bloc/plans_cubit/plans_cubit.dart';
import 'package:eatvio_app/features/plans/repositories/plans_repository.dart';
import 'package:eatvio_app/features/plans/services/plans_service.dart';
import 'package:eatvio_app/features/plans/presentation/cubit/about_plan_cubit.dart';
import 'package:eatvio_app/features/plans/repositories/plan_repository.dart';
import 'package:eatvio_app/features/plans/services/plan_service.dart';
@@ -54,6 +56,7 @@ import 'package:eatvio_app/features/settings/presentation/bloc/settings_cubit/se
import 'package:eatvio_app/features/settings/repositories/service_repository.dart';
import 'package:eatvio_app/features/settings/services/settings_service.dart';
import 'package:get_it/get_it.dart';
import 'package:eatvio_app/features/profile/presentation/bloc/plans_cubit/plans_cubit.dart' as profilePlans;
final sl = GetIt.instance;
@@ -71,6 +74,7 @@ Future<void> init() async {
sl.registerFactory<RecipesCubit>(() => RecipesCubit(feedRepository: sl(), recipeRepository: sl()));
sl.registerFactory<CalendarCubit>(() => CalendarCubit(calendarRepository: sl()));
sl.registerFactory<ProfileCubit>(() => ProfileCubit(profileRepository: sl(), chatRepository: sl()));
sl.registerFactory<profilePlans.PlansCubit>(() => profilePlans.PlansCubit(plansRepository: sl()));
sl.registerFactory<RecipeCreateCubit>(() => RecipeCreateCubit(recipeRepository: sl()));
sl.registerFactory<DietsCubit>(() => DietsCubit(feedRepository: sl(), dietsRepository: sl()));
sl.registerFactory<CommentsCubit>(() => CommentsCubit(feedRepository: sl()));
@@ -101,6 +105,7 @@ Future<void> init() async {
sl.registerLazySingleton<DietRepository>(() => DietRepository(dietsService: sl()));
sl.registerLazySingleton<BlogPostRepository>(() => BlogPostRepository(blogPostService: sl()));
sl.registerLazySingleton<CreateDietRepository>(() => CreateDietRepository(createDietService: sl()));
sl.registerLazySingleton<PlansRepository>(() => PlansRepository(plansService: sl()));
sl.registerLazySingleton<PlanRepository>(() => PlanRepository(planService: sl()));
// Services
@@ -117,6 +122,7 @@ Future<void> init() async {
sl.registerLazySingleton<DietService>(() => DietService(sl()));
sl.registerLazySingleton<BlogPostService>(() => BlogPostService(sl()));
sl.registerLazySingleton<CreateDietService>(() => CreateDietService(sl()));
sl.registerLazySingleton<PlansService>(() => PlansService(sl()));
sl.registerLazySingleton<PlanService>(() => PlanService(sl()));
// External

View File

@@ -18,6 +18,7 @@ import 'package:validators/validators.dart';
import 'bloc/auth_bloc.dart';
import 'models/auth_model.dart';
import 'package:flutter_native_splash/flutter_native_splash.dart';
class AuthScreen extends StatefulWidget {
static Widget builder(BuildContext context) {
@@ -43,6 +44,7 @@ class _AuthScreenState extends State<AuthScreen> {
@override
Widget build(BuildContext context) {
FlutterNativeSplash.remove();
final s = S.of(context);
return Scaffold(
appBar: AppBar(

View File

@@ -49,39 +49,43 @@ class CalendarScreen extends StatelessWidget {
}
Widget _buildCalendar(BuildContext context, CalendarStateLoaded state) {
return Stack(alignment: Alignment.bottomCenter, children: [
FormBuilder(
child: Scaffold(
appBar: AppBar(
toolbarHeight: 0,
automaticallyImplyLeading: false,
),
backgroundColor: Colors.white,
resizeToAvoidBottomInset: true,
body: SizedBox(
width: double.maxFinite,
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.only(bottom: 8),
child: Column(
children: [
SizedBox(height: 24),
_buildCalendarBody(context, state),
SizedBox(height: 24),
],
return Stack(
alignment: Alignment.bottomCenter,
children: [
FormBuilder(
child: Scaffold(
appBar: AppBar(
title: Text(
'Календарь',
),
),
backgroundColor: Colors.white,
resizeToAvoidBottomInset: true,
body: SizedBox(
width: double.maxFinite,
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.only(bottom: 8),
child: Column(
children: [
SizedBox(height: 24),
_buildCalendarBody(context, state),
SizedBox(height: 24),
],
),
),
),
),
),
],
],
),
),
),
),
),
],);
],
);
}
_buildCalendarBody(BuildContext context, CalendarStateLoaded state) {
@@ -180,44 +184,46 @@ class CalendarScreen extends StatelessWidget {
style: theme.textTheme.titleMedium,
),
SizedBox(height: 4),
Row(children: [
Container(
padding: EdgeInsets.all(4.0), // Отступы внутри контейнера
decoration: BoxDecoration(
color: diary['state'] == 'finished' ? Color.fromRGBO(1, 154, 62, 1) : Color.fromRGBO(154, 74, 1, 1),
borderRadius: BorderRadius.circular(24.0), // Закругленные углы
),
child: Text(
_getStateText(diary['state'] ?? ''),
style: CustomTextStyles.titleSmallBold, // Предполагается, что текст белый
),
),
SizedBox(width: 4),
if (diary['state'] == 'started')
Row(
children: [
Container(
padding: EdgeInsets.all(4.0), // Отступы внутри контейнера
decoration: BoxDecoration(
color: Color.fromRGBO(13, 110, 253, 1),
color: diary['state'] == 'finished' ? Color.fromRGBO(1, 154, 62, 1) : Color.fromRGBO(154, 74, 1, 1),
borderRadius: BorderRadius.circular(24.0), // Закругленные углы
),
child: Text(
'Заполнить отчет',
_getStateText(diary['state'] ?? ''),
style: CustomTextStyles.titleSmallBold, // Предполагается, что текст белый
),
),
if (diary['state'] == 'finished')
Container(
padding: EdgeInsets.all(4.0), // Отступы внутри контейнера
decoration: BoxDecoration(
color: Color.fromRGBO(13, 110, 253, 1),
borderRadius: BorderRadius.circular(24.0), // Закругленные углы
SizedBox(width: 4),
if (diary['state'] == 'started')
Container(
padding: EdgeInsets.all(4.0), // Отступы внутри контейнера
decoration: BoxDecoration(
color: Color.fromRGBO(13, 110, 253, 1),
borderRadius: BorderRadius.circular(24.0), // Закругленные углы
),
child: Text(
'Заполнить отчет',
style: CustomTextStyles.titleSmallBold, // Предполагается, что текст белый
),
),
child: Text(
'Изменить отчет',
style: CustomTextStyles.titleSmallBold, // Предполагается, что текст белый
if (diary['state'] == 'finished')
Container(
padding: EdgeInsets.all(4.0), // Отступы внутри контейнера
decoration: BoxDecoration(
color: Color.fromRGBO(13, 110, 253, 1),
borderRadius: BorderRadius.circular(24.0), // Закругленные углы
),
child: Text(
'Изменить отчет',
style: CustomTextStyles.titleSmallBold, // Предполагается, что текст белый
),
),
),
],),
],
),
],
),
),

View File

@@ -1,7 +1,6 @@
import 'package:eatvio_app/features/diary/presentation/bloc/diary_cubit.dart';
import 'package:eatvio_app/core/theme/theme_helper.dart';
import 'package:eatvio_app/core/widgets/custom_text_form_field.dart';
import 'package:eatvio_app/features/glossary/models/glossary_model.dart';
import 'package:flutter/material.dart';
import 'package:lottie/lottie.dart';
@@ -28,7 +27,7 @@ class _GlossaryModerationRequestModalWidgetState extends State<GlossaryModeratio
final proteinsController = TextEditingController();
final fatsController = TextEditingController();
final carbohydratesController = TextEditingController();
GlossaryModel? glossary;
@override
Widget build(BuildContext context) {
if (glossaryState == GlossaryState.alert) {
@@ -161,7 +160,7 @@ class _GlossaryModerationRequestModalWidgetState extends State<GlossaryModeratio
const SizedBox(height: 16),
InkWell(
onTap: () {
Navigator.of(context).pop(glossary);
Navigator.of(context).pop();
},
borderRadius: BorderRadius.circular(20),
child: Ink(
@@ -264,7 +263,7 @@ class _GlossaryModerationRequestModalWidgetState extends State<GlossaryModeratio
const SizedBox(height: 12),
InkWell(
onTap: () async {
glossary = (await widget.diaryCubit.sendProductToModeration(
await widget.diaryCubit.sendProductToModeration(
name: productNameController.text,
energy: double.parse(energyController.text),
proteins: double.parse(proteinsController.text),

View File

@@ -4,7 +4,6 @@ import 'package:eatvio_app/features/diary/models/finish_diary_day_model.dart';
import 'package:eatvio_app/features/diary/models/nutrition_model.dart';
import 'package:eatvio_app/features/diary/models/product_moderation_model.dart';
import 'package:eatvio_app/features/diary/services/diary_service.dart';
import 'package:eatvio_app/features/glossary/models/glossary_model.dart';
class DiaryRepository {
final DiaryService diaryService;
@@ -128,7 +127,7 @@ class DiaryRepository {
);
}
Future<GlossaryModerationModel> sendProductToModeration({
Future<void> sendProductToModeration({
required String name,
required double energy,
required double proteins,

View File

@@ -3,7 +3,6 @@ import 'package:dio/dio.dart';
import 'package:eatvio_app/features/diary/models/diary_day_model.dart';
import 'package:eatvio_app/features/diary/models/finish_diary_day_model.dart';
import 'package:eatvio_app/features/diary/models/nutrition_model.dart';
import 'package:eatvio_app/features/glossary/models/glossary_model.dart';
import 'package:retrofit/retrofit.dart';
part 'diary_service.g.dart';
@@ -88,7 +87,7 @@ abstract class DiaryService {
});
@POST('/api/diary/product_nutritional_values/sendToModeration')
Future<GlossaryModerationModel> sendProductToModeration({
Future<void> sendProductToModeration({
@Body() required Map<String, dynamic> data,
});
}

View File

@@ -387,14 +387,14 @@ class _DiaryService implements DiaryService {
}
@override
Future<GlossaryModerationModel> sendProductToModeration(
Future<void> sendProductToModeration(
{required Map<String, dynamic> data}) async {
final _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _headers = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(data);
final _options = _setStreamType<GlossaryModerationModel>(Options(
final _options = _setStreamType<void>(Options(
method: 'POST',
headers: _headers,
extra: _extra,
@@ -410,15 +410,7 @@ class _DiaryService implements DiaryService {
_dio.options.baseUrl,
baseUrl,
)));
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
late GlossaryModerationModel _value;
try {
_value = GlossaryModerationModel.fromJson(_result.data!);
} on Object catch (e, s) {
errorLogger?.logError(e, s, _options);
rethrow;
}
return _value;
await _dio.fetch<void>(_options);
}
RequestOptions _setStreamType<T>(RequestOptions requestOptions) {

View File

@@ -85,7 +85,10 @@ _$AuthorImpl _$$AuthorImplFromJson(Map<String, dynamic> json) => _$AuthorImpl(
authorProfileIcon: json['author_profile_icon'] as String,
authorIsMe: json['author_is_me'] as bool,
isEntitySubscribedByMe: json['is_entity_subscribed_by_me'] as bool?,
<<<<<<< HEAD
authorPlaceInRating: (json['author_place_in_rating'] as num?)?.toInt(),
=======
>>>>>>> upstream/main
);
Map<String, dynamic> _$$AuthorImplToJson(_$AuthorImpl instance) =>

View File

@@ -75,6 +75,7 @@ class _BlogPostWidgetState extends State<BlogPostWidget> {
height: 1,
color: Colors.black87,
fontWeight: FontWeight.w500,
fontSize: 16,
),
),
const SizedBox(height: 4),
@@ -83,6 +84,7 @@ class _BlogPostWidgetState extends State<BlogPostWidget> {
style: TextStyle(
height: 1,
color: Colors.black45,
fontSize: 14,
),
),
],
@@ -102,6 +104,7 @@ class _BlogPostWidgetState extends State<BlogPostWidget> {
child: Text(
state.feedBlogPostList[widget.index].title,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w600,
color: Colors.black87,
),
@@ -117,6 +120,7 @@ class _BlogPostWidgetState extends State<BlogPostWidget> {
: state.feedBlogPostList[widget.index].description,
style: {
"*": Style(
fontSize: FontSize(16),
color: Colors.black87,
),
},

View File

@@ -78,7 +78,7 @@ class _CommentsWidgetState extends State<CommentsWidget> {
),
SizedBox(height: 4),
SizedBox(
width: MediaQuery.of(context).size.width * 0.8,
width: isChild ? MediaQuery.of(context).size.width * 0.72 : MediaQuery.of(context).size.width * 0.8,
child: Text(
comment.body,
style: TextStyle(

View File

@@ -0,0 +1,16 @@
import 'package:eatvio_app/features/feed/models/plan_pagination_model.dart';
import 'package:eatvio_app/features/plans/services/plans_service.dart';
class PlansRepository {
final PlansService plansService;
PlansRepository({required this.plansService});
Future<List<PlanModel>> getPlansBySlug(String slug) async {
try {
return (await plansService.getPlansBySlug(author: slug)).data;
} catch (e) {
rethrow;
}
}
}

View File

@@ -0,0 +1,15 @@
import 'package:dio/dio.dart';
import 'package:eatvio_app/features/feed/models/plan_pagination_model.dart';
import 'package:retrofit/retrofit.dart';
part 'plans_service.g.dart';
@RestApi()
abstract class PlansService {
factory PlansService(Dio dio, {String baseUrl}) = _PlansService;
@GET('/api/plans/get_by_author/{author}')
Future<PlanPaginationModel> getPlansBySlug({
@Path() required String author,
});
}

View File

@@ -0,0 +1,86 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'plans_service.dart';
// **************************************************************************
// RetrofitGenerator
// **************************************************************************
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
class _PlansService implements PlansService {
_PlansService(
this._dio, {
this.baseUrl,
this.errorLogger,
});
final Dio _dio;
String? baseUrl;
final ParseErrorLogger? errorLogger;
@override
Future<PlanPaginationModel> getPlansBySlug({required String author}) async {
final _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _headers = <String, dynamic>{};
const Map<String, dynamic>? _data = null;
final _options = _setStreamType<PlanPaginationModel>(Options(
method: 'GET',
headers: _headers,
extra: _extra,
)
.compose(
_dio.options,
'/api/plans/get_by_author/${author}',
queryParameters: queryParameters,
data: _data,
)
.copyWith(
baseUrl: _combineBaseUrls(
_dio.options.baseUrl,
baseUrl,
)));
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
late PlanPaginationModel _value;
try {
_value = PlanPaginationModel.fromJson(_result.data!);
} on Object catch (e, s) {
errorLogger?.logError(e, s, _options);
rethrow;
}
return _value;
}
RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
if (T != dynamic &&
!(requestOptions.responseType == ResponseType.bytes ||
requestOptions.responseType == ResponseType.stream)) {
if (T == String) {
requestOptions.responseType = ResponseType.plain;
} else {
requestOptions.responseType = ResponseType.json;
}
}
return requestOptions;
}
String _combineBaseUrls(
String dioBaseUrl,
String? baseUrl,
) {
if (baseUrl == null || baseUrl.trim().isEmpty) {
return dioBaseUrl;
}
final url = Uri.parse(baseUrl);
if (url.isAbsolute) {
return url.toString();
}
return Uri.parse(dioBaseUrl).resolveUri(url).toString();
}
}

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") List<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")
List<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")
List<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 List<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")
List<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 List<Map<String, CompletedCoursesModel>>?,
vkLink: freezed == vkLink
? _value.vkLink
: vkLink // ignore: cast_nullable_to_non_nullable
@@ -746,22 +1006,37 @@ 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 List<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 List<Map<String, CompletedCoursesModel>>? _completedCourses;
@override
@JsonKey(name: "completed_cources")
List<Map<String, CompletedCoursesModel>>? get completedCourses {
final value = _completedCourses;
if (value == null) return null;
if (_completedCourses is EqualUnmodifiableListView)
return _completedCourses;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(value);
}
@override
@JsonKey(name: "vk_link")
final String? vkLink;
@@ -783,16 +1058,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 +1083,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 List<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")
List<Map<String, CompletedCoursesModel>>? get completedCourses;
@override
@JsonKey(name: "vk_link")
String? get vkLink;
@@ -862,14 +1152,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,32 @@ 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 List<dynamic>?)
?.map((e) => (e as Map<String, dynamic>).map(
(k, e) => MapEntry(k,
CompletedCoursesModel.fromJson(e as Map<String, dynamic>)),
))
.toList(),
vkLink: json['vk_link'] as String?,
instaLink: json['insta_link'] as String?,
fbLink: json['fb_link'] as String?,
@@ -71,10 +97,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 +110,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(

View File

@@ -0,0 +1,21 @@
import 'package:eatvio_app/features/plans/repositories/plans_repository.dart';
import 'package:eatvio_app/features/profile/presentation/bloc/plans_cubit/plans_state.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
class PlansCubit extends Cubit<PlansState> {
final PlansRepository plansRepository;
PlansCubit({
required this.plansRepository,
}) : super(const PlansState());
getPlans(String slug) async {
emit(const PlansState.loading());
try {
emit(PlansState.loaded(plansList: await plansRepository.getPlansBySlug(slug)));
} catch (e) {
print(e);
emit(PlansState.error(errorMessage: e.toString()));
}
}
}

View File

@@ -0,0 +1,19 @@
import 'package:eatvio_app/features/feed/models/plan_pagination_model.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
part 'plans_state.freezed.dart';
@freezed
abstract class PlansState with _$PlansState {
const factory PlansState() = _PlansState;
const factory PlansState.loading() = PlansStateLoading;
const factory PlansState.loaded({
required List<PlanModel> plansList,
}) = PlansStateLoaded;
const factory PlansState.error({
required String errorMessage,
}) = PlansStateError;
}

View File

@@ -0,0 +1,641 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
part of 'plans_state.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
/// @nodoc
mixin _$PlansState {
@optionalTypeArgs
TResult when<TResult extends Object?>(
TResult Function() $default, {
required TResult Function() loading,
required TResult Function(List<PlanModel> plansList) loaded,
required TResult Function(String errorMessage) error,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(List<PlanModel> plansList)? loaded,
TResult? Function(String errorMessage)? error,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(List<PlanModel> plansList)? loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_PlansState value) $default, {
required TResult Function(PlansStateLoading value) loading,
required TResult Function(PlansStateLoaded value) loaded,
required TResult Function(PlansStateError value) error,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult? Function(_PlansState value)? $default, {
TResult? Function(PlansStateLoading value)? loading,
TResult? Function(PlansStateLoaded value)? loaded,
TResult? Function(PlansStateError value)? error,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_PlansState value)? $default, {
TResult Function(PlansStateLoading value)? loading,
TResult Function(PlansStateLoaded value)? loaded,
TResult Function(PlansStateError value)? error,
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $PlansStateCopyWith<$Res> {
factory $PlansStateCopyWith(
PlansState value, $Res Function(PlansState) then) =
_$PlansStateCopyWithImpl<$Res, PlansState>;
}
/// @nodoc
class _$PlansStateCopyWithImpl<$Res, $Val extends PlansState>
implements $PlansStateCopyWith<$Res> {
_$PlansStateCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of PlansState
/// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
abstract class _$$PlansStateImplCopyWith<$Res> {
factory _$$PlansStateImplCopyWith(
_$PlansStateImpl value, $Res Function(_$PlansStateImpl) then) =
__$$PlansStateImplCopyWithImpl<$Res>;
}
/// @nodoc
class __$$PlansStateImplCopyWithImpl<$Res>
extends _$PlansStateCopyWithImpl<$Res, _$PlansStateImpl>
implements _$$PlansStateImplCopyWith<$Res> {
__$$PlansStateImplCopyWithImpl(
_$PlansStateImpl _value, $Res Function(_$PlansStateImpl) _then)
: super(_value, _then);
/// Create a copy of PlansState
/// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
class _$PlansStateImpl implements _PlansState {
const _$PlansStateImpl();
@override
String toString() {
return 'PlansState()';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType && other is _$PlansStateImpl);
}
@override
int get hashCode => runtimeType.hashCode;
@override
@optionalTypeArgs
TResult when<TResult extends Object?>(
TResult Function() $default, {
required TResult Function() loading,
required TResult Function(List<PlanModel> plansList) loaded,
required TResult Function(String errorMessage) error,
}) {
return $default();
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(List<PlanModel> plansList)? loaded,
TResult? Function(String errorMessage)? error,
}) {
return $default?.call();
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(List<PlanModel> plansList)? loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) {
if ($default != null) {
return $default();
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_PlansState value) $default, {
required TResult Function(PlansStateLoading value) loading,
required TResult Function(PlansStateLoaded value) loaded,
required TResult Function(PlansStateError value) error,
}) {
return $default(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult? Function(_PlansState value)? $default, {
TResult? Function(PlansStateLoading value)? loading,
TResult? Function(PlansStateLoaded value)? loaded,
TResult? Function(PlansStateError value)? error,
}) {
return $default?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_PlansState value)? $default, {
TResult Function(PlansStateLoading value)? loading,
TResult Function(PlansStateLoaded value)? loaded,
TResult Function(PlansStateError value)? error,
required TResult orElse(),
}) {
if ($default != null) {
return $default(this);
}
return orElse();
}
}
abstract class _PlansState implements PlansState {
const factory _PlansState() = _$PlansStateImpl;
}
/// @nodoc
abstract class _$$PlansStateLoadingImplCopyWith<$Res> {
factory _$$PlansStateLoadingImplCopyWith(_$PlansStateLoadingImpl value,
$Res Function(_$PlansStateLoadingImpl) then) =
__$$PlansStateLoadingImplCopyWithImpl<$Res>;
}
/// @nodoc
class __$$PlansStateLoadingImplCopyWithImpl<$Res>
extends _$PlansStateCopyWithImpl<$Res, _$PlansStateLoadingImpl>
implements _$$PlansStateLoadingImplCopyWith<$Res> {
__$$PlansStateLoadingImplCopyWithImpl(_$PlansStateLoadingImpl _value,
$Res Function(_$PlansStateLoadingImpl) _then)
: super(_value, _then);
/// Create a copy of PlansState
/// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
class _$PlansStateLoadingImpl implements PlansStateLoading {
const _$PlansStateLoadingImpl();
@override
String toString() {
return 'PlansState.loading()';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType && other is _$PlansStateLoadingImpl);
}
@override
int get hashCode => runtimeType.hashCode;
@override
@optionalTypeArgs
TResult when<TResult extends Object?>(
TResult Function() $default, {
required TResult Function() loading,
required TResult Function(List<PlanModel> plansList) loaded,
required TResult Function(String errorMessage) error,
}) {
return loading();
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(List<PlanModel> plansList)? loaded,
TResult? Function(String errorMessage)? error,
}) {
return loading?.call();
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(List<PlanModel> plansList)? loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) {
if (loading != null) {
return loading();
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_PlansState value) $default, {
required TResult Function(PlansStateLoading value) loading,
required TResult Function(PlansStateLoaded value) loaded,
required TResult Function(PlansStateError value) error,
}) {
return loading(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult? Function(_PlansState value)? $default, {
TResult? Function(PlansStateLoading value)? loading,
TResult? Function(PlansStateLoaded value)? loaded,
TResult? Function(PlansStateError value)? error,
}) {
return loading?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_PlansState value)? $default, {
TResult Function(PlansStateLoading value)? loading,
TResult Function(PlansStateLoaded value)? loaded,
TResult Function(PlansStateError value)? error,
required TResult orElse(),
}) {
if (loading != null) {
return loading(this);
}
return orElse();
}
}
abstract class PlansStateLoading implements PlansState {
const factory PlansStateLoading() = _$PlansStateLoadingImpl;
}
/// @nodoc
abstract class _$$PlansStateLoadedImplCopyWith<$Res> {
factory _$$PlansStateLoadedImplCopyWith(_$PlansStateLoadedImpl value,
$Res Function(_$PlansStateLoadedImpl) then) =
__$$PlansStateLoadedImplCopyWithImpl<$Res>;
@useResult
$Res call({List<PlanModel> plansList});
}
/// @nodoc
class __$$PlansStateLoadedImplCopyWithImpl<$Res>
extends _$PlansStateCopyWithImpl<$Res, _$PlansStateLoadedImpl>
implements _$$PlansStateLoadedImplCopyWith<$Res> {
__$$PlansStateLoadedImplCopyWithImpl(_$PlansStateLoadedImpl _value,
$Res Function(_$PlansStateLoadedImpl) _then)
: super(_value, _then);
/// Create a copy of PlansState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? plansList = null,
}) {
return _then(_$PlansStateLoadedImpl(
plansList: null == plansList
? _value._plansList
: plansList // ignore: cast_nullable_to_non_nullable
as List<PlanModel>,
));
}
}
/// @nodoc
class _$PlansStateLoadedImpl implements PlansStateLoaded {
const _$PlansStateLoadedImpl({required final List<PlanModel> plansList})
: _plansList = plansList;
final List<PlanModel> _plansList;
@override
List<PlanModel> get plansList {
if (_plansList is EqualUnmodifiableListView) return _plansList;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_plansList);
}
@override
String toString() {
return 'PlansState.loaded(plansList: $plansList)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$PlansStateLoadedImpl &&
const DeepCollectionEquality()
.equals(other._plansList, _plansList));
}
@override
int get hashCode =>
Object.hash(runtimeType, const DeepCollectionEquality().hash(_plansList));
/// Create a copy of PlansState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$PlansStateLoadedImplCopyWith<_$PlansStateLoadedImpl> get copyWith =>
__$$PlansStateLoadedImplCopyWithImpl<_$PlansStateLoadedImpl>(
this, _$identity);
@override
@optionalTypeArgs
TResult when<TResult extends Object?>(
TResult Function() $default, {
required TResult Function() loading,
required TResult Function(List<PlanModel> plansList) loaded,
required TResult Function(String errorMessage) error,
}) {
return loaded(plansList);
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(List<PlanModel> plansList)? loaded,
TResult? Function(String errorMessage)? error,
}) {
return loaded?.call(plansList);
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(List<PlanModel> plansList)? loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) {
if (loaded != null) {
return loaded(plansList);
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_PlansState value) $default, {
required TResult Function(PlansStateLoading value) loading,
required TResult Function(PlansStateLoaded value) loaded,
required TResult Function(PlansStateError value) error,
}) {
return loaded(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult? Function(_PlansState value)? $default, {
TResult? Function(PlansStateLoading value)? loading,
TResult? Function(PlansStateLoaded value)? loaded,
TResult? Function(PlansStateError value)? error,
}) {
return loaded?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_PlansState value)? $default, {
TResult Function(PlansStateLoading value)? loading,
TResult Function(PlansStateLoaded value)? loaded,
TResult Function(PlansStateError value)? error,
required TResult orElse(),
}) {
if (loaded != null) {
return loaded(this);
}
return orElse();
}
}
abstract class PlansStateLoaded implements PlansState {
const factory PlansStateLoaded({required final List<PlanModel> plansList}) =
_$PlansStateLoadedImpl;
List<PlanModel> get plansList;
/// Create a copy of PlansState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
_$$PlansStateLoadedImplCopyWith<_$PlansStateLoadedImpl> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class _$$PlansStateErrorImplCopyWith<$Res> {
factory _$$PlansStateErrorImplCopyWith(_$PlansStateErrorImpl value,
$Res Function(_$PlansStateErrorImpl) then) =
__$$PlansStateErrorImplCopyWithImpl<$Res>;
@useResult
$Res call({String errorMessage});
}
/// @nodoc
class __$$PlansStateErrorImplCopyWithImpl<$Res>
extends _$PlansStateCopyWithImpl<$Res, _$PlansStateErrorImpl>
implements _$$PlansStateErrorImplCopyWith<$Res> {
__$$PlansStateErrorImplCopyWithImpl(
_$PlansStateErrorImpl _value, $Res Function(_$PlansStateErrorImpl) _then)
: super(_value, _then);
/// Create a copy of PlansState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? errorMessage = null,
}) {
return _then(_$PlansStateErrorImpl(
errorMessage: null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// @nodoc
class _$PlansStateErrorImpl implements PlansStateError {
const _$PlansStateErrorImpl({required this.errorMessage});
@override
final String errorMessage;
@override
String toString() {
return 'PlansState.error(errorMessage: $errorMessage)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$PlansStateErrorImpl &&
(identical(other.errorMessage, errorMessage) ||
other.errorMessage == errorMessage));
}
@override
int get hashCode => Object.hash(runtimeType, errorMessage);
/// Create a copy of PlansState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$PlansStateErrorImplCopyWith<_$PlansStateErrorImpl> get copyWith =>
__$$PlansStateErrorImplCopyWithImpl<_$PlansStateErrorImpl>(
this, _$identity);
@override
@optionalTypeArgs
TResult when<TResult extends Object?>(
TResult Function() $default, {
required TResult Function() loading,
required TResult Function(List<PlanModel> plansList) loaded,
required TResult Function(String errorMessage) error,
}) {
return error(errorMessage);
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(List<PlanModel> plansList)? loaded,
TResult? Function(String errorMessage)? error,
}) {
return error?.call(errorMessage);
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(List<PlanModel> plansList)? loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) {
if (error != null) {
return error(errorMessage);
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_PlansState value) $default, {
required TResult Function(PlansStateLoading value) loading,
required TResult Function(PlansStateLoaded value) loaded,
required TResult Function(PlansStateError value) error,
}) {
return error(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult? Function(_PlansState value)? $default, {
TResult? Function(PlansStateLoading value)? loading,
TResult? Function(PlansStateLoaded value)? loaded,
TResult? Function(PlansStateError value)? error,
}) {
return error?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_PlansState value)? $default, {
TResult Function(PlansStateLoading value)? loading,
TResult Function(PlansStateLoaded value)? loaded,
TResult Function(PlansStateError value)? error,
required TResult orElse(),
}) {
if (error != null) {
return error(this);
}
return orElse();
}
}
abstract class PlansStateError implements PlansState {
const factory PlansStateError({required final String errorMessage}) =
_$PlansStateErrorImpl;
String get errorMessage;
/// Create a copy of PlansState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
_$$PlansStateErrorImplCopyWith<_$PlansStateErrorImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -1,7 +1,7 @@
import 'dart:io';
import 'package:eatvio_app/core/image_compressing/image_compress_utility.dart';
import 'package:eatvio_app/features/chat/repositories/chat_repository.dart';
import 'package:eatvio_app/features/feed/models/feed_blog_post_model.dart';
import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_state.dart';
import 'package:eatvio_app/features/profile/repositories/profile_repository.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -50,6 +50,22 @@ class ProfileCubit extends Cubit<ProfileState> {
}
}
updateFeedBlogPostList(FeedBlogPostModel feedBlogPostModel, bool wasLikedByMe) {
List<FeedBlogPostModel> feedBlogPostList = [...(state as ProfileStateLoaded).blogPosts];
final int index = feedBlogPostList.indexOf(feedBlogPostModel);
feedBlogPostList[index] = feedBlogPostModel.copyWith(
wasLikedByMe: wasLikedByMe,
totalLikes: wasLikedByMe == false ? feedBlogPostList[index].totalLikes - 1 : feedBlogPostList[index].totalLikes + 1,
);
emit(
ProfileState.loaded(
profile: (state as ProfileStateLoaded).profile,
profileDetails: (state as ProfileStateLoaded).profileDetails,
blogPosts: feedBlogPostList,
),
);
}
addCircumference({
required int chestCircumference,
required int waistCircumference,

View File

@@ -8,15 +8,18 @@ import 'package:eatvio_app/core/widgets/loader.dart';
import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart';
import 'package:eatvio_app/features/chat/presentation/pages/photo_view_screen.dart';
import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart';
import 'package:eatvio_app/features/feed/presentation/widgets/blog_post_widget.dart';
import 'package:eatvio_app/features/feed/presentation/widgets/plan_widget.dart';
import 'package:eatvio_app/features/profile/models/circumference_model.dart';
import 'package:eatvio_app/features/profile/models/weight_model.dart';
import 'package:eatvio_app/features/profile/presentation/bloc/plans_cubit/plans_cubit.dart';
import 'package:eatvio_app/features/profile/presentation/bloc/plans_cubit/plans_state.dart';
import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart';
import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_state.dart';
import 'package:eatvio_app/features/profile/presentation/bloc/sub_cubit/sub_cubit.dart';
import 'package:eatvio_app/features/profile/presentation/pages/subs_screen.dart';
import 'package:eatvio_app/features/profile/presentation/widgets/circumference_chart_widget.dart';
import 'package:eatvio_app/features/profile/presentation/widgets/imt_chart_widget.dart';
import 'package:eatvio_app/features/profile/presentation/widgets/profile_blog_post_widget.dart';
import 'package:eatvio_app/features/profile/presentation/widgets/weight_chart_widget.dart';
import 'package:eatvio_app/core/locator_service.dart';
import 'package:eatvio_app/core/theme/theme_helper.dart';
@@ -28,6 +31,7 @@ import 'package:flutter_svg/flutter_svg.dart';
import 'package:image_picker/image_picker.dart';
import 'package:share_plus/share_plus.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:flutter_native_splash/flutter_native_splash.dart';
class ProfileScreen extends StatefulWidget {
final Author? author;
@@ -42,7 +46,8 @@ class ProfileScreen extends StatefulWidget {
}
class _ProfileScreenState extends State<ProfileScreen> {
final ProfileCubit profileCubit = sl<ProfileCubit>();
late final ProfileCubit profileCubit = sl<ProfileCubit>();
final PlansCubit plansCubit = sl<PlansCubit>();
final List<String> chipsLabelList = ['Вес', 'Замеры', 'ИМТ'];
final List<String> chipsIntervalLabelList = ['1М', '3М', '6М', '1Г', 'ВСЁ ВРЕМЯ'];
final List<String> chipsIntervalList = ['1', '3', '6', '12', 'all'];
@@ -53,6 +58,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
int _selectedIntervalChipIndex = 0;
late bool canSub;
bool isFirstFetch = true;
int _currentBullet = 0;
@override
void initState() {
@@ -62,36 +68,43 @@ class _ProfileScreenState extends State<ProfileScreen> {
@override
Widget build(BuildContext context) {
return BlocBuilder<ProfileCubit, ProfileState>(
bloc: profileCubit,
builder: (BuildContext context, ProfileState state) {
if (state is ProfileStateLoaded) {
if (state.circumferencePoints != null) {
circumferencePoints = state.circumferencePoints!;
weightPoints = state.weightPoints!;
}
if (isFirstFetch) {
canSub = !state.profile.isEntitySubscribedByMe;
isFirstFetch = false;
}
return widget.author == null ? _myProfileScreen(state) : _profileScreen(state);
} else if (state is ProfileStateError) {
return Scaffold(
appBar: AppBar(),
body: Center(
child: Padding(
padding: const EdgeInsets.all(16),
child: Text(state.errorMessage),
FlutterNativeSplash.remove();
return BlocProvider<PlansCubit>(
create: (BuildContext context) => plansCubit,
child: BlocBuilder<ProfileCubit, ProfileState>(
bloc: profileCubit,
builder: (BuildContext context, ProfileState state) {
if (state is ProfileStateLoaded) {
if (state.circumferencePoints != null) {
circumferencePoints = state.circumferencePoints!;
weightPoints = state.weightPoints!;
}
if (isFirstFetch) {
canSub = !state.profile.isEntitySubscribedByMe;
if (state.profile.role == 'consultant') {
plansCubit..getPlans(state.profile.slug);
}
isFirstFetch = false;
}
return widget.author == null ? _myProfileScreen(state) : _profileScreen(state);
} else if (state is ProfileStateError) {
return Scaffold(
appBar: AppBar(),
body: Center(
child: Padding(
padding: const EdgeInsets.all(16),
child: Text(state.errorMessage),
),
),
),
);
} else {
return Scaffold(
appBar: AppBar(),
body: const Loader(),
);
}
},
);
} else {
return Scaffold(
appBar: AppBar(),
body: const Loader(),
);
}
},
),
);
}
@@ -114,6 +127,62 @@ class _ProfileScreenState extends State<ProfileScreen> {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
_header(state),
if (state.profile.role == 'consultant')
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
const SizedBox(width: 16),
Text(
'Консультант',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Color(
0xFF323F4B,
),
),
),
const SizedBox(width: 12),
if (state.profile.ratingPlace != null)
Container(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
decoration: BoxDecoration(
color: Color(0xFFF6FAFF),
borderRadius: BorderRadius.circular(12),
),
child: Text(
'${state.profile.ratingPlace!}-й в рейтинге',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: appTheme.blueA400,
),
),
),
],
),
if (state.profile.educationResource?.hasMedicalEducation == 1)
Row(
children: [
const SizedBox(width: 16),
Icon(
Icons.done_rounded,
color: Colors.green,
),
Text(
'Медицинское образование',
style: TextStyle(
color: Color(0xFF323F4B),
fontSize: 14,
fontWeight: FontWeight.w600,
),
),
],
),
],
),
if (state.profileDetails.additionalInfo.isNotEmpty) _additionalInfo(state),
const SizedBox(height: 8),
_messageAndSubscribe(state),
@@ -176,36 +245,51 @@ class _ProfileScreenState extends State<ProfileScreen> {
if (state.profile.role != 'consultant') {
return const SizedBox.shrink();
}
return Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
return BlocBuilder<PlansCubit, PlansState>(
bloc: plansCubit,
builder: (BuildContext context, PlansState state) {
if (state is PlansStateLoaded) {
return Column(
children: [
Text(
'Активные планы',
style: TextStyle(
color: Color(0xFF323F4B),
fontSize: 24,
height: 1,
fontWeight: FontWeight.w600,
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'Активные планы',
style: TextStyle(
color: Color(0xFF323F4B),
fontSize: 24,
height: 1,
fontWeight: FontWeight.w600,
),
),
],
),
),
Text(
widget.author == null ? 'Редактировать' : 'Показать все',
style: TextStyle(
color: Color(0xFF2F80ED),
fontSize: 16,
fontWeight: FontWeight.w500,
const SizedBox(height: 8),
SizedBox(
height: 378,
child: PageView.builder(
itemBuilder: (BuildContext context, int index) {
return PlanWidget(planModel: state.plansList[index]);
},
onPageChanged: (bullet) {
setState(() {
_currentBullet = bullet;
});
},
itemCount: state.plansList.length,
),
),
const SizedBox(height: 8),
_bullets(_currentBullet, state.plansList.length),
],
),
),
const SizedBox(height: 8),
_bullets(0, 4),
],
);
}
return Loader();
},
);
}
@@ -302,7 +386,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
),
Text(
widget.author == null ? 'Редактировать' : 'Показать все',
widget.author == null ? 'Редактировать' : '',
style: TextStyle(
color: Color(0xFF2F80ED),
fontSize: 16,
@@ -325,21 +409,8 @@ class _ProfileScreenState extends State<ProfileScreen> {
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
child: Row(
children: [
_diplomaImage(
state.profile.profilePhotoUrl,
),
const SizedBox(width: 8),
_diplomaImage(
state.profile.profilePhotoUrl,
),
const SizedBox(width: 8),
_diplomaImage(
state.profile.profilePhotoUrl,
),
const SizedBox(width: 8),
_diplomaImage(
state.profile.profilePhotoUrl,
),
if (state.profile.diplomasAndCertificates != null)
...state.profile.diplomasAndCertificates!.map((d) => _diplomaImage(baseUrl + '/storage/' + d.path)).toList(),
],
),
),
@@ -350,13 +421,27 @@ class _ProfileScreenState extends State<ProfileScreen> {
}
_diplomaImage(String url) {
return ClipRRect(
borderRadius: BorderRadius.circular(8),
child: CachedNetworkImage(
imageUrl: url,
fit: BoxFit.fitHeight,
width: MediaQuery.of(context).size.width / 3 - (60 / 3),
height: 160,
return GestureDetector(
onTap: () {
context.pushTransparentRoute(
rootNavigator: true,
PhotoViewScreen(
imageUrls: [url],
index: 0,
),
);
},
child: Hero(
tag: url,
child: ClipRRect(
borderRadius: BorderRadius.circular(8),
child: CachedNetworkImage(
imageUrl: url,
fit: BoxFit.fitHeight,
width: MediaQuery.of(context).size.width / 3 - (60 / 3),
height: 160,
),
),
),
);
}
@@ -381,7 +466,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
),
Text(
widget.author == null ? 'Редактировать' : 'Показать все',
widget.author == null ? 'Редактировать' : '',
style: TextStyle(
color: Color(0xFF2F80ED),
fontSize: 16,
@@ -401,10 +486,8 @@ class _ProfileScreenState extends State<ProfileScreen> {
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
child: Column(
children: [
_educationBlock(
'Наименование диплома или сертификата в 2 строки',
'30.01.2020',
),
if (state.profile.educationResource?.completedCourses != null)
...state.profile.educationResource!.completedCourses!.map((c) => _educationBlock(c.values.first.title, c.values.first.date)).toList(),
],
),
),
@@ -415,34 +498,37 @@ class _ProfileScreenState extends State<ProfileScreen> {
}
_educationBlock(String title, String date) {
return Material(
color: Color(0xFFF6FAFF),
borderRadius: BorderRadius.circular(12),
child: Padding(
padding: const EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: TextStyle(
height: 1,
color: Color(0xFF323F4B),
fontWeight: FontWeight.w500,
fontSize: 16,
return SizedBox(
width: double.infinity,
child: Material(
color: Color(0xFFF6FAFF),
borderRadius: BorderRadius.circular(12),
child: Padding(
padding: const EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: TextStyle(
height: 1,
color: Color(0xFF323F4B),
fontWeight: FontWeight.w500,
fontSize: 16,
),
),
),
const SizedBox(height: 4),
Text(
date,
style: TextStyle(
height: 1,
color: Color(0xFF6D6F71),
fontWeight: FontWeight.w500,
fontSize: 14,
const SizedBox(height: 4),
Text(
date,
style: TextStyle(
height: 1,
color: Color(0xFF6D6F71),
fontWeight: FontWeight.w500,
fontSize: 14,
),
),
),
],
],
),
),
),
);
@@ -705,8 +791,9 @@ class _ProfileScreenState extends State<ProfileScreen> {
padding: EdgeInsets.symmetric(vertical: 16),
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) => BlogPostWidget(
itemBuilder: (context, index) => ProfileBlogPostWidget(
index: index,
profileCubit: profileCubit,
),
separatorBuilder: (context, index) => SizedBox(height: 8),
itemCount: state.blogPosts.length,

View File

@@ -0,0 +1,245 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:dismissible_page/dismissible_page.dart';
import 'package:eatvio_app/core/const.dart';
import 'package:eatvio_app/core/utils/date_time_utils.dart';
import 'package:eatvio_app/core/widgets/feed_icon_button.dart';
import 'package:eatvio_app/features/chat/presentation/pages/photo_view_screen.dart';
import 'package:eatvio_app/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart';
import 'package:eatvio_app/core/theme/theme_helper.dart';
import 'package:eatvio_app/features/feed/presentation/widgets/subscribe_button_widget.dart';
import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart';
import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_state.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:go_router/go_router.dart';
import 'package:share_plus/share_plus.dart';
class ProfileBlogPostWidget extends StatefulWidget {
final int index;
final ProfileCubit profileCubit;
const ProfileBlogPostWidget({
super.key,
required this.index,
required this.profileCubit,
});
@override
State<ProfileBlogPostWidget> createState() => _ProfileBlogPostWidgetState();
}
class _ProfileBlogPostWidgetState extends State<ProfileBlogPostWidget> {
late bool isLiked;
late int totalLikes;
@override
Widget build(BuildContext context) {
return BlocBuilder<ProfileCubit, ProfileState>(
bloc: widget.profileCubit,
builder: (BuildContext context, ProfileState state) {
if (state is ProfileStateLoaded) {
isLiked = state.blogPosts[widget.index].wasLikedByMe;
totalLikes = state.blogPosts[widget.index].totalLikes;
return InkWell(
borderRadius: BorderRadius.circular(12),
onTap: () => GoRouter.of(context).pushNamed(
'blogPostScreen',
extra: state.blogPosts[widget.index],
),
child: Ink(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 12),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Row(
children: [
CircleAvatar(
radius: 20,
backgroundColor: Colors.black12,
foregroundImage: NetworkImage(
state.blogPosts[widget.index].author.authorProfileIcon,
),
),
SizedBox(width: 8),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
state.blogPosts[widget.index].author.authorName,
style: TextStyle(
height: 1,
color: Colors.black87,
fontWeight: FontWeight.w500,
),
),
const SizedBox(height: 4),
Text(
'${calculateDifference(state.blogPosts[widget.index].createdAt)} в ${state.blogPosts[widget.index].createdAt.hour.toString().padLeft(2, '0')}:${state.blogPosts[widget.index].createdAt.minute.toString().padLeft(2, '0')}',
style: TextStyle(
height: 1,
color: Colors.black45,
),
),
],
),
const Spacer(),
if (!state.blogPosts[widget.index].author.isEntitySubscribedByMe! && !state.blogPosts[widget.index].author.authorIsMe)
SubscribeButtonWidget(
slug: state.blogPosts[widget.index].author.authorSlug,
),
],
),
),
if (state.blogPosts[widget.index].title.isNotEmpty || state.blogPosts[widget.index].description.isNotEmpty) SizedBox(height: 12),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Text(
state.blogPosts[widget.index].title,
style: TextStyle(
fontWeight: FontWeight.w600,
color: Colors.black87,
),
),
),
if (state.blogPosts[widget.index].title.isNotEmpty && state.blogPosts[widget.index].description.isNotEmpty) SizedBox(height: 8),
if (state.blogPosts[widget.index].description.isNotEmpty)
Padding(
padding: const EdgeInsets.symmetric(horizontal: 4),
child: Html(
data: state.blogPosts[widget.index].description.length > 200
? state.blogPosts[widget.index].description.substring(0, 200)
: state.blogPosts[widget.index].description,
style: {
"*": Style(
color: Colors.black87,
),
},
),
),
if (state.blogPosts[widget.index].description.length > 200)
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Text(
'Читать полностью...',
style: TextStyle(
height: 1,
color: appTheme.blueA400,
decoration: TextDecoration.underline,
),
),
),
if (state.blogPosts[widget.index].title.isNotEmpty || state.blogPosts[widget.index].description.isNotEmpty) SizedBox(height: 8),
GestureDetector(
onTap: () {
context.pushTransparentRoute(
rootNavigator: true,
PhotoViewScreen(
imageUrls: [baseUrl + '/storage/' + state.blogPosts[widget.index].image],
index: 0,
),
);
},
child: Hero(
tag: baseUrl + '/storage/' + state.blogPosts[widget.index].image,
child: CachedNetworkImage(
fit: BoxFit.fitWidth,
width: MediaQuery.of(context).size.width,
imageUrl: baseUrl + '/storage/' + state.blogPosts[widget.index].image,
errorWidget: (context, str, object) => SizedBox.shrink(),
),
),
),
SizedBox(height: 12),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Row(
children: [
FeedIconButton(
icon: isLiked ? Icons.favorite_rounded : Icons.favorite_border_rounded,
text: totalLikes.toString(),
iconColor: isLiked ? Colors.red.withOpacity(0.8) : null,
backgroundColor: isLiked ? Colors.red.withOpacity(0.1) : null,
textColor: isLiked ? Colors.red.withOpacity(0.8) : null,
onTap: () async {
setState(() {
isLiked = !isLiked;
isLiked ? totalLikes++ : totalLikes--;
});
isLiked
? await context.read<FeedCubit>().likePost(state.blogPosts[widget.index].id)
: await context.read<FeedCubit>().unlikedPost(state.blogPosts[widget.index].id);
await widget.profileCubit.updateFeedBlogPostList(
state.blogPosts[widget.index],
isLiked ? false : true,
);
},
),
SizedBox(width: 8),
FeedIconButton(
svgIcon: SvgPicture.asset(
'assets/icons/comment.svg',
height: 20,
width: 20,
colorFilter: ColorFilter.mode(
appTheme.gray600,
BlendMode.srcIn,
),
),
text: state.blogPosts[widget.index].totalComments.toString(),
onTap: () => GoRouter.of(context).pushNamed(
'blogPostScreen',
extra: state.blogPosts[widget.index],
),
),
SizedBox(width: 8),
FeedIconButton(
svgIcon: SvgPicture.asset(
height: 20,
width: 20,
'assets/icons/share.svg',
colorFilter: ColorFilter.mode(appTheme.gray600, BlendMode.srcIn),
),
onTap: () => Share.shareUri(
Uri.parse(
baseUrl + '/ru/blog_post/' + state.blogPosts[widget.index].id.toString(),
),
),
),
Spacer(),
Icon(
Icons.visibility_rounded,
size: 16,
color: appTheme.gray500,
),
SizedBox(width: 4),
Text(
state.blogPosts[widget.index].totalViews.toString(),
style: TextStyle(
fontSize: 12,
color: appTheme.gray500,
fontWeight: FontWeight.w400,
),
),
],
),
),
SizedBox(height: 8),
],
),
),
);
}
return const SizedBox.shrink();
},
);
}
}

View File

@@ -19,7 +19,6 @@ void main() async {
WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
await di.init();
await Future.delayed(Duration(seconds: 1), () => FlutterNativeSplash.remove());
runApp(MyApp());
}

View File

@@ -16,17 +16,17 @@ dependencies:
flutter_secure_storage: ^9.2.2
flutter_bloc: ^8.1.6
cached_network_image: ^3.4.1
flutter_svg: ^2.0.14
equatable: ^2.0.5
flutter_svg: ^2.0.16
equatable: ^2.0.7
freezed_annotation: ^2.4.4
json_annotation: ^4.9.0
validators: ^3.0.0
path_provider: ^2.1.5
carousel_slider_plus: ^7.0.2
carousel_slider_plus: ^7.1.0
flutter_form_builder: ^9.5.0
image_picker: ^1.1.2
flutter_typeahead: ^5.2.0
go_router: ^14.6.0
go_router: ^14.6.2
keyboard_dismisser: ^3.0.0
retrofit: ^4.4.1
get_it: ^8.0.2
@@ -39,8 +39,8 @@ dependencies:
badges: ^3.1.2
google_fonts: ^6.2.1
location: ^7.0.1
syncfusion_flutter_charts: ^27.2.2
syncfusion_flutter_gauges: ^27.2.2
syncfusion_flutter_charts: ^27.2.5
syncfusion_flutter_gauges: ^27.2.5
table_calendar: ^3.1.2
flutter_keyboard_visibility: ^6.0.0
share_plus: ^10.1.2
@@ -48,7 +48,7 @@ dependencies:
file_picker: ^8.1.4
audioplayers: ^6.1.0
intl: ^0.19.0
rive: ^0.13.19
rive: ^0.13.20
mask_text_input_formatter: ^2.9.0
lottie: ^3.1.3
flutter_portal: ^1.1.4
@@ -65,6 +65,7 @@ dev_dependencies:
freezed: ^2.5.7
json_serializable: ^6.9.0
retrofit_generator: ^9.1.5
mockito: ^5.4.4
flutter_test:
sdk: flutter

View File

@@ -1,37 +0,0 @@
import 'package:eatvio_app/features/auth/auth_screen/auth_screen.dart';
import 'package:eatvio_app/features/auth/auth_screen/bloc/auth_bloc.dart';
import 'package:eatvio_app/features/auth/auth_screen/models/auth_model.dart';
import 'package:eatvio_app/generated/l10n.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
group('AuthScreen', () {
testWidgets('renders AuthScreen with initial state', (WidgetTester tester) async {
final authBloc = AuthBloc(AuthState(authModelObj: AuthModel()));
await tester.pumpWidget(
MaterialApp(
localizationsDelegates: const [
S.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
supportedLocales: S.delegate.supportedLocales,
home: BlocProvider<AuthBloc>(
create: (context) => authBloc,
child: Builder(
builder: (context) {
return AuthScreen();
},
),
),
),
);
});
});
}

View File

@@ -0,0 +1,92 @@
import 'package:eatvio_app/features/feed/models/feed_blog_post_model.dart';
import 'package:eatvio_app/features/profile/models/circumference_model.dart';
import 'package:eatvio_app/features/profile/models/profile_model.dart';
import 'package:eatvio_app/features/profile/models/weight_model.dart';
import 'package:eatvio_app/features/profile/services/profile_service.dart';
import 'package:mockito/annotations.dart';
import 'package:mockito/mockito.dart';
import 'package:flutter_test/flutter_test.dart';
import 'profile_service_test.mocks.dart';
@GenerateNiceMocks([MockSpec<ProfileService>()])
void main() {
group('profileService', () {
final mockProfileService = MockProfileService();
test('getMyProfile', () async {
when(mockProfileService.getMyProfile()).thenAnswer(
(_) async => await Future.value(
ProfileModel(
id: 0,
name: 'Alexander Avanesyan',
email: 'mso7nueh@mail.ru',
isPublicProfile: true,
isEntitySubscribedByMe: false,
slug: 'slug',
profilePhotoUrl: '',
role: 'user',
badges: [],
subscriptions: [],
subscribers: [],
),
),
);
expect(await mockProfileService.getMyProfile(), isA<ProfileModel>());
});
test('getProfileDetailsBySlug', () async {
when(mockProfileService.getProfileDetailsBySlug(slug: 'slug')).thenAnswer(
(_) async => await Future.value(
ProfileDetailsModel(
firstName: 'Alexnader',
lastName: 'Avanesyan',
birthdate: '2024-05-28',
gender: 'male',
country: 'Russia',
city: 'Moscow',
lang: 'Russian',
weight: 84,
height: 178,
chestCircumference: 100,
waistCircumference: 80,
hipCircumference: 90,
bloodPressureUp: 120,
bloodPressureDown: 80,
hasHypo: false,
hasHyper: false,
aboutAlergy: '',
aboutTakingPils: '',
aboutSportHobbies: 'Judo',
favoriteFoods: '',
unfavoriteFoods: '',
additionalInfo: '10 lvl faceit',
isMoodFillable: true,
isBedtimeFillable: true,
activityCoefficient: 2,
),
),
);
expect(await mockProfileService.getProfileDetailsBySlug(slug: 'slug'), isA<ProfileDetailsModel>());
});
test('getBlogPostByAuthorSlug', () async {
when(mockProfileService.getBlogPostByAuthorSlug(slug: '')).thenAnswer(
(_) async => [],
);
expect(await mockProfileService.getBlogPostByAuthorSlug(slug: 'slug'), isA<List<FeedBlogPostModel>>());
});
test('getWeight', () async {
when(mockProfileService.getWeight(period: '')).thenAnswer(
(_) async => [],
);
expect(await mockProfileService.getWeight(period: ''), isA<List<WeightModel>>());
});
test('getCircumferences', () async {
when(mockProfileService.getCircumferences(period: '')).thenAnswer(
(_) async => [],
);
expect(await mockProfileService.getCircumferences(period: ''), isA<List<CircumferenceModel>>());
});
});
}

View File

@@ -0,0 +1,414 @@
// Mocks generated by Mockito 5.4.4 from annotations
// in eatvio_app/test/features/profile/services/profile_service_test.dart.
// Do not manually edit this file.
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i5;
import 'dart:io' as _i9;
import 'package:eatvio_app/features/feed/models/feed_blog_post_model.dart'
as _i6;
import 'package:eatvio_app/features/profile/models/circumference_model.dart'
as _i8;
import 'package:eatvio_app/features/profile/models/profile_model.dart' as _i2;
import 'package:eatvio_app/features/profile/models/sub_model.dart' as _i3;
import 'package:eatvio_app/features/profile/models/weight_model.dart' as _i7;
import 'package:eatvio_app/features/profile/services/profile_service.dart'
as _i4;
import 'package:mockito/mockito.dart' as _i1;
// ignore_for_file: type=lint
// ignore_for_file: avoid_redundant_argument_values
// ignore_for_file: avoid_setters_without_getters
// ignore_for_file: comment_references
// ignore_for_file: deprecated_member_use
// ignore_for_file: deprecated_member_use_from_same_package
// ignore_for_file: implementation_imports
// ignore_for_file: invalid_use_of_visible_for_testing_member
// ignore_for_file: prefer_const_constructors
// ignore_for_file: unnecessary_parenthesis
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class
class _FakeProfileModel_0 extends _i1.SmartFake implements _i2.ProfileModel {
_FakeProfileModel_0(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}
class _FakeProfileDetailsModel_1 extends _i1.SmartFake
implements _i2.ProfileDetailsModel {
_FakeProfileDetailsModel_1(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}
class _FakeSubPaginationModel_2 extends _i1.SmartFake
implements _i3.SubPaginationModel {
_FakeSubPaginationModel_2(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}
/// A class which mocks [ProfileService].
///
/// See the documentation for Mockito's code generation for more information.
class MockProfileService extends _i1.Mock implements _i4.ProfileService {
@override
_i5.Future<_i2.ProfileModel> getProfileBySlug({required String? slug}) =>
(super.noSuchMethod(
Invocation.method(
#getProfileBySlug,
[],
{#slug: slug},
),
returnValue: _i5.Future<_i2.ProfileModel>.value(_FakeProfileModel_0(
this,
Invocation.method(
#getProfileBySlug,
[],
{#slug: slug},
),
)),
returnValueForMissingStub:
_i5.Future<_i2.ProfileModel>.value(_FakeProfileModel_0(
this,
Invocation.method(
#getProfileBySlug,
[],
{#slug: slug},
),
)),
) as _i5.Future<_i2.ProfileModel>);
@override
_i5.Future<_i2.ProfileModel> getMyProfile() => (super.noSuchMethod(
Invocation.method(
#getMyProfile,
[],
),
returnValue: _i5.Future<_i2.ProfileModel>.value(_FakeProfileModel_0(
this,
Invocation.method(
#getMyProfile,
[],
),
)),
returnValueForMissingStub:
_i5.Future<_i2.ProfileModel>.value(_FakeProfileModel_0(
this,
Invocation.method(
#getMyProfile,
[],
),
)),
) as _i5.Future<_i2.ProfileModel>);
@override
_i5.Future<_i2.ProfileDetailsModel> getMyProfileDetails() =>
(super.noSuchMethod(
Invocation.method(
#getMyProfileDetails,
[],
),
returnValue: _i5.Future<_i2.ProfileDetailsModel>.value(
_FakeProfileDetailsModel_1(
this,
Invocation.method(
#getMyProfileDetails,
[],
),
)),
returnValueForMissingStub: _i5.Future<_i2.ProfileDetailsModel>.value(
_FakeProfileDetailsModel_1(
this,
Invocation.method(
#getMyProfileDetails,
[],
),
)),
) as _i5.Future<_i2.ProfileDetailsModel>);
@override
_i5.Future<_i2.ProfileDetailsModel> getProfileDetailsBySlug(
{required String? slug}) =>
(super.noSuchMethod(
Invocation.method(
#getProfileDetailsBySlug,
[],
{#slug: slug},
),
returnValue: _i5.Future<_i2.ProfileDetailsModel>.value(
_FakeProfileDetailsModel_1(
this,
Invocation.method(
#getProfileDetailsBySlug,
[],
{#slug: slug},
),
)),
returnValueForMissingStub: _i5.Future<_i2.ProfileDetailsModel>.value(
_FakeProfileDetailsModel_1(
this,
Invocation.method(
#getProfileDetailsBySlug,
[],
{#slug: slug},
),
)),
) as _i5.Future<_i2.ProfileDetailsModel>);
@override
_i5.Future<void> addCircumference({
required int? chestCircumference,
required int? waistCircumference,
required int? hipCircumference,
}) =>
(super.noSuchMethod(
Invocation.method(
#addCircumference,
[],
{
#chestCircumference: chestCircumference,
#waistCircumference: waistCircumference,
#hipCircumference: hipCircumference,
},
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> addWeight({required double? weight}) => (super.noSuchMethod(
Invocation.method(
#addWeight,
[],
{#weight: weight},
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<List<_i6.FeedBlogPostModel>> getBlogPostByAuthorSlug(
{required String? slug}) =>
(super.noSuchMethod(
Invocation.method(
#getBlogPostByAuthorSlug,
[],
{#slug: slug},
),
returnValue: _i5.Future<List<_i6.FeedBlogPostModel>>.value(
<_i6.FeedBlogPostModel>[]),
returnValueForMissingStub:
_i5.Future<List<_i6.FeedBlogPostModel>>.value(
<_i6.FeedBlogPostModel>[]),
) as _i5.Future<List<_i6.FeedBlogPostModel>>);
@override
_i5.Future<List<_i7.WeightModel>> getWeight({required String? period}) =>
(super.noSuchMethod(
Invocation.method(
#getWeight,
[],
{#period: period},
),
returnValue:
_i5.Future<List<_i7.WeightModel>>.value(<_i7.WeightModel>[]),
returnValueForMissingStub:
_i5.Future<List<_i7.WeightModel>>.value(<_i7.WeightModel>[]),
) as _i5.Future<List<_i7.WeightModel>>);
@override
_i5.Future<List<_i7.WeightModel>> getWeightBySlug({
required String? period,
required String? slug,
}) =>
(super.noSuchMethod(
Invocation.method(
#getWeightBySlug,
[],
{
#period: period,
#slug: slug,
},
),
returnValue:
_i5.Future<List<_i7.WeightModel>>.value(<_i7.WeightModel>[]),
returnValueForMissingStub:
_i5.Future<List<_i7.WeightModel>>.value(<_i7.WeightModel>[]),
) as _i5.Future<List<_i7.WeightModel>>);
@override
_i5.Future<List<_i8.CircumferenceModel>> getCircumferences(
{required String? period}) =>
(super.noSuchMethod(
Invocation.method(
#getCircumferences,
[],
{#period: period},
),
returnValue: _i5.Future<List<_i8.CircumferenceModel>>.value(
<_i8.CircumferenceModel>[]),
returnValueForMissingStub:
_i5.Future<List<_i8.CircumferenceModel>>.value(
<_i8.CircumferenceModel>[]),
) as _i5.Future<List<_i8.CircumferenceModel>>);
@override
_i5.Future<List<_i8.CircumferenceModel>> getCircumferencesBySlug({
required String? period,
required String? slug,
}) =>
(super.noSuchMethod(
Invocation.method(
#getCircumferencesBySlug,
[],
{
#period: period,
#slug: slug,
},
),
returnValue: _i5.Future<List<_i8.CircumferenceModel>>.value(
<_i8.CircumferenceModel>[]),
returnValueForMissingStub:
_i5.Future<List<_i8.CircumferenceModel>>.value(
<_i8.CircumferenceModel>[]),
) as _i5.Future<List<_i8.CircumferenceModel>>);
@override
_i5.Future<_i3.SubPaginationModel> getSubscribers({
required String? slug,
String? query,
}) =>
(super.noSuchMethod(
Invocation.method(
#getSubscribers,
[],
{
#slug: slug,
#query: query,
},
),
returnValue:
_i5.Future<_i3.SubPaginationModel>.value(_FakeSubPaginationModel_2(
this,
Invocation.method(
#getSubscribers,
[],
{
#slug: slug,
#query: query,
},
),
)),
returnValueForMissingStub:
_i5.Future<_i3.SubPaginationModel>.value(_FakeSubPaginationModel_2(
this,
Invocation.method(
#getSubscribers,
[],
{
#slug: slug,
#query: query,
},
),
)),
) as _i5.Future<_i3.SubPaginationModel>);
@override
_i5.Future<_i3.SubPaginationModel> getSubscriptions({
required String? slug,
String? query,
}) =>
(super.noSuchMethod(
Invocation.method(
#getSubscriptions,
[],
{
#slug: slug,
#query: query,
},
),
returnValue:
_i5.Future<_i3.SubPaginationModel>.value(_FakeSubPaginationModel_2(
this,
Invocation.method(
#getSubscriptions,
[],
{
#slug: slug,
#query: query,
},
),
)),
returnValueForMissingStub:
_i5.Future<_i3.SubPaginationModel>.value(_FakeSubPaginationModel_2(
this,
Invocation.method(
#getSubscriptions,
[],
{
#slug: slug,
#query: query,
},
),
)),
) as _i5.Future<_i3.SubPaginationModel>);
@override
_i5.Future<void> subscribe({required String? slug}) => (super.noSuchMethod(
Invocation.method(
#subscribe,
[],
{#slug: slug},
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> unsubscribe({required String? slug}) => (super.noSuchMethod(
Invocation.method(
#unsubscribe,
[],
{#slug: slug},
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> uploadPhoto({required _i9.File? photo}) =>
(super.noSuchMethod(
Invocation.method(
#uploadPhoto,
[],
{#photo: photo},
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> deletePhoto() => (super.noSuchMethod(
Invocation.method(
#deletePhoto,
[],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
}