refactor: profile model

This commit is contained in:
mso7nueh
2024-09-09 18:18:35 +03:00
parent 3ccf5b6d92
commit 8ea819c5bc
77 changed files with 2735 additions and 2950 deletions

View File

@@ -24,8 +24,12 @@ mixin _$Ingredient {
String get unit => throw _privateConstructorUsedError;
String get portion => throw _privateConstructorUsedError;
/// Serializes this Ingredient to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of Ingredient
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$IngredientCopyWith<Ingredient> get copyWith =>
throw _privateConstructorUsedError;
}
@@ -49,6 +53,8 @@ class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of Ingredient
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -92,6 +98,8 @@ class __$$IngredientImplCopyWithImpl<$Res>
_$IngredientImpl _value, $Res Function(_$IngredientImpl) _then)
: super(_value, _then);
/// Create a copy of Ingredient
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -147,11 +155,13 @@ class _$IngredientImpl implements _Ingredient {
(identical(other.portion, portion) || other.portion == portion));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, name, unit, portion);
@JsonKey(ignore: true)
/// Create a copy of Ingredient
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$IngredientImplCopyWith<_$IngredientImpl> get copyWith =>
@@ -180,8 +190,11 @@ abstract class _Ingredient implements Ingredient {
String get unit;
@override
String get portion;
/// Create a copy of Ingredient
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$IngredientImplCopyWith<_$IngredientImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -30,8 +30,12 @@ mixin _$RecipeModel {
String? get image => throw _privateConstructorUsedError;
int? get cooking_time => throw _privateConstructorUsedError;
/// Serializes this RecipeModel to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of RecipeModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$RecipeModelCopyWith<RecipeModel> get copyWith =>
throw _privateConstructorUsedError;
}
@@ -64,6 +68,8 @@ class _$RecipeModelCopyWithImpl<$Res, $Val extends RecipeModel>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of RecipeModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -146,6 +152,8 @@ class __$$RecipeModelImplCopyWithImpl<$Res>
_$RecipeModelImpl _value, $Res Function(_$RecipeModelImpl) _then)
: super(_value, _then);
/// Create a copy of RecipeModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -279,7 +287,7 @@ class _$RecipeModelImpl implements _RecipeModel {
other.cooking_time == cooking_time));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
@@ -293,7 +301,9 @@ class _$RecipeModelImpl implements _RecipeModel {
image,
cooking_time);
@JsonKey(ignore: true)
/// Create a copy of RecipeModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$RecipeModelImplCopyWith<_$RecipeModelImpl> get copyWith =>
@@ -340,8 +350,11 @@ abstract class _RecipeModel implements RecipeModel {
String? get image;
@override
int? get cooking_time;
/// Create a copy of RecipeModel
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$RecipeModelImplCopyWith<_$RecipeModelImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -27,8 +27,12 @@ mixin _$RecipeTagModel {
@JsonKey(name: "meta")
Meta get meta => throw _privateConstructorUsedError;
/// Serializes this RecipeTagModel to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of RecipeTagModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$RecipeTagModelCopyWith<RecipeTagModel> get copyWith =>
throw _privateConstructorUsedError;
}
@@ -58,6 +62,8 @@ class _$RecipeTagModelCopyWithImpl<$Res, $Val extends RecipeTagModel>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of RecipeTagModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -81,6 +87,8 @@ class _$RecipeTagModelCopyWithImpl<$Res, $Val extends RecipeTagModel>
) as $Val);
}
/// Create a copy of RecipeTagModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$LinksCopyWith<$Res> get links {
@@ -89,6 +97,8 @@ class _$RecipeTagModelCopyWithImpl<$Res, $Val extends RecipeTagModel>
});
}
/// Create a copy of RecipeTagModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$MetaCopyWith<$Res> get meta {
@@ -125,6 +135,8 @@ class __$$RecipeTagModelImplCopyWithImpl<$Res>
_$RecipeTagModelImpl _value, $Res Function(_$RecipeTagModelImpl) _then)
: super(_value, _then);
/// Create a copy of RecipeTagModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -192,12 +204,14 @@ class _$RecipeTagModelImpl implements _RecipeTagModel {
(identical(other.meta, meta) || other.meta == meta));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType, const DeepCollectionEquality().hash(_data), links, meta);
@JsonKey(ignore: true)
/// Create a copy of RecipeTagModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$RecipeTagModelImplCopyWith<_$RecipeTagModelImpl> get copyWith =>
@@ -230,8 +244,11 @@ abstract class _RecipeTagModel implements RecipeTagModel {
@override
@JsonKey(name: "meta")
Meta get meta;
/// Create a copy of RecipeTagModel
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$RecipeTagModelImplCopyWith<_$RecipeTagModelImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@@ -253,8 +270,12 @@ mixin _$RecipeTag {
@JsonKey(name: "updated_at")
DateTime get updatedAt => throw _privateConstructorUsedError;
/// Serializes this RecipeTag to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of RecipeTag
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$RecipeTagCopyWith<RecipeTag> get copyWith =>
throw _privateConstructorUsedError;
}
@@ -282,6 +303,8 @@ class _$RecipeTagCopyWithImpl<$Res, $Val extends RecipeTag>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of RecipeTag
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -340,6 +363,8 @@ class __$$RecipeTagImplCopyWithImpl<$Res>
_$RecipeTagImpl _value, $Res Function(_$RecipeTagImpl) _then)
: super(_value, _then);
/// Create a copy of RecipeTag
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -423,12 +448,14 @@ class _$RecipeTagImpl implements _RecipeTag {
other.updatedAt == updatedAt));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode =>
Object.hash(runtimeType, id, name, recipesCount, createdAt, updatedAt);
@JsonKey(ignore: true)
/// Create a copy of RecipeTag
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$RecipeTagImplCopyWith<_$RecipeTagImpl> get copyWith =>
@@ -469,8 +496,11 @@ abstract class _RecipeTag implements RecipeTag {
@override
@JsonKey(name: "updated_at")
DateTime get updatedAt;
/// Create a copy of RecipeTag
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$RecipeTagImplCopyWith<_$RecipeTagImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -23,8 +23,12 @@ mixin _$Step {
String? get image => throw _privateConstructorUsedError;
String? get description => throw _privateConstructorUsedError;
/// Serializes this Step to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of Step
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$StepCopyWith<Step> get copyWith => throw _privateConstructorUsedError;
}
@@ -46,6 +50,8 @@ class _$StepCopyWithImpl<$Res, $Val extends Step>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of Step
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -82,6 +88,8 @@ class __$$StepImplCopyWithImpl<$Res>
__$$StepImplCopyWithImpl(_$StepImpl _value, $Res Function(_$StepImpl) _then)
: super(_value, _then);
/// Create a copy of Step
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -129,11 +137,13 @@ class _$StepImpl implements _Step {
other.description == description));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, image, description);
@JsonKey(ignore: true)
/// Create a copy of Step
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$StepImplCopyWith<_$StepImpl> get copyWith =>
@@ -157,8 +167,11 @@ abstract class _Step implements Step {
String? get image;
@override
String? get description;
/// Create a copy of Step
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$StepImplCopyWith<_$StepImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -147,6 +147,9 @@ class _$RecipeCreateStateCopyWithImpl<$Res, $Val extends RecipeCreateState>
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of RecipeCreateState
/// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@@ -163,6 +166,9 @@ class __$$RecipeCreateStateImplCopyWithImpl<$Res>
__$$RecipeCreateStateImplCopyWithImpl(_$RecipeCreateStateImpl _value,
$Res Function(_$RecipeCreateStateImpl) _then)
: super(_value, _then);
/// Create a copy of RecipeCreateState
/// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@@ -343,6 +349,9 @@ class __$$RecipeCreateStateLoadingImplCopyWithImpl<$Res>
_$RecipeCreateStateLoadingImpl _value,
$Res Function(_$RecipeCreateStateLoadingImpl) _then)
: super(_value, _then);
/// Create a copy of RecipeCreateState
/// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@@ -551,6 +560,8 @@ class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res>
$Res Function(_$RecipeCreateStateLoadedImpl) _then)
: super(_value, _then);
/// Create a copy of RecipeCreateState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -659,6 +670,8 @@ class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res>
));
}
/// Create a copy of RecipeCreateState
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$RecipeModelCopyWith<$Res>? get recipe {
@@ -671,6 +684,8 @@ class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res>
});
}
/// Create a copy of RecipeCreateState
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$SelectionPopupModelCopyWith<$Res> get selectedType {
@@ -679,6 +694,8 @@ class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res>
});
}
/// Create a copy of RecipeCreateState
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$SelectionPopupModelCopyWith<$Res> get selectedCookingTime {
@@ -688,6 +705,8 @@ class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res>
});
}
/// Create a copy of RecipeCreateState
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$SelectionPopupModelCopyWith<$Res> get selectedStatus {
@@ -887,7 +906,9 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded {
selectedStatus
]);
@JsonKey(ignore: true)
/// Create a copy of RecipeCreateState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$RecipeCreateStateLoadedImplCopyWith<_$RecipeCreateStateLoadedImpl>
@@ -1136,7 +1157,10 @@ abstract class RecipeCreateStateLoaded implements RecipeCreateState {
SelectionPopupModel get selectedType;
SelectionPopupModel get selectedCookingTime;
SelectionPopupModel get selectedStatus;
@JsonKey(ignore: true)
/// Create a copy of RecipeCreateState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
_$$RecipeCreateStateLoadedImplCopyWith<_$RecipeCreateStateLoadedImpl>
get copyWith => throw _privateConstructorUsedError;
}
@@ -1160,6 +1184,8 @@ class __$$RecipeCreateStateErrorImplCopyWithImpl<$Res>
$Res Function(_$RecipeCreateStateErrorImpl) _then)
: super(_value, _then);
/// Create a copy of RecipeCreateState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -1199,7 +1225,9 @@ class _$RecipeCreateStateErrorImpl implements RecipeCreateStateError {
@override
int get hashCode => Object.hash(runtimeType, errorMessage);
@JsonKey(ignore: true)
/// Create a copy of RecipeCreateState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$RecipeCreateStateErrorImplCopyWith<_$RecipeCreateStateErrorImpl>
@@ -1349,7 +1377,10 @@ abstract class RecipeCreateStateError implements RecipeCreateState {
_$RecipeCreateStateErrorImpl;
String get errorMessage;
@JsonKey(ignore: true)
/// Create a copy of RecipeCreateState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
_$$RecipeCreateStateErrorImplCopyWith<_$RecipeCreateStateErrorImpl>
get copyWith => throw _privateConstructorUsedError;
}

View File

@@ -7,7 +7,6 @@ import 'package:eatvio_app/features/feed/presentation/bloc/comments_cubit/commen
import 'package:eatvio_app/features/feed/presentation/bloc/comments_cubit/comments_state.dart';
import 'package:eatvio_app/features/feed/presentation/widgets/comments_widget.dart';
import 'package:eatvio_app/locator_service.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
@@ -345,7 +344,7 @@ class _AboutRecipesScreenState extends State<AboutRecipesScreen> {
if (state is CommentsStateLoading)
Padding(
padding: const EdgeInsets.all(32),
child: CupertinoActivityIndicator(),
child: CircularProgressIndicator(),
),
if (state is CommentsStateLoaded)
CommentsWidget(

View File

@@ -10,7 +10,6 @@ import 'package:eatvio_app/features/recipes/presentation/bloc/recipe_create_stat
import 'package:eatvio_app/widgets/custom_drop_down.dart';
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/services.dart';
import 'package:image_picker/image_picker.dart';
@@ -26,7 +25,7 @@ class RecipeCreateScreen extends StatelessWidget {
} else if (state is RecipeCreateStateLoading) {
return Scaffold(
body: Center(
child: CupertinoActivityIndicator(),
child: CircularProgressIndicator(),
),
);
} else if (state is RecipeCreateStateError) {

View File

@@ -8,7 +8,6 @@ import 'package:eatvio_app/features/recipes/presentation/bloc/recipe_create_stat
import 'package:eatvio_app/widgets/custom_drop_down.dart';
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/services.dart';
import 'package:image_picker/image_picker.dart';
@@ -30,7 +29,7 @@ class RecipeEditScreen extends StatelessWidget {
} else if (state is RecipeCreateStateLoading) {
return Scaffold(
body: Center(
child: CupertinoActivityIndicator(),
child: CircularProgressIndicator(),
),
);
} else if (state is RecipeCreateStateError) {