feat(order info): added order info screen

This commit is contained in:
Username1548
2025-04-04 20:21:31 +07:00
parent 9715f4cac9
commit 748484cf8f
387 changed files with 16171 additions and 18199 deletions

View File

@@ -12,8 +12,7 @@ part of 'badge_model.dart';
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',
);
'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');
BadgeModel _$BadgeModelFromJson(Map<String, dynamic> json) {
return _BadgeModel.fromJson(json);
@@ -40,17 +39,11 @@ mixin _$BadgeModel {
/// @nodoc
abstract class $BadgeModelCopyWith<$Res> {
factory $BadgeModelCopyWith(
BadgeModel value,
$Res Function(BadgeModel) then,
) = _$BadgeModelCopyWithImpl<$Res, BadgeModel>;
BadgeModel value, $Res Function(BadgeModel) then) =
_$BadgeModelCopyWithImpl<$Res, BadgeModel>;
@useResult
$Res call({
int id,
String title,
String description,
String image,
String type,
});
$Res call(
{int id, String title, String description, String image, String type});
}
/// @nodoc
@@ -74,36 +67,28 @@ class _$BadgeModelCopyWithImpl<$Res, $Val extends BadgeModel>
Object? image = null,
Object? type = null,
}) {
return _then(
_value.copyWith(
id:
null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
title:
null == title
? _value.title
: title // ignore: cast_nullable_to_non_nullable
as String,
description:
null == description
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String,
image:
null == image
? _value.image
: image // ignore: cast_nullable_to_non_nullable
as String,
type:
null == type
? _value.type
: type // ignore: cast_nullable_to_non_nullable
as String,
)
as $Val,
);
return _then(_value.copyWith(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
title: null == title
? _value.title
: title // ignore: cast_nullable_to_non_nullable
as String,
description: null == description
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String,
image: null == image
? _value.image
: image // ignore: cast_nullable_to_non_nullable
as String,
type: null == type
? _value.type
: type // ignore: cast_nullable_to_non_nullable
as String,
) as $Val);
}
}
@@ -111,18 +96,12 @@ class _$BadgeModelCopyWithImpl<$Res, $Val extends BadgeModel>
abstract class _$$BadgeModelImplCopyWith<$Res>
implements $BadgeModelCopyWith<$Res> {
factory _$$BadgeModelImplCopyWith(
_$BadgeModelImpl value,
$Res Function(_$BadgeModelImpl) then,
) = __$$BadgeModelImplCopyWithImpl<$Res>;
_$BadgeModelImpl value, $Res Function(_$BadgeModelImpl) then) =
__$$BadgeModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
int id,
String title,
String description,
String image,
String type,
});
$Res call(
{int id, String title, String description, String image, String type});
}
/// @nodoc
@@ -130,9 +109,8 @@ class __$$BadgeModelImplCopyWithImpl<$Res>
extends _$BadgeModelCopyWithImpl<$Res, _$BadgeModelImpl>
implements _$$BadgeModelImplCopyWith<$Res> {
__$$BadgeModelImplCopyWithImpl(
_$BadgeModelImpl _value,
$Res Function(_$BadgeModelImpl) _then,
) : super(_value, _then);
_$BadgeModelImpl _value, $Res Function(_$BadgeModelImpl) _then)
: super(_value, _then);
/// Create a copy of BadgeModel
/// with the given fields replaced by the non-null parameter values.
@@ -145,48 +123,40 @@ class __$$BadgeModelImplCopyWithImpl<$Res>
Object? image = null,
Object? type = null,
}) {
return _then(
_$BadgeModelImpl(
id:
null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
title:
null == title
? _value.title
: title // ignore: cast_nullable_to_non_nullable
as String,
description:
null == description
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String,
image:
null == image
? _value.image
: image // ignore: cast_nullable_to_non_nullable
as String,
type:
null == type
? _value.type
: type // ignore: cast_nullable_to_non_nullable
as String,
),
);
return _then(_$BadgeModelImpl(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
title: null == title
? _value.title
: title // ignore: cast_nullable_to_non_nullable
as String,
description: null == description
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String,
image: null == image
? _value.image
: image // ignore: cast_nullable_to_non_nullable
as String,
type: null == type
? _value.type
: type // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// @nodoc
@JsonSerializable()
class _$BadgeModelImpl implements _BadgeModel {
const _$BadgeModelImpl({
required this.id,
required this.title,
required this.description,
required this.image,
required this.type,
});
const _$BadgeModelImpl(
{required this.id,
required this.title,
required this.description,
required this.image,
required this.type});
factory _$BadgeModelImpl.fromJson(Map<String, dynamic> json) =>
_$$BadgeModelImplFromJson(json);
@@ -235,18 +205,19 @@ class _$BadgeModelImpl implements _BadgeModel {
@override
Map<String, dynamic> toJson() {
return _$$BadgeModelImplToJson(this);
return _$$BadgeModelImplToJson(
this,
);
}
}
abstract class _BadgeModel implements BadgeModel {
const factory _BadgeModel({
required final int id,
required final String title,
required final String description,
required final String image,
required final String type,
}) = _$BadgeModelImpl;
const factory _BadgeModel(
{required final int id,
required final String title,
required final String description,
required final String image,
required final String type}) = _$BadgeModelImpl;
factory _BadgeModel.fromJson(Map<String, dynamic> json) =
_$BadgeModelImpl.fromJson;

View File

@@ -12,12 +12,10 @@ part of 'chosen_diets_pagination_model.dart';
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',
);
'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');
ChosenDietsPaginationModel _$ChosenDietsPaginationModelFromJson(
Map<String, dynamic> json,
) {
Map<String, dynamic> json) {
return _ChosenDietsPaginationModel.fromJson(json);
}
@@ -33,28 +31,22 @@ mixin _$ChosenDietsPaginationModel {
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$ChosenDietsPaginationModelCopyWith<ChosenDietsPaginationModel>
get copyWith => throw _privateConstructorUsedError;
get copyWith => throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $ChosenDietsPaginationModelCopyWith<$Res> {
factory $ChosenDietsPaginationModelCopyWith(
ChosenDietsPaginationModel value,
$Res Function(ChosenDietsPaginationModel) then,
) =
_$ChosenDietsPaginationModelCopyWithImpl<
$Res,
ChosenDietsPaginationModel
>;
factory $ChosenDietsPaginationModelCopyWith(ChosenDietsPaginationModel value,
$Res Function(ChosenDietsPaginationModel) then) =
_$ChosenDietsPaginationModelCopyWithImpl<$Res,
ChosenDietsPaginationModel>;
@useResult
$Res call({@JsonKey(name: 'data') List<ChosenDietModel> diets});
}
/// @nodoc
class _$ChosenDietsPaginationModelCopyWithImpl<
$Res,
$Val extends ChosenDietsPaginationModel
>
class _$ChosenDietsPaginationModelCopyWithImpl<$Res,
$Val extends ChosenDietsPaginationModel>
implements $ChosenDietsPaginationModelCopyWith<$Res> {
_$ChosenDietsPaginationModelCopyWithImpl(this._value, this._then);
@@ -67,17 +59,15 @@ class _$ChosenDietsPaginationModelCopyWithImpl<
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? diets = null}) {
return _then(
_value.copyWith(
diets:
null == diets
? _value.diets
: diets // ignore: cast_nullable_to_non_nullable
as List<ChosenDietModel>,
)
as $Val,
);
$Res call({
Object? diets = null,
}) {
return _then(_value.copyWith(
diets: null == diets
? _value.diets
: diets // ignore: cast_nullable_to_non_nullable
as List<ChosenDietModel>,
) as $Val);
}
}
@@ -85,9 +75,9 @@ class _$ChosenDietsPaginationModelCopyWithImpl<
abstract class _$$ChosenDietsPaginationModelImplCopyWith<$Res>
implements $ChosenDietsPaginationModelCopyWith<$Res> {
factory _$$ChosenDietsPaginationModelImplCopyWith(
_$ChosenDietsPaginationModelImpl value,
$Res Function(_$ChosenDietsPaginationModelImpl) then,
) = __$$ChosenDietsPaginationModelImplCopyWithImpl<$Res>;
_$ChosenDietsPaginationModelImpl value,
$Res Function(_$ChosenDietsPaginationModelImpl) then) =
__$$ChosenDietsPaginationModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({@JsonKey(name: 'data') List<ChosenDietModel> diets});
@@ -95,44 +85,40 @@ abstract class _$$ChosenDietsPaginationModelImplCopyWith<$Res>
/// @nodoc
class __$$ChosenDietsPaginationModelImplCopyWithImpl<$Res>
extends
_$ChosenDietsPaginationModelCopyWithImpl<
$Res,
_$ChosenDietsPaginationModelImpl
>
extends _$ChosenDietsPaginationModelCopyWithImpl<$Res,
_$ChosenDietsPaginationModelImpl>
implements _$$ChosenDietsPaginationModelImplCopyWith<$Res> {
__$$ChosenDietsPaginationModelImplCopyWithImpl(
_$ChosenDietsPaginationModelImpl _value,
$Res Function(_$ChosenDietsPaginationModelImpl) _then,
) : super(_value, _then);
_$ChosenDietsPaginationModelImpl _value,
$Res Function(_$ChosenDietsPaginationModelImpl) _then)
: super(_value, _then);
/// Create a copy of ChosenDietsPaginationModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? diets = null}) {
return _then(
_$ChosenDietsPaginationModelImpl(
diets:
null == diets
? _value._diets
: diets // ignore: cast_nullable_to_non_nullable
as List<ChosenDietModel>,
),
);
$Res call({
Object? diets = null,
}) {
return _then(_$ChosenDietsPaginationModelImpl(
diets: null == diets
? _value._diets
: diets // ignore: cast_nullable_to_non_nullable
as List<ChosenDietModel>,
));
}
}
/// @nodoc
@JsonSerializable()
class _$ChosenDietsPaginationModelImpl implements _ChosenDietsPaginationModel {
_$ChosenDietsPaginationModelImpl({
@JsonKey(name: 'data') required final List<ChosenDietModel> diets,
}) : _diets = diets;
_$ChosenDietsPaginationModelImpl(
{@JsonKey(name: 'data') required final List<ChosenDietModel> diets})
: _diets = diets;
factory _$ChosenDietsPaginationModelImpl.fromJson(
Map<String, dynamic> json,
) => _$$ChosenDietsPaginationModelImplFromJson(json);
Map<String, dynamic> json) =>
_$$ChosenDietsPaginationModelImplFromJson(json);
final List<ChosenDietModel> _diets;
@override
@@ -167,21 +153,22 @@ class _$ChosenDietsPaginationModelImpl implements _ChosenDietsPaginationModel {
@override
@pragma('vm:prefer-inline')
_$$ChosenDietsPaginationModelImplCopyWith<_$ChosenDietsPaginationModelImpl>
get copyWith => __$$ChosenDietsPaginationModelImplCopyWithImpl<
_$ChosenDietsPaginationModelImpl
>(this, _$identity);
get copyWith => __$$ChosenDietsPaginationModelImplCopyWithImpl<
_$ChosenDietsPaginationModelImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$ChosenDietsPaginationModelImplToJson(this);
return _$$ChosenDietsPaginationModelImplToJson(
this,
);
}
}
abstract class _ChosenDietsPaginationModel
implements ChosenDietsPaginationModel {
factory _ChosenDietsPaginationModel({
@JsonKey(name: 'data') required final List<ChosenDietModel> diets,
}) = _$ChosenDietsPaginationModelImpl;
factory _ChosenDietsPaginationModel(
{@JsonKey(name: 'data') required final List<ChosenDietModel> diets}) =
_$ChosenDietsPaginationModelImpl;
factory _ChosenDietsPaginationModel.fromJson(Map<String, dynamic> json) =
_$ChosenDietsPaginationModelImpl.fromJson;
@@ -195,7 +182,7 @@ abstract class _ChosenDietsPaginationModel
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ChosenDietsPaginationModelImplCopyWith<_$ChosenDietsPaginationModelImpl>
get copyWith => throw _privateConstructorUsedError;
get copyWith => throw _privateConstructorUsedError;
}
ChosenDietModel _$ChosenDietModelFromJson(Map<String, dynamic> json) {
@@ -228,17 +215,15 @@ mixin _$ChosenDietModel {
/// @nodoc
abstract class $ChosenDietModelCopyWith<$Res> {
factory $ChosenDietModelCopyWith(
ChosenDietModel value,
$Res Function(ChosenDietModel) then,
) = _$ChosenDietModelCopyWithImpl<$Res, ChosenDietModel>;
ChosenDietModel value, $Res Function(ChosenDietModel) then) =
_$ChosenDietModelCopyWithImpl<$Res, ChosenDietModel>;
@useResult
$Res call({
@JsonKey(name: 'id') int chosenDietID,
@JsonKey(name: 'chosen_plan_id') int chosenPlanId,
@JsonKey() String state,
@JsonKey(name: 'start_date', fromJson: parseDate) DateTime startDate,
@JsonKey(name: 'diet', fromJson: _parseDietId) int? dietId,
});
$Res call(
{@JsonKey(name: 'id') int chosenDietID,
@JsonKey(name: 'chosen_plan_id') int chosenPlanId,
@JsonKey() String state,
@JsonKey(name: 'start_date', fromJson: parseDate) DateTime startDate,
@JsonKey(name: 'diet', fromJson: _parseDietId) int? dietId});
}
/// @nodoc
@@ -262,55 +247,45 @@ class _$ChosenDietModelCopyWithImpl<$Res, $Val extends ChosenDietModel>
Object? startDate = null,
Object? dietId = freezed,
}) {
return _then(
_value.copyWith(
chosenDietID:
null == chosenDietID
? _value.chosenDietID
: chosenDietID // ignore: cast_nullable_to_non_nullable
as int,
chosenPlanId:
null == chosenPlanId
? _value.chosenPlanId
: chosenPlanId // ignore: cast_nullable_to_non_nullable
as int,
state:
null == state
? _value.state
: state // ignore: cast_nullable_to_non_nullable
as String,
startDate:
null == startDate
? _value.startDate
: startDate // ignore: cast_nullable_to_non_nullable
as DateTime,
dietId:
freezed == dietId
? _value.dietId
: dietId // ignore: cast_nullable_to_non_nullable
as int?,
)
as $Val,
);
return _then(_value.copyWith(
chosenDietID: null == chosenDietID
? _value.chosenDietID
: chosenDietID // ignore: cast_nullable_to_non_nullable
as int,
chosenPlanId: null == chosenPlanId
? _value.chosenPlanId
: chosenPlanId // ignore: cast_nullable_to_non_nullable
as int,
state: null == state
? _value.state
: state // ignore: cast_nullable_to_non_nullable
as String,
startDate: null == startDate
? _value.startDate
: startDate // ignore: cast_nullable_to_non_nullable
as DateTime,
dietId: freezed == dietId
? _value.dietId
: dietId // ignore: cast_nullable_to_non_nullable
as int?,
) as $Val);
}
}
/// @nodoc
abstract class _$$ChosenDietModelImplCopyWith<$Res>
implements $ChosenDietModelCopyWith<$Res> {
factory _$$ChosenDietModelImplCopyWith(
_$ChosenDietModelImpl value,
$Res Function(_$ChosenDietModelImpl) then,
) = __$$ChosenDietModelImplCopyWithImpl<$Res>;
factory _$$ChosenDietModelImplCopyWith(_$ChosenDietModelImpl value,
$Res Function(_$ChosenDietModelImpl) then) =
__$$ChosenDietModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
@JsonKey(name: 'id') int chosenDietID,
@JsonKey(name: 'chosen_plan_id') int chosenPlanId,
@JsonKey() String state,
@JsonKey(name: 'start_date', fromJson: parseDate) DateTime startDate,
@JsonKey(name: 'diet', fromJson: _parseDietId) int? dietId,
});
$Res call(
{@JsonKey(name: 'id') int chosenDietID,
@JsonKey(name: 'chosen_plan_id') int chosenPlanId,
@JsonKey() String state,
@JsonKey(name: 'start_date', fromJson: parseDate) DateTime startDate,
@JsonKey(name: 'diet', fromJson: _parseDietId) int? dietId});
}
/// @nodoc
@@ -318,9 +293,8 @@ class __$$ChosenDietModelImplCopyWithImpl<$Res>
extends _$ChosenDietModelCopyWithImpl<$Res, _$ChosenDietModelImpl>
implements _$$ChosenDietModelImplCopyWith<$Res> {
__$$ChosenDietModelImplCopyWithImpl(
_$ChosenDietModelImpl _value,
$Res Function(_$ChosenDietModelImpl) _then,
) : super(_value, _then);
_$ChosenDietModelImpl _value, $Res Function(_$ChosenDietModelImpl) _then)
: super(_value, _then);
/// Create a copy of ChosenDietModel
/// with the given fields replaced by the non-null parameter values.
@@ -333,48 +307,40 @@ class __$$ChosenDietModelImplCopyWithImpl<$Res>
Object? startDate = null,
Object? dietId = freezed,
}) {
return _then(
_$ChosenDietModelImpl(
chosenDietID:
null == chosenDietID
? _value.chosenDietID
: chosenDietID // ignore: cast_nullable_to_non_nullable
as int,
chosenPlanId:
null == chosenPlanId
? _value.chosenPlanId
: chosenPlanId // ignore: cast_nullable_to_non_nullable
as int,
state:
null == state
? _value.state
: state // ignore: cast_nullable_to_non_nullable
as String,
startDate:
null == startDate
? _value.startDate
: startDate // ignore: cast_nullable_to_non_nullable
as DateTime,
dietId:
freezed == dietId
? _value.dietId
: dietId // ignore: cast_nullable_to_non_nullable
as int?,
),
);
return _then(_$ChosenDietModelImpl(
chosenDietID: null == chosenDietID
? _value.chosenDietID
: chosenDietID // ignore: cast_nullable_to_non_nullable
as int,
chosenPlanId: null == chosenPlanId
? _value.chosenPlanId
: chosenPlanId // ignore: cast_nullable_to_non_nullable
as int,
state: null == state
? _value.state
: state // ignore: cast_nullable_to_non_nullable
as String,
startDate: null == startDate
? _value.startDate
: startDate // ignore: cast_nullable_to_non_nullable
as DateTime,
dietId: freezed == dietId
? _value.dietId
: dietId // ignore: cast_nullable_to_non_nullable
as int?,
));
}
}
/// @nodoc
@JsonSerializable()
class _$ChosenDietModelImpl implements _ChosenDietModel {
_$ChosenDietModelImpl({
@JsonKey(name: 'id') required this.chosenDietID,
@JsonKey(name: 'chosen_plan_id') required this.chosenPlanId,
@JsonKey() required this.state,
@JsonKey(name: 'start_date', fromJson: parseDate) required this.startDate,
@JsonKey(name: 'diet', fromJson: _parseDietId) required this.dietId,
});
_$ChosenDietModelImpl(
{@JsonKey(name: 'id') required this.chosenDietID,
@JsonKey(name: 'chosen_plan_id') required this.chosenPlanId,
@JsonKey() required this.state,
@JsonKey(name: 'start_date', fromJson: parseDate) required this.startDate,
@JsonKey(name: 'diet', fromJson: _parseDietId) required this.dietId});
factory _$ChosenDietModelImpl.fromJson(Map<String, dynamic> json) =>
_$$ChosenDietModelImplFromJson(json);
@@ -418,13 +384,7 @@ class _$ChosenDietModelImpl implements _ChosenDietModel {
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
chosenDietID,
chosenPlanId,
state,
startDate,
dietId,
);
runtimeType, chosenDietID, chosenPlanId, state, startDate, dietId);
/// Create a copy of ChosenDietModel
/// with the given fields replaced by the non-null parameter values.
@@ -433,25 +393,25 @@ class _$ChosenDietModelImpl implements _ChosenDietModel {
@pragma('vm:prefer-inline')
_$$ChosenDietModelImplCopyWith<_$ChosenDietModelImpl> get copyWith =>
__$$ChosenDietModelImplCopyWithImpl<_$ChosenDietModelImpl>(
this,
_$identity,
);
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$ChosenDietModelImplToJson(this);
return _$$ChosenDietModelImplToJson(
this,
);
}
}
abstract class _ChosenDietModel implements ChosenDietModel {
factory _ChosenDietModel({
@JsonKey(name: 'id') required final int chosenDietID,
@JsonKey(name: 'chosen_plan_id') required final int chosenPlanId,
@JsonKey() required final String state,
@JsonKey(name: 'start_date', fromJson: parseDate)
required final DateTime startDate,
@JsonKey(name: 'diet', fromJson: _parseDietId) required final int? dietId,
}) = _$ChosenDietModelImpl;
factory _ChosenDietModel(
{@JsonKey(name: 'id') required final int chosenDietID,
@JsonKey(name: 'chosen_plan_id') required final int chosenPlanId,
@JsonKey() required final String state,
@JsonKey(name: 'start_date', fromJson: parseDate)
required final DateTime startDate,
@JsonKey(name: 'diet', fromJson: _parseDietId)
required final int? dietId}) = _$ChosenDietModelImpl;
factory _ChosenDietModel.fromJson(Map<String, dynamic> json) =
_$ChosenDietModelImpl.fromJson;

View File

@@ -7,34 +7,35 @@ part of 'chosen_diets_pagination_model.dart';
// **************************************************************************
_$ChosenDietsPaginationModelImpl _$$ChosenDietsPaginationModelImplFromJson(
Map<String, dynamic> json,
) => _$ChosenDietsPaginationModelImpl(
diets:
(json['data'] as List<dynamic>)
Map<String, dynamic> json) =>
_$ChosenDietsPaginationModelImpl(
diets: (json['data'] as List<dynamic>)
.map((e) => ChosenDietModel.fromJson(e as Map<String, dynamic>))
.toList(),
);
);
Map<String, dynamic> _$$ChosenDietsPaginationModelImplToJson(
_$ChosenDietsPaginationModelImpl instance,
) => <String, dynamic>{'data': instance.diets};
_$ChosenDietsPaginationModelImpl instance) =>
<String, dynamic>{
'data': instance.diets,
};
_$ChosenDietModelImpl _$$ChosenDietModelImplFromJson(
Map<String, dynamic> json,
) => _$ChosenDietModelImpl(
chosenDietID: (json['id'] as num).toInt(),
chosenPlanId: (json['chosen_plan_id'] as num).toInt(),
state: json['state'] as String,
startDate: parseDate(json['start_date'] as String),
dietId: _parseDietId(json['diet']),
);
Map<String, dynamic> json) =>
_$ChosenDietModelImpl(
chosenDietID: (json['id'] as num).toInt(),
chosenPlanId: (json['chosen_plan_id'] as num).toInt(),
state: json['state'] as String,
startDate: parseDate(json['start_date'] as String),
dietId: _parseDietId(json['diet']),
);
Map<String, dynamic> _$$ChosenDietModelImplToJson(
_$ChosenDietModelImpl instance,
) => <String, dynamic>{
'id': instance.chosenDietID,
'chosen_plan_id': instance.chosenPlanId,
'state': instance.state,
'start_date': instance.startDate.toIso8601String(),
'diet': instance.dietId,
};
_$ChosenDietModelImpl instance) =>
<String, dynamic>{
'id': instance.chosenDietID,
'chosen_plan_id': instance.chosenPlanId,
'state': instance.state,
'start_date': instance.startDate.toIso8601String(),
'diet': instance.dietId,
};

View File

@@ -12,8 +12,7 @@ part of 'circumference_model.dart';
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',
);
'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');
CircumferenceModel _$CircumferenceModelFromJson(Map<String, dynamic> json) {
return _CircumferenceModel.fromJson(json);
@@ -49,19 +48,17 @@ mixin _$CircumferenceModel {
/// @nodoc
abstract class $CircumferenceModelCopyWith<$Res> {
factory $CircumferenceModelCopyWith(
CircumferenceModel value,
$Res Function(CircumferenceModel) then,
) = _$CircumferenceModelCopyWithImpl<$Res, CircumferenceModel>;
CircumferenceModel value, $Res Function(CircumferenceModel) then) =
_$CircumferenceModelCopyWithImpl<$Res, CircumferenceModel>;
@useResult
$Res call({
@JsonKey(name: "id") int id,
@JsonKey(name: "user_id") int userId,
@JsonKey(name: "chest_circumference") int chestCircumference,
@JsonKey(name: "waist_circumference") int waistCircumference,
@JsonKey(name: "hip_circumference") int hipCircumference,
@JsonKey(name: "created_at") DateTime createdAt,
@JsonKey(name: "updated_at") DateTime updatedAt,
});
$Res call(
{@JsonKey(name: "id") int id,
@JsonKey(name: "user_id") int userId,
@JsonKey(name: "chest_circumference") int chestCircumference,
@JsonKey(name: "waist_circumference") int waistCircumference,
@JsonKey(name: "hip_circumference") int hipCircumference,
@JsonKey(name: "created_at") DateTime createdAt,
@JsonKey(name: "updated_at") DateTime updatedAt});
}
/// @nodoc
@@ -87,77 +84,64 @@ class _$CircumferenceModelCopyWithImpl<$Res, $Val extends CircumferenceModel>
Object? createdAt = null,
Object? updatedAt = null,
}) {
return _then(
_value.copyWith(
id:
null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
userId:
null == userId
? _value.userId
: userId // ignore: cast_nullable_to_non_nullable
as int,
chestCircumference:
null == chestCircumference
? _value.chestCircumference
: chestCircumference // ignore: cast_nullable_to_non_nullable
as int,
waistCircumference:
null == waistCircumference
? _value.waistCircumference
: waistCircumference // ignore: cast_nullable_to_non_nullable
as int,
hipCircumference:
null == hipCircumference
? _value.hipCircumference
: hipCircumference // ignore: cast_nullable_to_non_nullable
as int,
createdAt:
null == createdAt
? _value.createdAt
: createdAt // ignore: cast_nullable_to_non_nullable
as DateTime,
updatedAt:
null == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
)
as $Val,
);
return _then(_value.copyWith(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
userId: null == userId
? _value.userId
: userId // ignore: cast_nullable_to_non_nullable
as int,
chestCircumference: null == chestCircumference
? _value.chestCircumference
: chestCircumference // ignore: cast_nullable_to_non_nullable
as int,
waistCircumference: null == waistCircumference
? _value.waistCircumference
: waistCircumference // ignore: cast_nullable_to_non_nullable
as int,
hipCircumference: null == hipCircumference
? _value.hipCircumference
: hipCircumference // ignore: cast_nullable_to_non_nullable
as int,
createdAt: null == createdAt
? _value.createdAt
: createdAt // ignore: cast_nullable_to_non_nullable
as DateTime,
updatedAt: null == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
) as $Val);
}
}
/// @nodoc
abstract class _$$CircumferenceModelImplCopyWith<$Res>
implements $CircumferenceModelCopyWith<$Res> {
factory _$$CircumferenceModelImplCopyWith(
_$CircumferenceModelImpl value,
$Res Function(_$CircumferenceModelImpl) then,
) = __$$CircumferenceModelImplCopyWithImpl<$Res>;
factory _$$CircumferenceModelImplCopyWith(_$CircumferenceModelImpl value,
$Res Function(_$CircumferenceModelImpl) then) =
__$$CircumferenceModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
@JsonKey(name: "id") int id,
@JsonKey(name: "user_id") int userId,
@JsonKey(name: "chest_circumference") int chestCircumference,
@JsonKey(name: "waist_circumference") int waistCircumference,
@JsonKey(name: "hip_circumference") int hipCircumference,
@JsonKey(name: "created_at") DateTime createdAt,
@JsonKey(name: "updated_at") DateTime updatedAt,
});
$Res call(
{@JsonKey(name: "id") int id,
@JsonKey(name: "user_id") int userId,
@JsonKey(name: "chest_circumference") int chestCircumference,
@JsonKey(name: "waist_circumference") int waistCircumference,
@JsonKey(name: "hip_circumference") int hipCircumference,
@JsonKey(name: "created_at") DateTime createdAt,
@JsonKey(name: "updated_at") DateTime updatedAt});
}
/// @nodoc
class __$$CircumferenceModelImplCopyWithImpl<$Res>
extends _$CircumferenceModelCopyWithImpl<$Res, _$CircumferenceModelImpl>
implements _$$CircumferenceModelImplCopyWith<$Res> {
__$$CircumferenceModelImplCopyWithImpl(
_$CircumferenceModelImpl _value,
$Res Function(_$CircumferenceModelImpl) _then,
) : super(_value, _then);
__$$CircumferenceModelImplCopyWithImpl(_$CircumferenceModelImpl _value,
$Res Function(_$CircumferenceModelImpl) _then)
: super(_value, _then);
/// Create a copy of CircumferenceModel
/// with the given fields replaced by the non-null parameter values.
@@ -172,60 +156,50 @@ class __$$CircumferenceModelImplCopyWithImpl<$Res>
Object? createdAt = null,
Object? updatedAt = null,
}) {
return _then(
_$CircumferenceModelImpl(
id:
null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
userId:
null == userId
? _value.userId
: userId // ignore: cast_nullable_to_non_nullable
as int,
chestCircumference:
null == chestCircumference
? _value.chestCircumference
: chestCircumference // ignore: cast_nullable_to_non_nullable
as int,
waistCircumference:
null == waistCircumference
? _value.waistCircumference
: waistCircumference // ignore: cast_nullable_to_non_nullable
as int,
hipCircumference:
null == hipCircumference
? _value.hipCircumference
: hipCircumference // ignore: cast_nullable_to_non_nullable
as int,
createdAt:
null == createdAt
? _value.createdAt
: createdAt // ignore: cast_nullable_to_non_nullable
as DateTime,
updatedAt:
null == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
),
);
return _then(_$CircumferenceModelImpl(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
userId: null == userId
? _value.userId
: userId // ignore: cast_nullable_to_non_nullable
as int,
chestCircumference: null == chestCircumference
? _value.chestCircumference
: chestCircumference // ignore: cast_nullable_to_non_nullable
as int,
waistCircumference: null == waistCircumference
? _value.waistCircumference
: waistCircumference // ignore: cast_nullable_to_non_nullable
as int,
hipCircumference: null == hipCircumference
? _value.hipCircumference
: hipCircumference // ignore: cast_nullable_to_non_nullable
as int,
createdAt: null == createdAt
? _value.createdAt
: createdAt // ignore: cast_nullable_to_non_nullable
as DateTime,
updatedAt: null == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
));
}
}
/// @nodoc
@JsonSerializable()
class _$CircumferenceModelImpl implements _CircumferenceModel {
const _$CircumferenceModelImpl({
@JsonKey(name: "id") required this.id,
@JsonKey(name: "user_id") required this.userId,
@JsonKey(name: "chest_circumference") required this.chestCircumference,
@JsonKey(name: "waist_circumference") required this.waistCircumference,
@JsonKey(name: "hip_circumference") required this.hipCircumference,
@JsonKey(name: "created_at") required this.createdAt,
@JsonKey(name: "updated_at") required this.updatedAt,
});
const _$CircumferenceModelImpl(
{@JsonKey(name: "id") required this.id,
@JsonKey(name: "user_id") required this.userId,
@JsonKey(name: "chest_circumference") required this.chestCircumference,
@JsonKey(name: "waist_circumference") required this.waistCircumference,
@JsonKey(name: "hip_circumference") required this.hipCircumference,
@JsonKey(name: "created_at") required this.createdAt,
@JsonKey(name: "updated_at") required this.updatedAt});
factory _$CircumferenceModelImpl.fromJson(Map<String, dynamic> json) =>
_$$CircumferenceModelImplFromJson(json);
@@ -278,16 +252,8 @@ class _$CircumferenceModelImpl implements _CircumferenceModel {
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
id,
userId,
chestCircumference,
waistCircumference,
hipCircumference,
createdAt,
updatedAt,
);
int get hashCode => Object.hash(runtimeType, id, userId, chestCircumference,
waistCircumference, hipCircumference, createdAt, updatedAt);
/// Create a copy of CircumferenceModel
/// with the given fields replaced by the non-null parameter values.
@@ -296,26 +262,28 @@ class _$CircumferenceModelImpl implements _CircumferenceModel {
@pragma('vm:prefer-inline')
_$$CircumferenceModelImplCopyWith<_$CircumferenceModelImpl> get copyWith =>
__$$CircumferenceModelImplCopyWithImpl<_$CircumferenceModelImpl>(
this,
_$identity,
);
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$CircumferenceModelImplToJson(this);
return _$$CircumferenceModelImplToJson(
this,
);
}
}
abstract class _CircumferenceModel implements CircumferenceModel {
const factory _CircumferenceModel({
@JsonKey(name: "id") required final int id,
@JsonKey(name: "user_id") required final int userId,
@JsonKey(name: "chest_circumference") required final int chestCircumference,
@JsonKey(name: "waist_circumference") required final int waistCircumference,
@JsonKey(name: "hip_circumference") required final int hipCircumference,
@JsonKey(name: "created_at") required final DateTime createdAt,
@JsonKey(name: "updated_at") required final DateTime updatedAt,
}) = _$CircumferenceModelImpl;
const factory _CircumferenceModel(
{@JsonKey(name: "id") required final int id,
@JsonKey(name: "user_id") required final int userId,
@JsonKey(name: "chest_circumference")
required final int chestCircumference,
@JsonKey(name: "waist_circumference")
required final int waistCircumference,
@JsonKey(name: "hip_circumference") required final int hipCircumference,
@JsonKey(name: "created_at") required final DateTime createdAt,
@JsonKey(name: "updated_at")
required final DateTime updatedAt}) = _$CircumferenceModelImpl;
factory _CircumferenceModel.fromJson(Map<String, dynamic> json) =
_$CircumferenceModelImpl.fromJson;

View File

@@ -7,25 +7,25 @@ part of 'circumference_model.dart';
// **************************************************************************
_$CircumferenceModelImpl _$$CircumferenceModelImplFromJson(
Map<String, dynamic> json,
) => _$CircumferenceModelImpl(
id: (json['id'] as num).toInt(),
userId: (json['user_id'] as num).toInt(),
chestCircumference: (json['chest_circumference'] as num).toInt(),
waistCircumference: (json['waist_circumference'] as num).toInt(),
hipCircumference: (json['hip_circumference'] as num).toInt(),
createdAt: DateTime.parse(json['created_at'] as String),
updatedAt: DateTime.parse(json['updated_at'] as String),
);
Map<String, dynamic> json) =>
_$CircumferenceModelImpl(
id: (json['id'] as num).toInt(),
userId: (json['user_id'] as num).toInt(),
chestCircumference: (json['chest_circumference'] as num).toInt(),
waistCircumference: (json['waist_circumference'] as num).toInt(),
hipCircumference: (json['hip_circumference'] as num).toInt(),
createdAt: DateTime.parse(json['created_at'] as String),
updatedAt: DateTime.parse(json['updated_at'] as String),
);
Map<String, dynamic> _$$CircumferenceModelImplToJson(
_$CircumferenceModelImpl instance,
) => <String, dynamic>{
'id': instance.id,
'user_id': instance.userId,
'chest_circumference': instance.chestCircumference,
'waist_circumference': instance.waistCircumference,
'hip_circumference': instance.hipCircumference,
'created_at': instance.createdAt.toIso8601String(),
'updated_at': instance.updatedAt.toIso8601String(),
};
_$CircumferenceModelImpl instance) =>
<String, dynamic>{
'id': instance.id,
'user_id': instance.userId,
'chest_circumference': instance.chestCircumference,
'waist_circumference': instance.waistCircumference,
'hip_circumference': instance.hipCircumference,
'created_at': instance.createdAt.toIso8601String(),
'updated_at': instance.updatedAt.toIso8601String(),
};

View File

@@ -1,3 +1,4 @@
import 'package:eatvio_app/features/my_finance/models/card_model.dart';
import 'package:eatvio_app/features/profile/models/badge_model.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
@@ -14,7 +15,7 @@ class ProfileModel with _$ProfileModel {
@JsonKey(name: "email_verified_at") DateTime? emailVerifiedAt,
@JsonKey(name: "created_at") DateTime? createdAt,
@JsonKey(name: "updated_at") DateTime? updatedAt,
@JsonKey(name: "is_public_profile") required bool isPublicProfile,
@JsonKey(name: "is_public_profile", fromJson: parseBool) required bool isPublicProfile,
@JsonKey(name: 'is_entity_subscribed_by_me') required bool isEntitySubscribedByMe,
@JsonKey(name: "slug") required String slug,
@JsonKey(name: "profile_photo_url") required String profilePhotoUrl,

File diff suppressed because it is too large Load Diff

View File

@@ -6,57 +6,44 @@ part of 'profile_model.dart';
// JsonSerializableGenerator
// **************************************************************************
_$ProfileModelImpl _$$ProfileModelImplFromJson(
Map<String, dynamic> json,
) => _$ProfileModelImpl(
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
_$ProfileModelImpl _$$ProfileModelImplFromJson(Map<String, dynamic> json) =>
_$ProfileModelImpl(
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),
createdAt:
json['created_at'] == null
createdAt: json['created_at'] == null
? null
: DateTime.parse(json['created_at'] as String),
updatedAt:
json['updated_at'] == null
updatedAt: json['updated_at'] == null
? null
: DateTime.parse(json['updated_at'] as String),
isPublicProfile: json['is_public_profile'] as bool,
isEntitySubscribedByMe: json['is_entity_subscribed_by_me'] as bool,
slug: json['slug'] as String,
profilePhotoUrl: json['profile_photo_url'] as String,
roles: (json['roles'] as List<dynamic>).map((e) => e as String).toList(),
badges:
(json['badges'] as List<dynamic>)
isPublicProfile: parseBool(json['is_public_profile']),
isEntitySubscribedByMe: json['is_entity_subscribed_by_me'] as bool,
slug: json['slug'] as String,
profilePhotoUrl: json['profile_photo_url'] as String,
roles: (json['roles'] as List<dynamic>).map((e) => e as String).toList(),
badges: (json['badges'] as List<dynamic>)
.map((e) => BadgeModel.fromJson(e as Map<String, dynamic>))
.toList(),
subscriptions:
(json['subscriptions'] as List<dynamic>)
subscriptions: (json['subscriptions'] as List<dynamic>)
.map((e) => ProfilePreviewModel.fromJson(e as Map<String, dynamic>))
.toList(),
subscribers:
(json['subscribers'] as List<dynamic>)
subscribers: (json['subscribers'] as List<dynamic>)
.map((e) => ProfilePreviewModel.fromJson(e as Map<String, dynamic>))
.toList(),
educationResource:
json['education_resource'] == null
educationResource: json['education_resource'] == null
? null
: 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>,
),
)
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) =>
<String, dynamic>{
@@ -80,30 +67,28 @@ Map<String, dynamic> _$$ProfileModelImplToJson(_$ProfileModelImpl instance) =>
};
_$DiplomasAndCertificatesModelImpl _$$DiplomasAndCertificatesModelImplFromJson(
Map<String, dynamic> json,
) => _$DiplomasAndCertificatesModelImpl(
id: (json['id'] as num).toInt(),
path: json['path'] as String,
);
Map<String, dynamic> json) =>
_$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};
_$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(),
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?,
@@ -113,105 +98,108 @@ _$EducationModelImpl _$$EducationModelImplFromJson(Map<String, dynamic> json) =>
);
Map<String, dynamic> _$$EducationModelImplToJson(
_$EducationModelImpl instance,
) => <String, dynamic>{
'has_medical_education': instance.hasMedicalEducation,
'completed_cources': instance.completedCourses,
'vk_link': instance.vkLink,
'insta_link': instance.instaLink,
'fb_link': instance.fbLink,
'tg_link': instance.tgLink,
'personal_site_link': instance.personalSiteLink,
'request_state': instance.requestState,
};
_$EducationModelImpl instance) =>
<String, dynamic>{
'has_medical_education': instance.hasMedicalEducation,
'completed_cources': instance.completedCourses,
'vk_link': instance.vkLink,
'insta_link': instance.instaLink,
'fb_link': instance.fbLink,
'tg_link': instance.tgLink,
'personal_site_link': instance.personalSiteLink,
'request_state': instance.requestState,
};
_$CompletedCoursesModelImpl _$$CompletedCoursesModelImplFromJson(
Map<String, dynamic> json,
) => _$CompletedCoursesModelImpl(
date: json['date'] as String,
title: json['title'] as String,
);
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};
_$CompletedCoursesModelImpl instance) =>
<String, dynamic>{
'date': instance.date,
'title': instance.title,
};
_$ProfileDetailsModelImpl _$$ProfileDetailsModelImplFromJson(
Map<String, dynamic> json,
) => _$ProfileDetailsModelImpl(
firstName: json['first_name'] as String,
lastName: json['last_name'] as String,
birthdate: json['birthdate'] as String,
gender: json['gender'] as String,
country: json['country'] as String,
city: json['city'] as String,
lang: json['lang'] as String,
weight: (json['weight'] as num).toDouble(),
height: (json['height'] as num).toInt(),
chestCircumference: (json['chest_circumference'] as num).toInt(),
waistCircumference: (json['waist_circumference'] as num).toInt(),
hipCircumference: (json['hip_circumference'] as num).toInt(),
bloodPressureUp: (json['blood_pressure_up'] as num).toInt(),
bloodPressureDown: (json['blood_pressure_down'] as num).toInt(),
hasHypo: json['has_hypo'] as bool,
hasHyper: json['has_hyper'] as bool,
aboutAlergy: json['about_alergy'] as String,
aboutTakingPils: json['about_taking_pils'] as String,
aboutSportHobbies: json['about_sport_hobbies'] as String,
favoriteFoods: json['favorite_foods'] as String,
unfavoriteFoods: json['unfavorite_foods'] as String,
additionalInfo: json['additional_info'] as String,
createdAt:
json['created_at'] == null
Map<String, dynamic> json) =>
_$ProfileDetailsModelImpl(
firstName: json['first_name'] as String,
lastName: json['last_name'] as String,
birthdate: json['birthdate'] as String,
gender: json['gender'] as String,
country: json['country'] as String,
city: json['city'] as String,
lang: json['lang'] as String,
weight: (json['weight'] as num).toDouble(),
height: (json['height'] as num).toInt(),
chestCircumference: (json['chest_circumference'] as num).toInt(),
waistCircumference: (json['waist_circumference'] as num).toInt(),
hipCircumference: (json['hip_circumference'] as num).toInt(),
bloodPressureUp: (json['blood_pressure_up'] as num).toInt(),
bloodPressureDown: (json['blood_pressure_down'] as num).toInt(),
hasHypo: json['has_hypo'] as bool,
hasHyper: json['has_hyper'] as bool,
aboutAlergy: json['about_alergy'] as String,
aboutTakingPils: json['about_taking_pils'] as String,
aboutSportHobbies: json['about_sport_hobbies'] as String,
favoriteFoods: json['favorite_foods'] as String,
unfavoriteFoods: json['unfavorite_foods'] as String,
additionalInfo: json['additional_info'] as String,
createdAt: json['created_at'] == null
? null
: DateTime.parse(json['created_at'] as String),
updatedAt:
json['updated_at'] == null
updatedAt: json['updated_at'] == null
? null
: DateTime.parse(json['updated_at'] as String),
isMoodFillable: json['is_mood_fillable'] as bool,
isBedtimeFillable: json['is_bedtime_fillable'] as bool,
activityCoefficient: (json['activity_coefficient'] as num).toDouble(),
);
isMoodFillable: json['is_mood_fillable'] as bool,
isBedtimeFillable: json['is_bedtime_fillable'] as bool,
activityCoefficient: (json['activity_coefficient'] as num).toDouble(),
);
Map<String, dynamic> _$$ProfileDetailsModelImplToJson(
_$ProfileDetailsModelImpl instance,
) => <String, dynamic>{
'first_name': instance.firstName,
'last_name': instance.lastName,
'birthdate': instance.birthdate,
'gender': instance.gender,
'country': instance.country,
'city': instance.city,
'lang': instance.lang,
'weight': instance.weight,
'height': instance.height,
'chest_circumference': instance.chestCircumference,
'waist_circumference': instance.waistCircumference,
'hip_circumference': instance.hipCircumference,
'blood_pressure_up': instance.bloodPressureUp,
'blood_pressure_down': instance.bloodPressureDown,
'has_hypo': instance.hasHypo,
'has_hyper': instance.hasHyper,
'about_alergy': instance.aboutAlergy,
'about_taking_pils': instance.aboutTakingPils,
'about_sport_hobbies': instance.aboutSportHobbies,
'favorite_foods': instance.favoriteFoods,
'unfavorite_foods': instance.unfavoriteFoods,
'additional_info': instance.additionalInfo,
'created_at': instance.createdAt?.toIso8601String(),
'updated_at': instance.updatedAt?.toIso8601String(),
'is_mood_fillable': instance.isMoodFillable,
'is_bedtime_fillable': instance.isBedtimeFillable,
'activity_coefficient': instance.activityCoefficient,
};
_$ProfileDetailsModelImpl instance) =>
<String, dynamic>{
'first_name': instance.firstName,
'last_name': instance.lastName,
'birthdate': instance.birthdate,
'gender': instance.gender,
'country': instance.country,
'city': instance.city,
'lang': instance.lang,
'weight': instance.weight,
'height': instance.height,
'chest_circumference': instance.chestCircumference,
'waist_circumference': instance.waistCircumference,
'hip_circumference': instance.hipCircumference,
'blood_pressure_up': instance.bloodPressureUp,
'blood_pressure_down': instance.bloodPressureDown,
'has_hypo': instance.hasHypo,
'has_hyper': instance.hasHyper,
'about_alergy': instance.aboutAlergy,
'about_taking_pils': instance.aboutTakingPils,
'about_sport_hobbies': instance.aboutSportHobbies,
'favorite_foods': instance.favoriteFoods,
'unfavorite_foods': instance.unfavoriteFoods,
'additional_info': instance.additionalInfo,
'created_at': instance.createdAt?.toIso8601String(),
'updated_at': instance.updatedAt?.toIso8601String(),
'is_mood_fillable': instance.isMoodFillable,
'is_bedtime_fillable': instance.isBedtimeFillable,
'activity_coefficient': instance.activityCoefficient,
};
_$ProfilePreviewModelImpl _$$ProfilePreviewModelImplFromJson(
Map<String, dynamic> json,
) => _$ProfilePreviewModelImpl(
profilePhotoUrl: json['profile_photo_url'] as String,
);
Map<String, dynamic> json) =>
_$ProfilePreviewModelImpl(
profilePhotoUrl: json['profile_photo_url'] as String,
);
Map<String, dynamic> _$$ProfilePreviewModelImplToJson(
_$ProfilePreviewModelImpl instance,
) => <String, dynamic>{'profile_photo_url': instance.profilePhotoUrl};
_$ProfilePreviewModelImpl instance) =>
<String, dynamic>{
'profile_photo_url': instance.profilePhotoUrl,
};

View File

@@ -12,8 +12,7 @@ part of 'sub_model.dart';
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',
);
'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');
SubPaginationModel _$SubPaginationModelFromJson(Map<String, dynamic> json) {
return _SubPaginationModel.fromJson(json);
@@ -38,9 +37,8 @@ mixin _$SubPaginationModel {
/// @nodoc
abstract class $SubPaginationModelCopyWith<$Res> {
factory $SubPaginationModelCopyWith(
SubPaginationModel value,
$Res Function(SubPaginationModel) then,
) = _$SubPaginationModelCopyWithImpl<$Res, SubPaginationModel>;
SubPaginationModel value, $Res Function(SubPaginationModel) then) =
_$SubPaginationModelCopyWithImpl<$Res, SubPaginationModel>;
@useResult
$Res call({List<SubModel> data, Links links, Meta meta});
@@ -62,27 +60,25 @@ class _$SubPaginationModelCopyWithImpl<$Res, $Val extends SubPaginationModel>
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? data = null, Object? links = null, Object? meta = null}) {
return _then(
_value.copyWith(
data:
null == data
? _value.data
: data // ignore: cast_nullable_to_non_nullable
as List<SubModel>,
links:
null == links
? _value.links
: links // ignore: cast_nullable_to_non_nullable
as Links,
meta:
null == meta
? _value.meta
: meta // ignore: cast_nullable_to_non_nullable
as Meta,
)
as $Val,
);
$Res call({
Object? data = null,
Object? links = null,
Object? meta = null,
}) {
return _then(_value.copyWith(
data: null == data
? _value.data
: data // ignore: cast_nullable_to_non_nullable
as List<SubModel>,
links: null == links
? _value.links
: links // ignore: cast_nullable_to_non_nullable
as Links,
meta: null == meta
? _value.meta
: meta // ignore: cast_nullable_to_non_nullable
as Meta,
) as $Val);
}
/// Create a copy of SubPaginationModel
@@ -109,10 +105,9 @@ class _$SubPaginationModelCopyWithImpl<$Res, $Val extends SubPaginationModel>
/// @nodoc
abstract class _$$SubPaginationModelImplCopyWith<$Res>
implements $SubPaginationModelCopyWith<$Res> {
factory _$$SubPaginationModelImplCopyWith(
_$SubPaginationModelImpl value,
$Res Function(_$SubPaginationModelImpl) then,
) = __$$SubPaginationModelImplCopyWithImpl<$Res>;
factory _$$SubPaginationModelImplCopyWith(_$SubPaginationModelImpl value,
$Res Function(_$SubPaginationModelImpl) then) =
__$$SubPaginationModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({List<SubModel> data, Links links, Meta meta});
@@ -127,46 +122,44 @@ abstract class _$$SubPaginationModelImplCopyWith<$Res>
class __$$SubPaginationModelImplCopyWithImpl<$Res>
extends _$SubPaginationModelCopyWithImpl<$Res, _$SubPaginationModelImpl>
implements _$$SubPaginationModelImplCopyWith<$Res> {
__$$SubPaginationModelImplCopyWithImpl(
_$SubPaginationModelImpl _value,
$Res Function(_$SubPaginationModelImpl) _then,
) : super(_value, _then);
__$$SubPaginationModelImplCopyWithImpl(_$SubPaginationModelImpl _value,
$Res Function(_$SubPaginationModelImpl) _then)
: super(_value, _then);
/// Create a copy of SubPaginationModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? data = null, Object? links = null, Object? meta = null}) {
return _then(
_$SubPaginationModelImpl(
data:
null == data
? _value._data
: data // ignore: cast_nullable_to_non_nullable
as List<SubModel>,
links:
null == links
? _value.links
: links // ignore: cast_nullable_to_non_nullable
as Links,
meta:
null == meta
? _value.meta
: meta // ignore: cast_nullable_to_non_nullable
as Meta,
),
);
$Res call({
Object? data = null,
Object? links = null,
Object? meta = null,
}) {
return _then(_$SubPaginationModelImpl(
data: null == data
? _value._data
: data // ignore: cast_nullable_to_non_nullable
as List<SubModel>,
links: null == links
? _value.links
: links // ignore: cast_nullable_to_non_nullable
as Links,
meta: null == meta
? _value.meta
: meta // ignore: cast_nullable_to_non_nullable
as Meta,
));
}
}
/// @nodoc
@JsonSerializable()
class _$SubPaginationModelImpl implements _SubPaginationModel {
const _$SubPaginationModelImpl({
required final List<SubModel> data,
required this.links,
required this.meta,
}) : _data = data;
const _$SubPaginationModelImpl(
{required final List<SubModel> data,
required this.links,
required this.meta})
: _data = data;
factory _$SubPaginationModelImpl.fromJson(Map<String, dynamic> json) =>
_$$SubPaginationModelImplFromJson(json);
@@ -202,11 +195,7 @@ class _$SubPaginationModelImpl implements _SubPaginationModel {
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
const DeepCollectionEquality().hash(_data),
links,
meta,
);
runtimeType, const DeepCollectionEquality().hash(_data), links, meta);
/// Create a copy of SubPaginationModel
/// with the given fields replaced by the non-null parameter values.
@@ -215,22 +204,21 @@ class _$SubPaginationModelImpl implements _SubPaginationModel {
@pragma('vm:prefer-inline')
_$$SubPaginationModelImplCopyWith<_$SubPaginationModelImpl> get copyWith =>
__$$SubPaginationModelImplCopyWithImpl<_$SubPaginationModelImpl>(
this,
_$identity,
);
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$SubPaginationModelImplToJson(this);
return _$$SubPaginationModelImplToJson(
this,
);
}
}
abstract class _SubPaginationModel implements SubPaginationModel {
const factory _SubPaginationModel({
required final List<SubModel> data,
required final Links links,
required final Meta meta,
}) = _$SubPaginationModelImpl;
const factory _SubPaginationModel(
{required final List<SubModel> data,
required final Links links,
required final Meta meta}) = _$SubPaginationModelImpl;
factory _SubPaginationModel.fromJson(Map<String, dynamic> json) =
_$SubPaginationModelImpl.fromJson;
@@ -289,20 +277,19 @@ abstract class $SubModelCopyWith<$Res> {
factory $SubModelCopyWith(SubModel value, $Res Function(SubModel) then) =
_$SubModelCopyWithImpl<$Res, SubModel>;
@useResult
$Res call({
int id,
String slug,
String name,
String city,
DateTime birthdate,
@JsonKey(name: 'is_entity_subscribed_by_me') bool isEntitySubscribedByMe,
String email,
@JsonKey(name: 'profile_photo_url') String profilePhotoUrl,
String role,
@JsonKey(name: 'is_public_profile') bool isPublicProfile,
@JsonKey(name: 'created_at') DateTime createdAt,
@JsonKey(name: 'updated_at') DateTime updatedAt,
});
$Res call(
{int id,
String slug,
String name,
String city,
DateTime birthdate,
@JsonKey(name: 'is_entity_subscribed_by_me') bool isEntitySubscribedByMe,
String email,
@JsonKey(name: 'profile_photo_url') String profilePhotoUrl,
String role,
@JsonKey(name: 'is_public_profile') bool isPublicProfile,
@JsonKey(name: 'created_at') DateTime createdAt,
@JsonKey(name: 'updated_at') DateTime updatedAt});
}
/// @nodoc
@@ -333,71 +320,56 @@ class _$SubModelCopyWithImpl<$Res, $Val extends SubModel>
Object? createdAt = null,
Object? updatedAt = null,
}) {
return _then(
_value.copyWith(
id:
null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
slug:
null == slug
? _value.slug
: slug // ignore: cast_nullable_to_non_nullable
as String,
name:
null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
city:
null == city
? _value.city
: city // ignore: cast_nullable_to_non_nullable
as String,
birthdate:
null == birthdate
? _value.birthdate
: birthdate // ignore: cast_nullable_to_non_nullable
as DateTime,
isEntitySubscribedByMe:
null == isEntitySubscribedByMe
? _value.isEntitySubscribedByMe
: isEntitySubscribedByMe // ignore: cast_nullable_to_non_nullable
as bool,
email:
null == email
? _value.email
: email // ignore: cast_nullable_to_non_nullable
as String,
profilePhotoUrl:
null == profilePhotoUrl
? _value.profilePhotoUrl
: profilePhotoUrl // ignore: cast_nullable_to_non_nullable
as String,
role:
null == role
? _value.role
: role // ignore: cast_nullable_to_non_nullable
as String,
isPublicProfile:
null == isPublicProfile
? _value.isPublicProfile
: isPublicProfile // ignore: cast_nullable_to_non_nullable
as bool,
createdAt:
null == createdAt
? _value.createdAt
: createdAt // ignore: cast_nullable_to_non_nullable
as DateTime,
updatedAt:
null == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
)
as $Val,
);
return _then(_value.copyWith(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
slug: null == slug
? _value.slug
: slug // ignore: cast_nullable_to_non_nullable
as String,
name: null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
city: null == city
? _value.city
: city // ignore: cast_nullable_to_non_nullable
as String,
birthdate: null == birthdate
? _value.birthdate
: birthdate // ignore: cast_nullable_to_non_nullable
as DateTime,
isEntitySubscribedByMe: null == isEntitySubscribedByMe
? _value.isEntitySubscribedByMe
: isEntitySubscribedByMe // ignore: cast_nullable_to_non_nullable
as bool,
email: null == email
? _value.email
: email // ignore: cast_nullable_to_non_nullable
as String,
profilePhotoUrl: null == profilePhotoUrl
? _value.profilePhotoUrl
: profilePhotoUrl // ignore: cast_nullable_to_non_nullable
as String,
role: null == role
? _value.role
: role // ignore: cast_nullable_to_non_nullable
as String,
isPublicProfile: null == isPublicProfile
? _value.isPublicProfile
: isPublicProfile // ignore: cast_nullable_to_non_nullable
as bool,
createdAt: null == createdAt
? _value.createdAt
: createdAt // ignore: cast_nullable_to_non_nullable
as DateTime,
updatedAt: null == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
) as $Val);
}
}
@@ -405,25 +377,23 @@ class _$SubModelCopyWithImpl<$Res, $Val extends SubModel>
abstract class _$$SubModelImplCopyWith<$Res>
implements $SubModelCopyWith<$Res> {
factory _$$SubModelImplCopyWith(
_$SubModelImpl value,
$Res Function(_$SubModelImpl) then,
) = __$$SubModelImplCopyWithImpl<$Res>;
_$SubModelImpl value, $Res Function(_$SubModelImpl) then) =
__$$SubModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
int id,
String slug,
String name,
String city,
DateTime birthdate,
@JsonKey(name: 'is_entity_subscribed_by_me') bool isEntitySubscribedByMe,
String email,
@JsonKey(name: 'profile_photo_url') String profilePhotoUrl,
String role,
@JsonKey(name: 'is_public_profile') bool isPublicProfile,
@JsonKey(name: 'created_at') DateTime createdAt,
@JsonKey(name: 'updated_at') DateTime updatedAt,
});
$Res call(
{int id,
String slug,
String name,
String city,
DateTime birthdate,
@JsonKey(name: 'is_entity_subscribed_by_me') bool isEntitySubscribedByMe,
String email,
@JsonKey(name: 'profile_photo_url') String profilePhotoUrl,
String role,
@JsonKey(name: 'is_public_profile') bool isPublicProfile,
@JsonKey(name: 'created_at') DateTime createdAt,
@JsonKey(name: 'updated_at') DateTime updatedAt});
}
/// @nodoc
@@ -431,9 +401,8 @@ class __$$SubModelImplCopyWithImpl<$Res>
extends _$SubModelCopyWithImpl<$Res, _$SubModelImpl>
implements _$$SubModelImplCopyWith<$Res> {
__$$SubModelImplCopyWithImpl(
_$SubModelImpl _value,
$Res Function(_$SubModelImpl) _then,
) : super(_value, _then);
_$SubModelImpl _value, $Res Function(_$SubModelImpl) _then)
: super(_value, _then);
/// Create a copy of SubModel
/// with the given fields replaced by the non-null parameter values.
@@ -453,91 +422,76 @@ class __$$SubModelImplCopyWithImpl<$Res>
Object? createdAt = null,
Object? updatedAt = null,
}) {
return _then(
_$SubModelImpl(
id:
null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
slug:
null == slug
? _value.slug
: slug // ignore: cast_nullable_to_non_nullable
as String,
name:
null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
city:
null == city
? _value.city
: city // ignore: cast_nullable_to_non_nullable
as String,
birthdate:
null == birthdate
? _value.birthdate
: birthdate // ignore: cast_nullable_to_non_nullable
as DateTime,
isEntitySubscribedByMe:
null == isEntitySubscribedByMe
? _value.isEntitySubscribedByMe
: isEntitySubscribedByMe // ignore: cast_nullable_to_non_nullable
as bool,
email:
null == email
? _value.email
: email // ignore: cast_nullable_to_non_nullable
as String,
profilePhotoUrl:
null == profilePhotoUrl
? _value.profilePhotoUrl
: profilePhotoUrl // ignore: cast_nullable_to_non_nullable
as String,
role:
null == role
? _value.role
: role // ignore: cast_nullable_to_non_nullable
as String,
isPublicProfile:
null == isPublicProfile
? _value.isPublicProfile
: isPublicProfile // ignore: cast_nullable_to_non_nullable
as bool,
createdAt:
null == createdAt
? _value.createdAt
: createdAt // ignore: cast_nullable_to_non_nullable
as DateTime,
updatedAt:
null == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
),
);
return _then(_$SubModelImpl(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
slug: null == slug
? _value.slug
: slug // ignore: cast_nullable_to_non_nullable
as String,
name: null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
city: null == city
? _value.city
: city // ignore: cast_nullable_to_non_nullable
as String,
birthdate: null == birthdate
? _value.birthdate
: birthdate // ignore: cast_nullable_to_non_nullable
as DateTime,
isEntitySubscribedByMe: null == isEntitySubscribedByMe
? _value.isEntitySubscribedByMe
: isEntitySubscribedByMe // ignore: cast_nullable_to_non_nullable
as bool,
email: null == email
? _value.email
: email // ignore: cast_nullable_to_non_nullable
as String,
profilePhotoUrl: null == profilePhotoUrl
? _value.profilePhotoUrl
: profilePhotoUrl // ignore: cast_nullable_to_non_nullable
as String,
role: null == role
? _value.role
: role // ignore: cast_nullable_to_non_nullable
as String,
isPublicProfile: null == isPublicProfile
? _value.isPublicProfile
: isPublicProfile // ignore: cast_nullable_to_non_nullable
as bool,
createdAt: null == createdAt
? _value.createdAt
: createdAt // ignore: cast_nullable_to_non_nullable
as DateTime,
updatedAt: null == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
));
}
}
/// @nodoc
@JsonSerializable()
class _$SubModelImpl implements _SubModel {
const _$SubModelImpl({
required this.id,
required this.slug,
required this.name,
required this.city,
required this.birthdate,
@JsonKey(name: 'is_entity_subscribed_by_me')
required this.isEntitySubscribedByMe,
required this.email,
@JsonKey(name: 'profile_photo_url') required this.profilePhotoUrl,
required this.role,
@JsonKey(name: 'is_public_profile') required this.isPublicProfile,
@JsonKey(name: 'created_at') required this.createdAt,
@JsonKey(name: 'updated_at') required this.updatedAt,
});
const _$SubModelImpl(
{required this.id,
required this.slug,
required this.name,
required this.city,
required this.birthdate,
@JsonKey(name: 'is_entity_subscribed_by_me')
required this.isEntitySubscribedByMe,
required this.email,
@JsonKey(name: 'profile_photo_url') required this.profilePhotoUrl,
required this.role,
@JsonKey(name: 'is_public_profile') required this.isPublicProfile,
@JsonKey(name: 'created_at') required this.createdAt,
@JsonKey(name: 'updated_at') required this.updatedAt});
factory _$SubModelImpl.fromJson(Map<String, dynamic> json) =>
_$$SubModelImplFromJson(json);
@@ -605,20 +559,19 @@ class _$SubModelImpl implements _SubModel {
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
id,
slug,
name,
city,
birthdate,
isEntitySubscribedByMe,
email,
profilePhotoUrl,
role,
isPublicProfile,
createdAt,
updatedAt,
);
runtimeType,
id,
slug,
name,
city,
birthdate,
isEntitySubscribedByMe,
email,
profilePhotoUrl,
role,
isPublicProfile,
createdAt,
updatedAt);
/// Create a copy of SubModel
/// with the given fields replaced by the non-null parameter values.
@@ -630,26 +583,28 @@ class _$SubModelImpl implements _SubModel {
@override
Map<String, dynamic> toJson() {
return _$$SubModelImplToJson(this);
return _$$SubModelImplToJson(
this,
);
}
}
abstract class _SubModel implements SubModel {
const factory _SubModel({
required final int id,
required final String slug,
required final String name,
required final String city,
required final DateTime birthdate,
@JsonKey(name: 'is_entity_subscribed_by_me')
required final bool isEntitySubscribedByMe,
required final String email,
@JsonKey(name: 'profile_photo_url') required final String profilePhotoUrl,
required final String role,
@JsonKey(name: 'is_public_profile') required final bool isPublicProfile,
@JsonKey(name: 'created_at') required final DateTime createdAt,
@JsonKey(name: 'updated_at') required final DateTime updatedAt,
}) = _$SubModelImpl;
const factory _SubModel(
{required final int id,
required final String slug,
required final String name,
required final String city,
required final DateTime birthdate,
@JsonKey(name: 'is_entity_subscribed_by_me')
required final bool isEntitySubscribedByMe,
required final String email,
@JsonKey(name: 'profile_photo_url') required final String profilePhotoUrl,
required final String role,
@JsonKey(name: 'is_public_profile') required final bool isPublicProfile,
@JsonKey(name: 'created_at') required final DateTime createdAt,
@JsonKey(name: 'updated_at')
required final DateTime updatedAt}) = _$SubModelImpl;
factory _SubModel.fromJson(Map<String, dynamic> json) =
_$SubModelImpl.fromJson;

View File

@@ -7,23 +7,22 @@ part of 'sub_model.dart';
// **************************************************************************
_$SubPaginationModelImpl _$$SubPaginationModelImplFromJson(
Map<String, dynamic> json,
) => _$SubPaginationModelImpl(
data:
(json['data'] as List<dynamic>)
Map<String, dynamic> json) =>
_$SubPaginationModelImpl(
data: (json['data'] as List<dynamic>)
.map((e) => SubModel.fromJson(e as Map<String, dynamic>))
.toList(),
links: Links.fromJson(json['links'] as Map<String, dynamic>),
meta: Meta.fromJson(json['meta'] as Map<String, dynamic>),
);
links: Links.fromJson(json['links'] as Map<String, dynamic>),
meta: Meta.fromJson(json['meta'] as Map<String, dynamic>),
);
Map<String, dynamic> _$$SubPaginationModelImplToJson(
_$SubPaginationModelImpl instance,
) => <String, dynamic>{
'data': instance.data,
'links': instance.links,
'meta': instance.meta,
};
_$SubPaginationModelImpl instance) =>
<String, dynamic>{
'data': instance.data,
'links': instance.links,
'meta': instance.meta,
};
_$SubModelImpl _$$SubModelImplFromJson(Map<String, dynamic> json) =>
_$SubModelImpl(

View File

@@ -12,8 +12,7 @@ part of 'weight_model.dart';
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',
);
'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');
WeightModel _$WeightModelFromJson(Map<String, dynamic> json) {
return _WeightModel.fromJson(json);
@@ -47,18 +46,16 @@ mixin _$WeightModel {
/// @nodoc
abstract class $WeightModelCopyWith<$Res> {
factory $WeightModelCopyWith(
WeightModel value,
$Res Function(WeightModel) then,
) = _$WeightModelCopyWithImpl<$Res, WeightModel>;
WeightModel value, $Res Function(WeightModel) then) =
_$WeightModelCopyWithImpl<$Res, WeightModel>;
@useResult
$Res call({
@JsonKey(name: "id") int id,
@JsonKey(name: "user_id") int userId,
@JsonKey(name: "weight") int weight,
@JsonKey(name: "created_at") DateTime createdAt,
@JsonKey(name: "updated_at") DateTime updatedAt,
@JsonKey(name: "bmi") double bmi,
});
$Res call(
{@JsonKey(name: "id") int id,
@JsonKey(name: "user_id") int userId,
@JsonKey(name: "weight") int weight,
@JsonKey(name: "created_at") DateTime createdAt,
@JsonKey(name: "updated_at") DateTime updatedAt,
@JsonKey(name: "bmi") double bmi});
}
/// @nodoc
@@ -83,41 +80,32 @@ class _$WeightModelCopyWithImpl<$Res, $Val extends WeightModel>
Object? updatedAt = null,
Object? bmi = null,
}) {
return _then(
_value.copyWith(
id:
null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
userId:
null == userId
? _value.userId
: userId // ignore: cast_nullable_to_non_nullable
as int,
weight:
null == weight
? _value.weight
: weight // ignore: cast_nullable_to_non_nullable
as int,
createdAt:
null == createdAt
? _value.createdAt
: createdAt // ignore: cast_nullable_to_non_nullable
as DateTime,
updatedAt:
null == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
bmi:
null == bmi
? _value.bmi
: bmi // ignore: cast_nullable_to_non_nullable
as double,
)
as $Val,
);
return _then(_value.copyWith(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
userId: null == userId
? _value.userId
: userId // ignore: cast_nullable_to_non_nullable
as int,
weight: null == weight
? _value.weight
: weight // ignore: cast_nullable_to_non_nullable
as int,
createdAt: null == createdAt
? _value.createdAt
: createdAt // ignore: cast_nullable_to_non_nullable
as DateTime,
updatedAt: null == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
bmi: null == bmi
? _value.bmi
: bmi // ignore: cast_nullable_to_non_nullable
as double,
) as $Val);
}
}
@@ -125,19 +113,17 @@ class _$WeightModelCopyWithImpl<$Res, $Val extends WeightModel>
abstract class _$$WeightModelImplCopyWith<$Res>
implements $WeightModelCopyWith<$Res> {
factory _$$WeightModelImplCopyWith(
_$WeightModelImpl value,
$Res Function(_$WeightModelImpl) then,
) = __$$WeightModelImplCopyWithImpl<$Res>;
_$WeightModelImpl value, $Res Function(_$WeightModelImpl) then) =
__$$WeightModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
@JsonKey(name: "id") int id,
@JsonKey(name: "user_id") int userId,
@JsonKey(name: "weight") int weight,
@JsonKey(name: "created_at") DateTime createdAt,
@JsonKey(name: "updated_at") DateTime updatedAt,
@JsonKey(name: "bmi") double bmi,
});
$Res call(
{@JsonKey(name: "id") int id,
@JsonKey(name: "user_id") int userId,
@JsonKey(name: "weight") int weight,
@JsonKey(name: "created_at") DateTime createdAt,
@JsonKey(name: "updated_at") DateTime updatedAt,
@JsonKey(name: "bmi") double bmi});
}
/// @nodoc
@@ -145,9 +131,8 @@ class __$$WeightModelImplCopyWithImpl<$Res>
extends _$WeightModelCopyWithImpl<$Res, _$WeightModelImpl>
implements _$$WeightModelImplCopyWith<$Res> {
__$$WeightModelImplCopyWithImpl(
_$WeightModelImpl _value,
$Res Function(_$WeightModelImpl) _then,
) : super(_value, _then);
_$WeightModelImpl _value, $Res Function(_$WeightModelImpl) _then)
: super(_value, _then);
/// Create a copy of WeightModel
/// with the given fields replaced by the non-null parameter values.
@@ -161,54 +146,45 @@ class __$$WeightModelImplCopyWithImpl<$Res>
Object? updatedAt = null,
Object? bmi = null,
}) {
return _then(
_$WeightModelImpl(
id:
null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
userId:
null == userId
? _value.userId
: userId // ignore: cast_nullable_to_non_nullable
as int,
weight:
null == weight
? _value.weight
: weight // ignore: cast_nullable_to_non_nullable
as int,
createdAt:
null == createdAt
? _value.createdAt
: createdAt // ignore: cast_nullable_to_non_nullable
as DateTime,
updatedAt:
null == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
bmi:
null == bmi
? _value.bmi
: bmi // ignore: cast_nullable_to_non_nullable
as double,
),
);
return _then(_$WeightModelImpl(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
userId: null == userId
? _value.userId
: userId // ignore: cast_nullable_to_non_nullable
as int,
weight: null == weight
? _value.weight
: weight // ignore: cast_nullable_to_non_nullable
as int,
createdAt: null == createdAt
? _value.createdAt
: createdAt // ignore: cast_nullable_to_non_nullable
as DateTime,
updatedAt: null == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
bmi: null == bmi
? _value.bmi
: bmi // ignore: cast_nullable_to_non_nullable
as double,
));
}
}
/// @nodoc
@JsonSerializable()
class _$WeightModelImpl implements _WeightModel {
const _$WeightModelImpl({
@JsonKey(name: "id") required this.id,
@JsonKey(name: "user_id") required this.userId,
@JsonKey(name: "weight") required this.weight,
@JsonKey(name: "created_at") required this.createdAt,
@JsonKey(name: "updated_at") required this.updatedAt,
@JsonKey(name: "bmi") required this.bmi,
});
const _$WeightModelImpl(
{@JsonKey(name: "id") required this.id,
@JsonKey(name: "user_id") required this.userId,
@JsonKey(name: "weight") required this.weight,
@JsonKey(name: "created_at") required this.createdAt,
@JsonKey(name: "updated_at") required this.updatedAt,
@JsonKey(name: "bmi") required this.bmi});
factory _$WeightModelImpl.fromJson(Map<String, dynamic> json) =>
_$$WeightModelImplFromJson(json);
@@ -267,19 +243,20 @@ class _$WeightModelImpl implements _WeightModel {
@override
Map<String, dynamic> toJson() {
return _$$WeightModelImplToJson(this);
return _$$WeightModelImplToJson(
this,
);
}
}
abstract class _WeightModel implements WeightModel {
const factory _WeightModel({
@JsonKey(name: "id") required final int id,
@JsonKey(name: "user_id") required final int userId,
@JsonKey(name: "weight") required final int weight,
@JsonKey(name: "created_at") required final DateTime createdAt,
@JsonKey(name: "updated_at") required final DateTime updatedAt,
@JsonKey(name: "bmi") required final double bmi,
}) = _$WeightModelImpl;
const factory _WeightModel(
{@JsonKey(name: "id") required final int id,
@JsonKey(name: "user_id") required final int userId,
@JsonKey(name: "weight") required final int weight,
@JsonKey(name: "created_at") required final DateTime createdAt,
@JsonKey(name: "updated_at") required final DateTime updatedAt,
@JsonKey(name: "bmi") required final double bmi}) = _$WeightModelImpl;
factory _WeightModel.fromJson(Map<String, dynamic> json) =
_$WeightModelImpl.fromJson;

View File

@@ -12,8 +12,7 @@ part of 'plans_state.dart';
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',
);
'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 {
@@ -23,14 +22,16 @@ mixin _$PlansState {
required TResult Function() loading,
required TResult Function(List<PlanModel> plansList) loaded,
required TResult Function(String errorMessage) error,
}) => throw _privateConstructorUsedError;
}) =>
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;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function()? $default, {
@@ -38,21 +39,24 @@ mixin _$PlansState {
TResult Function(List<PlanModel> plansList)? loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
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;
}) =>
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;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_PlansState value)? $default, {
@@ -60,15 +64,15 @@ mixin _$PlansState {
TResult Function(PlansStateLoaded value)? loaded,
TResult Function(PlansStateError value)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $PlansStateCopyWith<$Res> {
factory $PlansStateCopyWith(
PlansState value,
$Res Function(PlansState) then,
) = _$PlansStateCopyWithImpl<$Res, PlansState>;
PlansState value, $Res Function(PlansState) then) =
_$PlansStateCopyWithImpl<$Res, PlansState>;
}
/// @nodoc
@@ -88,9 +92,8 @@ class _$PlansStateCopyWithImpl<$Res, $Val extends PlansState>
/// @nodoc
abstract class _$$PlansStateImplCopyWith<$Res> {
factory _$$PlansStateImplCopyWith(
_$PlansStateImpl value,
$Res Function(_$PlansStateImpl) then,
) = __$$PlansStateImplCopyWithImpl<$Res>;
_$PlansStateImpl value, $Res Function(_$PlansStateImpl) then) =
__$$PlansStateImplCopyWithImpl<$Res>;
}
/// @nodoc
@@ -98,9 +101,8 @@ class __$$PlansStateImplCopyWithImpl<$Res>
extends _$PlansStateCopyWithImpl<$Res, _$PlansStateImpl>
implements _$$PlansStateImplCopyWith<$Res> {
__$$PlansStateImplCopyWithImpl(
_$PlansStateImpl _value,
$Res Function(_$PlansStateImpl) _then,
) : super(_value, _then);
_$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.
@@ -206,20 +208,18 @@ abstract class _PlansState implements PlansState {
/// @nodoc
abstract class _$$PlansStateLoadingImplCopyWith<$Res> {
factory _$$PlansStateLoadingImplCopyWith(
_$PlansStateLoadingImpl value,
$Res Function(_$PlansStateLoadingImpl) then,
) = __$$PlansStateLoadingImplCopyWithImpl<$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);
__$$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.
@@ -325,10 +325,9 @@ abstract class PlansStateLoading implements PlansState {
/// @nodoc
abstract class _$$PlansStateLoadedImplCopyWith<$Res> {
factory _$$PlansStateLoadedImplCopyWith(
_$PlansStateLoadedImpl value,
$Res Function(_$PlansStateLoadedImpl) then,
) = __$$PlansStateLoadedImplCopyWithImpl<$Res>;
factory _$$PlansStateLoadedImplCopyWith(_$PlansStateLoadedImpl value,
$Res Function(_$PlansStateLoadedImpl) then) =
__$$PlansStateLoadedImplCopyWithImpl<$Res>;
@useResult
$Res call({List<PlanModel> plansList});
}
@@ -337,25 +336,23 @@ abstract class _$$PlansStateLoadedImplCopyWith<$Res> {
class __$$PlansStateLoadedImplCopyWithImpl<$Res>
extends _$PlansStateCopyWithImpl<$Res, _$PlansStateLoadedImpl>
implements _$$PlansStateLoadedImplCopyWith<$Res> {
__$$PlansStateLoadedImplCopyWithImpl(
_$PlansStateLoadedImpl _value,
$Res Function(_$PlansStateLoadedImpl) _then,
) : super(_value, _then);
__$$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>,
),
);
$Res call({
Object? plansList = null,
}) {
return _then(_$PlansStateLoadedImpl(
plansList: null == plansList
? _value._plansList
: plansList // ignore: cast_nullable_to_non_nullable
as List<PlanModel>,
));
}
}
@@ -363,7 +360,7 @@ class __$$PlansStateLoadedImplCopyWithImpl<$Res>
class _$PlansStateLoadedImpl implements PlansStateLoaded {
const _$PlansStateLoadedImpl({required final List<PlanModel> plansList})
: _plansList = plansList;
: _plansList = plansList;
final List<PlanModel> _plansList;
@override
@@ -383,10 +380,8 @@ class _$PlansStateLoadedImpl implements PlansStateLoaded {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$PlansStateLoadedImpl &&
const DeepCollectionEquality().equals(
other._plansList,
_plansList,
));
const DeepCollectionEquality()
.equals(other._plansList, _plansList));
}
@override
@@ -400,9 +395,7 @@ class _$PlansStateLoadedImpl implements PlansStateLoaded {
@pragma('vm:prefer-inline')
_$$PlansStateLoadedImplCopyWith<_$PlansStateLoadedImpl> get copyWith =>
__$$PlansStateLoadedImplCopyWithImpl<_$PlansStateLoadedImpl>(
this,
_$identity,
);
this, _$identity);
@override
@optionalTypeArgs
@@ -494,10 +487,9 @@ abstract class PlansStateLoaded implements PlansState {
/// @nodoc
abstract class _$$PlansStateErrorImplCopyWith<$Res> {
factory _$$PlansStateErrorImplCopyWith(
_$PlansStateErrorImpl value,
$Res Function(_$PlansStateErrorImpl) then,
) = __$$PlansStateErrorImplCopyWithImpl<$Res>;
factory _$$PlansStateErrorImplCopyWith(_$PlansStateErrorImpl value,
$Res Function(_$PlansStateErrorImpl) then) =
__$$PlansStateErrorImplCopyWithImpl<$Res>;
@useResult
$Res call({String errorMessage});
}
@@ -507,24 +499,22 @@ class __$$PlansStateErrorImplCopyWithImpl<$Res>
extends _$PlansStateCopyWithImpl<$Res, _$PlansStateErrorImpl>
implements _$$PlansStateErrorImplCopyWith<$Res> {
__$$PlansStateErrorImplCopyWithImpl(
_$PlansStateErrorImpl _value,
$Res Function(_$PlansStateErrorImpl) _then,
) : super(_value, _then);
_$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,
),
);
$Res call({
Object? errorMessage = null,
}) {
return _then(_$PlansStateErrorImpl(
errorMessage: null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
@@ -560,9 +550,7 @@ class _$PlansStateErrorImpl implements PlansStateError {
@pragma('vm:prefer-inline')
_$$PlansStateErrorImplCopyWith<_$PlansStateErrorImpl> get copyWith =>
__$$PlansStateErrorImplCopyWithImpl<_$PlansStateErrorImpl>(
this,
_$identity,
);
this, _$identity);
@override
@optionalTypeArgs

View File

@@ -12,8 +12,7 @@ part of 'profile_state.dart';
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',
);
'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 _$ProfileState {
@@ -22,58 +21,60 @@ mixin _$ProfileState {
TResult Function() $default, {
required TResult Function() loading,
required TResult Function(
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
)
loaded,
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints)
loaded,
required TResult Function(String errorMessage) error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
)?
loaded,
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints)?
loaded,
TResult? Function(String errorMessage)? error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
)?
loaded,
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints)?
loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_ProfileState value) $default, {
required TResult Function(ProfileStateLoading value) loading,
required TResult Function(ProfileStateLoaded value) loaded,
required TResult Function(ProfileStateError value) error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult? Function(_ProfileState value)? $default, {
TResult? Function(ProfileStateLoading value)? loading,
TResult? Function(ProfileStateLoaded value)? loaded,
TResult? Function(ProfileStateError value)? error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_ProfileState value)? $default, {
@@ -81,15 +82,15 @@ mixin _$ProfileState {
TResult Function(ProfileStateLoaded value)? loaded,
TResult Function(ProfileStateError value)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $ProfileStateCopyWith<$Res> {
factory $ProfileStateCopyWith(
ProfileState value,
$Res Function(ProfileState) then,
) = _$ProfileStateCopyWithImpl<$Res, ProfileState>;
ProfileState value, $Res Function(ProfileState) then) =
_$ProfileStateCopyWithImpl<$Res, ProfileState>;
}
/// @nodoc
@@ -109,9 +110,8 @@ class _$ProfileStateCopyWithImpl<$Res, $Val extends ProfileState>
/// @nodoc
abstract class _$$ProfileStateImplCopyWith<$Res> {
factory _$$ProfileStateImplCopyWith(
_$ProfileStateImpl value,
$Res Function(_$ProfileStateImpl) then,
) = __$$ProfileStateImplCopyWithImpl<$Res>;
_$ProfileStateImpl value, $Res Function(_$ProfileStateImpl) then) =
__$$ProfileStateImplCopyWithImpl<$Res>;
}
/// @nodoc
@@ -119,9 +119,8 @@ class __$$ProfileStateImplCopyWithImpl<$Res>
extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateImpl>
implements _$$ProfileStateImplCopyWith<$Res> {
__$$ProfileStateImplCopyWithImpl(
_$ProfileStateImpl _value,
$Res Function(_$ProfileStateImpl) _then,
) : super(_value, _then);
_$ProfileStateImpl _value, $Res Function(_$ProfileStateImpl) _then)
: super(_value, _then);
/// Create a copy of ProfileState
/// with the given fields replaced by the non-null parameter values.
@@ -152,13 +151,12 @@ class _$ProfileStateImpl implements _ProfileState {
TResult Function() $default, {
required TResult Function() loading,
required TResult Function(
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
)
loaded,
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints)
loaded,
required TResult Function(String errorMessage) error,
}) {
return $default();
@@ -170,13 +168,12 @@ class _$ProfileStateImpl implements _ProfileState {
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
)?
loaded,
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints)?
loaded,
TResult? Function(String errorMessage)? error,
}) {
return $default?.call();
@@ -188,13 +185,12 @@ class _$ProfileStateImpl implements _ProfileState {
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
)?
loaded,
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints)?
loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) {
@@ -248,20 +244,18 @@ abstract class _ProfileState implements ProfileState {
/// @nodoc
abstract class _$$ProfileStateLoadingImplCopyWith<$Res> {
factory _$$ProfileStateLoadingImplCopyWith(
_$ProfileStateLoadingImpl value,
$Res Function(_$ProfileStateLoadingImpl) then,
) = __$$ProfileStateLoadingImplCopyWithImpl<$Res>;
factory _$$ProfileStateLoadingImplCopyWith(_$ProfileStateLoadingImpl value,
$Res Function(_$ProfileStateLoadingImpl) then) =
__$$ProfileStateLoadingImplCopyWithImpl<$Res>;
}
/// @nodoc
class __$$ProfileStateLoadingImplCopyWithImpl<$Res>
extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateLoadingImpl>
implements _$$ProfileStateLoadingImplCopyWith<$Res> {
__$$ProfileStateLoadingImplCopyWithImpl(
_$ProfileStateLoadingImpl _value,
$Res Function(_$ProfileStateLoadingImpl) _then,
) : super(_value, _then);
__$$ProfileStateLoadingImplCopyWithImpl(_$ProfileStateLoadingImpl _value,
$Res Function(_$ProfileStateLoadingImpl) _then)
: super(_value, _then);
/// Create a copy of ProfileState
/// with the given fields replaced by the non-null parameter values.
@@ -293,13 +287,12 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading {
TResult Function() $default, {
required TResult Function() loading,
required TResult Function(
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
)
loaded,
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints)
loaded,
required TResult Function(String errorMessage) error,
}) {
return loading();
@@ -311,13 +304,12 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading {
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
)?
loaded,
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints)?
loaded,
TResult? Function(String errorMessage)? error,
}) {
return loading?.call();
@@ -329,13 +321,12 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading {
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
)?
loaded,
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints)?
loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) {
@@ -389,18 +380,16 @@ abstract class ProfileStateLoading implements ProfileState {
/// @nodoc
abstract class _$$ProfileStateLoadedImplCopyWith<$Res> {
factory _$$ProfileStateLoadedImplCopyWith(
_$ProfileStateLoadedImpl value,
$Res Function(_$ProfileStateLoadedImpl) then,
) = __$$ProfileStateLoadedImplCopyWithImpl<$Res>;
factory _$$ProfileStateLoadedImplCopyWith(_$ProfileStateLoadedImpl value,
$Res Function(_$ProfileStateLoadedImpl) then) =
__$$ProfileStateLoadedImplCopyWithImpl<$Res>;
@useResult
$Res call({
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
});
$Res call(
{ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints});
$ProfileModelCopyWith<$Res> get profile;
$ProfileDetailsModelCopyWith<$Res> get profileDetails;
@@ -410,10 +399,9 @@ abstract class _$$ProfileStateLoadedImplCopyWith<$Res> {
class __$$ProfileStateLoadedImplCopyWithImpl<$Res>
extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateLoadedImpl>
implements _$$ProfileStateLoadedImplCopyWith<$Res> {
__$$ProfileStateLoadedImplCopyWithImpl(
_$ProfileStateLoadedImpl _value,
$Res Function(_$ProfileStateLoadedImpl) _then,
) : super(_value, _then);
__$$ProfileStateLoadedImplCopyWithImpl(_$ProfileStateLoadedImpl _value,
$Res Function(_$ProfileStateLoadedImpl) _then)
: super(_value, _then);
/// Create a copy of ProfileState
/// with the given fields replaced by the non-null parameter values.
@@ -426,35 +414,28 @@ class __$$ProfileStateLoadedImplCopyWithImpl<$Res>
Object? weightPoints = freezed,
Object? circumferencePoints = freezed,
}) {
return _then(
_$ProfileStateLoadedImpl(
profile:
null == profile
? _value.profile
: profile // ignore: cast_nullable_to_non_nullable
as ProfileModel,
profileDetails:
null == profileDetails
? _value.profileDetails
: profileDetails // ignore: cast_nullable_to_non_nullable
as ProfileDetailsModel,
blogPosts:
null == blogPosts
? _value._blogPosts
: blogPosts // ignore: cast_nullable_to_non_nullable
as List<FeedBlogPostModel>,
weightPoints:
freezed == weightPoints
? _value._weightPoints
: weightPoints // ignore: cast_nullable_to_non_nullable
as List<WeightModel>?,
circumferencePoints:
freezed == circumferencePoints
? _value._circumferencePoints
: circumferencePoints // ignore: cast_nullable_to_non_nullable
as List<CircumferenceModel>?,
),
);
return _then(_$ProfileStateLoadedImpl(
profile: null == profile
? _value.profile
: profile // ignore: cast_nullable_to_non_nullable
as ProfileModel,
profileDetails: null == profileDetails
? _value.profileDetails
: profileDetails // ignore: cast_nullable_to_non_nullable
as ProfileDetailsModel,
blogPosts: null == blogPosts
? _value._blogPosts
: blogPosts // ignore: cast_nullable_to_non_nullable
as List<FeedBlogPostModel>,
weightPoints: freezed == weightPoints
? _value._weightPoints
: weightPoints // ignore: cast_nullable_to_non_nullable
as List<WeightModel>?,
circumferencePoints: freezed == circumferencePoints
? _value._circumferencePoints
: circumferencePoints // ignore: cast_nullable_to_non_nullable
as List<CircumferenceModel>?,
));
}
/// Create a copy of ProfileState
@@ -481,15 +462,15 @@ class __$$ProfileStateLoadedImplCopyWithImpl<$Res>
/// @nodoc
class _$ProfileStateLoadedImpl implements ProfileStateLoaded {
const _$ProfileStateLoadedImpl({
required this.profile,
required this.profileDetails,
required final List<FeedBlogPostModel> blogPosts,
final List<WeightModel>? weightPoints,
final List<CircumferenceModel>? circumferencePoints,
}) : _blogPosts = blogPosts,
_weightPoints = weightPoints,
_circumferencePoints = circumferencePoints;
const _$ProfileStateLoadedImpl(
{required this.profile,
required this.profileDetails,
required final List<FeedBlogPostModel> blogPosts,
final List<WeightModel>? weightPoints,
final List<CircumferenceModel>? circumferencePoints})
: _blogPosts = blogPosts,
_weightPoints = weightPoints,
_circumferencePoints = circumferencePoints;
@override
final ProfileModel profile;
@@ -537,29 +518,22 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded {
(identical(other.profile, profile) || other.profile == profile) &&
(identical(other.profileDetails, profileDetails) ||
other.profileDetails == profileDetails) &&
const DeepCollectionEquality().equals(
other._blogPosts,
_blogPosts,
) &&
const DeepCollectionEquality().equals(
other._weightPoints,
_weightPoints,
) &&
const DeepCollectionEquality().equals(
other._circumferencePoints,
_circumferencePoints,
));
const DeepCollectionEquality()
.equals(other._blogPosts, _blogPosts) &&
const DeepCollectionEquality()
.equals(other._weightPoints, _weightPoints) &&
const DeepCollectionEquality()
.equals(other._circumferencePoints, _circumferencePoints));
}
@override
int get hashCode => Object.hash(
runtimeType,
profile,
profileDetails,
const DeepCollectionEquality().hash(_blogPosts),
const DeepCollectionEquality().hash(_weightPoints),
const DeepCollectionEquality().hash(_circumferencePoints),
);
runtimeType,
profile,
profileDetails,
const DeepCollectionEquality().hash(_blogPosts),
const DeepCollectionEquality().hash(_weightPoints),
const DeepCollectionEquality().hash(_circumferencePoints));
/// Create a copy of ProfileState
/// with the given fields replaced by the non-null parameter values.
@@ -568,9 +542,7 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded {
@pragma('vm:prefer-inline')
_$$ProfileStateLoadedImplCopyWith<_$ProfileStateLoadedImpl> get copyWith =>
__$$ProfileStateLoadedImplCopyWithImpl<_$ProfileStateLoadedImpl>(
this,
_$identity,
);
this, _$identity);
@override
@optionalTypeArgs
@@ -578,22 +550,16 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded {
TResult Function() $default, {
required TResult Function() loading,
required TResult Function(
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
)
loaded,
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints)
loaded,
required TResult Function(String errorMessage) error,
}) {
return loaded(
profile,
profileDetails,
blogPosts,
weightPoints,
circumferencePoints,
);
profile, profileDetails, blogPosts, weightPoints, circumferencePoints);
}
@override
@@ -602,22 +568,16 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded {
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
)?
loaded,
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints)?
loaded,
TResult? Function(String errorMessage)? error,
}) {
return loaded?.call(
profile,
profileDetails,
blogPosts,
weightPoints,
circumferencePoints,
);
profile, profileDetails, blogPosts, weightPoints, circumferencePoints);
}
@override
@@ -626,24 +586,18 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded {
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
)?
loaded,
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints)?
loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) {
if (loaded != null) {
return loaded(
profile,
profileDetails,
blogPosts,
weightPoints,
circumferencePoints,
);
return loaded(profile, profileDetails, blogPosts, weightPoints,
circumferencePoints);
}
return orElse();
}
@@ -687,13 +641,13 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded {
}
abstract class ProfileStateLoaded implements ProfileState {
const factory ProfileStateLoaded({
required final ProfileModel profile,
required final ProfileDetailsModel profileDetails,
required final List<FeedBlogPostModel> blogPosts,
final List<WeightModel>? weightPoints,
final List<CircumferenceModel>? circumferencePoints,
}) = _$ProfileStateLoadedImpl;
const factory ProfileStateLoaded(
{required final ProfileModel profile,
required final ProfileDetailsModel profileDetails,
required final List<FeedBlogPostModel> blogPosts,
final List<WeightModel>? weightPoints,
final List<CircumferenceModel>? circumferencePoints}) =
_$ProfileStateLoadedImpl;
ProfileModel get profile;
ProfileDetailsModel get profileDetails;
@@ -710,10 +664,9 @@ abstract class ProfileStateLoaded implements ProfileState {
/// @nodoc
abstract class _$$ProfileStateErrorImplCopyWith<$Res> {
factory _$$ProfileStateErrorImplCopyWith(
_$ProfileStateErrorImpl value,
$Res Function(_$ProfileStateErrorImpl) then,
) = __$$ProfileStateErrorImplCopyWithImpl<$Res>;
factory _$$ProfileStateErrorImplCopyWith(_$ProfileStateErrorImpl value,
$Res Function(_$ProfileStateErrorImpl) then) =
__$$ProfileStateErrorImplCopyWithImpl<$Res>;
@useResult
$Res call({String errorMessage});
}
@@ -722,25 +675,23 @@ abstract class _$$ProfileStateErrorImplCopyWith<$Res> {
class __$$ProfileStateErrorImplCopyWithImpl<$Res>
extends _$ProfileStateCopyWithImpl<$Res, _$ProfileStateErrorImpl>
implements _$$ProfileStateErrorImplCopyWith<$Res> {
__$$ProfileStateErrorImplCopyWithImpl(
_$ProfileStateErrorImpl _value,
$Res Function(_$ProfileStateErrorImpl) _then,
) : super(_value, _then);
__$$ProfileStateErrorImplCopyWithImpl(_$ProfileStateErrorImpl _value,
$Res Function(_$ProfileStateErrorImpl) _then)
: super(_value, _then);
/// Create a copy of ProfileState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? errorMessage = null}) {
return _then(
_$ProfileStateErrorImpl(
errorMessage:
null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
),
);
$Res call({
Object? errorMessage = null,
}) {
return _then(_$ProfileStateErrorImpl(
errorMessage: null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
@@ -776,9 +727,7 @@ class _$ProfileStateErrorImpl implements ProfileStateError {
@pragma('vm:prefer-inline')
_$$ProfileStateErrorImplCopyWith<_$ProfileStateErrorImpl> get copyWith =>
__$$ProfileStateErrorImplCopyWithImpl<_$ProfileStateErrorImpl>(
this,
_$identity,
);
this, _$identity);
@override
@optionalTypeArgs
@@ -786,13 +735,12 @@ class _$ProfileStateErrorImpl implements ProfileStateError {
TResult Function() $default, {
required TResult Function() loading,
required TResult Function(
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
)
loaded,
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints)
loaded,
required TResult Function(String errorMessage) error,
}) {
return error(errorMessage);
@@ -804,13 +752,12 @@ class _$ProfileStateErrorImpl implements ProfileStateError {
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
)?
loaded,
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints)?
loaded,
TResult? Function(String errorMessage)? error,
}) {
return error?.call(errorMessage);
@@ -822,13 +769,12 @@ class _$ProfileStateErrorImpl implements ProfileStateError {
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints,
)?
loaded,
ProfileModel profile,
ProfileDetailsModel profileDetails,
List<FeedBlogPostModel> blogPosts,
List<WeightModel>? weightPoints,
List<CircumferenceModel>? circumferencePoints)?
loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) {

View File

@@ -12,8 +12,7 @@ part of 'sub_state.dart';
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',
);
'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 _$SubState {
@@ -23,14 +22,16 @@ mixin _$SubState {
required TResult Function() loading,
required TResult Function(List<SubModel> subList) loaded,
required TResult Function(String errorMessage) error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(List<SubModel> subList)? loaded,
TResult? Function(String errorMessage)? error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function()? $default, {
@@ -38,21 +39,24 @@ mixin _$SubState {
TResult Function(List<SubModel> subList)? loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_SubState value) $default, {
required TResult Function(SubStateLoading value) loading,
required TResult Function(SubStateLoaded value) loaded,
required TResult Function(SubStateError value) error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult? Function(_SubState value)? $default, {
TResult? Function(SubStateLoading value)? loading,
TResult? Function(SubStateLoaded value)? loaded,
TResult? Function(SubStateError value)? error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_SubState value)? $default, {
@@ -60,7 +64,8 @@ mixin _$SubState {
TResult Function(SubStateLoaded value)? loaded,
TResult Function(SubStateError value)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
}
/// @nodoc
@@ -86,9 +91,8 @@ class _$SubStateCopyWithImpl<$Res, $Val extends SubState>
/// @nodoc
abstract class _$$SubStateImplCopyWith<$Res> {
factory _$$SubStateImplCopyWith(
_$SubStateImpl value,
$Res Function(_$SubStateImpl) then,
) = __$$SubStateImplCopyWithImpl<$Res>;
_$SubStateImpl value, $Res Function(_$SubStateImpl) then) =
__$$SubStateImplCopyWithImpl<$Res>;
}
/// @nodoc
@@ -96,9 +100,8 @@ class __$$SubStateImplCopyWithImpl<$Res>
extends _$SubStateCopyWithImpl<$Res, _$SubStateImpl>
implements _$$SubStateImplCopyWith<$Res> {
__$$SubStateImplCopyWithImpl(
_$SubStateImpl _value,
$Res Function(_$SubStateImpl) _then,
) : super(_value, _then);
_$SubStateImpl _value, $Res Function(_$SubStateImpl) _then)
: super(_value, _then);
/// Create a copy of SubState
/// with the given fields replaced by the non-null parameter values.
@@ -204,10 +207,9 @@ abstract class _SubState implements SubState {
/// @nodoc
abstract class _$$SubStateLoadingImplCopyWith<$Res> {
factory _$$SubStateLoadingImplCopyWith(
_$SubStateLoadingImpl value,
$Res Function(_$SubStateLoadingImpl) then,
) = __$$SubStateLoadingImplCopyWithImpl<$Res>;
factory _$$SubStateLoadingImplCopyWith(_$SubStateLoadingImpl value,
$Res Function(_$SubStateLoadingImpl) then) =
__$$SubStateLoadingImplCopyWithImpl<$Res>;
}
/// @nodoc
@@ -215,9 +217,8 @@ class __$$SubStateLoadingImplCopyWithImpl<$Res>
extends _$SubStateCopyWithImpl<$Res, _$SubStateLoadingImpl>
implements _$$SubStateLoadingImplCopyWith<$Res> {
__$$SubStateLoadingImplCopyWithImpl(
_$SubStateLoadingImpl _value,
$Res Function(_$SubStateLoadingImpl) _then,
) : super(_value, _then);
_$SubStateLoadingImpl _value, $Res Function(_$SubStateLoadingImpl) _then)
: super(_value, _then);
/// Create a copy of SubState
/// with the given fields replaced by the non-null parameter values.
@@ -323,10 +324,9 @@ abstract class SubStateLoading implements SubState {
/// @nodoc
abstract class _$$SubStateLoadedImplCopyWith<$Res> {
factory _$$SubStateLoadedImplCopyWith(
_$SubStateLoadedImpl value,
$Res Function(_$SubStateLoadedImpl) then,
) = __$$SubStateLoadedImplCopyWithImpl<$Res>;
factory _$$SubStateLoadedImplCopyWith(_$SubStateLoadedImpl value,
$Res Function(_$SubStateLoadedImpl) then) =
__$$SubStateLoadedImplCopyWithImpl<$Res>;
@useResult
$Res call({List<SubModel> subList});
}
@@ -336,24 +336,22 @@ class __$$SubStateLoadedImplCopyWithImpl<$Res>
extends _$SubStateCopyWithImpl<$Res, _$SubStateLoadedImpl>
implements _$$SubStateLoadedImplCopyWith<$Res> {
__$$SubStateLoadedImplCopyWithImpl(
_$SubStateLoadedImpl _value,
$Res Function(_$SubStateLoadedImpl) _then,
) : super(_value, _then);
_$SubStateLoadedImpl _value, $Res Function(_$SubStateLoadedImpl) _then)
: super(_value, _then);
/// Create a copy of SubState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? subList = null}) {
return _then(
_$SubStateLoadedImpl(
subList:
null == subList
? _value._subList
: subList // ignore: cast_nullable_to_non_nullable
as List<SubModel>,
),
);
$Res call({
Object? subList = null,
}) {
return _then(_$SubStateLoadedImpl(
subList: null == subList
? _value._subList
: subList // ignore: cast_nullable_to_non_nullable
as List<SubModel>,
));
}
}
@@ -361,7 +359,7 @@ class __$$SubStateLoadedImplCopyWithImpl<$Res>
class _$SubStateLoadedImpl implements SubStateLoaded {
const _$SubStateLoadedImpl({required final List<SubModel> subList})
: _subList = subList;
: _subList = subList;
final List<SubModel> _subList;
@override
@@ -395,9 +393,7 @@ class _$SubStateLoadedImpl implements SubStateLoaded {
@pragma('vm:prefer-inline')
_$$SubStateLoadedImplCopyWith<_$SubStateLoadedImpl> get copyWith =>
__$$SubStateLoadedImplCopyWithImpl<_$SubStateLoadedImpl>(
this,
_$identity,
);
this, _$identity);
@override
@optionalTypeArgs
@@ -490,9 +486,8 @@ abstract class SubStateLoaded implements SubState {
/// @nodoc
abstract class _$$SubStateErrorImplCopyWith<$Res> {
factory _$$SubStateErrorImplCopyWith(
_$SubStateErrorImpl value,
$Res Function(_$SubStateErrorImpl) then,
) = __$$SubStateErrorImplCopyWithImpl<$Res>;
_$SubStateErrorImpl value, $Res Function(_$SubStateErrorImpl) then) =
__$$SubStateErrorImplCopyWithImpl<$Res>;
@useResult
$Res call({String errorMessage});
}
@@ -502,24 +497,22 @@ class __$$SubStateErrorImplCopyWithImpl<$Res>
extends _$SubStateCopyWithImpl<$Res, _$SubStateErrorImpl>
implements _$$SubStateErrorImplCopyWith<$Res> {
__$$SubStateErrorImplCopyWithImpl(
_$SubStateErrorImpl _value,
$Res Function(_$SubStateErrorImpl) _then,
) : super(_value, _then);
_$SubStateErrorImpl _value, $Res Function(_$SubStateErrorImpl) _then)
: super(_value, _then);
/// Create a copy of SubState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? errorMessage = null}) {
return _then(
_$SubStateErrorImpl(
errorMessage:
null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
),
);
$Res call({
Object? errorMessage = null,
}) {
return _then(_$SubStateErrorImpl(
errorMessage: null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
));
}
}

View File

@@ -85,7 +85,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
if (isFirstFetch) {
canSub = !state.profile.isEntitySubscribedByMe;
if (state.profile.roles.contains('consultant')) {
plansCubit..getPlans(state.profile.slug);
plansCubit.getPlans(state.profile.slug);
}
isFirstFetch = false;
}
@@ -116,7 +116,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
decoration: BoxDecoration(
decoration: const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.vertical(
bottom: Radius.circular(16),
@@ -133,7 +133,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
Row(
children: [
const SizedBox(width: 16),
Text(
const Text(
'Консультант',
style: TextStyle(
fontSize: 16,
@@ -148,7 +148,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
Container(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
decoration: BoxDecoration(
color: Color(0xFFF6FAFF),
color: const Color(0xFFF6FAFF),
borderRadius: BorderRadius.circular(12),
),
child: Text(
@@ -163,9 +163,9 @@ class _ProfileScreenState extends State<ProfileScreen> {
],
),
if (state.profile.educationResource?.hasMedicalEducation == 1)
Row(
const Row(
children: [
const SizedBox(width: 16),
SizedBox(width: 16),
Icon(
Icons.done_rounded,
color: Colors.green,
@@ -190,7 +190,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
),
_subscriptionsAndSubscribers(state),
if (state.profile.badges.isNotEmpty) Padding(padding: EdgeInsets.only(bottom: 16), child: _badges(state)),
if (state.profile.badges.isNotEmpty) Padding(padding: const EdgeInsets.only(bottom: 16), child: _badges(state)),
if (state.profile.roles.contains('consultant')) _socialLinks(state),
if (state.profile.roles.contains('consultant')) _education(state),
if (state.profile.roles.contains('consultant')) _diplomasAndCertificates(state),
@@ -211,7 +211,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
decoration: BoxDecoration(
decoration: const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.vertical(
bottom: Radius.circular(16),
@@ -226,11 +226,11 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
),
_subscriptionsAndSubscribers(state),
if (state.profile.badges.isNotEmpty) Padding(padding: EdgeInsets.only(bottom: 16), child: _badges(state)),
if (state.profile.badges.isNotEmpty) Padding(padding: const EdgeInsets.only(bottom: 16), child: _badges(state)),
if (state.profile.roles.contains('consultant')) _socialLinks(state),
if (state.profile.roles.contains('consultant')) _education(state),
if (state.profile.roles.contains('consultant')) _diplomasAndCertificates(state),
Padding(padding: EdgeInsets.only(bottom: 16), child: _charts()),
Padding(padding: const EdgeInsets.only(bottom: 16), child: _charts()),
if (state.profile.roles.contains('consultant')) _activePlans(state),
_newBlogPostButton(),
_blogPosts(state),
@@ -253,8 +253,8 @@ class _ProfileScreenState extends State<ProfileScreen> {
}
return Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 16),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
@@ -293,7 +293,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
],
);
}
return Loader();
return const Loader();
},
);
}
@@ -321,9 +321,9 @@ class _ProfileScreenState extends State<ProfileScreen> {
return AnimatedContainer(
width: isActive ? 10 : 8,
height: isActive ? 10 : 8,
duration: Duration(milliseconds: 150),
duration: const Duration(milliseconds: 150),
decoration: BoxDecoration(
color: isActive ? appTheme.blueA400 : Color(0xFFD7D9DC),
color: isActive ? appTheme.blueA400 : const Color(0xFFD7D9DC),
shape: BoxShape.circle,
),
);
@@ -341,19 +341,19 @@ class _ProfileScreenState extends State<ProfileScreen> {
},
borderRadius: BorderRadius.circular(8),
child: Ink(
padding: EdgeInsets.all(12),
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: Color(0xFFF6FAFF),
color: const Color(0xFFF6FAFF),
borderRadius: BorderRadius.circular(8),
),
child: Row(
child: const Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.add_circle_outline_rounded,
color: Color(0xFF2F80ED),
),
const SizedBox(width: 12),
SizedBox(width: 12),
Text(
'Новая запись',
style: TextStyle(
@@ -383,7 +383,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
const Text(
'Дипломы\nи сертификаты',
style: TextStyle(
color: Color(0xFF323F4B),
@@ -394,7 +394,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
Text(
widget.author == null ? 'Редактировать' : '',
style: TextStyle(
style: const TextStyle(
color: Color(0xFF2F80ED),
fontSize: 16,
fontWeight: FontWeight.w500,
@@ -417,7 +417,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
child: Row(
children: [
if (state.profile.diplomasAndCertificates != null)
...state.profile.diplomasAndCertificates!.map((d) => _diplomaImage(baseUrl + '/storage/' + d.path)).toList(),
...state.profile.diplomasAndCertificates!.map((d) => _diplomaImage('$baseUrl/storage/${d.path}')),
],
),
),
@@ -457,7 +457,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
_education(ProfileStateLoaded state) {
if (!state.profile.roles.contains('consultant') ||
state.profile.educationResource?.completedCourses == null ||
state.profile.educationResource?.completedCourses?.length == 0) {
(state.profile.educationResource?.completedCourses?.isEmpty ?? false)) {
return const SizedBox.shrink();
}
return Padding(
@@ -469,7 +469,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
const Text(
'Образование',
style: TextStyle(
color: Color(0xFF323F4B),
@@ -479,7 +479,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
Text(
widget.author == null ? 'Редактировать' : '',
style: TextStyle(
style: const TextStyle(
color: Color(0xFF2F80ED),
fontSize: 16,
fontWeight: FontWeight.w500,
@@ -499,7 +499,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
child: Column(
children: [
if (state.profile.educationResource?.completedCourses != null)
...state.profile.educationResource!.completedCourses!.map((c) => _educationBlock(c.values.first.title, c.values.first.date)).toList(),
...state.profile.educationResource!.completedCourses!.map((c) => _educationBlock(c.values.first.title, c.values.first.date)),
],
),
),
@@ -514,7 +514,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
return SizedBox(
width: double.infinity,
child: Material(
color: Color(0xFFF6FAFF),
color: const Color(0xFFF6FAFF),
borderRadius: BorderRadius.circular(12),
child: Padding(
padding: const EdgeInsets.all(12),
@@ -523,7 +523,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
children: [
Text(
title,
style: TextStyle(
style: const TextStyle(
height: 1,
color: Color(0xFF323F4B),
fontWeight: FontWeight.w500,
@@ -533,7 +533,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
const SizedBox(height: 4),
Text(
date,
style: TextStyle(
style: const TextStyle(
height: 1,
color: Color(0xFF6D6F71),
fontWeight: FontWeight.w500,
@@ -613,14 +613,14 @@ class _ProfileScreenState extends State<ProfileScreen> {
width: MediaQuery.of(context).size.width / 3 - (56 / 3),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: Color(0xFFF6F6F6),
color: const Color(0xFFF6F6F6),
),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 40, vertical: 16),
child: SvgPicture.asset(
icon,
width: 24,
colorFilter: ColorFilter.mode(Colors.black12, BlendMode.srcIn),
colorFilter: const ColorFilter.mode(Colors.black12, BlendMode.srcIn),
),
),
),
@@ -636,10 +636,14 @@ class _ProfileScreenState extends State<ProfileScreen> {
child: Ink(
padding: const EdgeInsets.all(8),
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
const Text(
'Достижения',
style: TextStyle(
color: Color(0xFF6D6F71),
@@ -655,12 +659,12 @@ class _ProfileScreenState extends State<ProfileScreen> {
for (int i = 0; i < state.profile.badges.length; i++) ...[
state.profile.badges[i].image.contains('svg')
? SvgPicture.network(
baseUrl + '/storage/' + state.profile.badges[i].image,
'$baseUrl/storage/${state.profile.badges[i].image}',
width: 40,
height: 40,
)
: CachedNetworkImage(
imageUrl: baseUrl + '/storage/' + state.profile.badges[i].image,
imageUrl: '$baseUrl/storage/${state.profile.badges[i].image}',
width: 40,
height: 40,
),
@@ -671,10 +675,6 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
],
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
),
),
),
);
@@ -688,7 +688,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
InkWell(
onTap: () => GoRouter.of(context).pushNamed(
'subsScreen',
extra: SubType.Subscriptions,
extra: SubType.subscriptions,
pathParameters: {
'slug': state.profile.slug,
},
@@ -697,6 +697,10 @@ class _ProfileScreenState extends State<ProfileScreen> {
child: Ink(
padding: const EdgeInsets.all(8),
width: MediaQuery.of(context).size.width / 2 - 6,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
@@ -704,7 +708,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
const Text(
'Подписки',
style: TextStyle(
color: Color(0xFF6D6F71),
@@ -714,7 +718,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
Text(
'${state.profile.subscriptions.length}',
style: TextStyle(
style: const TextStyle(
color: Color(0xFF323F4B),
fontSize: 22,
fontWeight: FontWeight.w700,
@@ -723,22 +727,18 @@ class _ProfileScreenState extends State<ProfileScreen> {
],
),
Padding(
padding: EdgeInsets.only(right: 8),
padding: const EdgeInsets.only(right: 8),
child: _miniAvatars(state.profile.subscriptions.map((e) => e.profilePhotoUrl).toList()),
),
],
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
),
),
),
SizedBox(width: 4),
const SizedBox(width: 4),
InkWell(
onTap: () => GoRouter.of(context).pushNamed(
'subsScreen',
extra: SubType.Subscribers,
extra: SubType.subscribers,
pathParameters: {
'slug': state.profile.slug,
},
@@ -747,6 +747,10 @@ class _ProfileScreenState extends State<ProfileScreen> {
child: Ink(
padding: const EdgeInsets.all(8),
width: MediaQuery.of(context).size.width / 2 - 6,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
@@ -754,7 +758,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
const Text(
'Подписчики',
style: TextStyle(
color: Color(0xFF6D6F71),
@@ -764,7 +768,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
Text(
'${state.profile.subscribers.length}',
style: TextStyle(
style: const TextStyle(
color: Color(0xFF323F4B),
fontSize: 22,
fontWeight: FontWeight.w700,
@@ -773,15 +777,11 @@ class _ProfileScreenState extends State<ProfileScreen> {
],
),
Padding(
padding: EdgeInsets.only(right: 8),
padding: const EdgeInsets.only(right: 8),
child: _miniAvatars(state.profile.subscribers.map((e) => e.profilePhotoUrl).toList()),
),
],
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
),
),
),
],
@@ -810,14 +810,14 @@ class _ProfileScreenState extends State<ProfileScreen> {
_blogPosts(ProfileStateLoaded state) {
return ListView.separated(
padding: EdgeInsets.symmetric(vertical: 16),
padding: const EdgeInsets.symmetric(vertical: 16),
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) => ProfileBlogPostWidget(
index: index,
profileCubit: profileCubit,
),
separatorBuilder: (context, index) => SizedBox(height: 8),
separatorBuilder: (context, index) => const SizedBox(height: 8),
itemCount: state.blogPosts.length,
);
}
@@ -872,7 +872,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
}
},
child: const Row(
children: const [
children: [
Icon(Icons.photo_camera),
SizedBox(width: 8),
Text('Фото'),
@@ -890,7 +890,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
}
},
child: const Row(
children: const [
children: [
Icon(Icons.photo),
SizedBox(width: 8),
Text('Галерея'),
@@ -912,17 +912,17 @@ class _ProfileScreenState extends State<ProfileScreen> {
}
},
itemBuilder: (context) => [
PopupMenuItem(
const PopupMenuItem(
value: 'view',
child: Text('Посмотреть'),
),
if (widget.author == null)
PopupMenuItem(
const PopupMenuItem(
value: 'replace',
child: Text('Заменить'),
),
if (widget.author == null)
PopupMenuItem(
const PopupMenuItem(
value: 'delete',
child: Text('Удалить'),
),
@@ -932,7 +932,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
child: CircleAvatar(
radius: 32,
foregroundImage: NetworkImage(state.profile.profilePhotoUrl),
backgroundImage: AssetImage('assets/images/no_avatar.png'),
backgroundImage: const AssetImage('assets/images/no_avatar.png'),
),
),
),
@@ -941,8 +941,8 @@ class _ProfileScreenState extends State<ProfileScreen> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
state.profileDetails.firstName + ' ' + state.profileDetails.lastName,
style: TextStyle(
'${state.profileDetails.firstName} ${state.profileDetails.lastName}',
style: const TextStyle(
color: Colors.black,
fontWeight: FontWeight.w600,
fontSize: 16,
@@ -963,7 +963,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
const Text(
'Подробнее',
style: TextStyle(
fontSize: 20,
@@ -972,13 +972,13 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
),
const SizedBox(height: 16),
_additional('Дата рожденя: ', '${state.profileDetails.birthdate}'),
_additional('Дата рожденя: ', state.profileDetails.birthdate),
const SizedBox(height: 12),
_additional('Страна: ', '${state.profileDetails.country}'),
_additional('Страна: ', state.profileDetails.country),
const SizedBox(height: 12),
_additional('Город: ', '${state.profileDetails.city}'),
_additional('Город: ', state.profileDetails.city),
const SizedBox(height: 12),
_additional('Язык общения: ', '${state.profileDetails.lang}'),
_additional('Язык общения: ', state.profileDetails.lang),
const SizedBox(height: 12),
_additional('В Eatvio с: ', '${state.profile.createdAt?.format('d.MM.yyyy', 'ru')}'),
const SizedBox(height: 12),
@@ -987,14 +987,14 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
);
},
child: Row(
child: const Row(
children: [
Icon(
Icons.info_outline,
size: 20,
color: Color(0xFF6D6F71),
),
const SizedBox(width: 4),
SizedBox(width: 4),
Text(
'Дополнительно',
style: TextStyle(
@@ -1015,7 +1015,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
final box = context.findRenderObject() as RenderBox?;
Share.shareUri(
Uri.parse(
baseUrl + '/ru/profile/' + state.profile.slug,
'$baseUrl/ru/profile/${state.profile.slug}',
),
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
);
@@ -1031,17 +1031,17 @@ class _ProfileScreenState extends State<ProfileScreen> {
}
},
itemBuilder: (context) => [
PopupMenuItem(
const PopupMenuItem(
value: 'share',
child: Text('Поделиться'),
),
if (widget.author != null)
PopupMenuItem(
const PopupMenuItem(
value: 'complain',
child: Text('Пожаловаться'),
),
],
child: Icon(Icons.more_horiz_rounded),
child: const Icon(Icons.more_horiz_rounded),
),
],
),
@@ -1053,7 +1053,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
children: [
Text(
title,
style: TextStyle(
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Color(0xFF6D6F71),
@@ -1061,7 +1061,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
Text(
value,
style: TextStyle(
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Color(0xFF323F4B),
@@ -1074,7 +1074,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
_messageAndSubscribe(ProfileStateLoaded state) {
return Row(
children: [
SizedBox(width: 16),
const SizedBox(width: 16),
GestureDetector(
onTap: () async {
GoRouter.of(context).pushNamed(
@@ -1086,7 +1086,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
},
child: Container(
alignment: Alignment.center,
padding: EdgeInsets.all(8),
padding: const EdgeInsets.all(8),
width: (MediaQuery.of(context).size.width - 40) / 2,
decoration: BoxDecoration(
color: appTheme.blueA400.withValues(alpha: 0.1),
@@ -1100,7 +1100,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
),
),
SizedBox(width: 8),
const SizedBox(width: 8),
GestureDetector(
onTap: () {
setState(() {
@@ -1110,7 +1110,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
},
child: Container(
alignment: Alignment.center,
padding: EdgeInsets.all(8),
padding: const EdgeInsets.all(8),
width: (MediaQuery.of(context).size.width - 40) / 2,
decoration: BoxDecoration(
color: !canSub ? Colors.grey.shade200 : appTheme.blueA400,
@@ -1124,7 +1124,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
),
),
SizedBox(width: 16),
const SizedBox(width: 16),
],
);
}
@@ -1138,14 +1138,14 @@ class _ProfileScreenState extends State<ProfileScreen> {
children: [
const SizedBox(height: 8),
SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 16),
padding: const EdgeInsets.symmetric(horizontal: 16),
scrollDirection: Axis.horizontal,
child: Row(
children: [
_choiceChipWidget(0),
SizedBox(width: 8),
const SizedBox(width: 8),
_choiceChipWidget(1),
SizedBox(width: 8),
const SizedBox(width: 8),
_choiceChipWidget(2),
],
),
@@ -1168,26 +1168,26 @@ class _ProfileScreenState extends State<ProfileScreen> {
weightPoints: weightPoints,
);
default:
return SizedBox.shrink();
return const SizedBox.shrink();
}
},
),
SizedBox(height: 8),
const SizedBox(height: 8),
Row(
children: [
SizedBox(width: 16),
const SizedBox(width: 16),
_choiceIntervalChipWidget(0),
SizedBox(width: 8),
const SizedBox(width: 8),
_choiceIntervalChipWidget(1),
SizedBox(width: 8),
const SizedBox(width: 8),
_choiceIntervalChipWidget(2),
SizedBox(width: 8),
const SizedBox(width: 8),
_choiceIntervalChipWidget(3),
SizedBox(width: 8),
const SizedBox(width: 8),
_choiceIntervalChipWidget(4),
],
),
SizedBox(height: 8),
const SizedBox(height: 8),
],
),
);

View File

@@ -8,7 +8,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
enum SubType { Subscribers, Subscriptions }
enum SubType { subscribers, subscriptions }
class SubsScreen extends StatefulWidget {
final SubType subType;
@@ -28,7 +28,7 @@ class _SubsScreenState extends State<SubsScreen> {
@override
Widget build(BuildContext context) {
return BlocProvider<SubCubit>(
create: (BuildContext context) => widget.subType == SubType.Subscriptions
create: (BuildContext context) => widget.subType == SubType.subscriptions
? (sl<SubCubit>()
..getSubscriptions(
widget.slug,
@@ -46,21 +46,21 @@ class _SubsScreenState extends State<SubsScreen> {
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: CupertinoSearchTextField(
prefixIcon: Icon(Icons.search),
prefixIcon: const Icon(Icons.search),
placeholder: 'Поиск',
onChanged: (query) {
if (query.length > 2) {
EasyDebounce.debounce(
'searchSubs',
Duration(milliseconds: 300),
const Duration(milliseconds: 300),
() {
widget.subType == SubType.Subscriptions
widget.subType == SubType.subscriptions
? (context.read<SubCubit>().getSubscriptions(widget.slug, query))
: (context.read<SubCubit>().getSubscribers(widget.slug, query));
},
);
} else {
widget.subType == SubType.Subscriptions
widget.subType == SubType.subscriptions
? (context.read<SubCubit>().getSubscriptions(widget.slug))
: (context.read<SubCubit>().getSubscribers(widget.slug));
}
@@ -69,7 +69,7 @@ class _SubsScreenState extends State<SubsScreen> {
),
),
title: Text(
widget.subType == SubType.Subscriptions ? 'Подписки' : 'Подписчики',
widget.subType == SubType.subscriptions ? 'Подписки' : 'Подписчики',
),
),
body: _buildStates(state),
@@ -81,7 +81,7 @@ class _SubsScreenState extends State<SubsScreen> {
_buildStates(SubState state) {
if (state is SubStateLoading) {
return Loader();
return const Loader();
}
if (state is SubStateError) {
return Text(state.errorMessage);

View File

@@ -34,12 +34,12 @@ class _CircumferenceChartWidgetState extends State<CircumferenceChartWidget> {
children: [
if (widget.circumferencePoints.isNotEmpty)
Padding(
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Row(
children: [
Text(
'${widget.circumferencePoints.last.chestCircumference}',
style: TextStyle(
style: const TextStyle(
color: Colors.black,
fontSize: 40,
fontWeight: FontWeight.w500,
@@ -47,29 +47,29 @@ class _CircumferenceChartWidgetState extends State<CircumferenceChartWidget> {
),
if (widget.circumferencePoints.length == 1)
Container(
margin: EdgeInsets.symmetric(horizontal: 12),
margin: const EdgeInsets.symmetric(horizontal: 12),
width: 8,
height: 8,
decoration: BoxDecoration(
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: Colors.black12,
),
),
if (widget.circumferencePoints.length > 1)
widget.circumferencePoints.last.chestCircumference > widget.circumferencePoints[widget.circumferencePoints.length - 2].chestCircumference
? Icon(
? const Icon(
Icons.arrow_drop_up,
size: 40,
color: Colors.grey,
)
: Icon(
: const Icon(
Icons.arrow_drop_down,
size: 40,
color: Colors.grey,
),
Text(
'${widget.circumferencePoints.last.waistCircumference}',
style: TextStyle(
style: const TextStyle(
color: Colors.black,
fontSize: 40,
fontWeight: FontWeight.w500,
@@ -77,29 +77,29 @@ class _CircumferenceChartWidgetState extends State<CircumferenceChartWidget> {
),
if (widget.circumferencePoints.length == 1)
Container(
margin: EdgeInsets.symmetric(horizontal: 12),
margin: const EdgeInsets.symmetric(horizontal: 12),
width: 8,
height: 8,
decoration: BoxDecoration(
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: Colors.black12,
),
),
if (widget.circumferencePoints.length > 1)
widget.circumferencePoints.last.waistCircumference > widget.circumferencePoints[widget.circumferencePoints.length - 2].waistCircumference
? Icon(
? const Icon(
Icons.arrow_drop_up,
size: 40,
color: Colors.grey,
)
: Icon(
: const Icon(
Icons.arrow_drop_down,
size: 40,
color: Colors.grey,
),
Text(
'${widget.circumferencePoints.last.hipCircumference}',
style: TextStyle(
style: const TextStyle(
color: Colors.black,
fontSize: 40,
fontWeight: FontWeight.w500,
@@ -107,22 +107,22 @@ class _CircumferenceChartWidgetState extends State<CircumferenceChartWidget> {
),
if (widget.circumferencePoints.length == 1)
Container(
margin: EdgeInsets.symmetric(horizontal: 12),
margin: const EdgeInsets.symmetric(horizontal: 12),
width: 8,
height: 8,
decoration: BoxDecoration(
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: Colors.black12,
),
),
if (widget.circumferencePoints.length > 1)
widget.circumferencePoints.last.hipCircumference > widget.circumferencePoints[widget.circumferencePoints.length - 2].hipCircumference
? Icon(
? const Icon(
Icons.arrow_drop_up,
size: 40,
color: Colors.grey,
)
: Icon(
: const Icon(
Icons.arrow_drop_down,
size: 40,
color: Colors.grey,
@@ -134,33 +134,33 @@ class _CircumferenceChartWidgetState extends State<CircumferenceChartWidget> {
alignment: Alignment.center,
children: [
SfCartesianChart(
margin: EdgeInsets.symmetric(horizontal: 8),
margin: const EdgeInsets.symmetric(horizontal: 8),
enableAxisAnimation: true,
plotAreaBorderWidth: 0,
trackballBehavior: TrackballBehavior(
enable: true,
activationMode: ActivationMode.singleTap,
tooltipDisplayMode: TrackballDisplayMode.groupAllPoints,
tooltipSettings: InteractiveTooltip(),
tooltipSettings: const InteractiveTooltip(),
lineType: TrackballLineType.vertical,
),
primaryXAxis: DateTimeCategoryAxis(
tickPosition: TickPosition.inside,
majorTickLines: MajorTickLines(
majorTickLines: const MajorTickLines(
size: 0,
),
edgeLabelPlacement: EdgeLabelPlacement.shift,
dateFormat: DateFormat.MMMd('ru'),
labelStyle: TextStyle(
labelStyle: const TextStyle(
color: Colors.grey,
),
majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withValues(alpha: 0.3)),
majorGridLines: MajorGridLines(dashArray: const [1], color: Colors.grey.withValues(alpha: 0.3)),
axisLine: AxisLine(
color: Colors.grey.withValues(alpha: 0.3),
width: 0.4,
),
),
primaryYAxis: NumericAxis(
primaryYAxis: const NumericAxis(
isVisible: false,
labelFormat: '{value} см',
axisLine: AxisLine(
@@ -259,12 +259,12 @@ class _CircumferenceChartWidgetState extends State<CircumferenceChartWidget> {
borderRadius: BorderRadius.circular(16),
child: Ink(
width: MediaQuery.of(context).size.width - 32,
padding: EdgeInsets.all(16),
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: appTheme.blueA400,
borderRadius: BorderRadius.circular(16),
),
child: Center(
child: const Center(
child: Text(
'Сохранить',
style: TextStyle(
@@ -280,16 +280,16 @@ class _CircumferenceChartWidgetState extends State<CircumferenceChartWidget> {
);
},
backgroundColor: appTheme.blueA400,
shape: CircleBorder(),
child: Icon(
shape: const CircleBorder(),
child: const Icon(
Icons.add,
color: Colors.white,
),
),
),
if (widget.circumferencePoints.isEmpty)
Padding(
padding: const EdgeInsets.symmetric(horizontal: 48),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 48),
child: Text(
'Добавьте Ваши замеры',
textAlign: TextAlign.center,
@@ -302,19 +302,19 @@ class _CircumferenceChartWidgetState extends State<CircumferenceChartWidget> {
}
List<CartesianSeries<CircumferenceModel, DateTime>> _getSplineSeries() {
final Color seriesColor1 = Colors.red;
const Color seriesColor1 = Colors.red;
final Color seriesColor2 = appTheme.blueA400;
final Color seriesColor3 = Colors.green;
const Color seriesColor3 = Colors.green;
return <CartesianSeries<CircumferenceModel, DateTime>>[
SplineAreaSeries<CircumferenceModel, DateTime>(
markerSettings: MarkerSettings(
markerSettings: const MarkerSettings(
isVisible: true,
color: seriesColor1,
height: 8,
width: 8,
),
dataLabelSettings: DataLabelSettings(
dataLabelSettings: const DataLabelSettings(
labelAlignment: ChartDataLabelAlignment.top,
isVisible: true,
),
@@ -326,7 +326,7 @@ class _CircumferenceChartWidgetState extends State<CircumferenceChartWidget> {
Colors.transparent,
],
begin: Alignment.topCenter,
end: Alignment(0, 0.6),
end: const Alignment(0, 0.6),
),
name: 'Грудь',
xValueMapper: (CircumferenceModel value, int index) => value.createdAt,
@@ -339,7 +339,7 @@ class _CircumferenceChartWidgetState extends State<CircumferenceChartWidget> {
height: 8,
width: 8,
),
dataLabelSettings: DataLabelSettings(
dataLabelSettings: const DataLabelSettings(
labelAlignment: ChartDataLabelAlignment.top,
isVisible: true,
),
@@ -351,20 +351,20 @@ class _CircumferenceChartWidgetState extends State<CircumferenceChartWidget> {
Colors.transparent,
],
begin: Alignment.topCenter,
end: Alignment(0, 0.6),
end: const Alignment(0, 0.6),
),
name: 'Талия',
xValueMapper: (CircumferenceModel value, int index) => value.createdAt,
yValueMapper: (CircumferenceModel value, int index) => value.waistCircumference,
),
SplineAreaSeries<CircumferenceModel, DateTime>(
markerSettings: MarkerSettings(
markerSettings: const MarkerSettings(
isVisible: true,
color: seriesColor3,
height: 8,
width: 8,
),
dataLabelSettings: DataLabelSettings(
dataLabelSettings: const DataLabelSettings(
labelAlignment: ChartDataLabelAlignment.top,
isVisible: true,
),
@@ -376,7 +376,7 @@ class _CircumferenceChartWidgetState extends State<CircumferenceChartWidget> {
Colors.transparent,
],
begin: Alignment.topCenter,
end: Alignment(0, 0.6),
end: const Alignment(0, 0.6),
),
name: 'Бёдра',
xValueMapper: (CircumferenceModel value, int index) => value.createdAt,

View File

@@ -21,10 +21,10 @@ class ImtChartWidget extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Row(
children: [
if (weightPoints.length > 0)
if (weightPoints.isNotEmpty)
Text(
'${weightPoints.last.bmi.toStringAsFixed(2)}',
style: TextStyle(
weightPoints.last.bmi.toStringAsFixed(2),
style: const TextStyle(
color: Colors.black,
fontSize: 40,
fontWeight: FontWeight.w500,
@@ -32,12 +32,12 @@ class ImtChartWidget extends StatelessWidget {
),
if (weightPoints.length > 1)
weightPoints.last.bmi > weightPoints[weightPoints.length - 2].bmi
? Icon(
? const Icon(
Icons.arrow_drop_up,
size: 40,
color: Colors.grey,
)
: Icon(
: const Icon(
Icons.arrow_drop_down,
size: 40,
color: Colors.grey,
@@ -49,41 +49,41 @@ class ImtChartWidget extends StatelessWidget {
alignment: Alignment.center,
children: [
SfCartesianChart(
margin: EdgeInsets.symmetric(horizontal: 8),
margin: const EdgeInsets.symmetric(horizontal: 8),
enableAxisAnimation: true,
plotAreaBorderWidth: 0,
trackballBehavior: TrackballBehavior(
enable: true,
activationMode: ActivationMode.singleTap,
tooltipDisplayMode: TrackballDisplayMode.groupAllPoints,
tooltipSettings: InteractiveTooltip(),
tooltipSettings: const InteractiveTooltip(),
lineType: TrackballLineType.vertical,
),
primaryXAxis: DateTimeCategoryAxis(
tickPosition: TickPosition.inside,
majorTickLines: MajorTickLines(
majorTickLines: const MajorTickLines(
size: 0,
),
edgeLabelPlacement: EdgeLabelPlacement.shift,
dateFormat: DateFormat.MMMd('ru'),
labelStyle: TextStyle(
labelStyle: const TextStyle(
color: Colors.grey,
),
majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withValues(alpha: 0.3)),
majorGridLines: MajorGridLines(dashArray: const [1], color: Colors.grey.withValues(alpha: 0.3)),
axisLine: AxisLine(
color: Colors.grey.withValues(alpha: 0.3),
width: 0.4,
),
),
primaryYAxis: NumericAxis(
primaryYAxis: const NumericAxis(
isVisible: false,
),
series: _getSplineSeries(),
tooltipBehavior: TooltipBehavior(enable: true),
),
if (weightPoints.isEmpty)
Padding(
padding: const EdgeInsets.symmetric(horizontal: 32),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 32),
child: Text(
'Индекс Массы Тела рассчитывается при указанных весе и росте',
textAlign: TextAlign.center,
@@ -104,7 +104,7 @@ class ImtChartWidget extends StatelessWidget {
height: 8,
width: 8,
),
dataLabelSettings: DataLabelSettings(
dataLabelSettings: const DataLabelSettings(
labelAlignment: ChartDataLabelAlignment.top,
isVisible: true,
),
@@ -116,7 +116,7 @@ class ImtChartWidget extends StatelessWidget {
Colors.transparent,
],
begin: Alignment.topCenter,
end: Alignment(0, 0.6),
end: const Alignment(0, 0.6),
),
name: 'ИМТ',
xValueMapper: (WeightModel value, int index) => value.createdAt,

View File

@@ -57,7 +57,7 @@ class _ProfileBlogPostWidgetState extends State<ProfileBlogPostWidget> {
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 12),
const SizedBox(height: 12),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Row(
@@ -69,13 +69,13 @@ class _ProfileBlogPostWidgetState extends State<ProfileBlogPostWidget> {
state.blogPosts[widget.index].author.authorProfileIcon,
),
),
SizedBox(width: 8),
const SizedBox(width: 8),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
state.blogPosts[widget.index].author.authorName,
style: TextStyle(
style: const TextStyle(
height: 1,
color: Colors.black87,
fontWeight: FontWeight.w500,
@@ -84,7 +84,7 @@ class _ProfileBlogPostWidgetState extends State<ProfileBlogPostWidget> {
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(
style: const TextStyle(
height: 1,
color: Colors.black45,
),
@@ -99,19 +99,19 @@ class _ProfileBlogPostWidgetState extends State<ProfileBlogPostWidget> {
],
),
),
if (state.blogPosts[widget.index].title.isNotEmpty || state.blogPosts[widget.index].description.isNotEmpty) SizedBox(height: 12),
if (state.blogPosts[widget.index].title.isNotEmpty || state.blogPosts[widget.index].description.isNotEmpty) const SizedBox(height: 12),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Text(
state.blogPosts[widget.index].title,
style: TextStyle(
style: const TextStyle(
fontWeight: FontWeight.w600,
fontSize: 18,
color: Colors.black87,
),
),
),
if (state.blogPosts[widget.index].title.isNotEmpty && state.blogPosts[widget.index].description.isNotEmpty) SizedBox(height: 8),
if (state.blogPosts[widget.index].title.isNotEmpty && state.blogPosts[widget.index].description.isNotEmpty) const SizedBox(height: 8),
if (state.blogPosts[widget.index].description.isNotEmpty)
Padding(
padding: const EdgeInsets.symmetric(horizontal: 4),
@@ -139,28 +139,28 @@ class _ProfileBlogPostWidgetState extends State<ProfileBlogPostWidget> {
),
),
),
if (state.blogPosts[widget.index].title.isNotEmpty || state.blogPosts[widget.index].description.isNotEmpty) SizedBox(height: 8),
if (state.blogPosts[widget.index].title.isNotEmpty || state.blogPosts[widget.index].description.isNotEmpty) const SizedBox(height: 8),
GestureDetector(
onTap: () {
context.pushTransparentRoute(
rootNavigator: true,
PhotoViewScreen(
imageUrls: [baseUrl + '/storage/' + state.blogPosts[widget.index].image],
imageUrls: ['$baseUrl/storage/${state.blogPosts[widget.index].image}'],
index: 0,
),
);
},
child: Hero(
tag: baseUrl + '/storage/' + state.blogPosts[widget.index].image,
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(),
imageUrl: '$baseUrl/storage/${state.blogPosts[widget.index].image}',
errorWidget: (context, str, object) => const SizedBox.shrink(),
),
),
),
SizedBox(height: 12),
const SizedBox(height: 12),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Row(
@@ -185,7 +185,7 @@ class _ProfileBlogPostWidgetState extends State<ProfileBlogPostWidget> {
);
},
),
SizedBox(width: 8),
const SizedBox(width: 8),
FeedIconButton(
svgIcon: SvgPicture.asset(
'assets/icons/comment.svg',
@@ -202,7 +202,7 @@ class _ProfileBlogPostWidgetState extends State<ProfileBlogPostWidget> {
extra: state.blogPosts[widget.index],
),
),
SizedBox(width: 8),
const SizedBox(width: 8),
FeedIconButton(
svgIcon: SvgPicture.asset(
height: 20,
@@ -214,19 +214,19 @@ class _ProfileBlogPostWidgetState extends State<ProfileBlogPostWidget> {
final box = context.findRenderObject() as RenderBox?;
Share.shareUri(
Uri.parse(
baseUrl + '/ru/blog_post/' + state.blogPosts[widget.index].id.toString(),
'$baseUrl/ru/blog_post/${state.blogPosts[widget.index].id}',
),
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
);
},
),
Spacer(),
const Spacer(),
Icon(
Icons.visibility_rounded,
size: 16,
color: appTheme.gray500,
),
SizedBox(width: 4),
const SizedBox(width: 4),
Text(
state.blogPosts[widget.index].totalViews.toString(),
style: TextStyle(
@@ -238,7 +238,7 @@ class _ProfileBlogPostWidgetState extends State<ProfileBlogPostWidget> {
],
),
),
SizedBox(height: 8),
const SizedBox(height: 8),
],
),
),

View File

@@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';
enum SubActionType { SendMessage, Subscribe }
enum SubActionType { sendMessage, subscribe }
class SubActionButtonWidget extends StatefulWidget {
final SubActionType subActionType;
@@ -33,22 +33,22 @@ class _SubActionButtonWidgetState extends State<SubActionButtonWidget> {
@override
Widget build(BuildContext context) {
if (subActionType == SubActionType.Subscribe) {
if (subActionType == SubActionType.subscribe) {
return InkWell(
onTap: () {
context.read<SubCubit>().subscribe(widget.slug);
setState(() {
subActionType = SubActionType.SendMessage;
subActionType = SubActionType.sendMessage;
});
},
borderRadius: BorderRadius.circular(8),
child: Ink(
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 4),
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: appTheme.blueA400,
),
child: Text(
child: const Text(
'Подписаться',
style: TextStyle(
fontSize: 13,
@@ -65,17 +65,17 @@ class _SubActionButtonWidgetState extends State<SubActionButtonWidget> {
'chatScreen',
extra: {
'chatId': await sl<ProfileCubit>().getChatRoomIdBySlug(slug: widget.slug),
},
},
);
},
borderRadius: BorderRadius.circular(8),
child: Ink(
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 4),
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Color(0xFFF1F2F6),
color: const Color(0xFFF1F2F6),
),
child: Text(
child: const Text(
'Сообщение',
style: TextStyle(
fontSize: 13,

View File

@@ -31,7 +31,7 @@ class _SubWidgetState extends State<SubWidget> {
),
),
child: Ink(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
child: Row(
children: [
CircleAvatar(
@@ -45,7 +45,7 @@ class _SubWidgetState extends State<SubWidget> {
children: [
Text(
widget.subModel.name,
style: TextStyle(
style: const TextStyle(
color: Color(0xFF323F4B),
fontSize: 16,
fontWeight: FontWeight.w600,
@@ -55,7 +55,7 @@ class _SubWidgetState extends State<SubWidget> {
const SizedBox(height: 4),
Text(
'${DateTime.now().year - widget.subModel.birthdate.year - (DateTime.now().isBefore(DateTime(DateTime.now().year, widget.subModel.birthdate.month, widget.subModel.birthdate.day)) ? 1 : 0)} лет, ${widget.subModel.city}',
style: TextStyle(
style: const TextStyle(
color: Color(0xFF6D6F71),
fontSize: 12,
fontWeight: FontWeight.w500,
@@ -66,7 +66,7 @@ class _SubWidgetState extends State<SubWidget> {
),
const Spacer(),
SubActionButtonWidget(
subActionType: widget.subModel.isEntitySubscribedByMe ? SubActionType.SendMessage : SubActionType.Subscribe,
subActionType: widget.subModel.isEntitySubscribedByMe ? SubActionType.sendMessage : SubActionType.subscribe,
slug: widget.subModel.slug,
),
],

View File

@@ -38,7 +38,7 @@ class _WeightChartWidgetState extends State<WeightChartWidget> {
children: [
Text(
'${widget.weightPoints.last.weight.toStringAsFixed(1)} кг',
style: TextStyle(
style: const TextStyle(
color: Colors.black,
fontSize: 40,
fontWeight: FontWeight.w500,
@@ -46,10 +46,10 @@ class _WeightChartWidgetState extends State<WeightChartWidget> {
),
if (widget.weightPoints.length == 1)
Container(
margin: EdgeInsets.symmetric(horizontal: 12),
margin: const EdgeInsets.symmetric(horizontal: 12),
width: 8,
height: 8,
decoration: BoxDecoration(
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: Colors.black12,
),
@@ -73,33 +73,33 @@ class _WeightChartWidgetState extends State<WeightChartWidget> {
alignment: Alignment.center,
children: [
SfCartesianChart(
margin: EdgeInsets.symmetric(horizontal: 8),
margin: const EdgeInsets.symmetric(horizontal: 8),
enableAxisAnimation: true,
plotAreaBorderWidth: 0,
trackballBehavior: TrackballBehavior(
enable: true,
activationMode: ActivationMode.singleTap,
tooltipDisplayMode: TrackballDisplayMode.groupAllPoints,
tooltipSettings: InteractiveTooltip(),
tooltipSettings: const InteractiveTooltip(),
lineType: TrackballLineType.vertical,
),
primaryXAxis: DateTimeCategoryAxis(
tickPosition: TickPosition.inside,
majorTickLines: MajorTickLines(
majorTickLines: const MajorTickLines(
size: 0,
),
edgeLabelPlacement: EdgeLabelPlacement.shift,
dateFormat: DateFormat.MMMd('ru'),
labelStyle: TextStyle(
labelStyle: const TextStyle(
color: Colors.grey,
),
majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey.withValues(alpha: 0.3)),
majorGridLines: MajorGridLines(dashArray: const [1], color: Colors.grey.withValues(alpha: 0.3)),
axisLine: AxisLine(
color: Colors.grey.withValues(alpha: 0.3),
width: 0.4,
),
),
primaryYAxis: NumericAxis(
primaryYAxis: const NumericAxis(
isVisible: false,
labelFormat: '{value} кг',
majorGridLines: MajorGridLines(dashArray: [1], color: Colors.grey),
@@ -181,12 +181,12 @@ class _WeightChartWidgetState extends State<WeightChartWidget> {
borderRadius: BorderRadius.circular(16),
child: Ink(
width: MediaQuery.of(context).size.width - 32,
padding: EdgeInsets.all(16),
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: appTheme.blueA400,
borderRadius: BorderRadius.circular(16),
),
child: Center(
child: const Center(
child: Text(
'Сохранить',
style: TextStyle(
@@ -202,14 +202,14 @@ class _WeightChartWidgetState extends State<WeightChartWidget> {
);
},
backgroundColor: appTheme.blueA400,
shape: CircleBorder(),
child: Icon(
shape: const CircleBorder(),
child: const Icon(
Icons.add,
color: Colors.white,
),
),
),
if (widget.weightPoints.isEmpty) Text('Добавьте Ваш вес'),
if (widget.weightPoints.isEmpty) const Text('Добавьте Ваш вес'),
],
),
],
@@ -225,7 +225,7 @@ class _WeightChartWidgetState extends State<WeightChartWidget> {
height: 8,
width: 8,
),
dataLabelSettings: DataLabelSettings(
dataLabelSettings: const DataLabelSettings(
labelAlignment: ChartDataLabelAlignment.top,
isVisible: true,
),
@@ -237,7 +237,7 @@ class _WeightChartWidgetState extends State<WeightChartWidget> {
Colors.transparent,
],
begin: Alignment.topCenter,
end: Alignment(0, 0.6),
end: const Alignment(0, 0.6),
),
name: 'Вес',
xValueMapper: (WeightModel value, int index) => value.createdAt,

View File

@@ -200,13 +200,12 @@ class _ProfileService implements ProfileService {
final _result = await _dio.fetch<List<dynamic>>(_options);
late List<FeedBlogPostModel> _value;
try {
_value =
_result.data!
.map(
(dynamic i) =>
FeedBlogPostModel.fromJson(i as Map<String, dynamic>),
)
.toList();
_value = _result.data!
.map(
(dynamic i) =>
FeedBlogPostModel.fromJson(i as Map<String, dynamic>),
)
.toList();
} on Object catch (e, s) {
errorLogger?.logError(e, s, _options);
rethrow;
@@ -233,12 +232,11 @@ class _ProfileService implements ProfileService {
final _result = await _dio.fetch<List<dynamic>>(_options);
late List<WeightModel> _value;
try {
_value =
_result.data!
.map(
(dynamic i) => WeightModel.fromJson(i as Map<String, dynamic>),
)
.toList();
_value = _result.data!
.map(
(dynamic i) => WeightModel.fromJson(i as Map<String, dynamic>),
)
.toList();
} on Object catch (e, s) {
errorLogger?.logError(e, s, _options);
rethrow;
@@ -268,12 +266,11 @@ class _ProfileService implements ProfileService {
final _result = await _dio.fetch<List<dynamic>>(_options);
late List<WeightModel> _value;
try {
_value =
_result.data!
.map(
(dynamic i) => WeightModel.fromJson(i as Map<String, dynamic>),
)
.toList();
_value = _result.data!
.map(
(dynamic i) => WeightModel.fromJson(i as Map<String, dynamic>),
)
.toList();
} on Object catch (e, s) {
errorLogger?.logError(e, s, _options);
rethrow;
@@ -302,13 +299,12 @@ class _ProfileService implements ProfileService {
final _result = await _dio.fetch<List<dynamic>>(_options);
late List<CircumferenceModel> _value;
try {
_value =
_result.data!
.map(
(dynamic i) =>
CircumferenceModel.fromJson(i as Map<String, dynamic>),
)
.toList();
_value = _result.data!
.map(
(dynamic i) =>
CircumferenceModel.fromJson(i as Map<String, dynamic>),
)
.toList();
} on Object catch (e, s) {
errorLogger?.logError(e, s, _options);
rethrow;
@@ -338,13 +334,12 @@ class _ProfileService implements ProfileService {
final _result = await _dio.fetch<List<dynamic>>(_options);
late List<CircumferenceModel> _value;
try {
_value =
_result.data!
.map(
(dynamic i) =>
CircumferenceModel.fromJson(i as Map<String, dynamic>),
)
.toList();
_value = _result.data!
.map(
(dynamic i) =>
CircumferenceModel.fromJson(i as Map<String, dynamic>),
)
.toList();
} on Object catch (e, s) {
errorLogger?.logError(e, s, _options);
rethrow;
@@ -473,11 +468,11 @@ class _ProfileService implements ProfileService {
);
final _options = _setStreamType<void>(
Options(
method: 'POST',
headers: _headers,
extra: _extra,
contentType: 'multipart/form-data',
)
method: 'POST',
headers: _headers,
extra: _extra,
contentType: 'multipart/form-data',
)
.compose(
_dio.options,
'/api/profile/photo/upload',