feat(verify): phone

This commit is contained in:
mso7nueh
2025-05-21 17:42:43 +03:00
parent cb9fff9327
commit 067e0929ed
98 changed files with 821 additions and 760 deletions

View File

@@ -43,6 +43,7 @@ import 'package:eatvio_app/features/profile/presentation/pages/subs_screen.dart'
import 'package:eatvio_app/features/recipe/presentation/about_recipe_screen.dart';
import 'package:eatvio_app/features/create_recipe/presentation/pages/recipe_create_screen.dart';
import 'package:eatvio_app/features/registration/presentation/pages/registration_screen.dart';
import 'package:eatvio_app/features/registration/presentation/pages/verify_screen.dart';
import 'package:eatvio_app/features/registration/presentation/pages/webview_registration_screen.dart';
import 'package:eatvio_app/features/settings/entities/settings_entity.dart';
import 'package:eatvio_app/features/settings/presentation/pages/change_email_screen.dart';
@@ -342,6 +343,11 @@ class AppRouter {
);
},
),
GoRoute(
path: '/verify-screen',
name: 'verifyScreen',
builder: (context, state) => VerifyScreen(passKey: state.extra as String),
),
],
);
}

View File

@@ -1,4 +1,5 @@
String baseUrl = 'https://eatvio.ru';
String baseUrl = 'https://apoloz-nauch-vei9nieng5er.eatv.io';
// String baseUrl = 'https://eatvio.ru';
// String baseUrl = 'https://dev2.eatvio.com';
const List<int> durationValues = [7, 14, 21];

View File

@@ -3,7 +3,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'selection_popup_model.freezed.dart';
@freezed
class SelectionPopupModel with _$SelectionPopupModel {
abstract class SelectionPopupModel with _$SelectionPopupModel {
const factory SelectionPopupModel({
int? id,
required String title,

View File

@@ -4,7 +4,7 @@ part 'pagination_model.freezed.dart';
part 'pagination_model.g.dart';
@freezed
class Links with _$Links {
abstract class Links with _$Links {
const factory Links({
@JsonKey(name: "first") required String first,
@JsonKey(name: "last") required String last,
@@ -16,7 +16,7 @@ class Links with _$Links {
}
@freezed
class Meta with _$Meta {
abstract class Meta with _$Meta {
const factory Meta({
@JsonKey(name: "current_page") required int currentPage,
@JsonKey(name: "from") required dynamic from,
@@ -34,7 +34,7 @@ class Meta with _$Meta {
}
@freezed
class Link with _$Link {
abstract class Link with _$Link {
const factory Link({
@JsonKey(name: "url") String? url,
@JsonKey(name: "label") String? label,

View File

@@ -5,7 +5,7 @@ part 'credentials_model.freezed.dart';
part 'credentials_model.g.dart';
@freezed
class CredentialsModel with _$CredentialsModel {
abstract class CredentialsModel with _$CredentialsModel {
const factory CredentialsModel({
required String email,
required String password,

View File

@@ -5,7 +5,7 @@ part 'token_model.freezed.dart';
part 'token_model.g.dart';
@freezed
class TokenModel with _$TokenModel {
abstract class TokenModel with _$TokenModel {
const factory TokenModel({
required String token,
}) = _TokenModel;

View File

@@ -3,7 +3,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'auth_state.freezed.dart';
@freezed
class AuthState with _$AuthState {
abstract class AuthState with _$AuthState {
const factory AuthState() = _AuthState;
const factory AuthState.loading() = AuthStateLoading;

View File

@@ -5,7 +5,7 @@ part '../../../presentation/feed/blog_post_create_screen/models/blog_post_create
part '../../../presentation/feed/blog_post_create_screen/models/blog_post_create_credentials_model.g.dart';
@freezed
class BlogPostCreateCredentialsModel with _$BlogPostCreateCredentialsModel {
abstract class BlogPostCreateCredentialsModel with _$BlogPostCreateCredentialsModel {
const factory BlogPostCreateCredentialsModel({
required String title,
required String description,

View File

@@ -5,7 +5,7 @@ part 'calendar_model.freezed.dart';
part 'calendar_model.g.dart';
@freezed
class CalendarModel with _$CalendarModel {
abstract class CalendarModel with _$CalendarModel {
const factory CalendarModel({
required String date,
@JsonKey(name: 'is_current_day_included_in_the_chosen_diet_progression') required bool isCurrentDayIncludedInTheChosenDietProgression,

View File

@@ -3,7 +3,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'cancel_plan_state.freezed.dart';
@freezed
class CancelPlanState with _$CancelPlanState {
abstract class CancelPlanState with _$CancelPlanState {
factory CancelPlanState() = _CancelPlanState;
}

View File

@@ -4,7 +4,7 @@ part 'cancelation_model.freezed.dart';
part 'cancelation_model.g.dart';
@freezed
class CancelationModel with _$CancelationModel {
abstract class CancelationModel with _$CancelationModel {
factory CancelationModel({
required String description,
required int price,

View File

@@ -5,7 +5,7 @@ part 'chat_message_model.freezed.dart';
part 'chat_message_model.g.dart';
@freezed
class ChatMessageModel with _$ChatMessageModel {
abstract class ChatMessageModel with _$ChatMessageModel {
const factory ChatMessageModel({
required int id,
required String data,

View File

@@ -6,7 +6,7 @@ part 'chat_messages_model.freezed.dart';
part 'chat_messages_model.g.dart';
@freezed
class ChatMessagesModel with _$ChatMessagesModel {
abstract class ChatMessagesModel with _$ChatMessagesModel {
const factory ChatMessagesModel({
@JsonKey(name: 'data') required List<ChatMessageModel> messagesList,
required ChatMetaModel meta,

View File

@@ -4,7 +4,7 @@ part 'chat_meta_model.freezed.dart';
part 'chat_meta_model.g.dart';
@freezed
class ChatMetaModel with _$ChatMetaModel {
abstract class ChatMetaModel with _$ChatMetaModel {
const factory ChatMetaModel({
@JsonKey(name: "last_page") required int lastPage,
}) = _ChatMetaModel;

View File

@@ -7,7 +7,7 @@ part 'chat_room_model.freezed.dart';
part 'chat_room_model.g.dart';
@freezed
class ChatRoomModel with _$ChatRoomModel {
abstract class ChatRoomModel with _$ChatRoomModel {
const factory ChatRoomModel({
required String id,
@JsonKey(name: 'chat_room_setting') required ChatRoomSettingsModel chatRoomSettings,
@@ -20,7 +20,7 @@ class ChatRoomModel with _$ChatRoomModel {
}
@freezed
class Users with _$Users {
abstract class Users with _$Users {
const factory Users({
@JsonKey(name: 'from_chat_user') required ChatUserModel sender,

View File

@@ -6,7 +6,7 @@ part 'chat_room_pagination_model.freezed.dart';
part 'chat_room_pagination_model.g.dart';
@freezed
class ChatRoomPaginationModel with _$ChatRoomPaginationModel {
abstract class ChatRoomPaginationModel with _$ChatRoomPaginationModel {
const factory ChatRoomPaginationModel({
@JsonKey(name: "chatRooms") required ChatRooms chatRooms,
@JsonKey(name: "number_of_unread_chat_rooms") required int unreadChatsCount,
@@ -16,7 +16,7 @@ class ChatRoomPaginationModel with _$ChatRoomPaginationModel {
}
@freezed
class ChatRooms with _$ChatRooms {
abstract class ChatRooms with _$ChatRooms {
const factory ChatRooms({
@JsonKey(name: "data") required List<ChatRoom> data,
@JsonKey(name: "last_page") required int lastPage,
@@ -27,7 +27,7 @@ class ChatRooms with _$ChatRooms {
}
@freezed
class ChatRoom with _$ChatRoom {
abstract class ChatRoom with _$ChatRoom {
const factory ChatRoom({
@JsonKey(name: "id") required String id,
@JsonKey(name: "room_name") required String roomName,
@@ -48,7 +48,7 @@ ChatMessageModel? parseLastMessage(dynamic json) {
}
@freezed
class Users with _$Users {
abstract class Users with _$Users {
const factory Users({
@JsonKey(name: "from_chat_user") required ChatUser fromChatUser,
@JsonKey(name: "to_chat_user") required ChatUser toChatUser,
@@ -58,7 +58,7 @@ class Users with _$Users {
}
@freezed
class ChatUser with _$ChatUser {
abstract class ChatUser with _$ChatUser {
const factory ChatUser({
@JsonKey(name: "id") required int id,
@JsonKey(name: "name") required String name,

View File

@@ -4,7 +4,7 @@ part 'chat_room_settings_model.freezed.dart';
part 'chat_room_settings_model.g.dart';
@freezed
class ChatRoomSettingsModel with _$ChatRoomSettingsModel {
abstract class ChatRoomSettingsModel with _$ChatRoomSettingsModel {
const factory ChatRoomSettingsModel({
required int id,
@JsonKey(name: 'room_name') required String roomName,

View File

@@ -4,7 +4,7 @@ part 'chat_user_model.freezed.dart';
part 'chat_user_model.g.dart';
@freezed
class ChatUserModel with _$ChatUserModel {
abstract class ChatUserModel with _$ChatUserModel {
const factory ChatUserModel({
required int id,
required String name,

View File

@@ -4,7 +4,7 @@ part 'payment_model.freezed.dart';
part 'payment_model.g.dart';
@freezed
class PaymentModel with _$PaymentModel {
abstract class PaymentModel with _$PaymentModel {
factory PaymentModel({
@JsonKey(name: 'checkout_url') required String paymentUrl,

View File

@@ -4,7 +4,7 @@ part 'plan_complain_model.freezed.dart';
part 'plan_complain_model.g.dart';
@freezed
class PlanComplainModel with _$PlanComplainModel {
abstract class PlanComplainModel with _$PlanComplainModel {
factory PlanComplainModel({
@JsonKey(name: 'description') required String description,

View File

@@ -4,7 +4,7 @@ part 'websocket_info_model.freezed.dart';
part 'websocket_info_model.g.dart';
@freezed
class WebsocketInfoModel with _$WebsocketInfoModel {
abstract class WebsocketInfoModel with _$WebsocketInfoModel {
const factory WebsocketInfoModel({
required String key,
required String host,

View File

@@ -5,7 +5,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'chats_state.freezed.dart';
@freezed
class ChatsState with _$ChatsState {
abstract class ChatsState with _$ChatsState {
factory ChatsState({
@Default(BaseState.initial) BaseState state,

View File

@@ -4,7 +4,7 @@ part 'complain_model.freezed.dart';
part 'complain_model.g.dart';
@freezed
class ComplainModel with _$ComplainModel {
abstract class ComplainModel with _$ComplainModel {
const factory ComplainModel({
@Default(null) String? description,

View File

@@ -6,7 +6,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'complaining_state.freezed.dart';
@freezed
class ComplainingState with _$ComplainingState {
abstract class ComplainingState with _$ComplainingState {
factory ComplainingState({
@Default(false) bool isLoading,

View File

@@ -5,7 +5,7 @@ part 'consultant_profile_model.freezed.dart';
part 'consultant_profile_model.g.dart';
@freezed
class ConsultantProfileModel with _$ConsultantProfileModel {
abstract class ConsultantProfileModel with _$ConsultantProfileModel {
const factory ConsultantProfileModel({
@JsonKey(name: 'has_medical_education', includeIfNull: false) bool? hasMedicalEducation,
@JsonKey(name: 'social_links', includeIfNull: false) SocialLinksModel? socialLinks,
@@ -17,7 +17,7 @@ class ConsultantProfileModel with _$ConsultantProfileModel {
}
@freezed
class SocialLinksModel with _$SocialLinksModel {
abstract class SocialLinksModel with _$SocialLinksModel {
const factory SocialLinksModel({
@JsonKey(name: 'vk_link', includeIfNull: false) String? vkLink,
@JsonKey(name: 'tg_link', includeIfNull: false) String? tgLink,
@@ -30,7 +30,7 @@ class SocialLinksModel with _$SocialLinksModel {
}
@freezed
class CertificatesModel with _$CertificatesModel {
abstract class CertificatesModel with _$CertificatesModel {
const factory CertificatesModel({
required String title,
required String date,

View File

@@ -6,7 +6,7 @@ part 'consultation_request_model.freezed.dart';
part 'consultation_request_model.g.dart';
@freezed
class ConsultationRequestModel with _$ConsultationRequestModel {
abstract class ConsultationRequestModel with _$ConsultationRequestModel {
const factory ConsultationRequestModel({
@JsonKey(name: 'rating_place') required int ratingPlace,
@JsonKey(name: 'education_resource') required EducationModel educationModel,
@@ -17,7 +17,7 @@ class ConsultationRequestModel with _$ConsultationRequestModel {
}
@freezed
class CertPhotosModel with _$CertPhotosModel {
abstract class CertPhotosModel with _$CertPhotosModel {
const factory CertPhotosModel({
required String url,
}) = _CertPhotosModel;

View File

@@ -4,7 +4,7 @@ part 'rating_model.freezed.dart';
part 'rating_model.g.dart';
@freezed
class RatingModel with _$RatingModel {
abstract class RatingModel with _$RatingModel {
factory RatingModel({
required DateTime date,

View File

@@ -6,7 +6,7 @@ part 'consultation_model.freezed.dart';
part 'consultation_model.g.dart';
@freezed
class ConsultationModel with _$ConsultationModel {
abstract class ConsultationModel with _$ConsultationModel {
factory ConsultationModel({
required int id,
@JsonKey(name: 'last_state') required ChosenPlanStateEnum chosenPlanState,
@@ -26,7 +26,7 @@ class ConsultationModel with _$ConsultationModel {
}
@freezed
class DiaryModel with _$DiaryModel {
abstract class DiaryModel with _$DiaryModel {
factory DiaryModel({
required int id,
required DiaryStateEnum state,
@@ -58,7 +58,7 @@ enum DiaryStateEnum {
}
@freezed
class ConsultationPaginationModel with _$ConsultationPaginationModel {
abstract class ConsultationPaginationModel with _$ConsultationPaginationModel {
factory ConsultationPaginationModel({required List<ConsultationModel> data}) = _ConsultationPaginationModel;
factory ConsultationPaginationModel.fromJson(Map<String, dynamic> json) => _$ConsultationPaginationModelFromJson(json);

View File

@@ -5,7 +5,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'consultations_state.freezed.dart';
@freezed
class ConsultationsState with _$ConsultationsState {
abstract class ConsultationsState with _$ConsultationsState {
factory ConsultationsState({
@Default(BaseState.initial) BaseState state,

View File

@@ -5,7 +5,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'create_diet_model.freezed.dart';
@freezed
class CreateDietModel with _$CreateDietModel {
abstract class CreateDietModel with _$CreateDietModel {
const CreateDietModel._();
const factory CreateDietModel({

View File

@@ -6,7 +6,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'create_diet_state.freezed.dart';
@freezed
class CreateDietState with _$CreateDietState {
abstract class CreateDietState with _$CreateDietState {
const factory CreateDietState({
required bool isLoading,
required bool isDietPublishing,

View File

@@ -127,11 +127,12 @@ class _DietImagePickerWidgetState extends State<DietImagePickerWidget> {
: Stack(
children: [
DottedBorder(
stackFit: StackFit.expand,
dashPattern: const [14, 14],
color: state.dietImageError != null ? appTheme.red : appTheme.dottedBorder,
borderType: BorderType.RRect,
radius: const Radius.circular(12),
options: RoundedRectDottedBorderOptions(
stackFit: StackFit.expand,
dashPattern: const [14, 14],
color: state.dietImageError != null ? appTheme.red : appTheme.dottedBorder,
radius: const Radius.circular(12),
),
child: const SizedBox.expand(),
),
Center(

View File

@@ -5,7 +5,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'create_plan_model.freezed.dart';
@freezed
class CreatePlanModel with _$CreatePlanModel {
abstract class CreatePlanModel with _$CreatePlanModel {
const CreatePlanModel._();
const factory CreatePlanModel({

View File

@@ -4,7 +4,7 @@ part 'plan_slug_model.freezed.dart';
part 'plan_slug_model.g.dart';
@freezed
class PlanSlugModel with _$PlanSlugModel {
abstract class PlanSlugModel with _$PlanSlugModel {
factory PlanSlugModel({@JsonKey(name: 'slug') required String slug}) = _PlanSlugModel;
factory PlanSlugModel.fromJson(Map<String, dynamic> json) => _$PlanSlugModelFromJson(json);

View File

@@ -5,7 +5,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'create_plan_state.freezed.dart';
@freezed
class CreatePlanState with _$CreatePlanState {
abstract class CreatePlanState with _$CreatePlanState {
const factory CreatePlanState({
required bool isLoading,
required String? errorMessage,
@@ -29,7 +29,7 @@ class CreatePlanState with _$CreatePlanState {
}
@freezed
class PlanValidationState with _$PlanValidationState {
abstract class PlanValidationState with _$PlanValidationState {
factory PlanValidationState({
required bool titleHasError,
required bool durationHasError,
@@ -54,7 +54,7 @@ class PlanValidationState with _$PlanValidationState {
}
@freezed
class OptionValidationState with _$OptionValidationState {
abstract class OptionValidationState with _$OptionValidationState {
factory OptionValidationState({
required bool titleHasError,
required bool priceHasError,

View File

@@ -116,11 +116,12 @@ class _PlanImagePickerWidgetState extends State<PlanImagePickerWidget> {
: Stack(
children: [
DottedBorder(
stackFit: StackFit.expand,
dashPattern: const [14, 14],
color: state.validationState.imageHasError ? appTheme.red : appTheme.dottedBorder,
borderType: BorderType.RRect,
radius: const Radius.circular(12),
options: RoundedRectDottedBorderOptions(
stackFit: StackFit.expand,
dashPattern: const [14, 14],
color: state.validationState.imageHasError ? appTheme.red : appTheme.dottedBorder,
radius: const Radius.circular(12),
),
child: const SizedBox.expand(),
),
Center(

View File

@@ -99,7 +99,7 @@ enum TypeOfRecipe {
}
@freezed
class RecipeCreateEntity with _$RecipeCreateEntity {
abstract class RecipeCreateEntity with _$RecipeCreateEntity {
const RecipeCreateEntity._();
const factory RecipeCreateEntity({
@@ -138,7 +138,7 @@ class RecipeCreateEntity with _$RecipeCreateEntity {
}
@freezed
class StepEntity with _$StepEntity {
abstract class StepEntity with _$StepEntity {
const StepEntity._();
const factory StepEntity({

View File

@@ -5,7 +5,7 @@ part 'ingredient.freezed.dart';
part 'ingredient.g.dart';
@freezed
class Ingredient with _$Ingredient {
abstract class Ingredient with _$Ingredient {
const factory Ingredient({
required String name,
required String unit,

View File

@@ -5,7 +5,7 @@ part 'product.freezed.dart';
part 'product.g.dart';
@freezed
class Product with _$Product {
abstract class Product with _$Product {
const factory Product({
required int id,
required String name,

View File

@@ -17,7 +17,7 @@ enum RecipeType {
}
@freezed
class RecipeCreateModel with _$RecipeCreateModel {
abstract class RecipeCreateModel with _$RecipeCreateModel {
const factory RecipeCreateModel({
required String title,
required String state,

View File

@@ -7,7 +7,7 @@ part 'recipe_model.freezed.dart';
part 'recipe_model.g.dart';
@freezed
class RecipeModel with _$RecipeModel {
abstract class RecipeModel with _$RecipeModel {
const factory RecipeModel({
List<Ingredient?>? ingredients,
List<Step?>? steps,

View File

@@ -6,7 +6,7 @@ part 'recipe_tag_model.freezed.dart';
part 'recipe_tag_model.g.dart';
@freezed
class RecipeTagModel with _$RecipeTagModel {
abstract class RecipeTagModel with _$RecipeTagModel {
const factory RecipeTagModel({
@JsonKey(name: "data") required List<RecipeTag> data,
@JsonKey(name: "links") required Links links,
@@ -17,7 +17,7 @@ class RecipeTagModel with _$RecipeTagModel {
}
@freezed
class RecipeTag with _$RecipeTag {
abstract class RecipeTag with _$RecipeTag {
const factory RecipeTag({
@JsonKey(name: "id") required int id,
@JsonKey(name: "name") required String name,

View File

@@ -5,7 +5,7 @@ part 'step.freezed.dart';
part 'step.g.dart';
@freezed
class Step with _$Step {
abstract class Step with _$Step {
const factory Step({
String? image,
String? description,

View File

@@ -4,7 +4,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'create_recipe_state.freezed.dart';
@freezed
class CreateRecipeState with _$CreateRecipeState {
abstract class CreateRecipeState with _$CreateRecipeState {
const factory CreateRecipeState({
required RecipeCreateEntity entity,
required bool loading,

View File

@@ -4,7 +4,7 @@ part 'consultant_comment_model.freezed.dart';
part 'consultant_comment_model.g.dart';
@freezed
class ConsultantCommentModel with _$ConsultantCommentModel {
abstract class ConsultantCommentModel with _$ConsultantCommentModel {
factory ConsultantCommentModel({
String? comment,
@Default({}) @JsonKey(name: 'meals') Map<String, MealCommentModel> mealsComments,
@@ -15,7 +15,7 @@ class ConsultantCommentModel with _$ConsultantCommentModel {
}
@freezed
class PortionCommentModel with _$PortionCommentModel {
abstract class PortionCommentModel with _$PortionCommentModel {
factory PortionCommentModel({
required String comment,
required int id,
@@ -25,7 +25,7 @@ class PortionCommentModel with _$PortionCommentModel {
}
@freezed
class MealCommentModel with _$MealCommentModel {
abstract class MealCommentModel with _$MealCommentModel {
factory MealCommentModel({
required String comment,

View File

@@ -4,7 +4,7 @@ part 'consultant_review_model.freezed.dart';
part 'consultant_review_model.g.dart';
@freezed
class ConsultantReviewModel with _$ConsultantReviewModel {
abstract class ConsultantReviewModel with _$ConsultantReviewModel {
factory ConsultantReviewModel({
required String planName,
@@ -18,7 +18,7 @@ class ConsultantReviewModel with _$ConsultantReviewModel {
@freezed
class ConsultantComments with _$ConsultantComments {
abstract class ConsultantComments with _$ConsultantComments {
factory ConsultantComments({
required String? dayComment,
@@ -32,7 +32,7 @@ class ConsultantComments with _$ConsultantComments {
@freezed
class MealComment with _$MealComment {
abstract class MealComment with _$MealComment {
factory MealComment({
required String comment,
@@ -43,7 +43,7 @@ class MealComment with _$MealComment {
}
@freezed
class PortionComment with _$PortionComment {
abstract class PortionComment with _$PortionComment {
factory PortionComment({
@JsonKey(name: 'id') required int portionId,

File diff suppressed because it is too large Load Diff

View File

@@ -6,9 +6,9 @@ part of 'consultant_review_model.dart';
// JsonSerializableGenerator
// **************************************************************************
_$ConsultantReviewModelImpl _$$ConsultantReviewModelImplFromJson(
_ConsultantReviewModel _$ConsultantReviewModelFromJson(
Map<String, dynamic> json) =>
_$ConsultantReviewModelImpl(
_ConsultantReviewModel(
planName: json['planName'] as String,
planDuration: (json['planDuration'] as num).toInt(),
currentPlanDay: (json['currentPlanDay'] as num).toInt(),
@@ -16,8 +16,8 @@ _$ConsultantReviewModelImpl _$$ConsultantReviewModelImplFromJson(
json['consultantComments'] as Map<String, dynamic>),
);
Map<String, dynamic> _$$ConsultantReviewModelImplToJson(
_$ConsultantReviewModelImpl instance) =>
Map<String, dynamic> _$ConsultantReviewModelToJson(
_ConsultantReviewModel instance) =>
<String, dynamic>{
'planName': instance.planName,
'planDuration': instance.planDuration,
@@ -25,9 +25,8 @@ Map<String, dynamic> _$$ConsultantReviewModelImplToJson(
'consultantComments': instance.consultantComments,
};
_$ConsultantCommentsImpl _$$ConsultantCommentsImplFromJson(
Map<String, dynamic> json) =>
_$ConsultantCommentsImpl(
_ConsultantComments _$ConsultantCommentsFromJson(Map<String, dynamic> json) =>
_ConsultantComments(
dayComment: json['dayComment'] as String?,
mealsComments: (json['mealsComments'] as List<dynamic>)
.map((e) => MealComment.fromJson(e as Map<String, dynamic>))
@@ -37,34 +36,31 @@ _$ConsultantCommentsImpl _$$ConsultantCommentsImplFromJson(
.toList(),
);
Map<String, dynamic> _$$ConsultantCommentsImplToJson(
_$ConsultantCommentsImpl instance) =>
Map<String, dynamic> _$ConsultantCommentsToJson(_ConsultantComments instance) =>
<String, dynamic>{
'dayComment': instance.dayComment,
'mealsComments': instance.mealsComments,
'portionsComments': instance.portionsComments,
};
_$MealCommentImpl _$$MealCommentImplFromJson(Map<String, dynamic> json) =>
_$MealCommentImpl(
_MealComment _$MealCommentFromJson(Map<String, dynamic> json) => _MealComment(
comment: json['comment'] as String,
typeNo: (json['typeNo'] as num).toInt(),
);
Map<String, dynamic> _$$MealCommentImplToJson(_$MealCommentImpl instance) =>
Map<String, dynamic> _$MealCommentToJson(_MealComment instance) =>
<String, dynamic>{
'comment': instance.comment,
'typeNo': instance.typeNo,
};
_$PortionCommentImpl _$$PortionCommentImplFromJson(Map<String, dynamic> json) =>
_$PortionCommentImpl(
_PortionComment _$PortionCommentFromJson(Map<String, dynamic> json) =>
_PortionComment(
portionId: (json['id'] as num).toInt(),
comment: json['comment'] as String,
);
Map<String, dynamic> _$$PortionCommentImplToJson(
_$PortionCommentImpl instance) =>
Map<String, dynamic> _$PortionCommentToJson(_PortionComment instance) =>
<String, dynamic>{
'id': instance.portionId,
'comment': instance.comment,

View File

@@ -21,7 +21,7 @@ enum PortionState {
}
@freezed
class DiaryDayWrapperModel with _$DiaryDayWrapperModel {
abstract class DiaryDayWrapperModel with _$DiaryDayWrapperModel {
const factory DiaryDayWrapperModel({
@JsonKey(
name: "diary",
@@ -33,7 +33,7 @@ class DiaryDayWrapperModel with _$DiaryDayWrapperModel {
}
@freezed
class DiaryDayModel with _$DiaryDayModel {
abstract class DiaryDayModel with _$DiaryDayModel {
const factory DiaryDayModel({
@JsonKey(name: "id") required int id,
@JsonKey(name: "date") required String date,
@@ -50,7 +50,7 @@ class DiaryDayModel with _$DiaryDayModel {
}
@freezed
class MealModel with _$MealModel {
abstract class MealModel with _$MealModel {
const factory MealModel({
@JsonKey(name: "id") required int id,
@JsonKey(name: "time") required String time,
@@ -65,7 +65,7 @@ class MealModel with _$MealModel {
}
@freezed
class DiaryPhotoModel with _$DiaryPhotoModel {
abstract class DiaryPhotoModel with _$DiaryPhotoModel {
const factory DiaryPhotoModel({
@JsonKey(name: "id") required int id,
@JsonKey(name: "original_name") required String originalName,
@@ -77,7 +77,7 @@ class DiaryPhotoModel with _$DiaryPhotoModel {
}
@freezed
class PortionModel with _$PortionModel {
abstract class PortionModel with _$PortionModel {
const factory PortionModel({
@JsonKey(name: "id") required int id,
@JsonKey(name: "product_nutritional_value_id") int? productNutritionalValueId,
@@ -92,7 +92,7 @@ class PortionModel with _$PortionModel {
}
@freezed
class TypeOfDiaryModel with _$TypeOfDiaryModel {
abstract class TypeOfDiaryModel with _$TypeOfDiaryModel {
const factory TypeOfDiaryModel({
@JsonKey(name: "has_chosen_diet") required bool hasChosenDiet,
@JsonKey(name: "has_chosen_plan") required bool hasChosenPlan,
@@ -103,7 +103,7 @@ class TypeOfDiaryModel with _$TypeOfDiaryModel {
}
@freezed
class ProductInMeal with _$ProductInMeal {
abstract class ProductInMeal with _$ProductInMeal {
const factory ProductInMeal({
@JsonKey(name: 'product_name') required String productName,
@JsonKey(name: 'portion') required String portion,

View File

@@ -5,7 +5,7 @@ part 'diary_index_model.freezed.dart';
part 'diary_index_model.g.dart';
@freezed
class DiaryIndexModel with _$DiaryIndexModel {
abstract class DiaryIndexModel with _$DiaryIndexModel {
const factory DiaryIndexModel({
required int id,
}) = _DiaryIndexModel;

View File

@@ -5,7 +5,7 @@ part 'finish_diary_day_model.freezed.dart';
part 'finish_diary_day_model.g.dart';
@Freezed()
class FinishDiaryDayModel with _$FinishDiaryDayModel {
abstract class FinishDiaryDayModel with _$FinishDiaryDayModel {
const factory FinishDiaryDayModel({required String wakeUp, required String retire, @JsonKey(includeIfNull: false) String? comment}) = _FinishDiaryDayModel;
factory FinishDiaryDayModel.fromJson(Map<String, dynamic> json) => _$FinishDiaryDayModelFromJson(json);

View File

@@ -5,7 +5,7 @@ part 'nutrition_model.freezed.dart';
part 'nutrition_model.g.dart';
@freezed
class NutritionDataModel with _$NutritionDataModel {
abstract class NutritionDataModel with _$NutritionDataModel {
const factory NutritionDataModel({
required NutritionModel dailyNutritionIntake,
required NutritionModel dailyNutritionRecommendation,
@@ -15,7 +15,7 @@ class NutritionDataModel with _$NutritionDataModel {
}
@freezed
class NutritionModel with _$NutritionModel {
abstract class NutritionModel with _$NutritionModel {
const factory NutritionModel({
required double energy,
required double proteins,

View File

@@ -4,7 +4,7 @@ part 'product_moderation_model.freezed.dart';
part 'product_moderation_model.g.dart';
@freezed
class ProductModerationModel with _$ProductModerationModel {
abstract class ProductModerationModel with _$ProductModerationModel {
const factory ProductModerationModel({
required String name,
@JsonKey(name: 'energy_on_100gr')

View File

@@ -5,7 +5,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'consultant_comments_state.freezed.dart';
@freezed
class ConsultantCommentsState with _$ConsultantCommentsState {
abstract class ConsultantCommentsState with _$ConsultantCommentsState {
factory ConsultantCommentsState({
required ConsultantCommentModel commentsModel,

View File

@@ -6,7 +6,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'diary_state.freezed.dart';
@freezed
class DiaryState with _$DiaryState {
abstract class DiaryState with _$DiaryState {
const factory DiaryState() = _DiaryState;
const factory DiaryState.loading() = DiaryStateLoading;

View File

@@ -79,12 +79,13 @@ class _ProductWidgetState extends State<ProductWidget> {
}
if (widget.portion.portionState == PortionState.eatenDeleted) {
return DottedBorder(
dashPattern: const [6, 6],
padding: EdgeInsets.zero,
borderPadding: EdgeInsets.zero,
borderType: BorderType.RRect,
radius: const Radius.circular(20),
color: const Color(0xFF6D6F71),
options: const RoundedRectDottedBorderOptions(
dashPattern: [6, 6],
padding: EdgeInsets.zero,
borderPadding: EdgeInsets.zero,
radius: Radius.circular(20),
color: Color(0xFF6D6F71),
),
child: ListTile(
onTap: () => diaryCubit.restore(
diaryId: state.diary.id,

View File

@@ -4,7 +4,7 @@ part 'diet_likes_model.freezed.dart';
part 'diet_likes_model.g.dart';
@freezed
class DietLikesModel with _$DietLikesModel {
abstract class DietLikesModel with _$DietLikesModel {
const factory DietLikesModel({
@JsonKey(name: 'total_likers') required int totalLikes,
@JsonKey(name: 'is_liked') required bool isLiked,

View File

@@ -4,7 +4,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'about_diet_state.freezed.dart';
@freezed
class AboutDietState with _$AboutDietState {
abstract class AboutDietState with _$AboutDietState {
const factory AboutDietState() = _AboutDietState;
const factory AboutDietState.initial() = DietStateInitial;

View File

@@ -5,7 +5,7 @@ part 'comment_model.freezed.dart';
part 'comment_model.g.dart';
@freezed
class CommentModel with _$CommentModel {
abstract class CommentModel with _$CommentModel {
const factory CommentModel({
@JsonKey(name: "data") required List<Comment> data,
@JsonKey(name: "links") required Links links,
@@ -16,7 +16,7 @@ class CommentModel with _$CommentModel {
}
@freezed
class Comment with _$Comment {
abstract class Comment with _$Comment {
const factory Comment({
@JsonKey(name: "id") required int id,
@JsonKey(name: "author_name") required String authorName,

View File

@@ -6,7 +6,7 @@ part 'diets_pagination_model.freezed.dart';
part 'diets_pagination_model.g.dart';
@freezed
class DietsPagination with _$DietsPagination {
abstract class DietsPagination with _$DietsPagination {
const factory DietsPagination({
@JsonKey(name: "data") required List<Diet> data,
@JsonKey(name: "links") required Links links,
@@ -17,7 +17,7 @@ class DietsPagination with _$DietsPagination {
}
@freezed
class Diet with _$Diet {
abstract class Diet with _$Diet {
const factory Diet({
@JsonKey(name: "id") required int id,
@JsonKey(name: "name") required String name,
@@ -61,7 +61,7 @@ enum DietState {
}
@freezed
class CreatedDiet with _$CreatedDiet {
abstract class CreatedDiet with _$CreatedDiet {
const factory CreatedDiet({
@JsonKey(name: "id") required int id,
}) = _CreatedDiet;
@@ -78,7 +78,7 @@ int parseDuration(dynamic duration) {
}
@freezed
class Author with _$Author {
abstract class Author with _$Author {
const factory Author({
@JsonKey(name: "author_slug") required String authorSlug,
@JsonKey(name: "author_name") required String authorName,
@@ -92,7 +92,7 @@ class Author with _$Author {
}
@freezed
class DailySchedule with _$DailySchedule {
abstract class DailySchedule with _$DailySchedule {
const factory DailySchedule({
@JsonKey(name: "name") required String name,
@JsonKey(name: "portion") required Portion portion,
@@ -141,7 +141,7 @@ enum Portion {
}
@freezed
class DietType with _$DietType {
abstract class DietType with _$DietType {
const DietType._();
const factory DietType({
@JsonKey(name: "light") bool? light,
@@ -170,7 +170,7 @@ class EnumValues<T> {
}
@freezed
class DailyNutrition with _$DailyNutrition {
abstract class DailyNutrition with _$DailyNutrition {
const factory DailyNutrition({
@JsonKey(name: 'energy') required double energy,
@JsonKey(name: 'proteins') required double proteins,

View File

@@ -5,7 +5,7 @@ part 'feed_blog_post_model.freezed.dart';
part 'feed_blog_post_model.g.dart';
@freezed
class FeedBlogPostModel with _$FeedBlogPostModel {
abstract class FeedBlogPostModel with _$FeedBlogPostModel {
const factory FeedBlogPostModel({
required int id,
required String state,

View File

@@ -7,7 +7,7 @@ part 'feed_blog_post_settings_model.freezed.dart';
part 'feed_blog_post_settings_model.g.dart';
@freezed
class FeedBlogPostSettingsModel with _$FeedBlogPostSettingsModel {
abstract class FeedBlogPostSettingsModel with _$FeedBlogPostSettingsModel {
const factory FeedBlogPostSettingsModel({
@JsonKey(name: 'data') required List<FeedBlogPostModel> feedBlogPostList,
required Meta meta,

View File

@@ -6,7 +6,7 @@ part 'feed_consultant_model.freezed.dart';
part 'feed_consultant_model.g.dart';
@freezed
class FeedConsultantPaginationModel with _$FeedConsultantPaginationModel {
abstract class FeedConsultantPaginationModel with _$FeedConsultantPaginationModel {
const factory FeedConsultantPaginationModel({
required List<FeedConsultantModel> data,
required Links links,
@@ -17,7 +17,7 @@ class FeedConsultantPaginationModel with _$FeedConsultantPaginationModel {
}
@freezed
class FeedConsultantModel with _$FeedConsultantModel {
abstract class FeedConsultantModel with _$FeedConsultantModel {
const factory FeedConsultantModel({
required String slug,
required String name,

View File

@@ -8,7 +8,7 @@ part 'plan_pagination_model.freezed.dart';
part 'plan_pagination_model.g.dart';
@freezed
class PlanPaginationModel with _$PlanPaginationModel {
abstract class PlanPaginationModel with _$PlanPaginationModel {
const factory PlanPaginationModel({
@JsonKey(name: "data") required List<PlanModel> data,
@JsonKey(name: "links") required Links links,
@@ -19,7 +19,7 @@ class PlanPaginationModel with _$PlanPaginationModel {
}
@freezed
class PlanModel with _$PlanModel {
abstract class PlanModel with _$PlanModel {
const factory PlanModel({
@JsonKey(name: "id") required int id,
@JsonKey(name: "slug") required String slug,
@@ -61,7 +61,7 @@ PlanType planTypeFromJson(dynamic json) {
}
@freezed
class PacketOptions with _$PacketOptions {
abstract class PacketOptions with _$PacketOptions {
const factory PacketOptions({
@JsonKey(name: "items", fromJson: _parseItems) required List<String> items,
@JsonKey(name: "price") required dynamic price,
@@ -82,7 +82,7 @@ List<String> _parseItems(json) {
}
@freezed
class PlanType with _$PlanType {
abstract class PlanType with _$PlanType {
const PlanType._();
const factory PlanType({
@JsonKey(name: "fit", fromJson: parseBool) required bool? fit,

View File

@@ -5,7 +5,7 @@ part 'recipes_model.freezed.dart';
part 'recipes_model.g.dart';
@freezed
class Recipe with _$Recipe {
abstract class Recipe with _$Recipe {
const factory Recipe({
required int id,
required String image,
@@ -36,14 +36,14 @@ class Recipe with _$Recipe {
}
@freezed
class Tag with _$Tag {
abstract class Tag with _$Tag {
const factory Tag({required String name}) = _Tag;
factory Tag.fromJson(Map<String, Object?> json) => _$TagFromJson(json);
}
@freezed
class Ingredient with _$Ingredient {
abstract class Ingredient with _$Ingredient {
const factory Ingredient({
required String name,
String? unit,
@@ -60,7 +60,7 @@ int _parseProductId(json) {
return json as int;
}
@freezed
class Step with _$Step {
abstract class Step with _$Step {
const factory Step({required String image, @JsonKey(name: 'description_md') required String description}) = _Step;
factory Step.fromJson(Map<String, Object?> json) => _$StepFromJson(json);

View File

@@ -6,7 +6,7 @@ part 'recipes_pagination_model.freezed.dart';
part 'recipes_pagination_model.g.dart';
@freezed
class RecipesPagination with _$RecipesPagination {
abstract class RecipesPagination with _$RecipesPagination {
const factory RecipesPagination({
@JsonKey(name: 'data') required List<Recipe> recipesList,
// @JsonKey(name: "current_page") required int currentPage,

View File

@@ -4,7 +4,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'diets_state.freezed.dart';
@freezed
class DietsState with _$DietsState {
abstract class DietsState with _$DietsState {
const factory DietsState({
required DietsFilterState filterState,
required List<Diet> dietsList,
@@ -25,7 +25,7 @@ class DietsState with _$DietsState {
}
@freezed
class DietsFilterState with _$DietsFilterState {
abstract class DietsFilterState with _$DietsFilterState {
const factory DietsFilterState({
required int sortingIndex,
required int durationIndex,

View File

@@ -27,7 +27,7 @@ abstract class PlansState with _$PlansState {
}
@freezed
class PlansFilterState with _$PlansFilterState {
abstract class PlansFilterState with _$PlansFilterState {
const factory PlansFilterState({
required (int?, int?) priceFilter,
required int durationIndex,

View File

@@ -4,7 +4,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'profile_state.freezed.dart';
@freezed
class ProfileState with _$ProfileState {
abstract class ProfileState with _$ProfileState {
factory ProfileState({
ProfileModel? profile,

View File

@@ -4,7 +4,7 @@ part 'glossary_model.freezed.dart';
part 'glossary_model.g.dart';
@freezed
class GlossaryPaginationModel with _$GlossaryPaginationModel {
abstract class GlossaryPaginationModel with _$GlossaryPaginationModel {
const factory GlossaryPaginationModel({
@JsonKey(name: 'data') required List<GlossaryModel> glossariesList,
}) = _GlossaryPaginationModel;
@@ -13,7 +13,7 @@ class GlossaryPaginationModel with _$GlossaryPaginationModel {
}
@freezed
class GlossaryModerationModel with _$GlossaryModerationModel {
abstract class GlossaryModerationModel with _$GlossaryModerationModel {
const factory GlossaryModerationModel({
@JsonKey(name: 'product_nutritional_value') required GlossaryModel glossary,
}) = _GlossaryModerationModel;
@@ -22,7 +22,7 @@ class GlossaryModerationModel with _$GlossaryModerationModel {
}
@freezed
class GlossaryModel with _$GlossaryModel {
abstract class GlossaryModel with _$GlossaryModel {
const factory GlossaryModel({
required int id,
required String name,

View File

@@ -5,7 +5,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'my_diets_state.freezed.dart';
@freezed
class MyDietsState with _$MyDietsState {
abstract class MyDietsState with _$MyDietsState {
factory MyDietsState({
@Default([]) List<Diet> activeDiets,
@Default([]) List<Diet> draftDiets,

View File

@@ -4,7 +4,7 @@ part 'card_model.freezed.dart';
part 'card_model.g.dart';
@freezed
class CardModel with _$CardModel {
abstract class CardModel with _$CardModel {
factory CardModel({
required int id,
@JsonKey(name: 'bank_pan') required String cardNumber,

View File

@@ -4,7 +4,7 @@ part 'payment_url_model.freezed.dart';
part 'payment_url_model.g.dart';
@freezed
class PaymentUrlModel with _$PaymentUrlModel {
abstract class PaymentUrlModel with _$PaymentUrlModel {
factory PaymentUrlModel({
required String paymentUrl,

View File

@@ -5,7 +5,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'user_cards_state.freezed.dart';
@freezed
class UserCardsState with _$UserCardsState {
abstract class UserCardsState with _$UserCardsState {
factory UserCardsState({
@Default([]) List<CardModel> cards,

View File

@@ -5,7 +5,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'my_plans_state.freezed.dart';
@freezed
class MyPlansState with _$MyPlansState {
abstract class MyPlansState with _$MyPlansState {
factory MyPlansState({
@Default([]) List<PlanModel> activePlans,
@Default([]) List<PlanModel> draftPlans,

View File

@@ -4,7 +4,7 @@ part 'notification_model.freezed.dart';
part 'notification_model.g.dart';
@freezed
class NotificationModel with _$NotificationModel {
abstract class NotificationModel with _$NotificationModel {
factory NotificationModel({
required NotificationType type

View File

@@ -4,7 +4,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'order_info_state.freezed.dart';
@freezed
class OrderInfoState with _$OrderInfoState {
abstract class OrderInfoState with _$OrderInfoState {
factory OrderInfoState({
@Default(true) bool isLoading,

View File

@@ -6,7 +6,7 @@ part 'chosen_plan_model.freezed.dart';
part 'chosen_plan_model.g.dart';
@freezed
class ChosenPlanModel with _$ChosenPlanModel {
abstract class ChosenPlanModel with _$ChosenPlanModel {
factory ChosenPlanModel({
@JsonKey() required int id,

View File

@@ -6,7 +6,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'about_plan_state.freezed.dart';
@freezed
class AboutPlanState with _$AboutPlanState {
abstract class AboutPlanState with _$AboutPlanState {
const factory AboutPlanState({
required bool isLoading,

View File

@@ -5,7 +5,7 @@ part 'badge_model.freezed.dart';
part 'badge_model.g.dart';
@freezed
class BadgeModel with _$BadgeModel {
abstract class BadgeModel with _$BadgeModel {
const factory BadgeModel({
required int id,
required String title,

View File

@@ -5,7 +5,7 @@ part 'chosen_diets_pagination_model.freezed.dart';
part 'chosen_diets_pagination_model.g.dart';
@freezed
class ChosenDietsPaginationModel with _$ChosenDietsPaginationModel {
abstract class ChosenDietsPaginationModel with _$ChosenDietsPaginationModel {
factory ChosenDietsPaginationModel({
@JsonKey(name: 'data') required List<ChosenDietModel> diets,
}) = _ChosenDietsPaginationModel;
@@ -14,7 +14,7 @@ class ChosenDietsPaginationModel with _$ChosenDietsPaginationModel {
}
@freezed
class ChosenDietModel with _$ChosenDietModel {
abstract class ChosenDietModel with _$ChosenDietModel {
factory ChosenDietModel({
@JsonKey(name: 'id') required int chosenDietID,
@JsonKey(name: 'chosen_plan_id') required int chosenPlanId,

View File

@@ -5,7 +5,7 @@ part 'circumference_model.freezed.dart';
part 'circumference_model.g.dart';
@freezed
class CircumferenceModel with _$CircumferenceModel {
abstract class CircumferenceModel with _$CircumferenceModel {
const factory CircumferenceModel({
@JsonKey(name: "id") required int id,
@JsonKey(name: "user_id") required int userId,

View File

@@ -6,7 +6,7 @@ part 'profile_model.freezed.dart';
part 'profile_model.g.dart';
@freezed
class ProfileModel with _$ProfileModel {
abstract class ProfileModel with _$ProfileModel {
const factory ProfileModel({
@JsonKey(name: "id") required int id,
@JsonKey(name: "name") required String name,
@@ -31,7 +31,7 @@ class ProfileModel with _$ProfileModel {
}
@freezed
class DiplomasAndCertificatesModel with _$DiplomasAndCertificatesModel {
abstract class DiplomasAndCertificatesModel with _$DiplomasAndCertificatesModel {
const factory DiplomasAndCertificatesModel({
required int id,
required String path,
@@ -41,10 +41,10 @@ class DiplomasAndCertificatesModel with _$DiplomasAndCertificatesModel {
}
@freezed
class EducationModel with _$EducationModel {
abstract 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: "completed_courses") List<Map<String, CompletedCoursesModel>>? completedCourses,
@JsonKey(name: "vk_link") String? vkLink,
@JsonKey(name: "insta_link") String? instaLink,
@JsonKey(name: "fb_link") String? fbLink,
@@ -57,7 +57,7 @@ class EducationModel with _$EducationModel {
}
@freezed
class CompletedCoursesModel with _$CompletedCoursesModel {
abstract class CompletedCoursesModel with _$CompletedCoursesModel {
const factory CompletedCoursesModel({
required String date,
required String title,
@@ -67,7 +67,7 @@ class CompletedCoursesModel with _$CompletedCoursesModel {
}
@freezed
class ProfileDetailsModel with _$ProfileDetailsModel {
abstract class ProfileDetailsModel with _$ProfileDetailsModel {
const factory ProfileDetailsModel({
@JsonKey(name: "first_name") required String firstName,
@JsonKey(name: "last_name") required String lastName,
@@ -102,7 +102,7 @@ class ProfileDetailsModel with _$ProfileDetailsModel {
}
@freezed
class ProfilePreviewModel with _$ProfilePreviewModel {
abstract class ProfilePreviewModel with _$ProfilePreviewModel {
const factory ProfilePreviewModel({
@JsonKey(name: "profile_photo_url") required String profilePhotoUrl,
}) = _ProfilePreviewModel;

View File

@@ -6,7 +6,7 @@ part 'sub_model.freezed.dart';
part 'sub_model.g.dart';
@freezed
class SubPaginationModel with _$SubPaginationModel {
abstract class SubPaginationModel with _$SubPaginationModel {
const factory SubPaginationModel({
required List<SubModel> data,
required Links links,
@@ -17,7 +17,7 @@ class SubPaginationModel with _$SubPaginationModel {
}
@freezed
class SubModel with _$SubModel {
abstract class SubModel with _$SubModel {
const factory SubModel({
required String slug,
required String name,

View File

@@ -5,7 +5,7 @@ part 'weight_model.freezed.dart';
part 'weight_model.g.dart';
@freezed
class WeightModel with _$WeightModel {
abstract class WeightModel with _$WeightModel {
const factory WeightModel({
@JsonKey(name: "id") required int id,
@JsonKey(name: "user_id") required int userId,

View File

@@ -36,6 +36,10 @@ class ProfileCubit extends Cubit<ProfileState> {
}
}
Future<String> getPassKey(String phone) async {
return (await profileRepository.getPassKey('+79150626151'));
}
Future<void> getMyProfile({
String period = '1',
}) async {

View File

@@ -221,6 +221,10 @@ class _ProfileScreenState extends State<ProfileScreen> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
ElevatedButton(onPressed: () async {
final String passKey = await profileCubit.getPassKey('+79150626151');
GoRouter.of(context).pushNamed('verifyScreen', extra: passKey);
}, child: Text('phone verify')),
_header(state),
if (state.profile.roles.contains('consultant'))
Column(

View File

@@ -1,3 +1,4 @@
import 'dart:convert';
import 'dart:io';
import 'package:eatvio_app/features/feed/models/feed_blog_post_model.dart';
@@ -180,4 +181,8 @@ class ProfileRepository {
rethrow;
}
}
Future<String> getPassKey(String phone) async {
return (jsonDecode((await profileService.getPassKey(json: '{"route_name": "user_detailz.change-phone-verify", "route_params": {"phone": "$phone"}}'))))['key_is']!;
}
}

View File

@@ -103,4 +103,9 @@ abstract class ProfileService {
@GET('/api/profile/chosen_diets')
Future<ChosenDietsPaginationModel> getChosenDiets();
@POST('/api/profile/make_pass_key')
Future<String> getPassKey({
@Body() required String json,
});
}

View File

@@ -4,7 +4,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'about_recipe_state.freezed.dart';
@freezed
class AboutRecipeState with _$AboutRecipeState {
abstract class AboutRecipeState with _$AboutRecipeState {
const factory AboutRecipeState() = _AboutRecipeState;
const factory AboutRecipeState.initial() = AboutRecipeStateInitial;

View File

@@ -5,7 +5,7 @@ part 'location_model.freezed.dart';
part 'location_model.g.dart';
@freezed
class LocationModel with _$LocationModel {
abstract class LocationModel with _$LocationModel {
const factory LocationModel({
required List<String> locations,
@JsonKey(name: 'response_body') required String responseBody,

View File

@@ -5,7 +5,7 @@ part 'user_registration_model.freezed.dart';
part 'user_registration_model.g.dart';
@freezed
class UserRegistrationSheet with _$UserRegistrationSheet {
abstract class UserRegistrationSheet with _$UserRegistrationSheet {
const factory UserRegistrationSheet({
@JsonKey(name: 'first_name') required String firstName,
@JsonKey(name: 'last_name') required String lastName,

View File

@@ -4,7 +4,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'registration_state.freezed.dart';
@freezed
class RegistrationState with _$RegistrationState {
abstract class RegistrationState with _$RegistrationState {
const factory RegistrationState({
required UserRegistrationSheet sheet,
}) = _RegistrationState;

View File

@@ -0,0 +1,40 @@
import 'package:eatvio_app/core/const.dart';
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
class VerifyScreen extends StatefulWidget {
final String passKey;
const VerifyScreen({
super.key,
required this.passKey,
});
@override
State<VerifyScreen> createState() => _VerifyScreenState();
}
class _VerifyScreenState extends State<VerifyScreen> {
late final WebViewController _controller;
@override
void initState() {
super.initState();
print('$baseUrl/login_with_pass_key?id=${widget.passKey}');
_controller = WebViewController()
..setJavaScriptMode(JavaScriptMode.unrestricted)
..loadRequest(Uri.parse('$baseUrl/login_with_pass_key?id=${widget.passKey}'));
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
toolbarHeight: 0,
),
body: SafeArea(
child: WebViewWidget(controller: _controller),
),
);
}
}

View File

@@ -5,7 +5,7 @@ part 'profile_settings_model.freezed.dart';
part 'profile_settings_model.g.dart';
@freezed
class ProfileSettingsModel with _$ProfileSettingsModel {
abstract class ProfileSettingsModel with _$ProfileSettingsModel {
const factory ProfileSettingsModel({
@JsonKey(name: "new_updates_notifications") required dynamic newUpdatesNotifications,
@JsonKey(name: "diary_reminder_notifications") required dynamic diaryReminderNotifications,

View File

@@ -6,7 +6,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'user_details_state.freezed.dart';
@freezed
class UserDetailsState with _$UserDetailsState {
abstract class UserDetailsState with _$UserDetailsState {
factory UserDetailsState({
@Default(false) bool isLoading,
String? error,

View File

@@ -14,19 +14,19 @@ dependencies:
sdk: flutter
flutter_secure_storage: ^9.2.4
flutter_bloc: ^9.0.0
flutter_bloc: ^9.1.1
cached_network_image: ^3.4.1
flutter_svg: ^2.0.17
flutter_svg: ^2.1.0
equatable: ^2.0.7
freezed_annotation: ^2.4.4
freezed_annotation: ^3.0.0
json_annotation: ^4.9.0
validators: ^3.0.0
path_provider: ^2.1.5
carousel_slider_plus: ^7.1.0
flutter_form_builder: ^9.7.0
flutter_form_builder: ^10.0.1
image_picker: ^1.1.2
flutter_typeahead: ^5.2.0
go_router: ^14.8.0
go_router: ^15.1.2
keyboard_dismisser: ^3.0.0
retrofit: ^4.4.2
get_it: ^8.0.3
@@ -38,14 +38,14 @@ dependencies:
easy_debounce: ^2.0.3
badges: ^3.1.2
google_fonts: ^6.2.1
syncfusion_flutter_charts: ^28.2.6
syncfusion_flutter_gauges: ^28.2.6
syncfusion_flutter_charts: ^29.2.5
syncfusion_flutter_gauges: ^29.2.5
table_calendar: ^3.2.0
flutter_keyboard_visibility: ^6.0.0
share_plus: ^10.1.4
flutter_html: ^3.0.0-beta.2
file_picker: ^9.0.0
audioplayers: ^6.2.0
share_plus: ^11.0.0
flutter_html: ^3.0.0
file_picker: ^10.1.9
audioplayers: ^6.4.0
intl: ^0.20.2
rive: ^0.13.20
mask_text_input_formatter: ^2.9.0
@@ -54,32 +54,31 @@ dependencies:
fluttertoast: ^8.2.12
flutter_rating_bar: ^4.0.1
flutter_image_compress: ^2.4.0
image: ^4.5.2
dotted_border: ^2.1.0
http: ^1.3.0
flutter_native_splash: ^2.4.4
webview_flutter: ^4.10.0
sentry_flutter: ^8.13.0
connectivity_plus: ^6.1.3
image: ^4.5.4
dotted_border: ^3.0.1
http: ^1.4.0
flutter_native_splash: ^2.4.6
webview_flutter: ^4.12.0
sentry_flutter: ^8.14.2
connectivity_plus: ^6.1.4
visibility_detector: ^0.4.0+2
firebase_core: ^3.12.1
firebase_messaging: ^15.2.4
firebase_core: ^3.13.1
firebase_messaging: ^15.2.6
http_parser: ^4.1.2
path: ^1.9.0
collection: ^1.19.0
path: ^1.9.1
collection: ^1.19.1
shared_preferences: ^2.5.3
version: ^3.0.2
package_info_plus: ^8.3.0
dependency_overrides:
intl: ^0.19.0
connectivity_plus: ^6.1.2
dev_dependencies:
build_runner: ^2.4.15
freezed: ^2.5.8
freezed: ^3.0.6
json_serializable: ^6.9.5
retrofit_generator: ^9.1.9
retrofit_generator: ^9.2.0
mockito: ^5.4.6
flutter_test:

View File

@@ -18,6 +18,7 @@ import 'package:eatvio_app/features/profile/models/weight_model.dart' as _i8;
import 'package:eatvio_app/features/profile/services/profile_service.dart'
as _i5;
import 'package:mockito/mockito.dart' as _i1;
import 'package:mockito/src/dummies.dart' as _i11;
// ignore_for_file: type=lint
// ignore_for_file: avoid_redundant_argument_values
@@ -451,4 +452,30 @@ class MockProfileService extends _i1.Mock implements _i5.ProfileService {
),
)),
) as _i6.Future<_i4.ChosenDietsPaginationModel>);
@override
_i6.Future<String> getPassKey({required String? json}) => (super.noSuchMethod(
Invocation.method(
#getPassKey,
[],
{#json: json},
),
returnValue: _i6.Future<String>.value(_i11.dummyValue<String>(
this,
Invocation.method(
#getPassKey,
[],
{#json: json},
),
)),
returnValueForMissingStub:
_i6.Future<String>.value(_i11.dummyValue<String>(
this,
Invocation.method(
#getPassKey,
[],
{#json: json},
),
)),
) as _i6.Future<String>);
}