forked from eatvio/eatvio_app
feat(order info): added order info screen
This commit is contained in:
@@ -12,8 +12,7 @@ part of 'chosen_plan_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');
|
||||
|
||||
ChosenPlanModel _$ChosenPlanModelFromJson(Map<String, dynamic> json) {
|
||||
return _ChosenPlanModel.fromJson(json);
|
||||
@@ -49,19 +48,17 @@ mixin _$ChosenPlanModel {
|
||||
/// @nodoc
|
||||
abstract class $ChosenPlanModelCopyWith<$Res> {
|
||||
factory $ChosenPlanModelCopyWith(
|
||||
ChosenPlanModel value,
|
||||
$Res Function(ChosenPlanModel) then,
|
||||
) = _$ChosenPlanModelCopyWithImpl<$Res, ChosenPlanModel>;
|
||||
ChosenPlanModel value, $Res Function(ChosenPlanModel) then) =
|
||||
_$ChosenPlanModelCopyWithImpl<$Res, ChosenPlanModel>;
|
||||
@useResult
|
||||
$Res call({
|
||||
@JsonKey() int id,
|
||||
@JsonKey(name: 'option_type') String optionType,
|
||||
@JsonKey(name: 'start_date') DateTime startDate,
|
||||
@JsonKey(name: 'last_state') ChosenPlanStateEnum chosenPlanState,
|
||||
@JsonKey(name: 'chat_id') String chatId,
|
||||
@JsonKey(name: 'consultant_id') int consultantId,
|
||||
@JsonKey(name: 'plan') PlanModel plan,
|
||||
});
|
||||
$Res call(
|
||||
{@JsonKey() int id,
|
||||
@JsonKey(name: 'option_type') String optionType,
|
||||
@JsonKey(name: 'start_date') DateTime startDate,
|
||||
@JsonKey(name: 'last_state') ChosenPlanStateEnum chosenPlanState,
|
||||
@JsonKey(name: 'chat_id') String chatId,
|
||||
@JsonKey(name: 'consultant_id') int consultantId,
|
||||
@JsonKey(name: 'plan') PlanModel plan});
|
||||
|
||||
$PlanModelCopyWith<$Res> get plan;
|
||||
}
|
||||
@@ -89,46 +86,36 @@ class _$ChosenPlanModelCopyWithImpl<$Res, $Val extends ChosenPlanModel>
|
||||
Object? consultantId = null,
|
||||
Object? plan = null,
|
||||
}) {
|
||||
return _then(
|
||||
_value.copyWith(
|
||||
id:
|
||||
null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
optionType:
|
||||
null == optionType
|
||||
? _value.optionType
|
||||
: optionType // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
startDate:
|
||||
null == startDate
|
||||
? _value.startDate
|
||||
: startDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
chosenPlanState:
|
||||
null == chosenPlanState
|
||||
? _value.chosenPlanState
|
||||
: chosenPlanState // ignore: cast_nullable_to_non_nullable
|
||||
as ChosenPlanStateEnum,
|
||||
chatId:
|
||||
null == chatId
|
||||
? _value.chatId
|
||||
: chatId // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
consultantId:
|
||||
null == consultantId
|
||||
? _value.consultantId
|
||||
: consultantId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
plan:
|
||||
null == plan
|
||||
? _value.plan
|
||||
: plan // ignore: cast_nullable_to_non_nullable
|
||||
as PlanModel,
|
||||
)
|
||||
as $Val,
|
||||
);
|
||||
return _then(_value.copyWith(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
optionType: null == optionType
|
||||
? _value.optionType
|
||||
: optionType // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
startDate: null == startDate
|
||||
? _value.startDate
|
||||
: startDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
chosenPlanState: null == chosenPlanState
|
||||
? _value.chosenPlanState
|
||||
: chosenPlanState // ignore: cast_nullable_to_non_nullable
|
||||
as ChosenPlanStateEnum,
|
||||
chatId: null == chatId
|
||||
? _value.chatId
|
||||
: chatId // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
consultantId: null == consultantId
|
||||
? _value.consultantId
|
||||
: consultantId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
plan: null == plan
|
||||
? _value.plan
|
||||
: plan // ignore: cast_nullable_to_non_nullable
|
||||
as PlanModel,
|
||||
) as $Val);
|
||||
}
|
||||
|
||||
/// Create a copy of ChosenPlanModel
|
||||
@@ -145,21 +132,19 @@ class _$ChosenPlanModelCopyWithImpl<$Res, $Val extends ChosenPlanModel>
|
||||
/// @nodoc
|
||||
abstract class _$$ChosenPlanModelImplCopyWith<$Res>
|
||||
implements $ChosenPlanModelCopyWith<$Res> {
|
||||
factory _$$ChosenPlanModelImplCopyWith(
|
||||
_$ChosenPlanModelImpl value,
|
||||
$Res Function(_$ChosenPlanModelImpl) then,
|
||||
) = __$$ChosenPlanModelImplCopyWithImpl<$Res>;
|
||||
factory _$$ChosenPlanModelImplCopyWith(_$ChosenPlanModelImpl value,
|
||||
$Res Function(_$ChosenPlanModelImpl) then) =
|
||||
__$$ChosenPlanModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({
|
||||
@JsonKey() int id,
|
||||
@JsonKey(name: 'option_type') String optionType,
|
||||
@JsonKey(name: 'start_date') DateTime startDate,
|
||||
@JsonKey(name: 'last_state') ChosenPlanStateEnum chosenPlanState,
|
||||
@JsonKey(name: 'chat_id') String chatId,
|
||||
@JsonKey(name: 'consultant_id') int consultantId,
|
||||
@JsonKey(name: 'plan') PlanModel plan,
|
||||
});
|
||||
$Res call(
|
||||
{@JsonKey() int id,
|
||||
@JsonKey(name: 'option_type') String optionType,
|
||||
@JsonKey(name: 'start_date') DateTime startDate,
|
||||
@JsonKey(name: 'last_state') ChosenPlanStateEnum chosenPlanState,
|
||||
@JsonKey(name: 'chat_id') String chatId,
|
||||
@JsonKey(name: 'consultant_id') int consultantId,
|
||||
@JsonKey(name: 'plan') PlanModel plan});
|
||||
|
||||
@override
|
||||
$PlanModelCopyWith<$Res> get plan;
|
||||
@@ -170,9 +155,8 @@ class __$$ChosenPlanModelImplCopyWithImpl<$Res>
|
||||
extends _$ChosenPlanModelCopyWithImpl<$Res, _$ChosenPlanModelImpl>
|
||||
implements _$$ChosenPlanModelImplCopyWith<$Res> {
|
||||
__$$ChosenPlanModelImplCopyWithImpl(
|
||||
_$ChosenPlanModelImpl _value,
|
||||
$Res Function(_$ChosenPlanModelImpl) _then,
|
||||
) : super(_value, _then);
|
||||
_$ChosenPlanModelImpl _value, $Res Function(_$ChosenPlanModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ChosenPlanModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -187,60 +171,50 @@ class __$$ChosenPlanModelImplCopyWithImpl<$Res>
|
||||
Object? consultantId = null,
|
||||
Object? plan = null,
|
||||
}) {
|
||||
return _then(
|
||||
_$ChosenPlanModelImpl(
|
||||
id:
|
||||
null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
optionType:
|
||||
null == optionType
|
||||
? _value.optionType
|
||||
: optionType // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
startDate:
|
||||
null == startDate
|
||||
? _value.startDate
|
||||
: startDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
chosenPlanState:
|
||||
null == chosenPlanState
|
||||
? _value.chosenPlanState
|
||||
: chosenPlanState // ignore: cast_nullable_to_non_nullable
|
||||
as ChosenPlanStateEnum,
|
||||
chatId:
|
||||
null == chatId
|
||||
? _value.chatId
|
||||
: chatId // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
consultantId:
|
||||
null == consultantId
|
||||
? _value.consultantId
|
||||
: consultantId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
plan:
|
||||
null == plan
|
||||
? _value.plan
|
||||
: plan // ignore: cast_nullable_to_non_nullable
|
||||
as PlanModel,
|
||||
),
|
||||
);
|
||||
return _then(_$ChosenPlanModelImpl(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
optionType: null == optionType
|
||||
? _value.optionType
|
||||
: optionType // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
startDate: null == startDate
|
||||
? _value.startDate
|
||||
: startDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
chosenPlanState: null == chosenPlanState
|
||||
? _value.chosenPlanState
|
||||
: chosenPlanState // ignore: cast_nullable_to_non_nullable
|
||||
as ChosenPlanStateEnum,
|
||||
chatId: null == chatId
|
||||
? _value.chatId
|
||||
: chatId // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
consultantId: null == consultantId
|
||||
? _value.consultantId
|
||||
: consultantId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
plan: null == plan
|
||||
? _value.plan
|
||||
: plan // ignore: cast_nullable_to_non_nullable
|
||||
as PlanModel,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$ChosenPlanModelImpl implements _ChosenPlanModel {
|
||||
_$ChosenPlanModelImpl({
|
||||
@JsonKey() required this.id,
|
||||
@JsonKey(name: 'option_type') required this.optionType,
|
||||
@JsonKey(name: 'start_date') required this.startDate,
|
||||
@JsonKey(name: 'last_state') required this.chosenPlanState,
|
||||
@JsonKey(name: 'chat_id') required this.chatId,
|
||||
@JsonKey(name: 'consultant_id') required this.consultantId,
|
||||
@JsonKey(name: 'plan') required this.plan,
|
||||
});
|
||||
_$ChosenPlanModelImpl(
|
||||
{@JsonKey() required this.id,
|
||||
@JsonKey(name: 'option_type') required this.optionType,
|
||||
@JsonKey(name: 'start_date') required this.startDate,
|
||||
@JsonKey(name: 'last_state') required this.chosenPlanState,
|
||||
@JsonKey(name: 'chat_id') required this.chatId,
|
||||
@JsonKey(name: 'consultant_id') required this.consultantId,
|
||||
@JsonKey(name: 'plan') required this.plan});
|
||||
|
||||
factory _$ChosenPlanModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$ChosenPlanModelImplFromJson(json);
|
||||
@@ -292,16 +266,8 @@ class _$ChosenPlanModelImpl implements _ChosenPlanModel {
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
id,
|
||||
optionType,
|
||||
startDate,
|
||||
chosenPlanState,
|
||||
chatId,
|
||||
consultantId,
|
||||
plan,
|
||||
);
|
||||
int get hashCode => Object.hash(runtimeType, id, optionType, startDate,
|
||||
chosenPlanState, chatId, consultantId, plan);
|
||||
|
||||
/// Create a copy of ChosenPlanModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -310,27 +276,27 @@ class _$ChosenPlanModelImpl implements _ChosenPlanModel {
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ChosenPlanModelImplCopyWith<_$ChosenPlanModelImpl> get copyWith =>
|
||||
__$$ChosenPlanModelImplCopyWithImpl<_$ChosenPlanModelImpl>(
|
||||
this,
|
||||
_$identity,
|
||||
);
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$ChosenPlanModelImplToJson(this);
|
||||
return _$$ChosenPlanModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _ChosenPlanModel implements ChosenPlanModel {
|
||||
factory _ChosenPlanModel({
|
||||
@JsonKey() required final int id,
|
||||
@JsonKey(name: 'option_type') required final String optionType,
|
||||
@JsonKey(name: 'start_date') required final DateTime startDate,
|
||||
@JsonKey(name: 'last_state')
|
||||
required final ChosenPlanStateEnum chosenPlanState,
|
||||
@JsonKey(name: 'chat_id') required final String chatId,
|
||||
@JsonKey(name: 'consultant_id') required final int consultantId,
|
||||
@JsonKey(name: 'plan') required final PlanModel plan,
|
||||
}) = _$ChosenPlanModelImpl;
|
||||
factory _ChosenPlanModel(
|
||||
{@JsonKey() required final int id,
|
||||
@JsonKey(name: 'option_type') required final String optionType,
|
||||
@JsonKey(name: 'start_date') required final DateTime startDate,
|
||||
@JsonKey(name: 'last_state')
|
||||
required final ChosenPlanStateEnum chosenPlanState,
|
||||
@JsonKey(name: 'chat_id') required final String chatId,
|
||||
@JsonKey(name: 'consultant_id') required final int consultantId,
|
||||
@JsonKey(name: 'plan') required final PlanModel plan}) =
|
||||
_$ChosenPlanModelImpl;
|
||||
|
||||
factory _ChosenPlanModel.fromJson(Map<String, dynamic> json) =
|
||||
_$ChosenPlanModelImpl.fromJson;
|
||||
|
||||
@@ -7,31 +7,29 @@ part of 'chosen_plan_model.dart';
|
||||
// **************************************************************************
|
||||
|
||||
_$ChosenPlanModelImpl _$$ChosenPlanModelImplFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _$ChosenPlanModelImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
optionType: json['option_type'] as String,
|
||||
startDate: DateTime.parse(json['start_date'] as String),
|
||||
chosenPlanState: $enumDecode(
|
||||
_$ChosenPlanStateEnumEnumMap,
|
||||
json['last_state'],
|
||||
),
|
||||
chatId: json['chat_id'] as String,
|
||||
consultantId: (json['consultant_id'] as num).toInt(),
|
||||
plan: PlanModel.fromJson(json['plan'] as Map<String, dynamic>),
|
||||
);
|
||||
Map<String, dynamic> json) =>
|
||||
_$ChosenPlanModelImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
optionType: json['option_type'] as String,
|
||||
startDate: DateTime.parse(json['start_date'] as String),
|
||||
chosenPlanState:
|
||||
$enumDecode(_$ChosenPlanStateEnumEnumMap, json['last_state']),
|
||||
chatId: json['chat_id'] as String,
|
||||
consultantId: (json['consultant_id'] as num).toInt(),
|
||||
plan: PlanModel.fromJson(json['plan'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ChosenPlanModelImplToJson(
|
||||
_$ChosenPlanModelImpl instance,
|
||||
) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'option_type': instance.optionType,
|
||||
'start_date': instance.startDate.toIso8601String(),
|
||||
'last_state': _$ChosenPlanStateEnumEnumMap[instance.chosenPlanState]!,
|
||||
'chat_id': instance.chatId,
|
||||
'consultant_id': instance.consultantId,
|
||||
'plan': instance.plan,
|
||||
};
|
||||
_$ChosenPlanModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'option_type': instance.optionType,
|
||||
'start_date': instance.startDate.toIso8601String(),
|
||||
'last_state': _$ChosenPlanStateEnumEnumMap[instance.chosenPlanState]!,
|
||||
'chat_id': instance.chatId,
|
||||
'consultant_id': instance.consultantId,
|
||||
'plan': instance.plan,
|
||||
};
|
||||
|
||||
const _$ChosenPlanStateEnumEnumMap = {
|
||||
ChosenPlanStateEnum.stateInited: 'initied',
|
||||
|
||||
Reference in New Issue
Block a user